-
Notifications
You must be signed in to change notification settings - Fork 12
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
Direnv seems to set path a bit too late for other extensions to pick up #109
Comments
thanks for the report, sadly load order is not something we really have influence over: we're already asking to be activated as early as possible. fwiw vscode logs when and why it activates which extensions: in the bottom panel, in the oh and just to make sure: you're using the latest version of the extension, which prompts you to restart extensions after the environment generated in your .envrc changes, and that doesn't help? if you close all windows, |
Hi! I've been encountering the same problem.
Version 0.6.1, extension sometimes prompts about the restart, but if the environment isn't changed overall that won't happen.
No file changes are necessary. The problem can be triggered just by opening some |
i haven't managed to reproduce this yet but i'll keep trying |
I'll see if i can make a video if that helps
…On Fri, 16 Sept 2022, 15:57 Martin Kühl, ***@***.***> wrote:
i haven't managed to reproduce this yet but i'll keep trying
—
Reply to this email directly, view it on GitHub
<#109 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAEZNI63T2OTQPEBUP237YTV6R4GHANCNFSM5TYG5ZWA>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
sorry, i thought i had replied already 😔
that would be great, thanks! |
It's quite often the case for me when I'm using |
@andronat just in case it can be useful to you, I am able to "gain enough time" for |
I've just switched to using this extension after nix-env-selector stopped working (arrterian/nix-env-selector#80). I never had this sort of issue there. Instead the whole of VSCode would seem to freeze until that extension had finished initialising the environment. It may be worth looking at their source to see what was being done differently.
This does actually seem to reliably work! At least for language servers which don't start until a relevant source file is viewed (e.g. Haskell works, but I haven't tested Rust yet, which starts earlier in the background). Anyway, obviously it's still not ideal. |
Could y'all try the build attached at https://github.com/direnv/direnv-vscode/actions/runs/4722972778 and check if it improves things, and if it doesn't attach the contents of that window's "Extension Host" Output log? |
No visible difference. I still have to wait before opening a Haskell file, to avoid
|
Thanks |
Yep, that works! Awesome, thanks. |
I assume this is fixed now, feel free to reopen otherwise. |
Unfortunately the issue is still present for me in Open https://github.com/arianvp/auth in VSCode I still get even though I can not reopen the issue myself |
Logs:
|
These are the activation events for
I'm wondering if the:
part is causing issues. as the Haskell language server extension does not have that |
It would've been too nice I guess… Can you try the build at https://github.com/direnv/direnv-vscode/actions/runs/4737391176?pr=464 and see if it helps? |
Unfortunately this did not help. |
I'm running into a similar issue with the ruby-lsp extension. If anyone has any tips on how to work around this issue please post them! |
This works like magic. |
I'm finding that direnv doesn't seem to work with rust-analyzer at the moment. It was working well at some point in the past. In my setup the 'cargo' binary is found via direnv, and the extension fails to find it. |
The same situation applies to the Deno language server. When a TS file is opened to start with, this is what is logged:
I don't know if this is also relevant, but here are the logs from the TypeScript server as well:
|
At least for OCaml the issue was that it was accessing |
@mkhl would maybe not the proper way be to write an issue on VS Code itself, that the extension host needs an event to signify when the environment is ready, and have some extensions use this in some way? |
I noticed that say if I open vscode and I have a
go
file open; that visual studio code complains that it can't find thego
binary eventhough it is in mydirenv
file. If I open vscode but the first file that gets loaded is not a.go
file but say a.md
file then I do not get the error and if I then open a go file it can find thego
binary and language server works.I often fix this scenario by closing all go files; opening an unrelated file, and then run
Reload window
to reload the direnv plugin. so that the other plugins pick up the paths that direnv plugin set.It seems as if the direnv plugin gets loaded too late. I don't know if this is something that we can influence but it's a bit of an annoying bug to work around.
The text was updated successfully, but these errors were encountered: