diff options
author | David Sherret <dsherret@users.noreply.github.com> | 2024-04-14 20:07:04 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-04-15 00:07:04 +0000 |
commit | 1835b4f06189560eb17a103b8db05e011a7cd799 (patch) | |
tree | d4cdda015ca39e861d1a1fdc9fbb843ec02c35a2 /cli/lsp/documents.rs | |
parent | 8f1a92f3c39a4db7582824944d2c9319a11efcc0 (diff) |
fix(lsp): ensure project version is incremented when config changes (#23366)
I'm running into a node resolution bug in the lsp only and while
tracking it down I noticed this one.
Fixed by moving the project version out of `Documents`.
Diffstat (limited to 'cli/lsp/documents.rs')
-rw-r--r-- | cli/lsp/documents.rs | 13 |
1 files changed, 0 insertions, 13 deletions
diff --git a/cli/lsp/documents.rs b/cli/lsp/documents.rs index 8100b0732..1dd18f599 100644 --- a/cli/lsp/documents.rs +++ b/cli/lsp/documents.rs @@ -851,7 +851,6 @@ pub struct Documents { redirect_resolver: Arc<RedirectResolver>, /// If --unstable-sloppy-imports is enabled. unstable_sloppy_imports: bool, - project_version: usize, } impl Documents { @@ -878,7 +877,6 @@ impl Documents { has_injected_types_node_package: false, redirect_resolver: Arc::new(RedirectResolver::new(cache)), unstable_sloppy_imports: false, - project_version: 0, } } @@ -890,14 +888,6 @@ impl Documents { .flat_map(|value| value.get_type().or_else(|| value.get_code())) } - pub fn project_version(&self) -> String { - self.project_version.to_string() - } - - pub fn increment_project_version(&mut self) { - self.project_version += 1; - } - /// "Open" a document from the perspective of the editor, meaning that /// requests for information from the document will come from the in-memory /// representation received from the language server client, versus reading @@ -925,7 +915,6 @@ impl Documents { self.file_system_docs.set_dirty(true); self.open_docs.insert(specifier, document.clone()); - self.increment_project_version(); self.dirty = true; document } @@ -957,7 +946,6 @@ impl Documents { self.get_npm_resolver(), )?; self.open_docs.insert(doc.specifier().clone(), doc.clone()); - self.increment_project_version(); Ok(doc) } @@ -985,7 +973,6 @@ impl Documents { .docs .insert(specifier.clone(), document); - self.increment_project_version(); self.dirty = true; } Ok(()) |