aboutsummaryrefslogtreecommitdiff
path: root/crates/rust-analyzer/src/global_state.rs
diff options
context:
space:
mode:
authorJeremy Kolb <[email protected]>2020-08-09 21:27:48 +0100
committerkjeremy <[email protected]>2020-08-10 16:03:08 +0100
commitcf6d14cee7fee17ed668f502de5042136446945b (patch)
treeb5c91a8daa3c9461b1e9305ae141ece3907b4d9f /crates/rust-analyzer/src/global_state.rs
parentcef39c3efb98e5ece42bb72c14d96388380a308c (diff)
Return InvalidRequest if Shutdown has been requested
From the LSP 3.16 spec: "If a server receives requests after a shutdown request those requests should error with InvalidRequest."
Diffstat (limited to 'crates/rust-analyzer/src/global_state.rs')
-rw-r--r--crates/rust-analyzer/src/global_state.rs2
1 files changed, 2 insertions, 0 deletions
diff --git a/crates/rust-analyzer/src/global_state.rs b/crates/rust-analyzer/src/global_state.rs
index 0e592ac1b..658a50d15 100644
--- a/crates/rust-analyzer/src/global_state.rs
+++ b/crates/rust-analyzer/src/global_state.rs
@@ -73,6 +73,7 @@ pub(crate) struct GlobalState {
73 pub(crate) mem_docs: FxHashMap<VfsPath, DocumentData>, 73 pub(crate) mem_docs: FxHashMap<VfsPath, DocumentData>,
74 pub(crate) semantic_tokens_cache: Arc<Mutex<FxHashMap<Url, SemanticTokens>>>, 74 pub(crate) semantic_tokens_cache: Arc<Mutex<FxHashMap<Url, SemanticTokens>>>,
75 pub(crate) vfs: Arc<RwLock<(vfs::Vfs, FxHashMap<FileId, LineEndings>)>>, 75 pub(crate) vfs: Arc<RwLock<(vfs::Vfs, FxHashMap<FileId, LineEndings>)>>,
76 pub(crate) shutdown_requested: bool,
76 pub(crate) status: Status, 77 pub(crate) status: Status,
77 pub(crate) source_root_config: SourceRootConfig, 78 pub(crate) source_root_config: SourceRootConfig,
78 pub(crate) proc_macro_client: ProcMacroClient, 79 pub(crate) proc_macro_client: ProcMacroClient,
@@ -124,6 +125,7 @@ impl GlobalState {
124 mem_docs: FxHashMap::default(), 125 mem_docs: FxHashMap::default(),
125 semantic_tokens_cache: Arc::new(Default::default()), 126 semantic_tokens_cache: Arc::new(Default::default()),
126 vfs: Arc::new(RwLock::new((vfs::Vfs::default(), FxHashMap::default()))), 127 vfs: Arc::new(RwLock::new((vfs::Vfs::default(), FxHashMap::default()))),
128 shutdown_requested: false,
127 status: Status::default(), 129 status: Status::default(),
128 source_root_config: SourceRootConfig::default(), 130 source_root_config: SourceRootConfig::default(),
129 proc_macro_client: ProcMacroClient::dummy(), 131 proc_macro_client: ProcMacroClient::dummy(),