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

bug: Recent attempt to fix the double Lua LSP workspace loading progress seems to break Lua indexes in certain situations #178

Open
3 tasks done
GitMurf opened this issue Jan 24, 2024 · 3 comments
Labels
bug Something isn't working

Comments

@GitMurf
Copy link

GitMurf commented Jan 24, 2024

Did you check docs and existing issues?

  • I have read all the neodev.nvim docs
  • I have searched the existing issues of neodev.nvim
  • I have searched the existing issues of plugins related to this issue

Neovim version (nvim -v)

NVIM v0.10.0-dev-2135+g98a4ed0a1

Operating system/version

Windows 11

Describe the bug

Related references / discussion:

As mentioned here (c6be05a#r137665412)

I have problems using lspsaga peek definitions as it loads the peeked item in a floating window and then loads the lsp for that floating window... it seems to conflict with whatever changes were made in this PR as lua language server then reloads the lua workspace files specific to just that floating window (I think basically just loads the few files related to whatever I am peeking)... so then what happens is when I close the floating window my original file seems to have reference to just those limited lua workspace loaded files and all the sudden I get a bunch of diagnostics for missing references for vim.xxx global definitions. To fix this I have to run a LspRestart on that buffer.

image

As further context, @liskin workaround posted here (LuaLS/lua-language-server#1596 (comment)) does work as expected and does not have this issue.

Steps To Reproduce

  1. See below my .neoconf.json (main thing to notice is I have disabled importing of all plugins and only have a few imported with my lua workspace.
  2. Add a line to one of your lazy plugin imports for setting a keymap like: vim.keymap.set("n", "<leader>TEST", "TEST", { desc = "TEST" })
  3. Restart neovim
  4. Use LspSaga to do a peek definition on the keymap keyword from step 2 using :Lspsaga peek_definition
  5. Notice in my final screenshot below I (1) peek def keymap (2) loads def from neodev types nightly (3) the diagnostic of undefined globals now pops up in my original buffer

.neoconf.json

{
  "neodev": {
    "library": {
      "enabled": true,
      "runtime": true,
      "types": true,
      "plugins": [
        "nvim-treesitter",
        "plenary.nvim",
        "telescope.nvim"
      ]
    }
  },
  "neoconf": {
    "plugins": {
      "lua_ls": {
        "enabled": true
      }
    }
  }
}

image

Expected Behavior

The lua lsp workspace loader should not be duplicated, which is now working as expected... but now when I peek into other buffers, the lua workspace indexing seems to lose references most notably it seems to the core vim api stuff?

Repro

No response

@csh0101
Copy link

csh0101 commented Jan 29, 2024

I meet this issue..
the situation is ..
everything is ok at first time I open the file.
and after I do some operations , the lua_ls is reload double for this buffer.
and everything has gone.. lsp is no effective ..

@csh0101
Copy link

csh0101 commented Feb 7, 2024

I meet this issue.. 我遇到这个问题.. the situation is .. everything is ok at first time I open the file. and after I do some operations , the lua_ls is reload double for this buffer. and everything has gone.. lsp is no effective ..一切都消失了.. lsp 无效..

it's volar's issue

@AntonC9018
Copy link

Is there any known workaround? The plugin is basically useless because of this

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

3 participants