Skip to content
Merged
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
5 changes: 1 addition & 4 deletions Extension/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6487,10 +6487,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$/)"
}
]
},
Expand Down
9 changes: 2 additions & 7 deletions Extension/src/LanguageServer/lmTool.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,15 +44,10 @@ const knownValues: { [Property in keyof ChatContextResult]?: { [id: string]: str
}
};

const plainTextContentType = 'text/plain';

export class CppConfigurationLanguageModelTool implements vscode.LanguageModelTool<void> {
public async invoke(options: vscode.LanguageModelToolInvocationOptions<void>, token: vscode.CancellationToken): Promise<vscode.LanguageModelToolResult> {
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<string> {
Expand Down
Loading