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
@@ -2,10 +2,14 @@
2
2
# DO NOT TOUCH — Managed by doc writer
3
3
ContentId: 106AA11C-DB26-493A-9E3C-16F513B2AEC8
4
4
<<<<<<< HEAD
5
+
<<<<<<< HEAD
5
6
DateApproved: 10/03/2024
6
7
=======
7
8
DateApproved: 10/29/2024
8
9
>>>>>>> 27e6951b86c69326ee8ff76ba46694a60b72ec65
10
+
=======
11
+
DateApproved: 10/29/2024
12
+
>>>>>>> 27e6951b86c69326ee8ff76ba46694a60b72ec65
9
13
10
14
# Summarize the whole topic in less than 300 characters for SEO purpose
11
15
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
@@ -2,10 +2,14 @@
2
2
# DO NOT TOUCH — Managed by doc writer
3
3
ContentId: 9c48dfbf-e49d-4f33-aadc-5ebf06d5dde0
4
4
<<<<<<< HEAD
5
+
<<<<<<< HEAD
5
6
DateApproved: 10/03/2024
6
7
=======
7
8
DateApproved: 10/29/2024
8
9
>>>>>>> 27e6951b86c69326ee8ff76ba46694a60b72ec65
10
+
=======
11
+
DateApproved: 10/29/2024
12
+
>>>>>>> 27e6951b86c69326ee8ff76ba46694a60b72ec65
9
13
10
14
# Summarize the whole topic in less than 300 characters for SEO purpose
11
15
MetaDescription: Common capabilities that Visual Studio Code extensions (plug-ins) can take advantage of
@@ -40,17 +44,25 @@ An extension can register custom Context Menu items that will be displayed in di
40
44
41
45
## Data Storage
42
46
47
+
<<<<<<< HEAD
43
48
<<<<<<< HEAD
44
49
There are four options for storing data:
45
50
=======
46
51
There are five options for storing data:
47
52
>>>>>>> 27e6951b86c69326ee8ff76ba46694a60b72ec65
53
+
=======
54
+
There are five options for storing data:
55
+
>>>>>>> 27e6951b86c69326ee8ff76ba46694a60b72ec65
48
56
49
57
-[`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.
50
58
-[`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`.
51
59
-[`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.
52
60
-[`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.
53
61
<<<<<<< HEAD
62
+
<<<<<<< HEAD
63
+
=======
64
+
-[`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.
65
+
>>>>>>> 27e6951b86c69326ee8ff76ba46694a60b72ec65
54
66
=======
55
67
-[`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
@@ -2,10 +2,14 @@
2
2
# DO NOT TOUCH — Managed by doc writer
3
3
ContentId: bea1d4c5-71e5-4b27-ac1e-fa9b59886dab
4
4
<<<<<<< HEAD
5
+
<<<<<<< HEAD
5
6
DateApproved: 10/03/2024
6
7
=======
7
8
DateApproved: 10/29/2024
8
9
>>>>>>> 27e6951b86c69326ee8ff76ba46694a60b72ec65
10
+
=======
11
+
DateApproved: 10/29/2024
12
+
>>>>>>> 27e6951b86c69326ee8ff76ba46694a60b72ec65
9
13
10
14
# Summarize the whole topic in less than 300 characters for SEO purpose
11
15
MetaDescription: Tutorial that walks you through creating a GitHub Copilot chat participant in VS Code by using the Chat API.
@@ -82,13 +86,19 @@ This code registers a chat participant with the following attributes:
82
86
83
87
Finally, setting `isSticky: true` will automatically prepend the participant name in the chat input field after the user has started interacting with the participant.
84
88
89
+
<<<<<<< HEAD
85
90
<<<<<<< HEAD
86
91
## Step 3: Craft the prompt and select the model
87
92
88
93
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 and select the model for the requests.
89
94
=======
90
95
## Step 3: Craft the prompt
91
96
97
+
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.
98
+
>>>>>>> 27e6951b86c69326ee8ff76ba46694a60b72ec65
99
+
=======
100
+
## Step 3: Craft the prompt
101
+
92
102
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.
93
103
>>>>>>> 27e6951b86c69326ee8ff76ba46694a60b72ec65
94
104
@@ -107,6 +117,7 @@ The second prompt is more specific and gives the participant a clear direction o
107
117
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.';
108
118
```
109
119
120
+
<<<<<<< HEAD
110
121
<<<<<<< HEAD
111
122
You also need to select the model for the requests. gpt-4o is recommended since it is fast and high quality.
112
123
@@ -120,6 +131,11 @@ Now that the prompt and model are selected, you need to implement the request ha
120
131
=======
121
132
## Step 4: Implement the request handler
122
133
134
+
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.
135
+
>>>>>>> 27e6951b86c69326ee8ff76ba46694a60b72ec65
136
+
=======
137
+
## Step 4: Implement the request handler
138
+
123
139
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.
138
155
=======
139
156
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`.
140
157
158
+
Send the request using `request.model.sendRequest`, which will send the request using the currently selected model. Finally, stream the response to the user.
159
+
>>>>>>> 27e6951b86c69326ee8ff76ba46694a60b72ec65
160
+
=======
161
+
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
+
141
163
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