Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 0 additions & 20 deletions .github/instructions/api-version.instructions.md

This file was deleted.

298 changes: 0 additions & 298 deletions .github/workflows/api-proposal-version-check.yml

This file was deleted.

12 changes: 3 additions & 9 deletions build/lib/compilation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -292,8 +292,7 @@ function generateApiProposalNames() {
}

const pattern = /vscode\.proposed\.([a-zA-Z\d]+)\.d\.ts$/;
const versionPattern = /^\s*\/\/\s*version\s*:\s*(\d+)\s*$/mi;
const proposals = new Map<string, { proposal: string; version?: number }>();
const proposals = new Map<string, { proposal: string }>();

const input = es.through();
const output = input
Expand All @@ -308,13 +307,8 @@ function generateApiProposalNames() {

const proposalName = match[1];

const contents = f.contents!.toString('utf8');
const versionMatch = versionPattern.exec(contents);
const version = versionMatch ? versionMatch[1] : undefined;

proposals.set(proposalName, {
proposal: `https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.${proposalName}.d.ts`,
version: version ? parseInt(version) : undefined
});
}, function () {
const names = [...proposals.keys()].sort();
Expand All @@ -329,10 +323,10 @@ function generateApiProposalNames() {
'const _allApiProposals = {',
`${names.map(proposalName => {
const proposal = proposals.get(proposalName)!;
return `\t${proposalName}: {${eol}\t\tproposal: '${proposal.proposal}',${eol}${proposal.version ? `\t\tversion: ${proposal.version}${eol}` : ''}\t}`;
return `\t${proposalName}: {${eol}\t\tproposal: '${proposal.proposal}',${eol}\t}`;
}).join(`,${eol}`)}`,
'};',
'export const allApiProposals = Object.freeze<{ [proposalName: string]: Readonly<{ proposal: string; version?: number }> }>(_allApiProposals);',
'export const allApiProposals = Object.freeze<{ [proposalName: string]: Readonly<{ proposal: string }> }>(_allApiProposals);',
'export type ApiProposalName = keyof typeof _allApiProposals;',
'',
].join(eol);
Expand Down
19 changes: 5 additions & 14 deletions extensions/copilot/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -308,26 +308,17 @@ The view also has entries for tool calls on their own, and a prompt-tsx debug vi

## API updates

When updating VS Code proposed extension API that is used by the extension, we have two tools to make sure that the version of the extension that gets installed will be compatible with the version of VS Code: the `engines.vscode` field in `package.json`, and the proposed API version.
When updating VS Code proposed extension API that is used by the extension, the `engines.vscode` field in `package.json` is used to make sure that the version of the extension that gets installed will be compatible with the version of VS Code.

### Making breaking changes to API
### Updating to the latest API

When making a change to the proposed API that breaks backwards compatibility, you MUST update the API version of the proposal. This is declared in a comment at the top of the proposal .d.ts, and gets automatically updated in `extensionsApiProposals.ts` by the build task. Example: https://github.com/microsoft/vscode/blob/93a7382ecd63439a5bc507ef60e57610845ec05d/src/vscode-dts/vscode.proposed.lmTools.d.ts#L6.
When adopting any change to a proposed API (whether backwards-compatible or not), you must update the date part of the `engines.vscode` field in `package.json`. For example, `"vscode": "^1.91.0-20240624"`. This ensures that the extension will only be installed and activated in a version of VS Code that supports the new API.

Then, you must adopt this change in the extension and declare that the extension supports this version of the API in `package.json`'s `enabledApiProposals`, like `lmTools@2`. This will ensure that the extension will only be installed and activated in a version of VS Code that supports the same version of the API.
You must adopt API changes in the extension at the same time as they're made in VS Code, otherwise the next day's Insiders build won't have a compatible Copilot Chat extension available.

And, you must adopt this change in the extension at the same time as it's made in VS Code, otherwise the next day's Insiders build won't have a compatible Copilot Chat extension available.

Examples of changes that break backwards compatibility:
Examples of API changes:
- Renaming a method that is used by the extension
- Changing the parameters that an existing method takes
- Adding a required static contribution point for a proposal that the extension already uses

### Making additive changes to API

When making a change to proposed API that adds a new feature but doesn't break backwards compatibility, you don't have to update the API version, because an older version of the extension will still work with the new VS Code build. But, once you adopt that new API, you must update the date part of the `engines.vscode` field in `package.json`. For example, `"vscode": "^1.91.0-20240624"`. This ensures that the extension will only be installed and activated in a version of VS Code that supports the new API.

Examples of additive changes
- Adding a new response type to `ChatResponseStream`
- Adding a new API proposal
- Adding a new method to an existing interface
Expand Down
Loading
Loading