Skip to content

Commit d3e7401

Browse files
authored
Merge pull request #7719 from microsoft/release-195-merge-vnext
Prepare release 1.95
2 parents d42e35a + 5487117 commit d3e7401

File tree

274 files changed

+1028
-695
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

274 files changed

+1028
-695
lines changed

api/advanced-topics/extension-host.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
# DO NOT TOUCH — Managed by doc writer
33
ContentId: 106AA11C-DB26-493A-9E3C-16F513B2AEC8
4-
DateApproved: 10/03/2024
4+
DateApproved: 10/29/2024
55

66
# Summarize the whole topic in less than 300 characters for SEO purpose
77
MetaDescription: The Visual Studio Code Extension Host is responsible for managing extensions and ensuring the stability and performance of Visual Studio Code.

api/advanced-topics/remote-extensions.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
ContentId: 5c708951-e566-42db-9d97-e9715d95cdd1
3-
DateApproved: 10/03/2024
3+
DateApproved: 10/29/2024
44

55
# Summarize the whole topic in less than 300 characters for SEO purpose
66
MetaDescription: A guide to adding Visual Studio Code Remote Development and GitHub Codespaces support to extensions

api/advanced-topics/tslint-eslint-migration.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
ContentId: f00c4913-58e3-4a61-aa42-e769c3430906
3-
DateApproved: 10/03/2024
3+
DateApproved: 10/29/2024
44

55
# Summarize the whole topic in less than 300 characters for SEO purpose
66
MetaDescription: A guide to migrating extension projects from the TSLint linter to ESLint.

api/advanced-topics/using-proposed-api.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
# DO NOT TOUCH — Managed by doc writer
33
ContentId: f4d4e9e0-8901-405c-aaf5-faa16c32588b
4-
DateApproved: 10/03/2024
4+
DateApproved: 10/29/2024
55

66
# Summarize the whole topic in less than 300 characters for SEO purpose
77
MetaDescription: Use Visual Studio Code's Proposed API

api/extension-capabilities/common-capabilities.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
# DO NOT TOUCH — Managed by doc writer
33
ContentId: 9c48dfbf-e49d-4f33-aadc-5ebf06d5dde0
4-
DateApproved: 10/03/2024
4+
DateApproved: 10/29/2024
55

66
# Summarize the whole topic in less than 300 characters for SEO purpose
77
MetaDescription: Common capabilities that Visual Studio Code extensions (plug-ins) can take advantage of

api/extension-capabilities/extending-workbench.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
# DO NOT TOUCH — Managed by doc writer
33
ContentId: e0d5bd37-f020-4235-ad81-c977baaeb24f
4-
DateApproved: 10/03/2024
4+
DateApproved: 10/29/2024
55

66
# Summarize the whole topic in less than 300 characters for SEO purpose
77
MetaDescription: Explain how to extend Visual Studio Code's workbench area with custom UI components

api/extension-capabilities/overview.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
# DO NOT TOUCH — Managed by doc writer
33
ContentId: d22675fc-6609-43f2-a66b-8f2a52597195
4-
DateApproved: 10/03/2024
4+
DateApproved: 10/29/2024
55

66
# Summarize the whole topic in less than 300 characters for SEO purpose
77
MetaDescription: Learn the details of what's possible with Visual Studio Code's rich extension (plug-in) API.

api/extension-capabilities/theming.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
# DO NOT TOUCH — Managed by doc writer
33
ContentId: 37b6ae0a-d1b5-48b6-9bd4-9b50ef11d573
4-
DateApproved: 10/03/2024
4+
DateApproved: 10/29/2024
55

66
# Summarize the whole topic in less than 300 characters for SEO purpose
77
MetaDescription: Learn how to add custom themes for colors and icons in Visual Studio Code.

api/extension-guides/chat-tutorial.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
# DO NOT TOUCH — Managed by doc writer
33
ContentId: bea1d4c5-71e5-4b27-ac1e-fa9b59886dab
4-
DateApproved: 10/03/2024
4+
DateApproved: 10/29/2024
55

66
# Summarize the whole topic in less than 300 characters for SEO purpose
77
MetaDescription: Tutorial that walks you through creating a GitHub Copilot chat participant in VS Code by using the Chat API.

api/extension-guides/chat.md

Lines changed: 7 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
# DO NOT TOUCH — Managed by doc writer
33
ContentId: ac3f00c8-78a8-408c-8af6-3e997a482972
4-
DateApproved: 10/03/2024
4+
DateApproved: 10/29/2024
55

66
# Summarize the whole topic in less than 300 characters for SEO purpose
77
MetaDescription: A guide to creating an AI extension in Visual Studio Code
@@ -17,7 +17,7 @@ Chat participants are domain experts that can answer user queries within a speci
1717
- Forward the user request to a backend service
1818
- Use procedural logic and local resources
1919

20-
Participants can use the language model in a wide range of ways. Some participants only make use of the language model to get answers to custom prompts, for example the [sample chat participant](https://github.com/microsoft/vscode-extension-samples/tree/main/chat-sample). Other participants are more advanced and act like [autonomous agents](https://learn.microsoft.com/semantic-kernel/agents/) that invoke multiple tools with the help of the language model. An example of such an advanced participant is the built-in `@workspace` that knows about your workspace and can answer questions about it. Internally, `@workspace` is powered by multiple tools: GitHub's knowledge graph, combined with semantic search, local code indexes, and VS Code's language services.
20+
Participants can use the language model in a wide range of ways. Some participants only make use of the language model to get answers to custom prompts, for example the [sample chat participant](https://github.com/microsoft/vscode-extension-samples/tree/main/chat-sample). Other participants are more advanced and act like autonomous agents that invoke multiple tools with the help of the language model. An example of such an advanced participant is the built-in `@workspace` that knows about your workspace and can answer questions about it. Internally, `@workspace` is powered by multiple tools: GitHub's knowledge graph, combined with semantic search, local code indexes, and VS Code's language services.
2121

2222
When a user explicitly mentions a `@participant` in their chat prompt, that prompt is forwarded to the extension that contributed that specific chat participant. The participant then uses a `ResponseStream` to respond to the request. To provide a smooth user experience, the Chat API is streaming-based. A chat response can contain rich content, such as Markdown, file trees, command buttons, and more. Get more info about the [supported response output types](#supported-chat-response-output-types).
2323

@@ -33,7 +33,6 @@ Alternatively, it is possible to extend GitHub Copilot by creating a GitHub App
3333

3434
- [Chat extension sample](https://github.com/microsoft/vscode-extension-samples/tree/main/chat-sample)
3535
- [ChatParticipant API](/api/references/vscode-api#chat)
36-
- [ChatVariableResolver API](https://github.com/microsoft/vscode/blob/main/src/vscode-dts/vscode.proposed.chatVariableResolver.d.ts)
3736

3837
## Parts of the chat user experience
3938

@@ -64,7 +63,6 @@ You can further expand the functionality of the chat extension with the followin
6463

6564
- Register chat commands to provide users with a shorthand notation for common questions
6665
- Define suggested follow-up questions to help the user continue a conversation
67-
- Define chat variables to capture and share domain-specific context in chat conversations
6866

6967
As a starting point for developing a chat extension, you can refer to our [chat extension sample](https://github.com/microsoft/vscode-extension-samples/tree/main/chat-sample). This sample implements a simple cat tutor that can explain computer science topics using cat metaphors.
7068

@@ -143,7 +141,7 @@ const handler: vscode.ChatRequestHandler = async (request: vscode.ChatRequest, c
143141

144142
#### Determine the request intent
145143

146-
To determine the intent of the user's request, you can reference the `vscode.ChatRequest` parameter to access the prompt, [commands](#register-commands), chat location, and [chat variables](#variables) that the user entered in the Chat view. Optionally, you can take advantage of the language model to determine the user's intent, rather than using traditional logic. Learn how you can use the [Language Model API](/api/extension-guides/language-model) in your extension.
144+
To determine the intent of the user's request, you can reference the `vscode.ChatRequest` parameter to access the user's prompt, [commands](#register-commands), and chat location. Optionally, you can take advantage of the language model to determine the user's intent, rather than using traditional logic. As part of the `request` object you get a language model instance that the user picked in the chat model dropdown. Learn how you can use the [Language Model API](/api/extension-guides/language-model) in your extension.
147145

148146
The following code snippet shows the basic structure of first using the command, and then the user prompt to determine the user intent:
149147

@@ -159,7 +157,7 @@ const handler: vscode.ChatRequestHandler = async (request: vscode.ChatRequest, c
159157
} else {
160158

161159
// Determine the user's intent
162-
const intent = determineUserIntent(request.prompt, request.variables);
160+
const intent = determineUserIntent(request.prompt, request.variables, request.model);
163161

164162
// Add logic here to handle other scenarios
165163
}
@@ -168,7 +166,7 @@ const handler: vscode.ChatRequestHandler = async (request: vscode.ChatRequest, c
168166

169167
#### Process the request
170168

171-
Next, you need to implement the actual logic for processing the user request. Often, chat extensions use the [Language Model API](/api/extension-guides/language-model) to process the request. In this case, you might adjust the language model prompt to match the user's intent. Alternately, you can implement the extension logic by invoking a backend service, by using traditional programming logic, or by using a combination of all these options. For example, you could invoke a web search to gather additional information, which you then provide as context to the language model.
169+
Next, you need to implement the actual logic for processing the user request. Often, chat extensions use the `request.model` language model instance to process the request. In this case, you might adjust the language model prompt to match the user's intent. Alternately, you can implement the extension logic by invoking a backend service, by using traditional programming logic, or by using a combination of all these options. For example, you could invoke a web search to gather additional information, which you then provide as context to the language model.
172170

173171
While processing the current request, you might want to refer to previous chat messages. For example, if a previous response returned a C# code snippet, the user's current request might be "give the code in Python". Learn how you can [use the chat message history](#use-the-chat-message-history).
174172

@@ -465,47 +463,6 @@ The following list provides the output types for a chat response in the Chat vie
465463

466464
> **Important**: Images and links are only available when they originate from a domain that is in the trusted domain list. Get more info about [link protection in VS Code](/docs/editor/editingevolved#outgoing-link-protection).
467465

468-
## Variables
469-
470-
> [!NOTE]
471-
> The Variables API is still in a proposed state and we are actively working on it.
472-
473-
Chat extensions can also contribute chat *variables*, which provide context about the extension's domain. For example, a C++ extension might contribute a variable `#cpp` that would get resolved based on the state of the language service - what C++ version is used and what C++ programming approach is preferred.
474-
475-
Users can refer to a chat variable in a prompt by using the `#` symbol. A variable is resolved by either the chat extension that contributed that variable, or by VS Code when it's a built-in variable (for example, `#file` or `#selection`). VS Code offers the list of registered variables upon typing the `#` symbol in the chat input.
476-
477-
![List of variables in chat](images/chat/variables.png)
478-
479-
Variables are resolved independently of the active chat participant. This means that you can use them as a mechanism to share context between different participants. For example, `@workspace` already maintains an index of the current workspace and contributes a variable `#codebase`. Users can include this variable in a prompt to pass the codebase context to another chat participant.
480-
481-
Variables and their values are passed as an object bag to the handler in `request.variables`. The prompt contains variable references as entered by the user and it is up to the participant to further modify the prompt, for instance by inlining variable values or creating links to headings which contain the resolved values. Variables are sorted in reverse order by their appearance in the prompt. That means that the last variable in the prompt is the first in this list. This simplifies string-manipulation of the prompt.
482-
483-
Variable resolvers can offer multiple length levels for the variable value. VS Code selects one based on how many tokens are left in a language model prompt.
484-
485-
```typescript
486-
vscode.chat.registerVariable('cat_context', 'Describes the state of mind and version of the cat', {
487-
resolve: (name, context, token) => {
488-
if (name == 'cat_context') {
489-
const mood = Math.random() > 0.5 ? 'happy' : 'grumpy';
490-
return [
491-
{
492-
level: vscode.ChatVariableLevel.Short,
493-
value: 'version 1.3 ' + mood
494-
},
495-
{
496-
level: vscode.ChatVariableLevel.Medium,
497-
value: 'I am a playful cat, version 1.3, and I am ' + mood
498-
},
499-
{
500-
level: vscode.ChatVariableLevel.Full,
501-
value: 'I am a playful cat, version 1.3, this version prefer to explain everything using mouse and tail metaphors. I am ' + mood
502-
}
503-
]
504-
}
505-
}
506-
});
507-
```
508-
509466
## Measuring success
510467

511468
We recommend that you measure the success of your participant by adding telemetry logging for `Unhelpful` user feedback events, and for the total number of requests that your participant handled. An initial participant success metric can then be defined as: `unhelpful_feedback_count / total_requests`.
@@ -549,11 +506,11 @@ When referring to your chat participant in any of the user-facing elements, such
549506
550507
Chat participants should not be purely question-answering bots. When building a chat participant, be creative and use the existing VS Code API to create rich integrations in VS Code. Users also love rich and convenient interactions, such as buttons in your responses, menu items that bring users to your participant in chat. Think about real life scenarios where AI can help your users.
551508
552-
It doesn't make sense for every extension to contribute a chat participant. Having too many participants in chat might lead to a bad user experience. Chat participants are best when you want to control the full prompt, including instructions to the language model. Use chat variables when you only want to provide extra context to a prompt when requested by the user. You can reuse the carefully crafted Copilot system message and you can contribute context to other participants.
509+
It doesn't make sense for every extension to contribute a chat participant. Having too many participants in chat might lead to a bad user experience. Chat participants are best when you want to control the full prompt, including instructions to the language model. You can reuse the carefully crafted Copilot system message and you can contribute context to other participants.
553510
554511
For example, language extensions (such as the C++ extension) can contribute in various other ways:
555512
556-
- Contribute variables that bring language service smarts to the user query. For example, the C++ extension could resolve the `#cpp` variable to the C++ state of the workspace. This gives the Copilot language model the right C++ context to improve the quality of Copilot answers for C++.
513+
- Contribute tools that bring language service smarts to the user query. For example, the C++ extension could resolve the `#cpp` tool to the C++ state of the workspace. This gives the Copilot language model the right C++ context to improve the quality of Copilot answers for C++.
557514
- Contribute smart actions that use the language model, optionally in combination with traditional language service knowledge, to deliver a great user experience. For example, C++ might already offer an "extract to method" smart action that uses the language model to generate a fitting default name for the new method.
558515
559516
Chat extensions should explicitly ask for user consent if they are about to do a costly operation or are about to edit or delete something that can't be undone. To have a great user experience, we discourage extensions from contributing multiple chat participants. Up to one chat participant per extension is a simple model that scales well in the UI.
@@ -564,7 +521,6 @@ Once you have created your AI extension, you can publish your extension to the V
564521
565522
- Before publishing to the VS Marketplace we recommend that you read the [Microsoft AI tools and practices guidelines](https://www.microsoft.com/en-us/ai/tools-practices). These guidelines provide best practices for the responsible development and use of AI technologies.
566523
- By publishing to the VS Marketplace, your extension is adhering to the [GitHub Copilot extensibility acceptable development and use policy](https://docs.github.com/en/early-access/copilot/github-copilot-extensibility-platform-partnership-plugin-acceptable-development-and-use-policy).
567-
- Update the attributes in the `package.json` to make it easy for users to find your extension. Add "AI" and "Chat" to the `categories` field in your `package.json`.
568524
- Upload to the Marketplace as described in [Publishing Extension](https://code.visualstudio.com/api/working-with-extensions/publishing-extension).
569525
- If your extension already contributes functionality other than chat, we recommend that you do not introduce an extension dependency on GitHub Copilot in the [extension manifest](/api/references/extension-manifest). This ensures that extension users that do not use GitHub Copilot can use the non-chat functionality without having to install GitHub Copilot.
570526

0 commit comments

Comments
 (0)