Open dylan-chong opened 1 week ago
What lsp clients are involved?
Have to dig it up later, when I have more time on hands. Currently I'm a bit busy with fixing my old laptop...
hey, cheers for the quick response. the dont think the lsp matters but in the example i have lua_ls/vimls. i can replicate with jsonls/tsserver too.
i wonder if this line needs to pass the opts { bufnr: auEvent.buf }
as vim.lsp.start
probably attaches to the current buffer
ive also noticed a separate issue where this plugin doesnt seem to disable lsps in other tabs through normal usage (not racing). ie you timeout on one tab, refocus (it'll say Lsp inactive in statusline) then switch to another tab before the start duration, then the lsp is still running.
is the plugin supposed to work as a global stop all lsps, or work per buffer?
Please, make a screenshot of two files and use :LspInfo
command to show which lsps are running and which aren't.
Once again, read troubleshooting doc subsection on nvim-navic
lsp-timeout
doesn't care about current buffer. It keeps track of lsp per every buffer's window and stop/restart them accordingly per the same buffer every time, regardless of the currently focused one.
file a
file b
ah so you have to be really quick on step 5 (switching to file a) it may help to try a startTimeout of 0.4 in case you are not fast enough at switching buffers
Running in single file mode
This is not expected. You have to deal with this problem first. Checkout single_file_support
setting for lspconfig
plugin first. Try also to stop and start LSP clients manually by using LspStart
/ LspStop
to see if lsps are working directory-relative.
Ah okay that's interesting. In the case shown above, lua_ls and json_lsp have no marker to detect the root of the project. This makes sense for neovim configs or some random json file. So running in single file mode is by design
I've read TROUBLESHOOTING instructions
Summary
see lua and vim lsps are attached to the lua file buffer according to statusline
Steps to reproduce
probably some race condition with picking the current buffer after a time delay (after which the user has switched buffers)
Versions
NVIM v0.11.0-dev-302+gbe999e6a0 plugin 6325906730330105a9adc41d0ceb8499b3072e2b
Specify operating system/environment
Windows WSL