Skip to content

Commit e8d62f1

Browse files
authored
config(amazonq): patch language configuration not added correctly #5663 (#5854)
## Problem patch #5663 Due to this line of code https://github.com/aws/aws-toolkit-vscode/blob/master/packages/core/src/codewhisperer/util/runtimeLanguageContext.ts#L156-L173 when users make inline completion call with new languages, logs will show `2024-10-24 08:52:55.501 [error] codewhisperer: unknown runtime language dart`, however it doesn't have functional impact because it will fallback to original language string (which is the reason why it doesn't fail test cases) and it's only affecting logs. test has been added https://github.com/aws/aws-toolkit-vscode/blob/master/packages/amazonq/test/unit/codewhisperer/util/runtimeLanguageContext.test.ts#L184-L222 ## Solution
1 parent 41f64ae commit e8d62f1

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

packages/amazonq/test/unit/codewhisperer/util/runtimeLanguageContext.test.ts

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -211,9 +211,6 @@ describe('runtimeLanguageContext', function () {
211211
]
212212

213213
for (const [inputCwsprLanguageId, expectedCwsprLanguageId] of codewhispererLanguageIds) {
214-
if (inputCwsprLanguageId === 'systemVerilog') {
215-
console.log()
216-
}
217214
it(`should return ${expectedCwsprLanguageId} if input codewhispererLanguageId is - ${inputCwsprLanguageId}`, function () {
218215
const actual = languageContext.toRuntimeLanguage(inputCwsprLanguageId)
219216
assert.strictEqual(actual, expectedCwsprLanguageId)

packages/core/src/codewhisperer/util/runtimeLanguageContext.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,17 @@ const runtimeLanguageSet: ReadonlySet<RuntimeLanguage> = new Set([
2121
'kotlin',
2222
'php',
2323
'python',
24+
'powershell',
25+
'r',
26+
'dart',
2427
'ruby',
2528
'rust',
2629
'scala',
2730
'shell',
2831
'sql',
32+
'swift',
33+
'lua',
34+
'vue',
2935
'typescript',
3036
'json',
3137
'yaml',

0 commit comments

Comments
 (0)