Add isolatedDeclarations quickfix#3304
Draft
jakebailey wants to merge 3 commits intojabaile/fine-grained-idfrom
Draft
Add isolatedDeclarations quickfix#3304jakebailey wants to merge 3 commits intojabaile/fine-grained-idfrom
jakebailey wants to merge 3 commits intojabaile/fine-grained-idfrom
Conversation
00aa35b to
b883553
Compare
jakebailey
commented
Mar 31, 2026
Comment on lines
+787
to
+791
| propertyName.Parent = parameter.Name().Parent //nolint:customlint // .Parent set to get node to printback using text from original file instead of processed text; TODO: this should be achievable via EmitFlags instead | ||
| tx.EmitContext().AddEmitFlags(propertyName, printer.EFNoComments|printer.EFNoSourceMap) | ||
|
|
||
| localName := parameter.Name().Clone(tx.Factory()) | ||
| localName.Parent = parameter.AsNode() //nolint:customlint // .Parent set to get node to printback using text from original file instead of processed text; TODO: this should be achievable via EmitFlags instead | ||
| localName.Parent = parameter.Name().Parent //nolint:customlint // .Parent set to get node to printback using text from original file instead of processed text; TODO: this should be achievable via EmitFlags instead |
Member
Author
There was a problem hiding this comment.
This turned out to matter after all, which feels gross
jakebailey
commented
Mar 31, 2026
| ast.KindJsxNamespacedName: | ||
| // !!! If `node` is not a parse tree node, verify its original node comes from the same source file | ||
| if p.currentSourceFile == nil || node.Parent == nil || ast.NodeIsSynthesized(node) { | ||
| if !canUseSourceFile || ast.GetSourceFileOfNode(node) != p.emitContext.MostOriginal(p.currentSourceFile.AsNode()).AsSourceFile() { |
Member
Author
There was a problem hiding this comment.
This new check fixes some stuff, but re-broke the case with the escaped identifier.
jakebailey
commented
Mar 31, 2026
Comment on lines
+231
to
+242
| // For fourslash tests, use seenContentLine to preserve leading blank lines | ||
| // (matching TS fourslash's //// content markers). For compiler tests, use | ||
| // Len() != 0 which drops leading blanks (matching TS's harness behavior). | ||
| if options.AllowImplicitFirstFile { | ||
| if seenContentLine { | ||
| currentFileContent.WriteRune('\n') | ||
| } | ||
| seenContentLine = true | ||
| } else { | ||
| if currentFileContent.Len() != 0 { | ||
| currentFileContent.WriteRune('\n') | ||
| } |
Member
Author
There was a problem hiding this comment.
I need to pull some of these changes into its own PR, as there are general improvements here that I found when fixing the ID stuff.
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.
Builds on #3303.
Had to port more fourslash generator code, but filtered down to just these fixes.