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

Variables that are defined in another build stage should not be suggested for completion #201

Closed
rcjsuen opened this issue Feb 6, 2018 · 1 comment
Assignees
Labels

Comments

@rcjsuen
Copy link
Owner

rcjsuen commented Feb 6, 2018

image

Variables are scoped to a build stage. Thus, variables in one build stage shouldn't be suggested when we send a textDocument/completion request in a different build stage.

FROM scratch
ENV xyz=y
FROM alpine
RUN echo $xyz
$ docker build .
Sending build context to Docker daemon  1.695MB
Step 1/4 : FROM scratch
 --->
Step 2/4 : ENV xyz y
 ---> Running in 85a85f49228c
 ---> 4c491c4aebff
Removing intermediate container 85a85f49228c
Step 3/4 : FROM alpine
 ---> 3fd9065eaf02
Step 4/4 : RUN echo $xyz
 ---> Running in 854c6e67692b

 ---> 75e57160efb1
Removing intermediate container 854c6e67692b
Successfully built 75e57160efb1
FROM scratch
ARG xyz=y
FROM alpine
RUN echo $xyz
$ docker build .
Sending build context to Docker daemon  1.695MB
Step 1/4 : FROM scratch
 --->
Step 2/4 : ARG xyz=y
 ---> Running in ce3339cc0e85
 ---> 8789ac237b75
Removing intermediate container ce3339cc0e85
Step 3/4 : FROM alpine
 ---> 3fd9065eaf02
Step 4/4 : RUN echo $xyz
 ---> Using cache
 ---> 75e57160efb1
Successfully built 75e57160efb1
@rcjsuen rcjsuen added the bug label Feb 6, 2018
@rcjsuen
Copy link
Owner Author

rcjsuen commented Feb 7, 2018

This isn't a bug in the language server. The parser isn't returning the right stuff. See rcjsuen/dockerfile-ast#15.

@rcjsuen rcjsuen self-assigned this Feb 7, 2018
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