Skip to content

Commit 8e5bbf1

Browse files
authored
Support C89 in Completion Prompts (#13132)
- Also send unrecognized ones in telementry for further ananlysis.
1 parent 200f093 commit 8e5bbf1

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

Extension/src/LanguageServer/lmTool.ts

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ const knownValues: { [Property in keyof ChatContextResult]?: { [id: string]: str
3838
'c++17': 'C++17',
3939
'c++20': 'C++20',
4040
'c++23': 'C++23',
41-
'c90': "C90",
41+
'c89': "C89",
4242
'c99': "C99",
4343
'c11': "C11",
4444
'c17': "C17",
@@ -140,6 +140,8 @@ export async function getProjectContext(uri: vscode.Uri, context: { flags: Recor
140140
return undefined;
141141
}
142142

143+
const originalStandardVersion = projectContext.result.standardVersion;
144+
143145
formatChatContext(projectContext.result);
144146

145147
const result: ProjectContext = {
@@ -160,6 +162,11 @@ export async function getProjectContext(uri: vscode.Uri, context: { flags: Recor
160162
if (projectContext.result.standardVersion) {
161163
telemetryProperties["standardVersion"] = projectContext.result.standardVersion;
162164
}
165+
else {
166+
if (originalStandardVersion) {
167+
telemetryProperties["originalStandardVersion"] = originalStandardVersion;
168+
}
169+
}
163170
if (projectContext.result.targetPlatform) {
164171
telemetryProperties["targetPlatform"] = projectContext.result.targetPlatform;
165172
}

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -376,6 +376,7 @@ describe('CppConfigurationLanguageModelTool Tests', () => {
376376
property['language'] === undefined &&
377377
property['compiler'] === undefined &&
378378
property['standardVersion'] === undefined &&
379+
property['originalStandardVersion'] === 'gnu++17' &&
379380
property['targetPlatform'] === undefined)));
380381
ok(result, 'result should not be undefined');
381382
ok(result.language === '');

0 commit comments

Comments
 (0)