Visitar URL original
Bake variable typing support? · Issue #495 · docker/docker-language-server · GitHub
Skip to content

Bake variable typing support? #495

Open

Description

@rrjjvv

Do you have any plans to support Bake (explicit) variable typing? If not planned, would you be open to it?

It just so happens I started using this server at the same time I was working on an older bake project which predated typing. As I was updating it to utilize typing, simple usages 'worked' (they didn't trigger any errors/warnings, but also didn't offer any new functionality), until I hit #490. While investigating, I saw there is no explicit support and that it was working 'on accident'. I'm now starting to run into things getting flagged as errors.

The typing feature is still relatively new; it was introduced six months ago (https://github.com/docker/buildx/releases/tag/v0.24.0), and I have yet to see it used in a public project. I wasn't surprised that it was not actively supported or that there were no open issues about it.

(All of my current errors went away by adding just five lines to the schema.)

Activity

  1. rcjsuen commented on Nov 22, 2025

    @rcjsuen
    Collaborator

    @rrjjvv Thanks for bringing this up to our attention. It seems like primitive types aren't too bad but the complex types can get...rather complex.

    Could you a) list the specific use cases you have and b) things that are getting incorrectly flagged as errors?

  2. rrjjvv commented on Nov 24, 2025

    @rrjjvv
    Author

    @rcjsuen For some reason I can't replicate the original errors for b) at the moment... though I stopped my patched copy and reinstalled the release version, they are no longer getting flagged. Don't know if my IDE has something cached or if there's another change I've made since my report that's changing the behavior., but they were:

    • Setting a typed variable default = null (by memory, the error was something along the lines of specifying a keyword rather than a primitive or one of the simpler of the complex types. I don't do this in practice since the value is null when typed, but had set it while confirming the available workarounds for that bug.)
    • Specifying a variable with type = set(string) (or any complex type). I don't remember the error being straightforward, but I 'knew' what it meant... along the lines of set(string) not being an expression or a keyword.

    It just occurred to me that I would have encountered those errors either in the release version and/or with a version containing only the buildx upgrade, but since then I pulled those other merges as well (so building main right now isn't the same as my minimal fix); later I'll try to retrace my steps to get the original errors.

    While I'm sure there's a world of opportunities with complete typing, just recognizing the syntax (those two points above) would be more than good enough for me.

    but the complex types can get...rather complex.

    Indeed... you don't have to tell me twice!!! (The feature of explicit typing in bake was actually my fault doing.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions