Skip to content
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

Stage name shadowing an image that was previously used is not a valid definition location for the original line #130

Closed
rcjsuen opened this issue Aug 3, 2024 · 0 comments
Assignees
Labels
bug Something isn't working

Comments

@rcjsuen
Copy link
Owner

rcjsuen commented Aug 3, 2024

The definition of alpine on the first line should not cause the editor to focus on the alpine stage name on the second line as the two are not the same given that the declaration of the shadowed name comes after the original image name.

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

console.log(service.computeDefinition({ uri: "file:///tmp/Dockerfile" }, document, { line: 0, character: 8 }));
{
  uri: 'file:///tmp/Dockerfile',
  range: {
    start: { line: 1, character: 16 },
    end: { line: 1, character: 22 }
  }
}
@rcjsuen rcjsuen added the bug Something isn't working label Aug 3, 2024
@rcjsuen rcjsuen changed the title Stage name shadowing an image that was previously is not a valid definition location Stage name shadowing an image that was previously used is not a valid definition location for the original line Aug 3, 2024
@rcjsuen rcjsuen closed this as completed in fd6622b Aug 4, 2024
@rcjsuen rcjsuen self-assigned this Aug 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant