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
Copy file name to clipboardExpand all lines: api/advanced-topics/extension-host.md
+4Lines changed: 4 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -3,13 +3,17 @@
3
3
ContentId: 106AA11C-DB26-493A-9E3C-16F513B2AEC8
4
4
<<<<<<< HEAD
5
5
<<<<<<< HEAD
6
+
<<<<<<< HEAD
6
7
DateApproved: 10/03/2024
7
8
=======
8
9
DateApproved: 10/29/2024
9
10
>>>>>>> 27e6951b86c69326ee8ff76ba46694a60b72ec65
10
11
=======
11
12
DateApproved: 10/29/2024
12
13
>>>>>>> 27e6951b86c69326ee8ff76ba46694a60b72ec65
14
+
=======
15
+
DateApproved: 10/29/2024
16
+
>>>>>>> 27e6951b86c69326ee8ff76ba46694a60b72ec65
13
17
14
18
# Summarize the whole topic in less than 300 characters for SEO purpose
15
19
MetaDescription: The Visual Studio Code Extension Host is responsible for managing extensions and ensuring the stability and performance of Visual Studio Code.
Copy file name to clipboardExpand all lines: api/extension-capabilities/common-capabilities.md
+12Lines changed: 12 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -3,13 +3,17 @@
3
3
ContentId: 9c48dfbf-e49d-4f33-aadc-5ebf06d5dde0
4
4
<<<<<<< HEAD
5
5
<<<<<<< HEAD
6
+
<<<<<<< HEAD
6
7
DateApproved: 10/03/2024
7
8
=======
8
9
DateApproved: 10/29/2024
9
10
>>>>>>> 27e6951b86c69326ee8ff76ba46694a60b72ec65
10
11
=======
11
12
DateApproved: 10/29/2024
12
13
>>>>>>> 27e6951b86c69326ee8ff76ba46694a60b72ec65
14
+
=======
15
+
DateApproved: 10/29/2024
16
+
>>>>>>> 27e6951b86c69326ee8ff76ba46694a60b72ec65
13
17
14
18
# Summarize the whole topic in less than 300 characters for SEO purpose
15
19
MetaDescription: Common capabilities that Visual Studio Code extensions (plug-ins) can take advantage of
@@ -44,6 +48,7 @@ An extension can register custom Context Menu items that will be displayed in di
44
48
45
49
## Data Storage
46
50
51
+
<<<<<<< HEAD
47
52
<<<<<<< HEAD
48
53
<<<<<<< HEAD
49
54
There are four options for storing data:
@@ -53,13 +58,20 @@ There are five options for storing data:
53
58
=======
54
59
There are five options for storing data:
55
60
>>>>>>> 27e6951b86c69326ee8ff76ba46694a60b72ec65
61
+
=======
62
+
There are five options for storing data:
63
+
>>>>>>> 27e6951b86c69326ee8ff76ba46694a60b72ec65
56
64
57
65
-[`ExtensionContext.workspaceState`](/api/references/vscode-api#ExtensionContext.workspaceState): A workspace storage where you can write key/value pairs. VS Code manages the storage and will restore it when the same workspace is opened again.
58
66
-[`ExtensionContext.globalState`](/api/references/vscode-api#ExtensionContext.globalState): A global storage where you can write key/value pairs. VS Code manages the storage and will restore it for each extension activation. You can selectively synchronize key/value pairs in global storage by setting the keys for sync using `setKeysForSync` method on `globalState`.
59
67
-[`ExtensionContext.storageUri`](/api/references/vscode-api#ExtensionContext.storageUri): A workspace specific storage URI pointing to a local directory where your extension has read/write access. This is a good option if you need to store large files that are accessible only from the current workspace.
60
68
-[`ExtensionContext.globalStorageUri`](/api/references/vscode-api#ExtensionContext.globalStorageUri): A global storage URI pointing to a local directory where your extension has read/write access. This is a good option if you need to store large files that are accessible from all workspaces.
61
69
<<<<<<< HEAD
62
70
<<<<<<< HEAD
71
+
<<<<<<< HEAD
72
+
=======
73
+
-[`ExtensionContext.secrets`](/api/references/vscode-api#ExtensionContext.secrets): A global storage for secrets (or any information that is sensitive) that will be encrypted. These are not synced across machines. For VS Code desktop, this leverages Electron's [safeStorage API](https://www.electronjs.org/docs/latest/api/safe-storage). For VS Code for the Web, this uses a Double Key Encryption (DKE) implementation.
74
+
>>>>>>> 27e6951b86c69326ee8ff76ba46694a60b72ec65
63
75
=======
64
76
-[`ExtensionContext.secrets`](/api/references/vscode-api#ExtensionContext.secrets): A global storage for secrets (or any information that is sensitive) that will be encrypted. These are not synced across machines. For VS Code desktop, this leverages Electron's [safeStorage API](https://www.electronjs.org/docs/latest/api/safe-storage). For VS Code for the Web, this uses a Double Key Encryption (DKE) implementation.
Copy file name to clipboardExpand all lines: api/extension-guides/chat-tutorial.md
+50Lines changed: 50 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -3,13 +3,17 @@
3
3
ContentId: bea1d4c5-71e5-4b27-ac1e-fa9b59886dab
4
4
<<<<<<< HEAD
5
5
<<<<<<< HEAD
6
+
<<<<<<< HEAD
6
7
DateApproved: 10/03/2024
7
8
=======
8
9
DateApproved: 10/29/2024
9
10
>>>>>>> 27e6951b86c69326ee8ff76ba46694a60b72ec65
10
11
=======
11
12
DateApproved: 10/29/2024
12
13
>>>>>>> 27e6951b86c69326ee8ff76ba46694a60b72ec65
14
+
=======
15
+
DateApproved: 10/29/2024
16
+
>>>>>>> 27e6951b86c69326ee8ff76ba46694a60b72ec65
13
17
14
18
# Summarize the whole topic in less than 300 characters for SEO purpose
15
19
MetaDescription: Tutorial that walks you through creating a GitHub Copilot chat participant in VS Code by using the Chat API.
@@ -86,6 +90,7 @@ This code registers a chat participant with the following attributes:
86
90
87
91
Finally, setting `isSticky: true` will automatically prepend the participant name in the chat input field after the user has started interacting with the participant.
88
92
93
+
<<<<<<< HEAD
89
94
<<<<<<< HEAD
90
95
<<<<<<< HEAD
91
96
## Step 3: Craft the prompt and select the model
@@ -99,6 +104,11 @@ Now that the participant is registered, you can start implementing the logic for
99
104
=======
100
105
## Step 3: Craft the prompt
101
106
107
+
Now that the participant is registered, you can start implementing the logic for the code tutor. In the `extension.ts` file, you will define a prompt for the requests.
108
+
>>>>>>> 27e6951b86c69326ee8ff76ba46694a60b72ec65
109
+
=======
110
+
## Step 3: Craft the prompt
111
+
102
112
Now that the participant is registered, you can start implementing the logic for the code tutor. In the `extension.ts` file, you will define a prompt for the requests.
103
113
>>>>>>> 27e6951b86c69326ee8ff76ba46694a60b72ec65
104
114
@@ -117,6 +127,7 @@ The second prompt is more specific and gives the participant a clear direction o
117
127
const BASE_PROMPT ='You are a helpful code tutor. Your job is to teach the user with simple descriptions and sample code of the concept. Respond with a guided overview of the concept in a series of messages. Do not give the user the answer directly, but guide them to find the answer themselves. If the user asks a non-programming question, politely decline to respond.';
118
128
```
119
129
130
+
<<<<<<< HEAD
120
131
<<<<<<< HEAD
121
132
<<<<<<< HEAD
122
133
You also need to select the model for the requests. gpt-4o is recommended since it is fast and high quality.
@@ -136,6 +147,11 @@ Now that the prompt is selected, you need to implement the request handler. This
136
147
=======
137
148
## Step 4: Implement the request handler
138
149
150
+
Now that the prompt is selected, you need to implement the request handler. This is what will process the user's chat request. You will define the request handler, perform logic for processing the request, and return a response to the user.
151
+
>>>>>>> 27e6951b86c69326ee8ff76ba46694a60b72ec65
152
+
=======
153
+
## Step 4: Implement the request handler
154
+
139
155
Now that the prompt is selected, you need to implement the request handler. This is what will process the user's chat request. You will define the request handler, perform logic for processing the request, and return a response to the user.
Within the body of this handler, initialize the prompt and model. Check that the model returned successfully.
@@ -160,13 +177,19 @@ Send the request using `request.model.sendRequest`, which will send the request
160
177
=======
161
178
Within the body of this handler, initialize the prompt and a `messages` array with the prompt. Then, send in what the user typed in the chat box. You can access this through `request.prompt`.
162
179
180
+
Send the request using `request.model.sendRequest`, which will send the request using the currently selected model. Finally, stream the response to the user.
181
+
>>>>>>> 27e6951b86c69326ee8ff76ba46694a60b72ec65
182
+
=======
183
+
Within the body of this handler, initialize the prompt and a `messages` array with the prompt. Then, send in what the user typed in the chat box. You can access this through `request.prompt`.
184
+
163
185
Send the request using `request.model.sendRequest`, which will send the request using the currently selected model. Finally, stream the response to the user.
0 commit comments