[api] Add various merged symbol checker methods - #64598
Open
Andrew Branch (andrewbranch) wants to merge 1 commit into
Open
Andrew Branch (andrewbranch) wants to merge 1 commit into
Andrew Branch (andrewbranch) wants to merge 1 commit into
Conversation
Andrew Branch (andrewbranch)
requested review from
Wesley Wigham (weswigham)
and
a balanced review from Copilot
October 2, 2026 17:01
Jake Bailey (jakebailey)
approved these changes
Oct 2, 2026
Contributor
There was a problem hiding this comment.
Warning
Copilot couldn't run its full agentic review because it didn't start before the timeout. Make sure your repository has a runner available, or add a copilot-code-review.yml file specifying one with the runs-on attribute. See the docs for more details.
Copilot review overview
Review effort: Lite
Findings: 3
Open (3)
The newast.CanHaveSymbol(node)condition can fail for nodes that are declarations but cannot… · New This change alters the rejection criteria forhandleGetSymbolOfDeclarationby newly treating… · New Similar tohandleGetSymbolOfDeclaration, this branches on!ast.CanHaveSymbol(node)but reports… · New
What changed in this PR
Adds new remote Checker APIs to support merged symbol resolution and parent relationships, enabling correct symbol operations across multi-file declaration merging scenarios.
Changes:
- Exposes checker methods for merged symbols and symbol/parent lookup via the internal Go API layer.
- Wires new protocol methods through the session request router and generated protocol typings.
- Updates sync/async TypeScript API surfaces and adds parity + behavioral tests for merged/late-bound symbol behavior.
| File | Description |
|---|---|
| tsc/internal/checker/exports.go | Exposes additional checker wrappers for merged symbol / symbol lookup. |
| tsc/internal/api/session_createsourcefile_test.go | Updates expected error text for get-symbol-of-declaration failure. |
| tsc/internal/api/session.go | Adds new request handlers and tightens declaration symbol eligibility checks. |
| tsc/internal/api/proto.go | Registers new protocol method names and unmarshallers. |
| packages/typescript/test/sync/api.test.ts | Updates sync API tests and adds new checker symbol method scenarios. |
| packages/typescript/test/sync/api-generators.test.ts | Adds generator parity cases for new checker methods. |
| packages/typescript/test/async/api.test.ts | Updates async API tests and adds new checker symbol method scenarios. |
| packages/typescript/src/api/sync/api.ts | Adds sync Checker APIs for merged symbol / node symbol / parent-of-symbol. |
| packages/typescript/src/api/proto.generated.ts | Extends generated protocol method typings/unions for batching. |
| packages/typescript/src/api/async/api.ts | Adds async Checker APIs for merged symbol / node symbol / parent-of-symbol. |
💡 Add a code-review agent skill for context-aware, tailored reviews. Learn more in the docs.
Comment on lines
+2155
to
2157
| if node == nil || !ast.IsDeclaration(node) || !ast.CanHaveSymbol(node) { | ||
| return nil, fmt.Errorf("%w: node index %d is not a declaration", ErrClientError, params.Index) | ||
| } |
Comment on lines
+2155
to
2157
| if node == nil || !ast.IsDeclaration(node) || !ast.CanHaveSymbol(node) { | ||
| return nil, fmt.Errorf("%w: node index %d is not a declaration", ErrClientError, params.Index) | ||
| } |
Comment on lines
+4708
to
+4713
| if !ast.IsDeclaration(node) || !ast.CanHaveSymbol(node) { | ||
| return nil, fmt.Errorf("%w: node is not a declaration", ErrClientError) | ||
| } | ||
| symbol := setup.checker.GetSymbolOfDeclaration(node) | ||
| if symbol == nil { | ||
| return nil, fmt.Errorf("%w: declaration has no symbol", ErrClientError) |
Copilot started reviewing on behalf of
Andrew Branch (andrewbranch)
October 2, 2026 17:39
View session
This branch has not been deployed
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.

Follow-up requested in #64571 (review)