You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* Register a chat context provider. Chat context can be provided:
15
-
* - For a resource. Make sure to pass a selector that matches the resource you want to provide context for.
16
-
* Providers registered without a selector will not be called for resource-based context.
17
-
* - Explicitly. These context items are shown as options when the user explicitly attaches context.
14
+
* Register a chat workspace context provider. Workspace context is automatically included in all chat requests.
18
15
*
19
16
* To ensure your extension is activated when chat context is requested, make sure to include the following activations events:
20
17
* - If your extension implements `provideWorkspaceChatContext` or `provideChatContextForResource`, find an activation event which is a good signal to activate.
* Register a chat explicit context provider. Explicit context items are shown as options when the user explicitly attaches context use the "Attache Context" action in the chat input box.
28
+
*
29
+
* Explicit context providers should also be statically contributed in package.json using the `chatContext` contribution point.
30
+
*
31
+
* To ensure your extension is activated when chat context is requested, make sure to include the `onChatContextProvider:<id>` activation event in your `package.json`.
32
+
*
33
+
* @param id Unique identifier for the provider.
34
+
* @param provider The chat explicit context provider.
* Register a chat resource context provider. Resource context is provided for a specific resource.
40
+
* Make sure to pass a selector that matches the resource you want to provide context for.
41
+
*
42
+
* To ensure your extension is activated when chat context is requested, make sure to include the `onChatContextProvider:<id>` activation event in your `package.json`.
43
+
*
44
+
* @param selector Document selector to filter which resources the provider is called for.
45
+
* @param id Unique identifier for the provider.
46
+
* @param provider The chat resource context provider.
* @deprecated Use {@link registerChatWorkspaceContextProvider}, {@link registerChatExplicitContextProvider}, or {@link registerChatResourceContextProvider} instead.
54
+
*
24
55
* @param selector Optional document selector to filter which resources the provider is called for. If omitted, the provider will only be called for explicit context requests.
25
56
* @param id Unique identifier for the provider.
26
57
* @param provider The chat context provider.
@@ -32,12 +63,21 @@ declare module 'vscode' {
32
63
exportinterfaceChatContextItem{
33
64
/**
34
65
* Icon for the context item.
66
+
* - If `icon` is not defined, no icon is shown.
67
+
* - If `icon` is defined and is a file or folder icon, the icon is derived from {@link resourceUri} if `resourceUri` is defined.
68
+
* - Otherwise, `icon` is used.
35
69
*/
36
-
icon: ThemeIcon;
70
+
icon?: ThemeIcon;
37
71
/**
38
72
* Human readable label for the context item.
73
+
* If not set, the label is derived from {@link resourceUri}.
74
+
*/
75
+
label?: string;
76
+
/**
77
+
* A resource URI for the context item.
78
+
* Used to derive the {@link label} and {@link icon} if they are not set.
39
79
*/
40
-
label: string;
80
+
resourceUri?: Uri;
41
81
/**
42
82
* An optional description of the context item, e.g. to describe the item to the language model.
43
83
*/
@@ -53,27 +93,34 @@ declare module 'vscode' {
53
93
/**
54
94
* An optional command that is executed when the context item is clicked.
55
95
* The original context item will be passed as the first argument to the command.
96
+
* The original context item will be passed as the first argument to the command.
* Provide a list of chat context items that a user can choose from. These context items are shown as options when the user explicitly attaches context.
* Given a particular resource, provide a chat context item for it. This is used for implicit context (see the settings `chat.implicitContext.enabled` and `chat.implicitContext.suggestedContext`).
89
157
* Chat context items can be provided without a `value`, as the `value` can be resolved later using `resolveChatContext`.
90
158
* `resolveChatContext` is only called for items that do not have a `value`.
91
159
*
92
160
* Called when the resource is a webview or a text editor.
161
+
* Called when the resource is a webview or a text editor.
93
162
*
94
163
* @param options Options include the resource for which to provide context.
* If a chat context item is provided without a `value`, from either of the `provide` methods, this method is called to resolve the `value` for the item.
0 commit comments