girishji / vimcomplete

Async autocompletion for Vim.
MIT License
127 stars 6 forks source link

LSP completion only works for most recently opened filetype #77

Closed tommy-hager closed 1 month ago

tommy-hager commented 1 month ago

When working with multiple buffers of different filetypes LSP completion only works for the most recently opened filetype. Currently using yegappan's vim9 LSP, and I found that the LSP's default autocompletions does work between different filetypes, however, with vimcomplete it appears to fall back to path and buffer completion.

The output of :VimCompleteCompletors shows path and buffer for older buffers, path, buffer and LSP for the most recent one. Disabling and then enabling vimcomplete on the older buffers did not seem to change this behavior.

For reference this was discovered/tested with Python, Java and Vimscript using pyright, vim-language-server, and jdtls, but it also appeared to be the case with typescript-language-server and html-language-server.

Edit: Including autocmd BufEnter * LspServer restart in my .vimrc seems to be a temporary solution, although it's likely not a perfect one.

girishji commented 1 month ago

I will look into this.

girishji commented 1 month ago

Sorry for late reply. Please try now.

tommy-hager commented 1 month ago

Works perfectly, thank you!