-
-
Notifications
You must be signed in to change notification settings - Fork 29
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
[BUG] Extension don't add package to PATH variable, when some active tabs need any package from shell.nix #66
Comments
Thank you for taking time to report this, I thought I had been going crazy. |
I also encountered the same problem. I read the source code of this extension. I think this is an underlying flaw of this extension, related to the VSCode extension activation order. In order to start fast enough, VSCode does not provide an API to define the order of extension activation. Therefore, in some cases, other extensions will start before this extension completes nix-env-selector/src/main/main.cljs Line 21 in 62f01e6
Taking the Go extension as an example, if I don't open the go source file, it will work fine, the extension host output is:
If I open the Go source file, the Go extension will report an error, and the extension host output is:
Therefore, I think the implementation of this extension can only completely solve this problem by modifying the user's shell profile to inject environment variables such as PATH. For example if [ $VSCODE_RESOLVING_ENVIRONMENT ]; then
# source ....
fi
|
I don't think anything can be done without modifying VSCode. Trying to fix it on the extension side ends up being hacky and buggy. |
Weird situation. First time run extension, I selected my configured
shell.nix
file, extension loaded packages, everything works. Second time, extension didn't load my packages and LSP throws exception, because package didn't add to PATH. But when I close every tabs, that use any package from shell.nix, extension will load packages, add to PATH and everything back to normal.I found this bug for GoLang project. You can generate simple golang project and add to your shell.nix LSP for golang.
The text was updated successfully, but these errors were encountered: