Comments (17)
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.
Erlang/OTP 25 [erts-13.0] [source] [64-bit] [smp:12:12] [ds:12:12:10] [async-threads:1] [jit:ns]
Elixir 1.14.0 (compiled with Erlang/OTP 25)
from next-ls.
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 Application.compile_env!
is at risk.
So I believe it is just the runtime.exs
that should be skipped.
A very very dirty solution would be to redefine the Mix.Tasks.Loadconfig
module, with a no-op function as load_runtime/1
.
What is strange is that NextLS is not supposed to boot the user application, is it? If I raise
in my runtime.exs
and run mix compile
it works, because it is not evaluated at compile-time. So why does NextLS evaluates that file instead of its own configuration?
from next-ls.
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.
Yes, I was thinking that even dependencies sometimes need app config when compiling, so they have to run.
What is strange is that NextLS is not supposed to boot the user application, is it?
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.
from next-ls.
Would it be imaginable that NextLS starts a custom application in that VM, just adding the elixirc_paths
of the user project to its own paths, dynamically or in mix.exs. That way you do not need flags because the mod
in .app
is not the user's.
That would sill require to copy the config files or something...
from next-ls.
I think a workaround for you right now would be to wrap your entire runtime.exs file in if not System.get_env("NEXT_LS_PARENT_PID") do
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
from next-ls.
I published 0.5.2 that sets an LSP
variable, so you can do if System.get_env("LSP") do
from next-ls.
Using NEXT_LS_PARENT_PID
works with a custom run with TCP but it does not work with the default stdio adapter (and letting the extension start it itself)
[Error - 13:06:35] Client NextLS: connection to server is erroring. Shutting down server.
[Error - 13:06:35] Stopping server failed
Error: Client is not running and can't be stopped. It's current state is: starting
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 ( NEXTLS_VERSION=0.5.1 /home/lud/.vscode/extensions/elixir-tools.elixir-tools-0.2.2/bin/nextls --port 9999
) the vscode output shows that the app is compiling, an I can have the current file symbols, but there is no code formatting nor go-to-definition and the workspace symbols do not work, they always display the symbols for the same module. Not sure if it is expected or related to the runtime.exs problem though.
( Same with NEXTLS_VERSION=0.5.2
)
from next-ls.
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?
from next-ls.
Can you remind me what your exact elixir and OTP versions are?
from next-ls.
Let me know if you get to try this out again and if it fixed your issues.
from next-ls.
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:
NEXTLS_VERSION=0.5.4 /home/lud/.vscode/extensions/elixir-tools.elixir-tools-0.3.0/bin/nextls --port 9999
from next-ls.
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?
from next-ls.
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?
from next-ls.
Delete the .elixir-tools folder so it forces it to rebuild the lookup table.
from next-ls.
No changes unfortunately. I can try to debug to see why, I do not know when though.
from next-ls.
Make sure they aren't anything in these cases that haven't been implemented yet: https://www.elixir-tools.dev/next-ls/#definition
from next-ls.
Ah yes, that should be it. Thank you.
from next-ls.
Related Issues (20)
- code lens: show number of references above module/function
- bug(completions): variables leaking from for/with
- Indexing project fails because rebar3 is not included in bundled Elixir HOT 4
- completions: behaviour callbacks HOT 1
- Nix mix FOD deps has mismatched sha256 hashes on lattes release (0.21.1) HOT 3
- Missing hex in bundled elixir (bad MIX_HOME?) HOT 4
- Missing error message when formatting fails
- "Do you want the application to accept incoming network connections" alert on every start on macOS
- [error] Bad RPC call to node nextls-runtime => LSP Exited => :timeout HOT 6
- Unnecessary (?) completions on "do|" HOT 8
- Execute commands on emacs HOT 6
- bug(definition): exception when gathering variables
- Failed to load metadata on file opening (nvim/0.10) HOT 1
- "expected either either a list of a %GenLSP.Structures.SymbolInformation{}, a list of a %GenLSP.Structures.DocumentSymbol{}, or null or a %GenLSP.ErrorResponse{}" HOT 1
- The server shuts down when I close the editor HOT 13
- Boot up time HOT 1
- Completion request fails on a LiveComponent
- Suggestion: change code action for "underscoring" a variable to "rename to _var_name" HOT 1
- bug: alias references use alias instead of full name when the module is aliased int he module but the alias isnt used
- No autocompletion for fields in %__MODULE__{} 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 next-ls.