Expose getFullyQualifiedName on the API Checker#4700
Open
WinterYukky wants to merge 1 commit into
Open
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Exposes getFullyQualifiedName through the checker API for parity with TypeScript’s classic TypeChecker.
Changes:
- Adds the exported Go checker method and API protocol handler.
- Adds synchronous and asynchronous client methods.
- Tests module-qualified and nested symbol names.
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
internal/checker/exports.go |
Exposes the checker implementation. |
internal/api/session.go |
Handles API requests. |
internal/api/proto.go |
Registers the protocol method. |
_packages/native-preview/src/api/sync/api.ts |
Adds the synchronous client API. |
_packages/native-preview/src/api/async/api.ts |
Adds the asynchronous client API. |
_packages/native-preview/test/sync/api.test.ts |
Tests synchronous behavior. |
_packages/native-preview/test/async/api.test.ts |
Tests asynchronous behavior. |
Author
|
@microsoft-github-policy-service agree |
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.
Summary
This adds
checker.getFullyQualifiedName(symbol)to the unstable API, for parity with the classic publicTypeChecker.getFullyQualifiedName.Why we need this change?
Tools that build on the Compiler API rely on this method for symbol identification. For example, jsii — the multi-language binding generator behind the AWS CDK, one of the largest TypeScript codebases — calls it ~357k times when compiling aws-cdk-lib, its single most-called checker API, — and it is currently the only checker API in jsii's extraction hot path with no equivalent here.
Notes
Implementation
The checker already had the internal
getFullyQualifiedName; this change only wires it up following the existingCheckerSymbolParamspattern (Go handler + async client method; the sync client and tests are generated viagenerateSync).Tests
Added sync/async client tests covering module-qualified names (
"/src/index".Standalone) and nested members ("/src/index".Outer.Inner).go test ./internal/api/...and the native-preview client test suites pass (196/196 each).