Skip to content

Commit

Permalink
fixes to compile after vscode lmTools API break
Browse files Browse the repository at this point in the history
  • Loading branch information
yiftahw committed Oct 21, 2024
1 parent 7f1050e commit 9a95b02
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,6 @@ OneLocBuild

# ignore imported localization xlf directory
vscode-translations-import

# todo remove
Extension/bin/libc.so
9 changes: 3 additions & 6 deletions Extension/src/LanguageServer/lmTool.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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<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);
}
const result: vscode.LanguageModelToolResult = { "content": [] };
result.content.push(await this.getContext(token));
return result;
}

Expand Down

0 comments on commit 9a95b02

Please sign in to comment.