internal: a bit more of cwd safety for flycheck

This commit is contained in:
Aleksey Kladov
2021-07-17 17:40:13 +03:00
parent 8df38aa797
commit 8d8c26e6f5
16 changed files with 72 additions and 52 deletions

View File

@@ -597,12 +597,14 @@ impl Config {
pub fn lru_capacity(&self) -> Option<usize> {
self.data.lruCapacity
}
pub fn proc_macro_srv(&self) -> Option<(PathBuf, Vec<OsString>)> {
pub fn proc_macro_srv(&self) -> Option<(AbsPathBuf, Vec<OsString>)> {
if !self.data.procMacro_enable {
return None;
}
let path = self.data.procMacro_server.clone().or_else(|| std::env::current_exe().ok())?;
let path = match &self.data.procMacro_server {
Some(it) => self.root_path.join(it),
None => AbsPathBuf::assert(std::env::current_exe().ok()?),
};
Some((path, vec!["proc-macro".into()]))
}
pub fn expand_proc_attr_macros(&self) -> bool {