Comments (4)
Thank you for taking time to report this, I thought I had been going crazy.
from nix-env-selector.
from nix-env-selector.
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 env/set-current-env
.
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:
2023-03-04 17:50:41.355 [info] ExtensionService#_doActivateExtension arrterian.nix-env-selector, startup: false, activationEvent: '*'
2023-03-04 17:50:41.355 [info] ExtensionService#_doActivateExtension mutantdino.resourcemonitor, startup: false, activationEvent: '*'
2023-03-04 17:50:41.356 [info] ExtensionService#_doActivateExtension vscode.extension-editing, startup: false, activationEvent: 'onLanguage:markdown'
2023-03-04 17:50:41.356 [info] ExtensionService#_doActivateExtension vscode.markdown-language-features, startup: false, activationEvent: 'onLanguage:markdown'
2023-03-04 17:50:41.356 [info] ExtensionService#_doActivateExtension DavidAnson.vscode-markdownlint, startup: false, activationEvent: 'onLanguage:markdown'
2023-03-04 17:50:42.638 [info] ExtensionService#_doActivateExtension vscode.git, startup: false, activationEvent: '*'
2023-03-04 17:50:42.638 [info] ExtensionService#_doActivateExtension vscode.github, startup: false, activationEvent: '*'
2023-03-04 17:50:42.816 [info] ExtensionService#_doActivateExtension vscode.markdown-math, startup: false, activationEvent: 'api', root cause: vscode.markdown-language-features
2023-03-04 17:50:42.972 [info] ExtensionService#_doActivateExtension golang.go, startup: true, activationEvent: 'workspaceContains:*.go,*/*.go,*/*/*.go'
If I open the Go source file, the Go extension will report an error, and the extension host output is:
2023-03-04 17:49:58.989 [info] ExtensionService#_doActivateExtension arrterian.nix-env-selector, startup: false, activationEvent: '*'
2023-03-04 17:49:58.989 [info] ExtensionService#_doActivateExtension mutantdino.resourcemonitor, startup: false, activationEvent: '*'
2023-03-04 17:49:58.989 [info] ExtensionService#_doActivateExtension golang.go, startup: false, activationEvent: 'onLanguage:go'
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 ~/.bashrc
if [ $VSCODE_RESOLVING_ENVIRONMENT ]; then
# source ....
fi
-
If it is the first configuration, you need to completely restart VSCode to take effect. In the Remote SSH scenario, you need to kill (https://code.visualstudio.com/docs/remote/troubleshooting#_cleaning-up-the-vs-code-server-on-the-remote).
kill -9 `ps aux | grep vscode-server | grep $USER | grep -v grep | awk '{print $2}'`
from nix-env-selector.
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.
from nix-env-selector.
Related Issues (20)
- [Feature] Pick up nix environment in tasks HOT 5
- Stuck applying environment HOT 12
- Rustup packages as settings packages HOT 3
- Have the extension output logs in the Output window HOT 4
- Can't make my fhs env work HOT 1
- shell.nix exetubables don't seem to be made available after selecting shell.nix HOT 1
- [Feature]: Support shell.nix files outside of the project directory
- "command 'nixEnvSelector.selectEnv' not found" HOT 1
- [Feature]: Support multiroot workspace HOT 2
- C/C++ Support: Can this be used to help generate the c_cpp_properties.json configuration file?
- [Documentation]: Document what `Hit environment` means
- [Feature]: Remember nix environment answer
- [Feature]: VSCode-Remote (SSH) support? HOT 6
- No longer applies shell.nix to integrated terminal? HOT 2
- Extension Development Host does not launch
- Can find packages from nix-shell, but not with nix-env-selector HOT 3
- TypeError when applying nix environment in Remote SSH HOT 3
- [Feature]: VSCodium support HOT 1
- Latest Pylance update brakes python environment HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from nix-env-selector.