Ignore stray textDocument/didSave requests#712
Open
mmyrte wants to merge 1 commit intoREditorSupport:masterfrom
Open
Ignore stray textDocument/didSave requests#712mmyrte wants to merge 1 commit intoREditorSupport:masterfrom
textDocument/didSave requests#712mmyrte wants to merge 1 commit intoREditorSupport:masterfrom
Conversation
|
Thank you. |
rgbkrk
approved these changes
Feb 20, 2026
rgbkrk
left a comment
There was a problem hiding this comment.
Thank you! I'm not a maintainer here obviously but I would love to have this fix.
Member
|
Looks like the change breaks most test cases where each test code relies on |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Zed chose to interpret the LSP spec differently from VS Code, sending
didSaveto any file, not caring what thelanguageIdis - see ocsmit/zed-r#6 - which leads to languagserver trying to parse and lint all over the place. (edit: found #681 also relates to this issue).Dirk Bäumer tentatively specifies that a server should not respond to a request if the file was not previously opened by it, see microsoft/language-server-protocol#2110, see hudson-trading/slang-server#237 for a sample implementation.
I'm proposing to simply ignore documents that are not yet in the workspace, which fixes the problems on my end. I'm afraid I don't know enough about this package or the protocol to assess whether this is acceptable; I also don't have the time to go into this much further
I am happy to amend this PR, if needed: we could specifically retrieve the document associated with a URI to check for the
is_openflag, but that leaves open the question of whether/how to ignore files not yet in the workspace.