Restore 4 more lost PRs#3634
Merged
jakebailey merged 4 commits intomainfrom Apr 28, 2026
Merged
Conversation
…n` is `force` (#3328) Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: andrewbranch <3277153+andrewbranch@users.noreply.github.com>
Contributor
There was a problem hiding this comment.
Pull request overview
Restores four previously-lost changesets to the TypeScript-go compiler/language server, covering auto-import behavior in CJS under Node module kinds and moduleDetection: "force", recursion identity fixes for deeply-nested types, numeric parsing in tsconfig, and re-enabling LSP semantic tokens.
Changes:
- Re-enabled LSP semantic tokens capability advertisement.
- Fixed auto-import “require vs import” selection by improving ESM/CJS syntax detection under
moduleDetection: "force"and Node module kinds; added fourslash coverage. - Added
ObjectFlagsFromTypeNodeto refine recursion identity for type references originating from AST type nodes; added compiler test coverage and baselines. - Updated tsconfig numeric parsing to accept JSON
numbervalues (float64) and refreshed config parsing baselines.
Reviewed changes
Copilot reviewed 19 out of 19 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| testdata/tests/cases/compiler/deeplyNestedTupleTypes.ts | New compiler test case for deeply-nested tuple assignability (recursion identity). |
| testdata/tests/cases/compiler/deeplyNestedArrayTypes.ts | New compiler test case for deeply-nested array assignability (recursion identity). |
| testdata/baselines/reference/compiler/deeplyNestedTupleTypes.types | Baseline for tuple test type output. |
| testdata/baselines/reference/compiler/deeplyNestedTupleTypes.symbols | Baseline for tuple test symbols output. |
| testdata/baselines/reference/compiler/deeplyNestedTupleTypes.errors.txt | Baseline for tuple test error output. |
| testdata/baselines/reference/compiler/deeplyNestedArrayTypes.types | Baseline for array test type output. |
| testdata/baselines/reference/compiler/deeplyNestedArrayTypes.symbols | Baseline for array test symbols output. |
| testdata/baselines/reference/compiler/deeplyNestedArrayTypes.errors.txt | Baseline for array test error output. |
| testdata/baselines/reference/config/tsconfigParsing/parses tsconfig with compilerOptions, files, include, and exclude with jsonSourceFile api.js | Baseline updated for numeric option parsing (maxNodeModuleJsDepth). |
| testdata/baselines/reference/config/tsconfigParsing/parses tsconfig with compilerOptions, files, include, and exclude with json api.js | Baseline updated for numeric option parsing (maxNodeModuleJsDepth). |
| internal/tsoptions/parsinghelpers.go | Accept float64 numeric values when converting JSON options into Go *int fields. |
| internal/lsp/server.go | Re-advertise SemanticTokensProvider during initialize. |
| internal/ls/autoimport/fix.go | Improve require-vs-import selection by detecting ESM/CJS syntax robustly under forced module detection. |
| internal/fourslash/tests/autoImportCJSWithNodeModuleKind_test.go | New fourslash tests covering CJS auto-import behavior under Node module kinds and moduleDetection: "force". |
| internal/checker/types.go | Add ObjectFlagsFromTypeNode flag. |
| internal/checker/relater.go | Adjust recursion identity logic to account for FromTypeNode. |
| internal/checker/checker.go | Mark certain type references from type nodes with ObjectFlagsFromTypeNode; add createTypeReferenceEx/tuple normalization variants. |
| _packages/native-preview/src/enums/objectFlags.ts | Sync preview enum with new FromTypeNode flag. |
| _packages/native-preview/src/enums/objectFlags.enum.ts | Sync preview enum with new FromTypeNode flag. |
Comments suppressed due to low confidence (1)
internal/checker/checker.go:24692
- createTypeReferenceEx caches instantiations solely by the typeArguments key. That means a type reference created with ObjectFlagsFromTypeNode will be returned by later createTypeReference calls (ObjectFlagsNone) for the same target+args, making the FromTypeNode classification “sticky” and potentially misclassifying type references produced by instantiation paths (which the relater logic treats differently for recursion identity). Consider separating the cache by this flag (e.g., include it in the cache key / maintain a second cache) or avoid storing FromTypeNode references in the shared instantiation cache.
Co-authored-by: Mateusz Burzyński <mateuszburzynski@gmail.com>
fdb5cc6 to
4679497
Compare
ahejlsberg
approved these changes
Apr 28, 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 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.
Restores #3328, #3445, #3502, #3513, also lost in the merge queue bug
Fixes #3632