Skip to content

Commit de2d7b5

Browse files
committed
use last version +1 on close
1 parent b477e01 commit de2d7b5

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
@@ -1984,17 +1984,21 @@ impl Server {
19841984
let Some(path) = self.path_for_uri(&url) else {
19851985
return;
19861986
};
1987-
self.version_info.lock().remove(&path);
1987+
let version = self
1988+
.version_info
1989+
.lock()
1990+
.remove(&uri)
1991+
.map(|version| version + 1);
19881992
let open_files = self.open_files.dupe();
19891993
if let Some(LspFile::Notebook(notebook)) = open_files.write().remove(&path).as_deref() {
19901994
for cell in notebook.cell_urls() {
19911995
self.connection
1992-
.publish_diagnostics_for_uri(cell.clone(), Vec::new(), None);
1996+
.publish_diagnostics_for_uri(cell.clone(), Vec::new(), version);
19931997
self.open_notebook_cells.write().remove(cell);
19941998
}
19951999
} else {
19962000
self.connection
1997-
.publish_diagnostics_for_uri(url.clone(), Vec::new(), None);
2001+
.publish_diagnostics_for_uri(url, Vec::new(), version);
19982002
}
19992003
self.unsaved_file_tracker.forget_uri_path(&url);
20002004
let state = self.state.dupe();

0 commit comments

Comments
 (0)