Skip to content

TS GO API: add getCompletionsAtPosition to the API and support includeSymbols#4263

Open
piotrtomiak wants to merge 2 commits into
microsoft:mainfrom
JetBrains:api-get-completions-at-position
Open

TS GO API: add getCompletionsAtPosition to the API and support includeSymbols#4263
piotrtomiak wants to merge 2 commits into
microsoft:mainfrom
JetBrains:api-get-completions-at-position

Conversation

@piotrtomiak

Copy link
Copy Markdown
Contributor

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 CompletionList and CompletionItem, which can store a symbol. Most of the changes in completions.go are about switching from lspproto to internal data type.

Copilot AI review requested due to automatic review settings June 10, 2026 21:11

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.

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 getCompletionsAtPosition request/response types and Session routing/handler.
  • Refactors internal completion plumbing to return an internal CompletionList/CompletionItem wrapper 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.

Comment thread internal/ls/completions.go
Comment thread internal/ls/completions.go Outdated
Comment thread internal/ls/string_completions.go
Comment thread _packages/native-preview/src/api/sync/types.ts
Comment thread _packages/native-preview/src/api/sync/types.ts Outdated
Comment thread _packages/native-preview/test/sync/api.test.ts
Comment thread _packages/native-preview/test/sync/api.test.ts Outdated
@RyanCavanaugh RyanCavanaugh added this to the Post-7.0 milestone Jun 10, 2026
@piotrtomiak piotrtomiak force-pushed the api-get-completions-at-position branch from 25f843e to f4c1cf4 Compare June 11, 2026 07:24
@piotrtomiak piotrtomiak force-pushed the api-get-completions-at-position branch from f4c1cf4 to 42df645 Compare June 11, 2026 07:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants