fix(lsp): clear push diagnostics on detach #40634

Problem: when an LS client detaches from the buffer, only pull diagnostics
are cleared via capability framework. Push diagnostics remain stuck even
when client stops/restarts.

Solution: clear push diagnostics on client detach.

ref #33864
This commit is contained in:
Oleh Volynets
2026-07-08 18:00:21 +02:00
committed by GitHub
parent 089662d318
commit ef130902cf
2 changed files with 47 additions and 14 deletions

View File

@@ -1436,6 +1436,8 @@ function Client:_on_detach(bufnr)
end
end
vim.diagnostic.reset(vim.lsp.diagnostic.get_namespace(self.id, false), bufnr)
changetracking.reset_buf(self, bufnr)
self:_text_document_did_close_handler(bufnr)