This repository was archived by the owner on Sep 1, 2026. It is now read-only.
Repository navigation
Fix overlay script kind fallback for unknown LSP language IDs - #4189
Merged
Jake Bailey (jakebailey) merged 2 commits intoJun 3, 2026
Merged
Conversation
Co-authored-by: jakebailey <[email protected]>
Copilot
AI
changed the title
[WIP] Fix tsgo LSP crashes when opening .mts file in mixed CJS/ESM repo
Fix overlay script kind fallback for unknown LSP language IDs
Jun 3, 2026
Jake Bailey (jakebailey)
marked this pull request as ready for review
June 3, 2026 17:23
Jake Bailey (jakebailey)
requested review from
Andrew Branch (andrewbranch) and
Copilot
June 3, 2026 17:23
Member
|
I'm not 100% thrilled that we would need to do this to appease a client, but, it's not the worst thought. |
Contributor
There was a problem hiding this comment.
Pull request overview
Fixes a crash in the tsgo LSP overlay filesystem when the client sends a non-standard/unknown languageId (e.g. "mts"), ensuring overlays don’t end up with ScriptKindUnknown and later fail in parsing.
Changes:
- Resolve overlay
ScriptKindfrom LSPlanguageId, but fall back to file-extension-based detection when the ID is unknown. - Add a regression test to ensure opening
file:///test1.mtswithlanguageId: "mts"results inScriptKindTS.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| internal/project/overlayfs.go | Adds a safe fallback to determine ScriptKind from filename when LSP language ID is not recognized. |
| internal/project/overlayfs_test.go | Adds a regression test covering unknown LSP language IDs for .mts overlays. |
Ryan Cavanaugh (RyanCavanaugh)
approved these changes
Jun 3, 2026
Jake Bailey (jakebailey)
added a commit
to jakebailey/TypeScript
that referenced
this pull request
Aug 13, 2026
…oft/typescript-go#4189) Co-authored-by: copilot-swe-agent[bot] <[email protected]> Co-authored-by: jakebailey <[email protected]>
This was referenced Nov 16, 2026
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
Opening a
.mtsfile could crash tsgo LSP when the client sent a non-standardlanguageIdsuch as"mts". The overlay shadowed the disk file withScriptKindUnknown, which later reached the parser.file:///test1.mtswithlanguageId: "mts".ScriptKindUnknown.