From 9a95b0242107819c8e18190ce11707f5faa339c2 Mon Sep 17 00:00:00 2001 From: Yiftah Waisman Date: Mon, 21 Oct 2024 09:30:08 +0300 Subject: [PATCH] fixes to compile after vscode lmTools API break --- .gitignore | 3 +++ Extension/src/LanguageServer/lmTool.ts | 9 +++------ 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.gitignore b/.gitignore index d2a8df0e94..01e1699399 100644 --- a/.gitignore +++ b/.gitignore @@ -13,3 +13,6 @@ OneLocBuild # ignore imported localization xlf directory vscode-translations-import + +# todo remove +Extension/bin/libc.so diff --git a/Extension/src/LanguageServer/lmTool.ts b/Extension/src/LanguageServer/lmTool.ts index 5951377b4e..a4461a2eed 100644 --- a/Extension/src/LanguageServer/lmTool.ts +++ b/Extension/src/LanguageServer/lmTool.ts @@ -43,15 +43,12 @@ const knownValues: { [Property in keyof ChatContextResult]?: { [id: string]: str 'macos': 'macOS' } }; - -const plainTextContentType = 'text/plain'; +// todo revert changes before pull request 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); - } + const result: vscode.LanguageModelToolResult = { "content": [] }; + result.content.push(await this.getContext(token)); return result; }