Skip to content

Malformed HCL template causes duplicate errors with the same range to be generated #203

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
rcjsuen opened this issue May 16, 2025 · 0 comments
Assignees
Labels

Comments

@rcjsuen
Copy link
Collaborator

rcjsuen commented May 16, 2025

target x {
  inherits = ["${var"]
  dockerfile = "./Dockerfile"
}

The Invalid multi-line string error is duplicated on the with the same range twice.

{
    "textDocument": {
        "uri": "file:///tmp/docker-bake.hcl",
        "languageId": "dockerbake",
        "version": 45,
        "text": "target x {\n  inherits = [\"${var\"]\n  dockerfile = \"./Dockerfile\"\n}"
    }
}
{
    "uri": "file:///tmp/docker-bake.hcl",
    "version": 45,
    "diagnostics": [
        {
            "range": {
                "start": {
                    "line": 1,
                    "character": 0
                },
                "end": {
                    "line": 1,
                    "character": 22
                }
            },
            "severity": 1,
            "source": "docker-language-server",
            "message": "Invalid multi-line string (Quoted strings may not be split over multiple lines. To produce a multi-line string, either use the \\n escape to represent a newline character or use the \"heredoc\" multi-line template syntax.)"
        },
        {
            "range": {
                "start": {
                    "line": 1,
                    "character": 0
                },
                "end": {
                    "line": 1,
                    "character": 22
                }
            },
            "severity": 1,
            "source": "docker-language-server",
            "message": "Invalid multi-line string (Quoted strings may not be split over multiple lines. To produce a multi-line string, either use the \\n escape to represent a newline character or use the \"heredoc\" multi-line template syntax.)"
        },
        {
            "range": {
                "start": {
                    "line": 1,
                    "character": 0
                },
                "end": {
                    "line": 1,
                    "character": 22
                }
            },
            "severity": 1,
            "source": "docker-language-server",
            "message": "Unclosed template interpolation sequence (There is no closing brace for this interpolation sequence before the end of the quoted template. This might be caused by incorrect nesting inside the given expression.)"
        }
    ]
}
@rcjsuen rcjsuen self-assigned this May 16, 2025
@rcjsuen rcjsuen added the bake label May 16, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant