From 8d7668ea88ce47271f14c14fe7abbf6834becda6 Mon Sep 17 00:00:00 2001 From: Ben McMorran Date: Thu, 19 Sep 2024 20:58:36 -0700 Subject: [PATCH 1/6] Check related files API flag when IntelliSense is disabled (#12743) --- Extension/src/LanguageServer/extension.ts | 2 +- Extension/src/main.ts | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/Extension/src/LanguageServer/extension.ts b/Extension/src/LanguageServer/extension.ts index 67077b2ba0..bb30b4927a 100644 --- a/Extension/src/LanguageServer/extension.ts +++ b/Extension/src/LanguageServer/extension.ts @@ -375,7 +375,7 @@ function onInterval(): void { /** * registered commands */ -export function registerCommands(enabled: boolean, isRelatedFilesApiEnabled: boolean = false): void { +export function registerCommands(enabled: boolean, isRelatedFilesApiEnabled: boolean): void { commandDisposables.forEach(d => d.dispose()); commandDisposables.length = 0; commandDisposables.push(vscode.commands.registerCommand('C_Cpp.SwitchHeaderSource', enabled ? onSwitchHeaderSource : onDisabledCommand)); diff --git a/Extension/src/main.ts b/Extension/src/main.ts index 7379235277..fd6bacb89e 100644 --- a/Extension/src/main.ts +++ b/Extension/src/main.ts @@ -146,7 +146,8 @@ export async function activate(context: vscode.ExtensionContext): Promise Date: Fri, 20 Sep 2024 17:05:37 -0700 Subject: [PATCH 2/6] Add signing for .js files (#12749) * Sign .js files. --- Build/signing/SignFiles.proj | 21 +++++++++++++++++++++ Build/signing/packages.config | 4 ++++ 2 files changed, 25 insertions(+) create mode 100644 Build/signing/SignFiles.proj create mode 100644 Build/signing/packages.config diff --git a/Build/signing/SignFiles.proj b/Build/signing/SignFiles.proj new file mode 100644 index 0000000000..b467041296 --- /dev/null +++ b/Build/signing/SignFiles.proj @@ -0,0 +1,21 @@ + + + + + + $(BUILD_STAGINGDIRECTORY)/Extension + + $(BaseOutputDirectory) + $(BaseOutputDirectory) + + + + + + Microsoft400 + + + + + \ No newline at end of file diff --git a/Build/signing/packages.config b/Build/signing/packages.config new file mode 100644 index 0000000000..df03298c5e --- /dev/null +++ b/Build/signing/packages.config @@ -0,0 +1,4 @@ + + + + \ No newline at end of file From b92dbb40c18fcfd4ed34037c70a0f3de3f6c426f Mon Sep 17 00:00:00 2001 From: Ben McMorran Date: Mon, 23 Sep 2024 11:35:08 -0700 Subject: [PATCH 3/6] Update lmTools API (#12755) --- Extension/package.json | 5 ++++- Extension/src/LanguageServer/lmTool.ts | 13 +++++++------ 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/Extension/package.json b/Extension/package.json index 81633633e8..f1bac00593 100644 --- a/Extension/package.json +++ b/Extension/package.json @@ -6452,7 +6452,10 @@ "modelDescription": "For the active C or C++ file, this tool provides: the language (C, C++, or CUDA), the language standard version (such as C++11, C++14, C++17, or C++20), the compiler (such as GCC, Clang, or MSVC), the target platform (such as x86, x64, or ARM), and the target architecture (such as 32-bit or 64-bit).", "icon": "$(file-code)", "parametersSchema": {}, - "when": "(config.C_Cpp.experimentalFeatures =~ /^[eE]nabled$/)" + "when": "(config.C_Cpp.experimentalFeatures =~ /^[eE]nabled$/)", + "supportedContentTypes": [ + "text/plain" + ] } ] }, diff --git a/Extension/src/LanguageServer/lmTool.ts b/Extension/src/LanguageServer/lmTool.ts index f643c63714..6b986463e1 100644 --- a/Extension/src/LanguageServer/lmTool.ts +++ b/Extension/src/LanguageServer/lmTool.ts @@ -44,14 +44,15 @@ const knownValues: { [Property in keyof ChatContextResult]?: { [id: string]: str } }; -class StringLanguageModelToolResult implements vscode.LanguageModelToolResult { - public constructor(public readonly value: string) { } - public toString(): string { return this.value; } -} +const plainTextContentType = 'text/plain'; export class CppConfigurationLanguageModelTool implements vscode.LanguageModelTool { - public async invoke(_parameters: any, token: vscode.CancellationToken): Promise { - return new StringLanguageModelToolResult(await this.getContext(token)); + public async invoke(options: vscode.LanguageModelToolInvocationOptions, token: vscode.CancellationToken): Promise { + const result: vscode.LanguageModelToolResult = {}; + if (options.requestedContentTypes.includes(plainTextContentType)) { + result[plainTextContentType] = await this.getContext(token); + } + return result; } private async getContext(token: vscode.CancellationToken): Promise { From cc653f868574013c77ba5a9416dcc4032df844d1 Mon Sep 17 00:00:00 2001 From: Sean McManus Date: Mon, 23 Sep 2024 18:55:38 -0700 Subject: [PATCH 4/6] Fix .js signing (#12757) * Fix .js signing. --- Extension/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Extension/package.json b/Extension/package.json index f1bac00593..2e5b7e4e74 100644 --- a/Extension/package.json +++ b/Extension/package.json @@ -6471,7 +6471,7 @@ "compile": "yarn install && (yarn verify prep --quiet || yarn prep) && yarn build", "watch": "yarn install && (yarn verify prep --quiet || yarn prep) && tsc --build tsconfig.json --watch", "rebuild": "yarn install && yarn clean && yarn prep && yarn build", - "vscode:prepublish": "yarn install && yarn clean && yarn webpack", + "vsix-prepublish": "yarn install && yarn clean && yarn webpack", "webpack": "yarn install && (yarn verify prep --quiet || yarn prep) && tsc --build ui.tsconfig.json && webpack --mode production --env vscode_nls", "generate-native-strings": "ts-node -T ./.scripts/generateNativeStrings.ts", "generate-options-schema": "ts-node -T ./.scripts/generateOptionsSchema.ts", From 4079b1e5161ffdd138d614a4c0ff5369ca529c9c Mon Sep 17 00:00:00 2001 From: Sean McManus Date: Mon, 23 Sep 2024 19:49:52 -0700 Subject: [PATCH 5/6] Fix Cg build. (#12759) * Fix Cg build. --- Build/cg/cg.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Build/cg/cg.yml b/Build/cg/cg.yml index 124c301f04..fae5d8d91f 100644 --- a/Build/cg/cg.yml +++ b/Build/cg/cg.yml @@ -102,6 +102,10 @@ extends: filename: mkdir arguments: $(Build.ArtifactStagingDirectory)\Extension + - script: yarn run vsix-prepublish + displayName: Build files + workingDirectory: $(Build.SourcesDirectory)\Extension + - task: CmdLine@1 name: ProcessRunner_12 displayName: Run VSCE to package vsix From 1e89750b0bb9629ba0262a6eb44d1ab41eb77d51 Mon Sep 17 00:00:00 2001 From: Sean McManus Date: Tue, 24 Sep 2024 16:45:58 -0700 Subject: [PATCH 6/6] 1.22.5 changelog (#12762) * Update changelog for 1.22.5. --- Extension/CHANGELOG.md | 9 +++++++++ Extension/package.json | 2 +- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/Extension/CHANGELOG.md b/Extension/CHANGELOG.md index 306b7c5728..a2a5cc18de 100644 --- a/Extension/CHANGELOG.md +++ b/Extension/CHANGELOG.md @@ -1,5 +1,14 @@ # C/C++ for Visual Studio Code Changelog +## Version 1.22.5: September 24, 2024 +### Enhancement +* Add the database path to the `C/C++: Log Diagnostics` output. + +### Bug Fixes +* Fix some synchronization and crash issues with `handle_edits`. [#12747](https://github.com/microsoft/vscode-cpptools/issues/12747) +* Fix usage of `#cpp` with Copilot chat. [PR #12755](https://github.com/microsoft/vscode-cpptools/pull/12755) +* Fix some document buffer issues. + ## Version 1.22.4: September 19, 2024 ### Enhancements * Performance improvements related to how custom configurations are processed. [#12632](https://github.com/microsoft/vscode-cpptools/issues/12632) diff --git a/Extension/package.json b/Extension/package.json index 2e5b7e4e74..8d8395e3fb 100644 --- a/Extension/package.json +++ b/Extension/package.json @@ -2,7 +2,7 @@ "name": "cpptools", "displayName": "C/C++", "description": "C/C++ IntelliSense, debugging, and code browsing.", - "version": "1.22.4-main", + "version": "1.22.5-main", "publisher": "ms-vscode", "icon": "LanguageCCPP_color_128x.png", "readme": "README.md",