diff options
Diffstat (limited to 'crates/ra_lsp_server/src')
-rw-r--r-- | crates/ra_lsp_server/src/world.rs | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/crates/ra_lsp_server/src/world.rs b/crates/ra_lsp_server/src/world.rs index b55046ec9..27da751ab 100644 --- a/crates/ra_lsp_server/src/world.rs +++ b/crates/ra_lsp_server/src/world.rs | |||
@@ -13,7 +13,7 @@ use ra_ide_api::{ | |||
13 | Analysis, AnalysisChange, AnalysisHost, CrateGraph, FeatureFlags, FileId, LibraryData, | 13 | Analysis, AnalysisChange, AnalysisHost, CrateGraph, FeatureFlags, FileId, LibraryData, |
14 | SourceRootId, | 14 | SourceRootId, |
15 | }; | 15 | }; |
16 | use ra_project_model::ProjectWorkspace; | 16 | use ra_project_model::{get_rustc_cfg_options, ProjectWorkspace}; |
17 | use ra_vfs::{LineEndings, RootEntry, Vfs, VfsChange, VfsFile, VfsRoot, VfsTask, Watch}; | 17 | use ra_vfs::{LineEndings, RootEntry, Vfs, VfsChange, VfsFile, VfsRoot, VfsTask, Watch}; |
18 | use ra_vfs_glob::{Glob, RustPackageFilterBuilder}; | 18 | use ra_vfs_glob::{Glob, RustPackageFilterBuilder}; |
19 | use relative_path::RelativePathBuf; | 19 | use relative_path::RelativePathBuf; |
@@ -97,6 +97,10 @@ impl WorldState { | |||
97 | change.set_debug_root_path(SourceRootId(r.0), vfs_root_path.display().to_string()); | 97 | change.set_debug_root_path(SourceRootId(r.0), vfs_root_path.display().to_string()); |
98 | } | 98 | } |
99 | 99 | ||
100 | // FIXME: Read default cfgs from config | ||
101 | let default_cfg_options = | ||
102 | get_rustc_cfg_options().atom("test".into()).atom("debug_assertion".into()); | ||
103 | |||
100 | // Create crate graph from all the workspaces | 104 | // Create crate graph from all the workspaces |
101 | let mut crate_graph = CrateGraph::default(); | 105 | let mut crate_graph = CrateGraph::default(); |
102 | let mut load = |path: &std::path::Path| { | 106 | let mut load = |path: &std::path::Path| { |
@@ -104,7 +108,7 @@ impl WorldState { | |||
104 | vfs_file.map(|f| FileId(f.0)) | 108 | vfs_file.map(|f| FileId(f.0)) |
105 | }; | 109 | }; |
106 | for ws in workspaces.iter() { | 110 | for ws in workspaces.iter() { |
107 | let (graph, crate_names) = ws.to_crate_graph(&mut load); | 111 | let (graph, crate_names) = ws.to_crate_graph(&default_cfg_options, &mut load); |
108 | let shift = crate_graph.extend(graph); | 112 | let shift = crate_graph.extend(graph); |
109 | for (crate_id, name) in crate_names { | 113 | for (crate_id, name) in crate_names { |
110 | change.set_debug_crate_name(crate_id.shift(shift), name) | 114 | change.set_debug_crate_name(crate_id.shift(shift), name) |