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
4 changes: 0 additions & 4 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -284,10 +284,6 @@ jobs:
mkdir -p .build/build_cache
tar -czf .build/build_cache/cache.tgz --files-from .build/build_cache_list.txt

- name: Ensure proposed API types are up to date
working-directory: extensions/copilot
run: npm run vscode-dts:check

- name: TypeScript type checking
working-directory: extensions/copilot
run: npm run typecheck
Expand Down
3 changes: 0 additions & 3 deletions extensions/copilot/.github/workflows/pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -121,9 +121,6 @@ jobs:
mkdir -p .build/build_cache
tar -czf .build/build_cache/cache.tgz --files-from .build/build_cache_list.txt
- name: Ensure proposed API types are up to date
run: npm run vscode-dts:check

- name: TypeScript type checking
run: npm run typecheck

Expand Down
1 change: 0 additions & 1 deletion extensions/copilot/chat-lib/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@
"@anthropic-ai/sdk": "^0.82.0",
"@octokit/types": "^14.1.0",
"@types/node": "^22.16.3",
"@types/vscode": "^1.109.0",
"copyfiles": "^2.4.1",
"dotenv": "^17.2.0",
"npm-run-all": "^4.1.5",
Expand Down
20 changes: 8 additions & 12 deletions extensions/copilot/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion extensions/copilot/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6301,7 +6301,6 @@
"@types/source-map-support": "^0.5.10",
"@types/tar": "^6.1.13",
"@types/vinyl": "^2.0.12",
"@types/vscode": "^1.109.0",
"@types/vscode-webview": "^1.57.4",
"@types/yargs": "^17.0.24",
"@typescript-eslint/eslint-plugin": "^8.35.0",
Expand Down
5 changes: 0 additions & 5 deletions extensions/copilot/script/applyLocalDts.sh

This file was deleted.

64 changes: 54 additions & 10 deletions extensions/copilot/script/build/extractChatLib.ts
Original file line number Diff line number Diff line change
Expand Up @@ -634,21 +634,65 @@ class ChatLibExtractor {
}

private async copyVSCodeProposedTypes(): Promise<void> {
console.log('Copying VS Code proposed API types...');
console.log('Copying vscode*.d.ts files referenced by vscode-api.d.ts...');

// Find all vscode.proposed.*.d.ts files in src/extension/
const extensionDir = path.join(REPO_ROOT, 'src', 'extension');
const proposedTypeFiles = await glob('vscode.proposed.*.d.ts', { cwd: extensionDir });
const vscodeApiSrcPath = path.join(REPO_ROOT, 'src', 'extension', 'vscode-api.d.ts');
if (!fs.existsSync(vscodeApiSrcPath)) {
throw new Error(`vscode-api.d.ts not found at ${vscodeApiSrcPath}`);
}

for (const file of proposedTypeFiles) {
const srcPath = path.join(extensionDir, file);
const destPath = path.join(TARGET_DIR, '_internal', 'extension', file);
const content = await fs.promises.readFile(vscodeApiSrcPath, 'utf-8');

await fs.promises.mkdir(path.dirname(destPath), { recursive: true });
// Parse all /// <reference path="..." /> directives
const refRegex = /\/\/\/\s*<reference\s+path="([^"]+)"\s*\/>/g;
let match;
const referencedFiles: { refPath: string; fileName: string }[] = [];

while ((match = refRegex.exec(content)) !== null) {
const refPath = match[1];
const fileName = path.basename(refPath);
referencedFiles.push({ refPath, fileName });
}

// Copy each referenced .d.ts file from the vscode repo
const vscodeDtsDestDir = path.join(TARGET_DIR, '_internal', 'vscode-dts');
await fs.promises.mkdir(vscodeDtsDestDir, { recursive: true });

for (const { refPath, fileName } of referencedFiles) {
// Resolve the reference path relative to the source file
const srcPath = path.resolve(path.dirname(vscodeApiSrcPath), refPath);
if (!fs.existsSync(srcPath)) {
console.warn(`Warning: Referenced file not found: ${srcPath}`);
continue;
}

const destPath = path.join(vscodeDtsDestDir, fileName);
await fs.promises.copyFile(srcPath, destPath);
}

console.log(`Copied ${proposedTypeFiles.length} VS Code proposed API type files`);
// Copy vscode-api.d.ts itself, updating reference paths
const updatedContent = content.replace(
/\/\/\/\s*<reference\s+path="([^"]+)"\s*\/>/g,
(_match, refPath: string) => {
const fileName = path.basename(refPath);
return `/// <reference path="./vscode-dts/${fileName}" />`;
}
);

const vscodeApiDestPath = path.join(TARGET_DIR, '_internal', 'vscode-api.d.ts');
await fs.promises.writeFile(vscodeApiDestPath, updatedContent);

// Also copy thenable.d.ts which is referenced by vscode.d.ts
const vscodeRepoRoot = path.join(REPO_ROOT, '..', '..');
const thenableSrcPath = path.join(vscodeRepoRoot, 'src', 'typings', 'thenable.d.ts');
if (fs.existsSync(thenableSrcPath)) {
await fs.promises.copyFile(thenableSrcPath, path.join(vscodeDtsDestDir, 'thenable.d.ts'));
console.log('Copied thenable.d.ts');
} else {
console.warn(`Warning: thenable.d.ts not found at ${thenableSrcPath}`);
}

console.log(`Copied vscode-api.d.ts and ${referencedFiles.length} referenced .d.ts files`);
}

private async copyTikTokenFiles(): Promise<void> {
Expand Down Expand Up @@ -871,4 +915,4 @@ async function main(): Promise<void> {

if (require.main === module) {
main();
}
}
11 changes: 0 additions & 11 deletions extensions/copilot/script/build/moveProposedDts.js

This file was deleted.

63 changes: 0 additions & 63 deletions extensions/copilot/script/build/vscodeDtsCheck.js

This file was deleted.

60 changes: 0 additions & 60 deletions extensions/copilot/script/build/vscodeDtsUpdate.js

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -1256,7 +1256,11 @@ export class CopilotCLIChatSessionParticipant extends Disposable {
resource: request.sessionResource,
},
isUntitled: false,
initialSessionOptions: undefined
initialSessionOptions: undefined,
inputState: {
groups: [],
onDidChange: Event.None
}
};
context = {
chatSessionContext,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,7 @@ export class ConversationFeature implements IExtensionContribution {
vscode.window.activeTerminal?.sendText(message, false);
}
}),
vscode.commands.registerCommand('github.copilot.git.generateCommitMessage', async (rootUri: vscode.Uri | undefined, _: vscode.SourceControlInputBoxValueProviderContext[], cancellationToken: vscode.CancellationToken | undefined) => {
vscode.commands.registerCommand('github.copilot.git.generateCommitMessage', async (rootUri: vscode.Uri | undefined, _: unknown, cancellationToken: vscode.CancellationToken | undefined) => {
const repository = await this.gitCommitMessageService.getRepository(rootUri);
if (!repository) {
return;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -499,13 +499,7 @@ export class EditCodeIntentInvocation implements IIntentInvocation {
}
}

const isReadonly = this.request.references.some(r => r.isReadonly && URI.isUri(r.value) && isEqual(r.value, uri));
if (isReadonly) {
return {
title: l10n.t`Allow edits to readonly file?`,
message: l10n.t`Do you want to allow edits to \`${this.workspaceService.asRelativePath(uri)}\`?`,
};
}
return undefined;
}

async processResponse?(context: IResponseProcessorContext, inputStream: AsyncIterable<IResponsePart>, outputStream: vscode.ChatResponseStream, token: vscode.CancellationToken): Promise<vscode.ChatResult> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ export class ChatVariablesCollection {
if (variable.value) {
const originalName = variable.name;
const uniqueName = this.uniqueFileName(originalName, this._source.slice(0, i));
this._variables.push({ reference: variable, originalName, uniqueName, value: variable.value, range: variable.range, isMarkedReadonly: variable.isReadonly });
this._variables.push({ reference: variable, originalName, uniqueName, value: variable.value, range: variable.range, isMarkedReadonly: false });
}
}
}
Expand Down
Loading
Loading