Optional configuration paths for gopls, go-outline, godef & C. #2874
Labels
FrozenDueToAge
WaitingForInfo
Issue is not actionable because of missing required information, which needs to be provided.
Milestone
Is your feature request related to a problem? Please describe.
Using devenv in conjunction with nix makes it hard to have a "portable" and "reproducible" development environment with go & vscode-go.
devenv, when activated, will install golang and other system packages in a subshell. Env variables are updated in the sub-shell, but are not readable by VS Code.
Example of my
devenv.nix
file:With the current version of the plugin I can manually set the
go.gopath
:It points to a sandboxed folder of the golang interpreter, but that folder only contains the standard go binaries.
Indeed
godef
,gopls
andgo-outline
are installed in different sendboxed folders (because this is what Nix does and what makes Nix a fully reproducible package manager):Describe the solution you'd like
The easier solution is to replicate what the Python plugin does.
In Python the end user can configure the full path (or just the name) of a command, as you can see in this screenshot:
This is a common problem in Python, especially when you need to run your code in a virtual environment (
python3 -m venv .venv
).By following this approach, the go plugin should be updated by exposing a configuration entry for every optional package, allowing the user to set its full path if needed (or by using as a fallback the actual value).
This will not be a breaking change but will unlock advanced usage.
The text was updated successfully, but these errors were encountered: