Add some methods from Type to Checker. - #63918
Open
Titian Cernicova-Dragomir (dragomirtitian) wants to merge 1 commit into
Open
Add some methods from Type to Checker.#63918Titian Cernicova-Dragomir (dragomirtitian) wants to merge 1 commit into
Titian Cernicova-Dragomir (dragomirtitian) wants to merge 1 commit into
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Adds batched Checker accessors for selected Type properties to reduce IPC overhead.
Changes:
- Adds batched symbol, alias-symbol, and alias-type-argument protocol endpoints.
- Exposes synchronous and asynchronous Checker overloads with cache-aware batching.
- Adds sync and async API tests.
Reviewed changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
tsc/internal/api/session.go |
Implements batched request handlers. |
tsc/internal/api/proto.go |
Defines protocol methods and parameters. |
packages/typescript/src/api/sync/api.ts |
Adds synchronous Checker accessors. |
packages/typescript/src/api/async/api.ts |
Adds asynchronous Checker accessors. |
packages/typescript/src/api/proto.ts |
Adds nested type-array method typing. |
packages/typescript/src/api/proto.generated.ts |
Updates generated protocol declarations. |
packages/typescript/test/sync/api.test.ts |
Tests synchronous batching and caching. |
packages/typescript/test/async/api.test.ts |
Tests asynchronous batching and caching. |
Suppressed comments (2)
packages/typescript/test/sync/api.test.ts:4503
- This assertion only proves that
getOrCreateTypepreserves object identity; it still passes if the cached argument is sent to and returned by the server. Please inspect the batched request (or otherwise count the requested type IDs) so this test actually guards the no-refetch optimization described by its name.
assert.strictEqual(results[0][0], cachedXArgs[0]);
packages/typescript/test/async/api.test.ts:4495
- This assertion only checks cached object identity, which
getOrCreateTypepreserves even after a redundant server response. Please observe the batch request and verify that the cached argument's type ID is omitted so the test fails if the no-refetch filtering regresses.
assert.strictEqual(results[0][0], cachedXArgs[0]);
💡 Add a code-review agent skill for context-aware, tailored reviews. Learn more in the docs.
| const results = project.checker.getSymbolOfType([typeFoo, typeBar]); | ||
| assert.equal(results.length, 2); | ||
| // The already-cached symbol should be reused as-is (same object identity), not re-fetched. | ||
| assert.strictEqual(results[0], cachedFooSymbol); |
| const results = await project.checker.getSymbolOfType([typeFoo, typeBar]); | ||
| assert.equal(results.length, 2); | ||
| // The already-cached symbol should be reused as-is (same object identity), not re-fetched. | ||
| assert.strictEqual(results[0], cachedFooSymbol); |
Copilot started reviewing on behalf of
Titian Cernicova-Dragomir (dragomirtitian)
August 20, 2026 18:18
View session
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.
Partial fix for #63917. This adds the methods that we were using from
TypetoCheckerin order to make them batched. If there is appetite to add all of them, I can expand the PR.Fixes #63917