aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_lsp_server/src
diff options
context:
space:
mode:
Diffstat (limited to 'crates/ra_lsp_server/src')
-rw-r--r--crates/ra_lsp_server/src/caps.rs2
-rw-r--r--crates/ra_lsp_server/src/cargo_target_spec.rs2
-rw-r--r--crates/ra_lsp_server/src/config.rs2
-rw-r--r--crates/ra_lsp_server/src/conv.rs2
-rw-r--r--crates/ra_lsp_server/src/lib.rs2
-rw-r--r--crates/ra_lsp_server/src/main.rs2
-rw-r--r--crates/ra_lsp_server/src/main_loop.rs2
-rw-r--r--crates/ra_lsp_server/src/main_loop/handlers.rs2
-rw-r--r--crates/ra_lsp_server/src/main_loop/pending_requests.rs2
-rw-r--r--crates/ra_lsp_server/src/main_loop/subscriptions.rs2
-rw-r--r--crates/ra_lsp_server/src/markdown.rs3
-rw-r--r--crates/ra_lsp_server/src/req.rs2
-rw-r--r--crates/ra_lsp_server/src/world.rs10
13 files changed, 32 insertions, 3 deletions
diff --git a/crates/ra_lsp_server/src/caps.rs b/crates/ra_lsp_server/src/caps.rs
index 22fc97a97..30bcbd7a8 100644
--- a/crates/ra_lsp_server/src/caps.rs
+++ b/crates/ra_lsp_server/src/caps.rs
@@ -1,3 +1,5 @@
1//! FIXME: write short doc here
2
1use lsp_types::{ 3use lsp_types::{
2 CodeActionProviderCapability, CodeLensOptions, CompletionOptions, 4 CodeActionProviderCapability, CodeLensOptions, CompletionOptions,
3 DocumentOnTypeFormattingOptions, FoldingRangeProviderCapability, GenericCapability, 5 DocumentOnTypeFormattingOptions, FoldingRangeProviderCapability, GenericCapability,
diff --git a/crates/ra_lsp_server/src/cargo_target_spec.rs b/crates/ra_lsp_server/src/cargo_target_spec.rs
index a083bb311..d996b53de 100644
--- a/crates/ra_lsp_server/src/cargo_target_spec.rs
+++ b/crates/ra_lsp_server/src/cargo_target_spec.rs
@@ -1,3 +1,5 @@
1//! FIXME: write short doc here
2
1use ra_ide_api::{FileId, RunnableKind}; 3use ra_ide_api::{FileId, RunnableKind};
2use ra_project_model::{self, ProjectWorkspace, TargetKind}; 4use ra_project_model::{self, ProjectWorkspace, TargetKind};
3 5
diff --git a/crates/ra_lsp_server/src/config.rs b/crates/ra_lsp_server/src/config.rs
index cf53e7c4c..579d4c692 100644
--- a/crates/ra_lsp_server/src/config.rs
+++ b/crates/ra_lsp_server/src/config.rs
@@ -1,3 +1,5 @@
1//! FIXME: write short doc here
2
1use rustc_hash::FxHashMap; 3use rustc_hash::FxHashMap;
2 4
3use serde::{Deserialize, Deserializer}; 5use serde::{Deserialize, Deserializer};
diff --git a/crates/ra_lsp_server/src/conv.rs b/crates/ra_lsp_server/src/conv.rs
index d78f77925..1318a1738 100644
--- a/crates/ra_lsp_server/src/conv.rs
+++ b/crates/ra_lsp_server/src/conv.rs
@@ -1,3 +1,5 @@
1//! FIXME: write short doc here
2
1use lsp_types::{ 3use lsp_types::{
2 self, CreateFile, DiagnosticSeverity, DocumentChangeOperation, DocumentChanges, Documentation, 4 self, CreateFile, DiagnosticSeverity, DocumentChangeOperation, DocumentChanges, Documentation,
3 Location, LocationLink, MarkupContent, MarkupKind, Position, Range, RenameFile, ResourceOp, 5 Location, LocationLink, MarkupContent, MarkupKind, Position, Range, RenameFile, ResourceOp,
diff --git a/crates/ra_lsp_server/src/lib.rs b/crates/ra_lsp_server/src/lib.rs
index fa3d88abd..7a71a90fb 100644
--- a/crates/ra_lsp_server/src/lib.rs
+++ b/crates/ra_lsp_server/src/lib.rs
@@ -1,3 +1,5 @@
1//! FIXME: write short doc here
2
1#![recursion_limit = "512"] 3#![recursion_limit = "512"]
2mod caps; 4mod caps;
3mod cargo_target_spec; 5mod cargo_target_spec;
diff --git a/crates/ra_lsp_server/src/main.rs b/crates/ra_lsp_server/src/main.rs
index 852fae027..7d9a1d054 100644
--- a/crates/ra_lsp_server/src/main.rs
+++ b/crates/ra_lsp_server/src/main.rs
@@ -1,3 +1,5 @@
1//! FIXME: write short doc here
2
1use flexi_logger::{Duplicate, Logger}; 3use flexi_logger::{Duplicate, Logger};
2use lsp_server::Connection; 4use lsp_server::Connection;
3 5
diff --git a/crates/ra_lsp_server/src/main_loop.rs b/crates/ra_lsp_server/src/main_loop.rs
index 2059f9800..35c35d32b 100644
--- a/crates/ra_lsp_server/src/main_loop.rs
+++ b/crates/ra_lsp_server/src/main_loop.rs
@@ -1,3 +1,5 @@
1//! FIXME: write short doc here
2
1mod handlers; 3mod handlers;
2mod subscriptions; 4mod subscriptions;
3pub(crate) mod pending_requests; 5pub(crate) mod pending_requests;
diff --git a/crates/ra_lsp_server/src/main_loop/handlers.rs b/crates/ra_lsp_server/src/main_loop/handlers.rs
index ae57e57e9..10e271376 100644
--- a/crates/ra_lsp_server/src/main_loop/handlers.rs
+++ b/crates/ra_lsp_server/src/main_loop/handlers.rs
@@ -1,3 +1,5 @@
1//! FIXME: write short doc here
2
1use std::{fmt::Write as _, io::Write as _}; 3use std::{fmt::Write as _, io::Write as _};
2 4
3use lsp_server::ErrorCode; 5use lsp_server::ErrorCode;
diff --git a/crates/ra_lsp_server/src/main_loop/pending_requests.rs b/crates/ra_lsp_server/src/main_loop/pending_requests.rs
index 7a99fc679..e7ea7aa5b 100644
--- a/crates/ra_lsp_server/src/main_loop/pending_requests.rs
+++ b/crates/ra_lsp_server/src/main_loop/pending_requests.rs
@@ -1,3 +1,5 @@
1//! FIXME: write short doc here
2
1use std::time::{Duration, Instant}; 3use std::time::{Duration, Instant};
2 4
3use lsp_server::RequestId; 5use lsp_server::RequestId;
diff --git a/crates/ra_lsp_server/src/main_loop/subscriptions.rs b/crates/ra_lsp_server/src/main_loop/subscriptions.rs
index bbeda723c..3856263b0 100644
--- a/crates/ra_lsp_server/src/main_loop/subscriptions.rs
+++ b/crates/ra_lsp_server/src/main_loop/subscriptions.rs
@@ -1,3 +1,5 @@
1//! FIXME: write short doc here
2
1use ra_ide_api::FileId; 3use ra_ide_api::FileId;
2use rustc_hash::FxHashSet; 4use rustc_hash::FxHashSet;
3 5
diff --git a/crates/ra_lsp_server/src/markdown.rs b/crates/ra_lsp_server/src/markdown.rs
index c1eb0236a..f51fc4ade 100644
--- a/crates/ra_lsp_server/src/markdown.rs
+++ b/crates/ra_lsp_server/src/markdown.rs
@@ -1,3 +1,5 @@
1//! FIXME: write short doc here
2
1pub(crate) fn format_docs(src: &str) -> String { 3pub(crate) fn format_docs(src: &str) -> String {
2 let mut processed_lines = Vec::new(); 4 let mut processed_lines = Vec::new();
3 let mut in_code_block = false; 5 let mut in_code_block = false;
@@ -70,5 +72,4 @@ let a = 1;
70 "```rust\nfn main(){}\n```\nSome comment.\n```rust\nlet a = 1;\n```" 72 "```rust\nfn main(){}\n```\nSome comment.\n```rust\nlet a = 1;\n```"
71 ); 73 );
72 } 74 }
73
74} 75}
diff --git a/crates/ra_lsp_server/src/req.rs b/crates/ra_lsp_server/src/req.rs
index 0540f166e..d25fc5726 100644
--- a/crates/ra_lsp_server/src/req.rs
+++ b/crates/ra_lsp_server/src/req.rs
@@ -1,3 +1,5 @@
1//! FIXME: write short doc here
2
1use lsp_types::{Location, Position, Range, TextDocumentIdentifier, Url}; 3use lsp_types::{Location, Position, Range, TextDocumentIdentifier, Url};
2use rustc_hash::FxHashMap; 4use rustc_hash::FxHashMap;
3use serde::{Deserialize, Serialize}; 5use serde::{Deserialize, Serialize};
diff --git a/crates/ra_lsp_server/src/world.rs b/crates/ra_lsp_server/src/world.rs
index 232409c3b..27da751ab 100644
--- a/crates/ra_lsp_server/src/world.rs
+++ b/crates/ra_lsp_server/src/world.rs
@@ -1,3 +1,5 @@
1//! FIXME: write short doc here
2
1use std::{ 3use std::{
2 path::{Path, PathBuf}, 4 path::{Path, PathBuf},
3 sync::Arc, 5 sync::Arc,
@@ -11,7 +13,7 @@ use ra_ide_api::{
11 Analysis, AnalysisChange, AnalysisHost, CrateGraph, FeatureFlags, FileId, LibraryData, 13 Analysis, AnalysisChange, AnalysisHost, CrateGraph, FeatureFlags, FileId, LibraryData,
12 SourceRootId, 14 SourceRootId,
13}; 15};
14use ra_project_model::ProjectWorkspace; 16use ra_project_model::{get_rustc_cfg_options, ProjectWorkspace};
15use ra_vfs::{LineEndings, RootEntry, Vfs, VfsChange, VfsFile, VfsRoot, VfsTask, Watch}; 17use ra_vfs::{LineEndings, RootEntry, Vfs, VfsChange, VfsFile, VfsRoot, VfsTask, Watch};
16use ra_vfs_glob::{Glob, RustPackageFilterBuilder}; 18use ra_vfs_glob::{Glob, RustPackageFilterBuilder};
17use relative_path::RelativePathBuf; 19use relative_path::RelativePathBuf;
@@ -95,6 +97,10 @@ impl WorldState {
95 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());
96 } 98 }
97 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
98 // Create crate graph from all the workspaces 104 // Create crate graph from all the workspaces
99 let mut crate_graph = CrateGraph::default(); 105 let mut crate_graph = CrateGraph::default();
100 let mut load = |path: &std::path::Path| { 106 let mut load = |path: &std::path::Path| {
@@ -102,7 +108,7 @@ impl WorldState {
102 vfs_file.map(|f| FileId(f.0)) 108 vfs_file.map(|f| FileId(f.0))
103 }; 109 };
104 for ws in workspaces.iter() { 110 for ws in workspaces.iter() {
105 let (graph, crate_names) = ws.to_crate_graph(&mut load); 111 let (graph, crate_names) = ws.to_crate_graph(&default_cfg_options, &mut load);
106 let shift = crate_graph.extend(graph); 112 let shift = crate_graph.extend(graph);
107 for (crate_id, name) in crate_names { 113 for (crate_id, name) in crate_names {
108 change.set_debug_crate_name(crate_id.shift(shift), name) 114 change.set_debug_crate_name(crate_id.shift(shift), name)