microsoft / vscode-docker

Docker Extension for Visual Studio Code
https://marketplace.visualstudio.com/items?itemName=ms-azuretools.vscode-docker
Other
1.19k stars 508 forks source link

Go to variable definition in URL #4150

Closed Alecton4 closed 8 months ago

Alecton4 commented 8 months ago

Not sure whether this is extension scope or VSCode scope but there is a conflict between go to definition and go to URL. Take the following snippet as an example:

ENV foo=foo
RUN curl https://$foo.bar && touch $foo

Ctrl + click on $foo inside the URL will go to the URL. Since go to URL will use https://$foo.bar as the address instead of https://foo.bar, it doesn't make much sense to go to URL. Is there a way to prioritize go to definition over go to URL?

bwateratmsft commented 8 months ago

Not sure this is even possible to override, I think the URL thing is built-in to VSCode.

karolz-ms commented 8 months ago

Assuming this is a fragment of a Dockerfile, what you describe would require that the VS Code editor/Dockerfile language service performs full Dockerfile evaluation, including variable substitution, and that on top of what @bwateratmsft describes. I do not think any of this is planned at this time.

bwateratmsft commented 8 months ago

It looks like the URL recognition is built into VSCode itself, so there's nothing we can do about this. Can you try opening an issue in the VSCode repository