Skip to content

Commit fb468c9

Browse files
committed
use last version +1 on close
1 parent 4f4fb53 commit fb468c9

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

pyrefly/lib/lsp/non_wasm/server.rs

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1888,17 +1888,21 @@ impl Server {
18881888

18891889
fn did_close(&self, url: Url) {
18901890
let uri = url.to_file_path().unwrap();
1891-
self.version_info.lock().remove(&uri);
1891+
let version = self
1892+
.version_info
1893+
.lock()
1894+
.remove(&uri)
1895+
.map(|version| version + 1);
18921896
let open_files = self.open_files.dupe();
18931897
if let Some(LspFile::Notebook(notebook)) = open_files.write().remove(&uri).as_deref() {
18941898
for cell in notebook.cell_urls() {
18951899
self.connection
1896-
.publish_diagnostics_for_uri(cell.clone(), Vec::new(), None);
1900+
.publish_diagnostics_for_uri(cell.clone(), Vec::new(), version);
18971901
self.open_notebook_cells.write().remove(cell);
18981902
}
18991903
} else {
19001904
self.connection
1901-
.publish_diagnostics_for_uri(url, Vec::new(), None);
1905+
.publish_diagnostics_for_uri(url, Vec::new(), version);
19021906
}
19031907
let state = self.state.dupe();
19041908
let lsp_queue = self.lsp_queue.dupe();

0 commit comments

Comments
 (0)