mirror of
https://github.com/rust-lang/rust-analyzer
synced 2025-01-14 06:03:58 +00:00
Allow non-absolute paths to rust source
This commit is contained in:
parent
e0f2e1560f
commit
a733f65126
1 changed files with 2 additions and 6 deletions
|
@ -7,7 +7,7 @@
|
||||||
//! configure the server itself, feature flags are passed into analysis, and
|
//! configure the server itself, feature flags are passed into analysis, and
|
||||||
//! tweak things like automatic insertion of `()` in completions.
|
//! tweak things like automatic insertion of `()` in completions.
|
||||||
|
|
||||||
use std::{convert::TryFrom, ffi::OsString, iter, path::PathBuf};
|
use std::{ffi::OsString, iter, path::PathBuf};
|
||||||
|
|
||||||
use flycheck::FlycheckConfig;
|
use flycheck::FlycheckConfig;
|
||||||
use hir::PrefixKind;
|
use hir::PrefixKind;
|
||||||
|
@ -468,11 +468,7 @@ impl Config {
|
||||||
self.data.cargo_autoreload
|
self.data.cargo_autoreload
|
||||||
}
|
}
|
||||||
pub fn cargo(&self) -> CargoConfig {
|
pub fn cargo(&self) -> CargoConfig {
|
||||||
let rustc_source = self.data.rustcSource.clone().and_then(|it| {
|
let rustc_source = self.data.rustcSource.as_ref().map(|it| self.root_path.join(&it));
|
||||||
AbsPathBuf::try_from(it)
|
|
||||||
.map_err(|_| log::error!("rustc source directory must be an absolute path"))
|
|
||||||
.ok()
|
|
||||||
});
|
|
||||||
|
|
||||||
CargoConfig {
|
CargoConfig {
|
||||||
no_default_features: self.data.cargo_noDefaultFeatures,
|
no_default_features: self.data.cargo_noDefaultFeatures,
|
||||||
|
|
Loading…
Reference in a new issue