-
Notifications
You must be signed in to change notification settings - Fork 3.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Revert "lsp: Do not notify all language servers on file save" #19183
Revert "lsp: Do not notify all language servers on file save" #19183
Conversation
…ustries#17756)" This reverts commit db92a31.
|
@osiewicz, no rush, but if you could tell me what the opinion of the team on this matter is, it would give me an idea of what to do next. I'm currently diving into Scala, and using another editor after Zed doesn't feel great 😔 |
Hey, I am a bit busy right now, but I've marked myself as a reviewer as I was involved in both the original PR and the followup discussion. |
Wasn't the Rust Analyzer actually fixed for that case? rust-lang/rust-analyzer@772acef I will also try to reuse client file watching for .scala files once I have time to look at it, but since the assumptions are not really a LSP standard I am not sure if this will fix things with 100% certainty. |
Wait, actually Rust Analyzer is doing the right thing, it's using https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#textDocumentRegistrationOptions which has nothing to do with https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#workspace_didChangeWatchedFiles There actually is the specific option for didSave and if it's null then everything should be sent |
@tgodzik sweet, that settles it then. That means that Zed is the the one changing. I'll work up a PR to support filtering based on document selectors, as it seems like we don't have that at all right now. |
I was mostly surprised, I haven't figured out the actual problem earlier. I did spend a lot of time in that spec already 😅 It made a lot of sense to have an option to declare supported files and it turns out there is! |
Yeah, I somehow missed it too, even though I've seen it and had it in the back of my mind but for some reason the discussion in the LSP repo made me think otherwise |
@WeetHet since today is a release day and RA should not error too much after this revert, I'm going to merge your PR and work on a follow-up separately. Thanks! |
…dustries#19183) Reverts zed-industries#17756. According to the existing implementations of the LSP specification, namely [Helix](https://github.com/helix-editor/helix/blob/a7651f5bf027ec98645d571ab05a685d97e1b772/helix-view/src/document.rs#L1038) and, if I'm not wrong, [VSCode](https://github.com/microsoft/vscode-languageserver-node/blob/main/client/src/common/textSynchronization.ts#L580), `textDocument/didSave` has nothing to do with the watched files and should be sent to the language servers connected to the buffers even if the files are not watched by those. As the LSP spec doesn't say anything about `didSave` being related to the watched files, and the reference implementation in VSCode seemingly does not filter the notifications according to those, it seems like this is an incorrect interpretation of the specification This also causes issues with language servers. See [Metals issue](scalameta/metals-zed#28 (comment)) for example Closes zed-industries#18636 Release Notes: - N/A
Reverts #17756. According to the existing implementations of the LSP specification, namely Helix and, if I'm not wrong, VSCode,
textDocument/didSave
has nothing to do with the watched files and should be sent to the language servers connected to the buffers even if the files are not watched by those. As the LSP spec doesn't say anything aboutdidSave
being related to the watched files, and the reference implementation in VSCode seemingly does not filter the notifications according to those, it seems like this is an incorrect interpretation of the specificationThis also causes issues with language servers. See Metals issue for example
Closes #18636
Release Notes: