prabirshrestha / vim-lsp

async language server protocol plugin for vim and neovim
MIT License
3.07k stars 303 forks source link

Fix various bugs when loading many buffers #1511

Closed analizator1 closed 8 months ago

analizator1 commented 8 months ago

I've hit a few bugs when trying to use vim-lsp and https://github.com/vim-ctrlspace/vim-ctrlspace. This happened when starting vim without any file (language server not started yet) and then loading a workspace with many buffers.

prabirshrestha commented 8 months ago

can you have a look at tests. seems like it is failing.

analizator1 commented 8 months ago

Strange - even if I open a job that succeeded and then "View raw logs" I can find a Segmentation fault, and most likely just a subset of tests were executed. Here: https://github.com/prabirshrestha/vim-lsp/actions/runs/6871148469/job/18688368071?pr=1511.

analizator1 commented 8 months ago

Anyway, just updated with master. I'll take a look at the tests later.

analizator1 commented 8 months ago

After the last commit (a789e7173ae20ea851992cb8cc137f23be516193) tests pass, but the problem with 2 instances of clangd is occurring again. How to reproduce:

:CheckHealth shows that everything should be fine:

lsp: health#lsp#check
========================================================================
## server status
  - OK: clangd: running

## server configuration: clangd
  - INFO:
    ### allowlist
    ['c', 'cpp', 'objc', 'objcpp', 'cuda']

## Performance
  - WARNING: Missing requirements to enable lua for faster performance.

I'm also using mattn/vim-lsp-settings plugin so maybe there is an issue with it.

analizator1 commented 8 months ago

I've found a proper workaround to this issue:

that is to avoid using mattn/vim-lsp-settings and instead to register clangd server by lsp#register_server. I have reverted my changes to this function.

analizator1 commented 8 months ago

Could you approve awaiting PR tests? Thanks

prabirshrestha commented 8 months ago

Merged. Thanks.