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

Add go.goroot command #2379

Closed
OrBin opened this issue Jul 27, 2022 · 2 comments
Closed

Add go.goroot command #2379

OrBin opened this issue Jul 27, 2022 · 2 comments
Labels
FeatureRequest FrozenDueToAge HelpWanted Issues that are not prioritized by the maintainers. Help is requested from community contributors.
Milestone

Comments

@OrBin
Copy link
Contributor

OrBin commented Jul 27, 2022

Is your feature request related to a problem? Please describe.
I want to define use GOROOT and GOPATH when defining substitutePath in a remote debugging (attach) configuration in launch.json.
The only possible way I could find to use GOPATH is add { "from": "${command:go.gopath}", "to": "/remote/go/path" }, but I cannot do the same thing for GOROOT since there's no go.goroot command.

Describe the solution you'd like
Adding a go.goroot command, returning the GOROOT value, just as go.gopath does for GOPATH.

Describe alternatives you've considered
I tried to use "${env:GOROOT}" and "${env:GOPATH}", but these env vars are not always defined.
I tried to find a way to run a shell command in the same context (something like "${shell:go env GOROOT}"), but that also didn't work.
I thought of working around this with a preLaunchTask, but couldn't find a way to use a task's output as an input for a launch configuration.

Additional context
N/A

It seems pretty easy to do (unless I'm missing something), so I'm willing to submit a PR with this, if you'll accept.

@gopherbot gopherbot added this to the Untriaged milestone Jul 27, 2022
@hyangah
Copy link
Contributor

hyangah commented Jul 27, 2022

Sounds good (I thought the same). Feel free to send a PR.

@hyangah hyangah added the HelpWanted Issues that are not prioritized by the maintainers. Help is requested from community contributors. label Jul 27, 2022
@hyangah hyangah modified the milestones: vscode-go/unplanned, v0.36.0 Jul 29, 2022
@gopherbot
Copy link
Collaborator

Change https://go.dev/cl/419834 mentions this issue: commands: add go.goroot command

@suzmue suzmue modified the milestones: v0.36.0, v0.35.2 Aug 11, 2022
Palettaemir pushed a commit to Palettaemir/vscode-go that referenced this issue Aug 17, 2022
Add go.goroot command, similar to the existing go.gopath.

Closes golang#2379.

Change-Id: I4851df5406897b347dbf17bd1f35e751d6ffa85a
GitHub-Last-Rev: 0e355e9
GitHub-Pull-Request: golang#2381
Reviewed-on: https://go-review.googlesource.com/c/vscode-go/+/419834
TryBot-Result: kokoro <noreply+kokoro@google.com>
Reviewed-by: Hyang-Ah Hana Kim <hyangah@gmail.com>
Reviewed-by: Cherry Mui <cherryyz@google.com>
Run-TryBot: Hyang-Ah Hana Kim <hyangah@gmail.com>
@golang golang locked and limited conversation to collaborators Aug 11, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
FeatureRequest FrozenDueToAge HelpWanted Issues that are not prioritized by the maintainers. Help is requested from community contributors.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants