Languageclient-neovim: Deoplete integration bug with complexes projects on TypeScript

Created on 16 Jan 2018  Â·  8Comments  Â·  Source: autozimu/LanguageClient-neovim

  • neovim/vim version NVIM v0.2.3-450-g60d6a8b132.3-450-g60d6a8b13
  • Plugin version (git SHA) b4033ed
  • Minimal vimrc
call plug#begin('~/.vim/plugged')
" Syntax typescript
Plug 'leafgarland/typescript-vim', { 'for': ['typescript']}
Plug 'HerringtonDarkholme/yats.vim', { 'for': ['typescript']}
Plug 'autozimu/LanguageClient-neovim', {
    \ 'branch': 'next',
    \ 'do': 'bash install.sh',
    \ }
Plug 'Shougo/deoplete.nvim', { 'do': ':UpdateRemotePlugins' }
call plug#end()
filetype plugin indent on
let g:deoplete#enable_at_startup = 0
autocmd InsertEnter * call deoplete#enable()
let g:LanguageClient_serverCommands = {
    \ 'typescript': ['javascript-typescript-stdio'],
    \ 'javascript': ['javascript-typescript-stdio'],
    \ }
let g:LanguageClient_loggingLevel = 'DEBUG'
set nu
  • Language server name/link and version javascript-typescript-stdio --version: 2.5.5

  • Reproduction steps (from clean state)

    1. Download smallProjectTSForBugReportOnLanguageClient.zip
    2. Unzip previous zip file
    3. npm install
    4. nvim -u ~/minimalVimrc app/server.js app/server.ts
    5. On line 15, type "console." and wait. You could see only a popup menu with « log [M] ». This menu is gathering only by Deoplete.
    6. If you type « l » and wait a long time on a slow computer ( Intel Core i5 M 520 (2.4 GHz, 2010), 8Go Ram) you could see « log f [LC] » gathering by LanguageClient.
    7. Now if you type one time on the backspace key, you could see the LanguageClient completion menu appears.
    8. On more complex projects, we could see than the LanguageClient completion menu and Deoplete completion menu never cooperates. I've seen sometime one appears before the other, or the menu blink…
  • Logs
    LanguageServer.log
    LanguageClient.log

Most helpful comment

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.

All 8 comments

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.

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.

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.

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.

@yymm are you still actively working on this?

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

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
.

Should be resolved by 5cce14326e8a7c317b72a85a5a6064727e401e54.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

fortes picture fortes  Â·  7Comments

Avi-D-coder picture Avi-D-coder  Â·  5Comments

dylan-chong picture dylan-chong  Â·  6Comments

ABitMoreDepth picture ABitMoreDepth  Â·  3Comments

languitar picture languitar  Â·  7Comments