-
-
Notifications
You must be signed in to change notification settings - Fork 40
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
Should not execute config/runtime.exs #97
Comments
I think you will need to evaluate the compile-time config files, otherwise it is possible that some user modules do not compile at all. (For instance, anything that call So I believe it is just the A very very dirty solution would be to redefine the What is strange is that NextLS is not supposed to boot the user application, is it? If I |
Yes, I was thinking that even dependencies sometimes need app config when compiling, so they have to run.
Next LS starts your project with a bunch of flags to not actually start anything, just load your code and deps into a VM that is then connected to Next LS via distributed erlang. |
Would it be imaginable that NextLS starts a custom application in that VM, just adding the That would sill require to copy the config files or something... |
I think a workaround for you right now would be to wrap your entire runtime.exs file in this env var is set by Next LS, so if it is present, it means you are in Next LS and can avoid executing anything |
Adds a dedicated environment variable to indicate to the runtime that you are in the Next LS runtime. Should help address #97 as a work around.
Adds a dedicated environment variable to indicate to the runtime that you are in the Next LS runtime. Should help address #97 as a work around.
I published 0.5.2 that sets an |
Using
I'm using vscode and the last extension version is one week old so I did not try with the "LSP" variable. Besides, when I start the tool from a shell ( ( Same with |
The extension version is not tied to the NextLS version. When you start it normally it will fetch the latest version of NextLS. With regard to your last statement, did you let it finish compiling? Or were those features not working while it was compiling? |
Can you remind me what your exact elixir and OTP versions are? |
IIRC the compilation was long time finished. Plus listing the current file symbols works well. I'm leaving the office for now but I can run any tests you want later.
|
This mix task does what we actually want, which is to load all of the code paths and not start the app. Fixes #97 Closes elixir-lang/elixir#12764
This mix task does what we actually want, which is to load all of the code paths and not start the app. Fixes #97 Closes elixir-lang/elixir#12764
This mix task does what we actually want, which is to load all of the code paths and not start the app. Fixes #97 Closes elixir-lang/elixir#12764
Let me know if you get to try this out again and if it fixed your issues. |
Hello, I see a vscode version from 4 days ago. Same errors on my side, telling that the server cannot be started It works though, if I run the server manually and connect with TCP with this version of the extension:
|
The vscode extension version is not tied to the next ls version. It always fetches the latest version of next ls automatically. But, you now can set the version from the extension. Could you try that just to be sure? |
I can confirm that it works now with this configuration: "elixir-tools.credo.enable": false,
"elixir-tools.nextls.enable": true,
"elixir-tools.nextls.version": "0.5.4", Though "Go To Definition" works only for a few cases (full module name, no aliases, and only for some modules). Is there a way to debug that? |
Delete the .elixir-tools folder so it forces it to rebuild the lookup table. |
No changes unfortunately. I can try to debug to see why, I do not know when though. |
Make sure they aren't anything in these cases that haven't been implemented yet: https://www.elixir-tools.dev/next-ls/#definition |
Ah yes, that should be it. Thank you. |
Description
This was noticed by a user who used a dependency in their config/runtime.exs file, which was not loaded yet because their app was not compiled at all.
But, they also showed that by using functions like
System.fetch_env!/1
, the config will fail and the app will fail to start.Solution
Need to find a way to start the runtime without it executing any of the Application config files.
The text was updated successfully, but these errors were encountered: