ahmedkhalf / project.nvim

The superior project management solution for neovim.
Apache License 2.0
1.38k stars 132 forks source link

LSP detection method not working #169

Open kkrime opened 4 days ago

kkrime commented 4 days ago

When using detection_methods = { "lsp", "pattern" } and navigating between projects, CWD doesn't happen.

when using detection_methods = { "pattern", "lsp" } CWD happens.

macOS 14.5 (23F79)
NVIM v0.10.2
Build type: Release
LuaJIT 2.1.1727870382

I've attached my zipped ~/.config/nvim folder with minimum config to reproduce project.zip

Mte90 commented 23 hours ago
WARNING vim.lsp.buf_get_clients() is deprecated. Feature will be removed in Nvim 0.12
  - ADVICE:
    - use vim.lsp.get_clients() instead.
    - stack traceback:
        /home/mte90/.vim/plugged/project.nvim/lua/project_nvim/project.lua:16
        /home/mte90/.vim/plugged/project.nvim/lua/project_nvim/project.lua:203
        /home/mte90/.vim/plugged/project.nvim/lua/project_nvim/project.lua:248
        lua:1

maybe is related to this

kkrime commented 6 hours ago

@Mte90 vim.lsp.buf_get_clients() was definitely not working, thanks; https://github.com/ahmedkhalf/project.nvim/pull/170

But now there's another issue, for some reason the value in the root_dir return from:

local client = vim.lsp.get_clients() -- with or without { bufnr = 0 }
client.config.root_dir

is always the same root_dir from the first call...

I checked :LspInfo and it does change the root directory to the correct new location, but it isn't being updated on vim.lsp.get_clients()

I tried ^ with just the lsp + project plugins with minimum configs and I it's the same thing

Any ideas on why this could be? If not any ideas on who I should take this up with?