TS GO API: add getCompletionsAtPosition to the API and support includeSymbols#4263
Open
piotrtomiak wants to merge 2 commits into
Open
TS GO API: add getCompletionsAtPosition to the API and support includeSymbols#4263piotrtomiak wants to merge 2 commits into
piotrtomiak wants to merge 2 commits into
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Note
Copilot was unable to run its full agentic suite in this review.
Adds a new API surface to fetch language-service completions at an arbitrary document position, optionally including symbol handles for returned entries.
Changes:
- Introduces
getCompletionsAtPositionrequest/response types and Session routing/handler. - Refactors internal completion plumbing to return an internal
CompletionList/CompletionItemwrapper that can carry optional*ast.Symbol. - Adds native-preview (sync + async) client methods, enums/types, and tests for the new completions API.
Reviewed changes
Copilot reviewed 13 out of 13 changed files in this pull request and generated 7 comments.
Show a summary per file
| File | Description |
|---|---|
| internal/ls/string_completions.go | Switches string/path completion conversion to internal CompletionList/CompletionItem wrappers. |
| internal/ls/completions.go | Adds internal completion types, symbol-carrying items, includeSymbols plumbing, and LSP conversion helpers. |
| internal/api/session.go | Wires new method and implements handler to return completion entries + optional symbol handles. |
| internal/api/proto.go | Adds MethodGetCompletionsAtPosition and request/response DTOs. |
| _packages/native-preview/test/sync/api.test.ts | Adds sync client tests for checker.getCompletionsAtPosition. |
| _packages/native-preview/test/async/api.test.ts | Adds async client tests for checker.getCompletionsAtPosition. |
| _packages/native-preview/src/enums/completionItemKind.ts | Adds runtime CompletionItemKind export for native-preview. |
| _packages/native-preview/src/enums/completionItemKind.enum.ts | Adds typed enum definition for CompletionItemKind. |
| _packages/native-preview/src/api/sync/types.ts | Adds completion-related public types and kind typing. |
| _packages/native-preview/src/api/sync/api.ts | Adds sync Checker.getCompletionsAtPosition and exports CompletionItemKind. |
| _packages/native-preview/src/api/proto.ts | Adds completion DTOs for client/server wire format. |
| _packages/native-preview/src/api/async/types.ts | Adds completion-related public types and kind typing. |
| _packages/native-preview/src/api/async/api.ts | Adds async Checker.getCompletionsAtPosition and exports CompletionItemKind. |
25f843e to
f4c1cf4
Compare
f4c1cf4 to
42df645
Compare
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.
This adds one of missing APIs for WebStorm support. It adds support for including symbols in the returned completion items list. This required adding an internal data type
CompletionListandCompletionItem, which can store a symbol. Most of the changes incompletions.goare about switching fromlspprototo internal data type.