Prevent LSP panics on stale document notifications - #64036
Merged
Andrew Branch (andrewbranch) merged 2 commits intoAug 26, 2026
Conversation
Co-authored-by: RyanCavanaugh <6685088+RyanCavanaugh@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Fix LSP panic due to overlay not found for changed file
Prevent LSP panics on stale document notifications
Aug 26, 2026
Ryan Cavanaugh (RyanCavanaugh)
requested a review
from Andrew Branch (andrewbranch)
August 26, 2026 19:58
Andrew Branch (andrewbranch)
approved these changes
Aug 26, 2026
Andrew Branch (andrewbranch)
left a comment
Member
There was a problem hiding this comment.
I have previously argued that these kinds of assertions help us catch internal inconsistencies, so I don't like to remove them, but I don't know what else to do when third party IDEs send us garbage inputs. I guess this is fine.
Jake Bailey (jakebailey)
approved these changes
Aug 26, 2026
Jake Bailey (jakebailey)
left a comment
Member
There was a problem hiding this comment.
I guess it's fine, I also feel bad about it
(PR is still drafted?)
Andrew Branch (andrewbranch)
marked this pull request as ready for review
August 26, 2026 22:46
Andrew Branch (andrewbranch)
enabled auto-merge
August 26, 2026 22:46
Copilot started reviewing on behalf of
Andrew Branch (andrewbranch)
August 26, 2026 22:46
View session
Contributor
There was a problem hiding this comment.
Pull request overview
Prevents LSP crashes from duplicate or stale document notifications by ignoring events without an active overlay.
Changes:
- Ignore close/change events for missing overlays.
- Add regression tests for duplicate close and stale change notifications.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
tsc/internal/project/overlayfs.go |
Guards overlay close/change processing. |
tsc/internal/project/overlayfs_test.go |
Tests stale notifications after closure. |
💡 Add a code-review agent skill for context-aware, tailored reviews. Learn more in the docs.
| } | ||
|
|
||
| if len(events.changes) > 0 { | ||
| if len(events.changes) > 0 && o != nil { |
Andrew Branch (andrewbranch)
deleted the
copilot/fix-lsp-overlay-not-found
branch
August 26, 2026 23:13
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.
Some LSP clients emit duplicate or stale document notifications. A
didCloseordidChangereceived after the document overlay was removed caused the language server to panic.Change
Coverage