Skip to content

Restore 4 more lost PRs#3634

Merged
jakebailey merged 4 commits intomainfrom
jabaile/restore-more-reverted
Apr 28, 2026
Merged

Restore 4 more lost PRs#3634
jakebailey merged 4 commits intomainfrom
jabaile/restore-more-reverted

Conversation

@jakebailey
Copy link
Copy Markdown
Member

Restores #3328, #3445, #3502, #3513, also lost in the merge queue bug

Fixes #3632

…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>
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 ObjectFlagsFromTypeNode to refine recursion identity for type references originating from AST type nodes; added compiler test coverage and baselines.
  • Updated tsconfig numeric parsing to accept JSON number values (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.

Comment thread internal/tsoptions/parsinghelpers.go
Comment thread internal/ls/autoimport/fix.go
@jakebailey jakebailey force-pushed the jabaile/restore-more-reverted branch from fdb5cc6 to 4679497 Compare April 28, 2026 02:47
@jakebailey jakebailey added this pull request to the merge queue Apr 28, 2026
Merged via the queue into main with commit de302e0 Apr 28, 2026
37 of 39 checks passed
@jakebailey jakebailey deleted the jabaile/restore-more-reverted branch April 28, 2026 15:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Semantic Tokens are commented out again

4 participants