Skip to content

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

Closed
@rcjsuen

Description

@rcjsuen
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.)"
        }
    ]
}

Metadata

Metadata

Assignees

Labels

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions