autozimu / LanguageClient-neovim

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

Deoplete integration bug with complexes projects on TypeScript #281

Closed JulioJu closed 6 years ago

JulioJu commented 6 years ago
kodemeister commented 6 years ago

The same happens for me in the simplest C++ code.

#include <string>

int main()
{
    std::string mystr;
    mystr.
    return 0;
}

If I type mystr. for the first time, deoplete works correctly and shows me all members of std::string. But if I delete a few characters with Backspace and retype them again, deoplete source breaks and I start getting different completions depending on how much characters I deleted with Backspace.

In more complex code deoplete doesn't show completions from the language server at all although the language server returns correct completions according to /tmp/LanguageServer.log.

autozimu commented 6 years ago

There are a few things to clarify.

  1. LanguageClient itself doesn't have completion menu. The menu is managed by deoplete or NCM.
  2. The completion slowness is server issue. Please report on server repo.
  3. For the case getting different results when backspacing and typing, I've no idea what happened. But can you retry the latest version and report back? There are both changes in this repo and deoplete.
  4. When you're typing "console.", ideally it should complete but it's not there yet, as deoplete doesn't support dynamic source customization (here the trigger character .). This should be fixed. At the moment, you could try NCM.
Shougo commented 6 years ago

When you're typing "console.", ideally it should complete but it's not there yet, as deoplete doesn't support dynamic source customization (here the trigger character .). This should be fixed. At the moment, you could try NCM.

dynamic source customization is complex feature. LanguageClient neovim should check filetype based keyword pattern in the source like omni source.

yymm commented 6 years ago

Now I'm investigating this issue (also for #329).

  1. For the case getting different results when backspacing and typing, I've no idea what happened. But can you retry the latest version and report back? There are both changes in this repo and deoplete.

I can't identify the root cause, but I think that improving by moving the list of completion candidates(g:LanguageClient_completeResults) in plugin/LanguageClient.vim to deplete source. I try it now.

  1. When you're typing "console.", ideally it should complete but it's not there yet, as deoplete doesn't support dynamic source customization (here the trigger character .). This should be fixed. At the moment, you could try NCM.

This problem is related to #329.

The reason behind this change is that there isn’t a proper way to customize different keyword to trigger completion in different filetype. The regex works with one filetype would cause problems in a different filetype.

It seems good to prepare input_pattern for each filetype in deoplete source.

autozimu commented 6 years ago

@yymm are you still actively working on this?

yymm commented 6 years ago

Yes, I will get out Pull Request soon, please wait for me.

autozimu commented 6 years ago

Great, thanks.

On Wed, Mar 21, 2018 at 16:59 yymm notifications@github.com wrote:

Yes, I will get out Pull Request soon, please wait for me.

— You are receiving this because you commented.

Reply to this email directly, view it on GitHub https://github.com/autozimu/LanguageClient-neovim/issues/281#issuecomment-375134631, or mute the thread https://github.com/notifications/unsubscribe-auth/ABYt77cwUUYvXDnN2K3sYEdPt29o7CiCks5tgul8gaJpZM4Rfbb3 .

autozimu commented 6 years ago

Should be resolved by 5cce14326e8a7c317b72a85a5a6064727e401e54.