From 86c6c10f18dc7a7ed4c65025813806738db18d3d Mon Sep 17 00:00:00 2001 From: Ben McMorran Date: Mon, 21 Oct 2024 08:47:53 -0700 Subject: [PATCH 1/2] React to lmTools API breaking changes (#12866) --- Extension/package.json | 5 +---- Extension/src/LanguageServer/lmTool.ts | 9 ++------- 2 files changed, 3 insertions(+), 11 deletions(-) diff --git a/Extension/package.json b/Extension/package.json index 9b238c6676..8674cf9db1 100644 --- a/Extension/package.json +++ b/Extension/package.json @@ -6451,10 +6451,7 @@ "userDescription": "%c_cpp.languageModelTools.configuration.userDescription%", "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)", - "when": "(config.C_Cpp.experimentalFeatures =~ /^[eE]nabled$/)", - "supportedContentTypes": [ - "text/plain" - ] + "when": "(config.C_Cpp.experimentalFeatures =~ /^[eE]nabled$/)" } ] }, diff --git a/Extension/src/LanguageServer/lmTool.ts b/Extension/src/LanguageServer/lmTool.ts index 5951377b4e..ed5be61a00 100644 --- a/Extension/src/LanguageServer/lmTool.ts +++ b/Extension/src/LanguageServer/lmTool.ts @@ -44,15 +44,10 @@ const knownValues: { [Property in keyof ChatContextResult]?: { [id: string]: str } }; -const plainTextContentType = 'text/plain'; - export class CppConfigurationLanguageModelTool implements vscode.LanguageModelTool { 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; + return new vscode.LanguageModelToolResult([ + new vscode.LanguageModelTextPart(await this.getContext(token))]); } private async getContext(token: vscode.CancellationToken): Promise { From ce20613f24da3eefb3fc0dfd7008d0f6a55c9fc5 Mon Sep 17 00:00:00 2001 From: Colen Garoutte-Carson <49173979+Colengms@users.noreply.github.com> Date: Mon, 21 Oct 2024 12:45:35 -0700 Subject: [PATCH 2/2] Update changelog for 1.22.10 (#12852) --- Extension/CHANGELOG.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Extension/CHANGELOG.md b/Extension/CHANGELOG.md index 3e83e1a790..d8a2f36bba 100644 --- a/Extension/CHANGELOG.md +++ b/Extension/CHANGELOG.md @@ -1,5 +1,10 @@ # C/C++ for Visual Studio Code Changelog +## Version 1.22.10: October 21, 2024 +### Bug Fixes +* Fix the 'Extract to Function' feature not working. +* Fix the 'Go to Next/Prev Preprocessor Conditional' feature not working. + ## Version 1.22.9: October 14, 2024 ### Performance Improvements * Initialization performance improvements. [#12030](https://github.com/microsoft/vscode-cpptools/issues/12030)