Skip to content
Draft
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
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,13 @@ describe('LanguageDetection', () => {
)
}
})

it(`maps the 'dockercompose' language id (used by some IDEs for docker-compose files) to yaml`, () => {
assert.strictEqual(
getLanguageId(TextDocument.create('test://docker-compose.yaml', 'dockercompose', 1, '')),
'yaml'
)
})
})

describe('getSupportedLanguageId', () => {
Expand All @@ -41,6 +48,11 @@ describe('LanguageDetection', () => {
assert.ok(getSupportedLanguageId(typescriptDocument, ['typescript', 'javascript']))
assert.ok(!getSupportedLanguageId(typescriptDocument, ['javascript']))
})

it('should support docker-compose files reported with the dockercompose language id', () => {
const dockerComposeDocument = TextDocument.create('test://docker-compose.yaml', 'dockercompose', 1, '')
assert.strictEqual(getSupportedLanguageId(dockerComposeDocument), 'yaml')
})
})

describe('getCodeWhispererLanguageIdFromPath', () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,9 @@ export const qLanguageIdByDocumentLanguageId: { [key: string]: CodewhispererLang
vue: 'vue',
yaml: 'yaml',
yml: 'yaml',
// Some IDEs (e.g. VS Code) report docker-compose files with the 'dockercompose'
// language id rather than 'yaml'; treat it as YAML so completions are provided.
dockercompose: 'yaml',
}

export const getSupportedLanguageId = (
Expand Down
Loading