-
Notifications
You must be signed in to change notification settings - Fork 38.2k
Closed
Labels
Milestone
Description
Refs: #271104
- anyOS @roblourens
- anyOS @bamurtaugh
- anyOS @zhichli
Complexity: 5
This is the first iteration of the contributable chat context API, so there is certainly room for improvement. For this milestone, the goal of testing is to :
- test that the API works
- test that the structure of the API makes sense
- provide feedback on naming or anything else you have feedback on, keeping in mind that this is early API
The ChatContextProvider has 3 ways to provide context. See the provide* methods: https://github.com/microsoft/vscode/blob/main/src/vscode-dts/vscode.proposed.chatContextProvider.d.ts#L48-L49
- Verify that the doc comments for each
provide*method make it clear how they are used. - Having read about the
provide*methods, verify that the doc comments also make it clear whatresolveChatContextis used for.
Test provideWorkspaceChatContext:
- Create an extension, for example with
yo code. - In your extension activation, register a
ChatContextProvider:vscode/src/vscode-dts/vscode.proposed.chatContextProvider.d.ts
Lines 25 to 26 in 645cbb4
export function registerChatContextProvider(selector: DocumentSelector | undefined, id: string, provider: ChatContextProvider): Disposable; - Read the documentation for
registerChatContextProvider, and verify that it explains how to make sure your extension is activated for providing context. - In your
ChatContextProvider, implementprovideWorkspaceChatContext, andresolveChatContext. Verify that your workspace chat context is added to chats that you start with Copilot. - Implement
onDidChangeWorkspaceChatContextand verify that after firing it, yourprovideWorkspaceChatContextgets called again for the next chat.
Test provideChatContextExplicit:
- You can use the same extension from the previous step.
- Implement
provideChatContextExplicitin your chat context provider. - Verify that your chat context items show when you attach context:
Test provideChatContextForResource:
- This one is too panful to test from scratch. Instead, you can test it with the latest pre-release version of the GitHub Pull Request extension
- Make sure you have
"chat.implicitContext.suggestedContext": trueset. - Open a PR webview from the Pull Requests view
- Ask a question about the PR in chat. Verify that you see that the title of the PR was attached automatically as context
- Verify that Chat knows things about the PR.
Reactions are currently unavailable