Skip to content

Commit 20245bd

Browse files
committed
use last version +1 on close
1 parent fe0d445 commit 20245bd

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

pyrefly/lib/lsp/non_wasm/server.rs

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1516,12 +1516,15 @@ impl Server {
15161516

15171517
fn did_close(&self, params: DidCloseTextDocumentParams) {
15181518
let uri = params.text_document.uri.to_file_path().unwrap();
1519-
self.version_info.lock().remove(&uri);
1519+
let version = self
1520+
.version_info
1521+
.lock()
1522+
.remove(&uri)
1523+
.map(|version| version + 1);
15201524
let open_files = self.open_files.dupe();
15211525
open_files.write().remove(&uri);
1522-
// TODO: should we use the last version or None?
15231526
self.connection
1524-
.publish_diagnostics_for_uri(params.text_document.uri, Vec::new(), None);
1527+
.publish_diagnostics_for_uri(params.text_document.uri, Vec::new(), version);
15251528
let state = self.state.dupe();
15261529
let lsp_queue = self.lsp_queue.dupe();
15271530
let open_files = self.open_files.dupe();

0 commit comments

Comments
 (0)