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

Can find packages from nix-shell, but not with nix-env-selector #80

Open
makeller1 opened this issue Apr 4, 2023 · 3 comments
Open
Assignees
Labels
bug Something isn't working

Comments

@makeller1
Copy link

When I run nix-shell and then code ., intellisense can find all of my packages. However, opening VS Code (not from the nix-shell) using nix-env-selector, intellisense does not find the packages. I've uninstalled, reinstalled, and repeated selection of the environment.

Environment:

  • OS: Ubuntu 22.04.2
  • VS Code
  • Version 1.77.0
@makeller1 makeller1 added the bug Something isn't working label Apr 4, 2023
@georgefst
Copy link

Yep, I've found this since the latest VSCode update (March 2023). In my case, it's the Haskell extension crashing at launch because it can't find the language server binary. So it looks like upstream may have completely broken this extension...

@georgefst
Copy link

georgefst commented Apr 17, 2023

Between this and #53*, I've ended up switching to using direnv (with nix-direnv). All I needed to do to replicate nix-env-selector was to install direnv and the maintained direnv VSCode extension and add a .envrc to each project with:

if ! has nix_direnv_version || ! nix_direnv_version 2.3.0; then
  source_url "https://raw.githubusercontent.com/nix-community/nix-direnv/2.3.0/direnvrc" "sha256-Dmd+j63L84wuzgyjITIfSxSD57Tx7v51DMxVZOsiUD8="
fi

use flake

then run direnv allow . once from each project directory.

I did prefer the seamless experience of nix-env-selector when it worked though!

* EDIT: And, perhaps, a general lagginess since the last VSCode update, particularly in Go To Next Change? I had assumed this was unrelated, but it also seems to have gone away since the switch...

hagl added a commit to hagl/nix-env-selector that referenced this issue Jul 14, 2023
This seems to activate the extension earlier and allows language extensions to depend
on the loaded nix environment. See arrterian#80
hagl added a commit to hagl/nix-env-selector that referenced this issue Jul 14, 2023
This seems to activate the extension earlier and allows language extensions to depend
on the loaded nix environment. See arrterian#80
@hagl
Copy link
Contributor

hagl commented Jul 14, 2023

For the haskell-language-server I could get it working again by adding an additional "onLanguage" activationEvent in the extension manifest. See #82

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants