mirror of
https://github.com/astral-sh/ruff.git
synced 2025-10-02 06:41:23 +00:00
[ty] Support publishing diagnostics in the server (#18309)
## Summary This PR adds support for [publishing diagnostics](https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#textDocument_publishDiagnostics) from the ty language server. It only adds support for it for text documents and not notebook documents because the server doesn't have full notebook support yet. Closes: astral-sh/ty#79 ## Test Plan Testing this out in Helix and Zed since those are the two editors that I know of that doesn't support pull diagnostics: ### Helix https://github.com/user-attachments/assets/e193f804-0b32-4f7e-8b83-6f9307e3d2d4 ### Zed https://github.com/user-attachments/assets/93ec7169-ce2b-4521-b009-a82d8afb9eaa
This commit is contained in:
parent
6d210dd0c7
commit
48c425c15b
11 changed files with 234 additions and 59 deletions
|
@ -34,7 +34,6 @@ impl Index {
|
|||
}
|
||||
}
|
||||
|
||||
#[expect(dead_code)]
|
||||
pub(super) fn text_document_urls(&self) -> impl Iterator<Item = &Url> + '_ {
|
||||
self.documents
|
||||
.iter()
|
||||
|
@ -135,7 +134,7 @@ impl Index {
|
|||
}
|
||||
|
||||
pub(super) fn open_notebook_document(&mut self, notebook_url: Url, document: NotebookDocument) {
|
||||
for cell_url in document.urls() {
|
||||
for cell_url in document.cell_urls() {
|
||||
self.notebook_cells
|
||||
.insert(cell_url.clone(), notebook_url.clone());
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue