Skip to content

Commit 5fe5353

Browse files
committed
update prompt
1 parent ea9ef3f commit 5fe5353

File tree

2 files changed

+8
-6
lines changed

2 files changed

+8
-6
lines changed

Extension/src/LanguageServer/lmTool.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -169,8 +169,8 @@ export class CppConfigurationLanguageModelTool implements vscode.LanguageModelTo
169169
telemetryProperties["targetArchitecture"] = chatContext.targetArchitecture;
170170
}
171171
if (chatContext.usedTestFrameworks?.length > 0) {
172-
contextString += `The active document contains the content of the file '${currentDoc.fileName}' which is located in a directory structure where other files are including headers for the following C++ test frameworks: ${chatContext.usedTestFrameworks.join(', ')} . `;
173-
telemetryProperties["testFrameworks"] = chatContext.usedTestFrameworks.join(',');
172+
contextString += `The project uses the following C++ test frameworks: ${chatContext.usedTestFrameworks.join(', ')}. `;
173+
telemetryProperties["testFrameworks"] = chatContext.usedTestFrameworks.join(', ');
174174
}
175175
return contextString;
176176
}

Extension/test/scenarios/SingleRootProject/tests/lmTool.test.ts

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -159,12 +159,12 @@ describe('CppConfigurationLanguageModelTool Tests', () => {
159159
"standardVersion": 'C++20',
160160
"targetPlatform": 'Windows',
161161
"targetArchitecture": 'x64',
162-
'testFrameworks': 'gtest,catch2'
162+
'testFrameworks': 'gtest, catch2'
163163
})));
164164
ok(result, 'result should not be undefined');
165165
const text = result.content[0] as vscode.LanguageModelTextPart;
166166
ok(text, 'result should contain a text part');
167-
const traits_text = `The user is working on a C++ project. The project uses language version C++20. The project compiles using the MSVC compiler. The project targets the Windows platform. The project targets the x64 architecture. The active document contains the content of the file 'undefined' which is located in a directory structure where other files are including headers for the following C++ test frameworks: gtest, catch2 . `;
167+
const traits_text = `The user is working on a C++ project. The project uses language version C++20. The project compiles using the MSVC compiler. The project targets the Windows platform. The project targets the x64 architecture. The project uses the following C++ test frameworks: gtest, catch2. `;
168168
ok(text.value === traits_text);
169169
});
170170

@@ -187,7 +187,8 @@ describe('CppConfigurationLanguageModelTool Tests', () => {
187187
standardVersion: 'c++20',
188188
compiler: compiler,
189189
targetPlatform: 'windows',
190-
targetArchitecture: 'x64'
190+
targetArchitecture: 'x64',
191+
usedTestFrameworks: []
191192
}
192193
});
193194

@@ -228,7 +229,8 @@ describe('CppConfigurationLanguageModelTool Tests', () => {
228229
standardVersion: 'gnu++17',
229230
compiler: 'javac',
230231
targetPlatform: 'arduino',
231-
targetArchitecture: 'bar'
232+
targetArchitecture: 'bar',
233+
usedTestFrameworks: []
232234
}
233235
});
234236
const telemetryProperties: Record<string, string> = {};

0 commit comments

Comments
 (0)