Skip to content

Highlight ranges include a build stage's definition but not its references in FROM instructions #128

Description

@rcjsuen

Highlight ranges are only returned for the first and fourth line when something should be returned for the second line as well.

FROM alpine AS base
FROM base
FROM busybox
COPY --from=base . .
const lib = require("dockerfile-language-service");
const service = lib.DockerfileLanguageServiceFactory.createLanguageService();
const document = `FROM alpine AS base
FROM base
FROM busybox
COPY --from=base . .`

console.log(JSON.stringify(service.computeHighlightRanges(document, { line: 3, character: 14 })));
[
    {
        "range": {
            "start": {
                "line": 0,
                "character": 15
            },
            "end": {
                "line": 0,
                "character": 19
            }
        },
        "kind": 3
    },
    {
        "range": {
            "start": {
                "line": 3,
                "character": 12
            },
            "end": {
                "line": 3,
                "character": 16
            }
        },
        "kind": 2
    }
]

Activity

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

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions