Skip to content

[api] Add various merged symbol checker methods - #64598

Open
Andrew Branch (andrewbranch) wants to merge 1 commit into
microsoft:mainfrom
andrewbranch:agents/add-checker-api-symbol-methods
Open

Andrew Branch (andrewbranch) wants to merge 1 commit into
microsoft:mainfrom
andrewbranch:agents/add-checker-api-symbol-methods

Conversation

@andrewbranch

Copy link
Copy Markdown
Member

Follow-up requested in #64571 (review)

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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 Medium severity

Open (3)
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)

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Author: Team For Uncommitted Bug PR for untriaged, rejected, closed or missing bug

Projects

Status: Needs merge

Development

Successfully merging this pull request may close these issues.

3 participants