Skip to content

fix: support inline completions in Docker Compose files - #2784

Open
laileni-aws wants to merge 2 commits into
Amazon-Q-Developer:mainfrom
laileni-aws:fix/inline-completion-dockercompose-language
Open

fix: support inline completions in Docker Compose files#2784
laileni-aws wants to merge 2 commits into
Amazon-Q-Developer:mainfrom
laileni-aws:fix/inline-completion-dockercompose-language

Conversation

@laileni-aws

Copy link
Copy Markdown
Collaborator

Problem

Amazon Q inline suggestions are not provided in Docker Compose files. Some IDEs (notably VS Code) identify docker-compose.yaml / docker-compose.yml with the editor language id dockercompose rather than yaml.

In shared/languageDetection.ts, getLanguageId resolves a document's language by:

  1. looking up the editor language id in qLanguageIdByDocumentLanguageId, then
  2. falling back to the file extension via languageByExtension.

dockercompose was not present in qLanguageIdByDocumentLanguageId, so the language id itself resolved to "unsupported". These files only worked when the extension fallback happened to match .yaml/.yml, and the inline completion handler logs languageId [dockercompose] not supported for the language-id path.

Fix

Map dockercompose to yaml in qLanguageIdByDocumentLanguageId, so the language is resolved directly from the reported language id (and consistently with the existing .yaml/.yml extension handling). Docker Compose files now receive the same completion support as other YAML files.

Because this is the shared Flare language server, the fix applies to every IDE that defers language support to the server (e.g. JetBrains and Eclipse send the document to the server without a client-side language allowlist).

Testing

  • Extended server/aws-lsp-codewhisperer/src/shared/languageDetection.test.ts:
    • getLanguageId maps the dockercompose language id to yaml;
    • getSupportedLanguageId resolves a dockercompose document to yaml (a supported language).
  • Ran the languageDetection unit tests: all passing (8/8).
  • prettier --check and eslint pass on the changed files.

Notes

Some IDEs (e.g. VS Code) report docker-compose files with the
'dockercompose' language id rather than 'yaml'. The server language
detection did not map 'dockercompose', so it only resolved these files
via the .yaml/.yml extension fallback and treated the language id as
unsupported. Map 'dockercompose' to 'yaml' so completions are provided
for docker-compose files regardless of how the client reports them.

Adds unit tests covering the language-id mapping and supported-language
resolution.
@codecov-commenter

codecov-commenter commented Jul 15, 2026

Copy link
Copy Markdown

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@laileni-aws
laileni-aws marked this pull request as ready for review September 9, 2026 16:43
@laileni-aws
laileni-aws requested a review from a team as a code owner September 9, 2026 16:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants