Skip to content

Proposal: Enhance Bake LSP Support #107

@colinhemmings

Description

@colinhemmings

Problem

The current LSP support for docker-bake.hcl files in the Docker DX VS Code extension is functional but limited:

  • Syntax: highlighting, code completion, formatting
  • Hover information only shows the type, without any helpful documentation or usage guidance.
  • There’s no support for visualizing the inheritance hierarchy of targets (e.g., inherits = ["_common"]), making it hard to reason about multi-target setups.
  • Outline a view outline of Bake file targets
  • Image references inside fields like tags = ["ghcr.io/abc/def"] are plain strings with no ability to click and inspect the image source (e.g., opening the URL in a browser).
  • Navigation from variable references to definitions and from docker-bake.hcl build stage references to corresponding Dockerfile declarations

These limitations reduce developer productivity and make it harder for users—especially those new to docker-bake.hcl—to understand, refactor, and explore their configurations confidently.

Proposed Solution

Enhance the Bake LSP implementation with the following capabilities:

  1. Hover and code completion improvements
    • Show helpful documentation (not just the type) when hovering over attributes.
    • Include usage examples, common values, and links to relevant docs.
  2. Target hierarchy visualization
    • Display how a target inherits from others (inherits = ["_common"]), similar to class inheritance in object-oriented languages.
    • Optional tree/graph view or inline hover/tooltip linking to inherited targets.
  3. Rename support
    • Allow developers to rename a target and automatically update all references (especially inherited relationships) across the file.
  4. Linkable image tags
    • Make values like tags = ["ghcr.io/abc/def"] clickable, opening the corresponding container registry page in the browser.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions