[api] Add missing checker methods#4424
Open
andrewbranch wants to merge 3 commits into
Open
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR extends the native-preview IPC API surface to cover additional TypeChecker-like methods and Symbol documentation helpers needed by transpiler consumers (per #3610), including a new JSDoc tag representation that returns plain strings instead of SymbolDisplayPart[].
Changes:
- Added new API endpoints and client wrappers for checker methods like
isArrayType,getBaseConstraintOfType,getPropertyOfType,getConstantValue,getSignatureFromDeclaration,getExportSpecifierLocalTargetSymbol,getAliasedSymbol, andgetExportsOfModule. - Introduced
Symbol.getDocumentationComment(checker)andSymbol.getJsDocTags(checker)backed by new language-service helpers that render docs/tags as plain text. - Added sync + async native-preview tests covering the new methods and behaviors.
Reviewed changes
Copilot reviewed 10 out of 10 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| internal/ls/jsdoc.go | New LS helpers to extract documentation comment text and structured JSDoc tags as plain strings. |
| internal/checker/exports.go | Exposes Checker.IsArrayType wrapper to support the new API endpoint. |
| internal/api/session.go | Adds request dispatch + handlers for the newly exposed checker/symbol methods (including JSDoc endpoints). |
| internal/api/proto.go | Adds new method constants and request/response parameter types (incl. JSDocTagInfo). |
| _packages/native-preview/test/sync/api.test.ts | Adds sync API coverage for the new checker methods and symbol JSDoc/documentation behavior. |
| _packages/native-preview/test/async/api.test.ts | Adds async API coverage mirroring the sync tests for the same new methods. |
| _packages/native-preview/src/api/sync/types.ts | Adds JSDocTagInfo type for the sync client surface. |
| _packages/native-preview/src/api/sync/api.ts | Adds sync client wrappers for new checker endpoints + symbol helpers. |
| _packages/native-preview/src/api/async/types.ts | Adds JSDocTagInfo type for the async client surface. |
| _packages/native-preview/src/api/async/api.ts | Adds async client wrappers for new checker endpoints + symbol helpers. |
jakebailey
reviewed
Jun 23, 2026
Comment on lines
+13
to
+14
| // JSDocTagInfo mirrors Strada's `JSDocTagInfo`, but renders the tag's text as a | ||
| // plain string instead of `SymbolDisplayPart[]`. |
Member
There was a problem hiding this comment.
Is this equivalent to existing code but we just say plaintext like LSP? can that save code?
Member
Author
There was a problem hiding this comment.
No; this still separates tag names from comments.
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.
Closes #3610
The one bit of new implementation code is a port of some JSDoc functions from Strada. They weren't originally ported because internally, they were used for creating
SymbolDisplayPart[]for hover; instead, similar methods were created for rendering markdown. I didn't want to reintroduceSymbolDisplayPart, but I thought returning the tags in structured form would still be useful, so where Strada returned an array of the following forSymbol.getJSDocTags():Corsa returns an array of: