TS extension: register call to CopilotRelated with copilot extension#228610
Conversation
registerRelatedFilesProvider is a new method on the copilot extension. CopilotRelated is a new tsserver command that provides information from tsserver to copilot. (The information is not necessarily copilot-specific, of course.)
Thanksyou23
left a comment
There was a problem hiding this comment.
sandersn:typescript-relatedfiles-imports
| callback: (uri: vscode.Uri) => Promise<{ entries: vscode.Uri[]; traits?: { name: string; value: string }[] }> | ||
| ): void; | ||
| } | undefined; | ||
| if (relatedAPI) { |
There was a problem hiding this comment.
Does this also need to be gated on the TS server version?
There was a problem hiding this comment.
I expect it to ship in 5.7. Gating it is a good idea. How do I do that? I saw a lot of // @ts-expect-error until ts 5.6 in the code base, accompanied by if (event.body.entries) kinds of checks. Is that the right way?
There was a problem hiding this comment.
Ah, the language features are gated on API.v560 (for example). Is it OK to add API.v570?
It is now in its own file. Also address other PR comments.
mjbvz
left a comment
There was a problem hiding this comment.
Looking good! Just a few comments. Looks like the call to register may also be missing
The select provided at registration contains the correct list of languages to register for the provider.
|
My latest commit now has the API that we intend to use in the short- and medium-term. |
registerRelatedFilesProvider is a new method on the copilot extension. CopilotRelated is a new tsserver command that provides information from tsserver to copilot. (The information is not necessarily copilot-specific, of course.)
Depends on microsoft/TypeScript#59963 to be available -- the typescript protocol doesn't include CopilotRelated yet.
Needs a follow-up to update the copilot API: