autozimu / LanguageClient-neovim

Language Server Protocol (LSP) support for vim and neovim.
MIT License
3.55k stars 273 forks source link

Snippet support autodetection fails in some cases #1028

Open faulesocke opened 4 years ago

faulesocke commented 4 years ago
health#LanguageClient#check
========================================================================
  - OK: binary found: /home/socke/.vim/plugged/LanguageClient-neovim/bin/languageclient
  - OK: languageclient 0.1.157 4b35f5d6859ab3d42546192cbede9add59a7435a
  - OK: Floating window is supported and will be used for hover

Describe the bug

Apparently the snippet support autodetection does not work correctly all the time (I tried with RLS and some other person had problems with go over at ncm2/ncm2-ultisnips#19.

Environment

Features: +acl +iconv +tui See ":help feature-compile"

system vimrc file: "$VIM/sysinit.vim" fall-back for $VIM: "/usr/share/nvim"



- This plugin version (`git rev-parse --short HEAD`):
See above.

- This plugin's binary version (`bin/languageclient --version`):
See above.

- Minimal vimrc content (A minimal vimrc is the smallest vimrc that could
  reproduce the issue. Refer to an example [here][min-vimrc.vim]):
I guess any minimal vimrc will do but the `g:LanguageClientHasSnippetSupport` option must be unset. For example use the vimrc presented here: ncm2/ncm2#19

- Language server link and version:
RLS nightly: `rls 1.41.0 (75491db 2020-04-27)`

[min-vimrc.vim]: https://github.com/autozimu/LanguageClient-neovim/blob/next/min-vimrc.vim

## To Reproduce
Steps to reproduce the behavior:
Use the vimrc that I linked above and try to get some snippets/parameter autocompletion on some rust code. Make sure the option `g:LanguageClientHasSnippetSupport` is not set.

## Current behavior
Does not work, i.e. no snippets seem to arrive at ncm2 and therefore parameter autocompletion does not work.

## Expected behavior
Parameter autocompletion should work.

## Additional context
**WORKAROUND** It only affects the autodetection, if you manually enable snippet support using `let g:LanguageClientHasSnippetSupport = 1` everything works as expected.
faulesocke commented 4 years ago

If you point me to some code locations I can figure out stuff for myself and provide a PR. I guess this would be easiest for all of us.

martskins commented 4 years ago

I would suggest providing a proper minimal vimrc to reproduce the issue, the vimrc you linked does not include ncm2 or ultisnips or anything of the sort, so it's not really sufficient to try and reproduce the issue.

faulesocke commented 4 years ago
* Minimal vimrc content (A minimal vimrc is the smallest vimrc that could
  reproduce the issue. Refer to an example [here](https://github.com/autozimu/LanguageClient-neovim/blob/next/min-vimrc.vim)):
  I guess any minimal vimrc will do but the `g:LanguageClientHasSnippetSupport` option must be unset. For example use the vimrc presented here: [ncm2/ncm2#19](https://github.com/ncm2/ncm2/issues/19)
martskins commented 4 years ago

Hm? I may be missing something but that min vimrc does not include the plugins that you seem to be using to trigger this issue, so it's not really enough.

faulesocke commented 4 years ago

Maybe you clicked on the wrong link? ncm2/ncm2/issues/19

It includes ncm2, ncm2-ultisnips, ultisnips, and LanguageClient-neovim. This should be enough to reproduce my issue with parameter autocompletion.

faulesocke commented 4 years ago

However, you do not need ncm2 to reproduce the issue, you only need it to observe it. There might be other ways to observe it.

martskins commented 4 years ago

Ah yes sorry, I managed to overlook that link while reading :smile: