Giter VIP home page Giter VIP logo

Comments (13)

shiroyasha avatar shiroyasha commented on September 22, 2024 1

Sounds great! Thank you for investing time & energy into this 🙇‍♂️

from next-ls.

mhanberg avatar mhanberg commented on September 22, 2024

This is expected

from next-ls.

mhanberg avatar mhanberg commented on September 22, 2024

Are you using the TCP adapter for a special reason?

from next-ls.

shiroyasha avatar shiroyasha commented on September 22, 2024

This is expected

Oh, I see, sorry for not checking the documentation first. My mistake.

Are you using the TCP adapter for a special reason?

Two reasons:

  1. My typical workflow is to open vim, edit some files, close vim, and commit. But, I'm seeing some delays in starting up the language server. As a workaround I'm looking into having an up-and-running language server where my vim instance can attach fast.

  2. The rest of my project is running inside of Docker containers during development, and I would love to move the language server inside of a container as well. This is just an experiment so far, which is also not going great as I'm stuck on a problem that I don't know how to further debug https://elixirforum.com/t/running-elixir-lsp-in-docker/63618 😅

from next-ls.

mhanberg avatar mhanberg commented on September 22, 2024

How long are these delays?

The TCP mode is not meant to be used by multiple editors or editing sessions, it's mostly meant to for easy testing during development of Next LS.

Regarding that Elixir Forum post, I noticed that your downloaded the linux arm binary. Is that correct? What is your host OS?

from next-ls.

shiroyasha avatar shiroyasha commented on September 22, 2024

Around 15-20 seconds. Not a huge problem, but it would be nice if I could eliminate it.

I have a short screencast that demonstrates this behaviour.

go-to-definition-delay-lt-10mb.mov

Sorry for the awful video quality, GitHub limited me to 10mb, so I exported it is as 480p. I still have the original, and can upload it to Youtube if it helps.


The TCP mode is not meant to be used by multiple editors or editing sessions, it's mostly meant to for easy testing during development of Next LS.

Clear. I was experimenting with something that was not meant for regular usage 😅

Regarding that Elixir Forum post, I noticed that your downloaded the linux arm binary. Is that correct? What is your host OS?

It should be the correct one, I think. I'm running inside of an UTM based virtual machine on a Mac Studio 2.

$ uname -a
Linux dev 5.15.0-102-generic #112-Ubuntu SMP Tue Mar 5 16:49:56 UTC 2024 aarch64 aarch64 aarch64 GNU/Linux

Thank you for taking time to look into this. I fully understand that I'm doing something a bit exotic, which does not fall into the regular, everyday, usage of next-ls.

from next-ls.

mhanberg avatar mhanberg commented on September 22, 2024

Around 15-20 seconds. Not a huge problem, but it would be nice if I could eliminate it.

I have a short screencast that demonstrates this behaviour.

Left pane: Opening a feature test with Vim, and pressing continuously gd to execute "go to definition".
Right page: tail -f .elixir-tools/next-ls.log

so, definitions shouldn't work inside of test files (its a current limitation of test files), so i am surprised to see that jump work at all.

From what I saw, the server booted up pretty quickly, the textDocument/publishDiagnostics notifications comes once your app has compiled or credo has finished running.

Also, based on looking at your config, are you using Elixir LS and Next LS? that might explain why it was able to jump at all (I can't remember how Elixir LS works inside test files).

Can you try your test again but opening a normal file inside lib?

from next-ls.

mhanberg avatar mhanberg commented on September 22, 2024

Ignore that other issue i opened 😅

from next-ls.

shiroyasha avatar shiroyasha commented on September 22, 2024

Heh, interesting, I also didn't know that go-to-definition should not work in test files.

Here are some further experiments:

  1. I've disabled elixir_ls in my vimfiles: https://github.com/shiroyasha/neovimfiles/blob/master/lua/shiroyasha/plugins/lsp/elixir.lua#L15.

  2. I've tested it from the lib folder. There, it is super fast, it is able to jump in a second of opening a file.

go-to-def-lib.mov
  1. I've tested the jump from the test file, it was still working, but same as before with a 20 second delay.

The good news is that the original performance problem is non-existent as I was basing my judgment mostly on test files. One thing that still puzzles me is how does the jump still working even after I've removed the elixir_ls config. 🤔


Edit: Just to be sure that it is not elixir-ls, I've also commented out this line https://github.com/shiroyasha/neovimfiles/blob/master/lua/shiroyasha/plugins/lsp/elixir.lua#L2

from next-ls.

shiroyasha avatar shiroyasha commented on September 22, 2024

I dig a bit deeper, and looked into the database.

Screenshot 2024-05-17 at 23 17 34

Given that there is no mention of the test directory, or the support module in the nextls.db, it must mean that I'm still using ElixirLS for that jump after all.


Out of curiosity, what is the root problem that prevents nextls from collecting references in the test directory?

from next-ls.

mhanberg avatar mhanberg commented on September 22, 2024

Edit: Just to be sure that it is not elixir-ls, I've also commented out this line https://github.com/shiroyasha/neovimfiles/blob/master/lua/shiroyasha/plugins/lsp/elixir.lua#L2

Elixir LS is enabled by default, so you have to disable it for it to turn off.

Out of curiosity, what is the root problem that prevents nextls from collecting references in the test directory?

Tests are scripts and are not compiled. The way Next LS builds its index is via compiler tracers.

Also, some test code (often in test/support) is only compiled in the test environment, but we compile your project in the dev environment.

from next-ls.

shiroyasha avatar shiroyasha commented on September 22, 2024

Thank you for your detailed responses regarding the language server behavior. I would really like to have the goto definition functionality inside of tests, if it is possible in any way.

Would you be open to continuing this conversation in a dedicated github discussion? I would be happy to contribute or prototype some ideas to explore this further. Of course, if it is not a planned feature, I understand that as well.

from next-ls.

mhanberg avatar mhanberg commented on September 22, 2024

There are two open issues related to test files.

#90

#84

I think I might have an idea with how to accomplish definition/references and will post about it in that issue.

from next-ls.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.