autozimu / LanguageClient-neovim

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

When connecting to sbt server for Scala files, Language-Server fails when deoplete is turned on. #573

Open spf3000 opened 6 years ago

spf3000 commented 6 years ago

Describe the bug

When connecting to sbt server for Scala files, Language-Server fails when deoplete is turned on.

Environment

Nvim version: NVIM v0.3.0

augroup filetype_scala autocmd! autocmd BufReadPost *.scala setlocal filetype=scala augroup END

" Always draw sign column. Prevent buffer moving when adding/deleting sign. set signcolumn=yes

let g:LanguageClient_serverCommands = { \ 'scala': ['node', expand('/usr/local/bin/sbt-server-stdio.js')] \ } let g:deoplete#enable_at_startup = 1



## To Reproduce
Steps to reproduce the behavior:
0. Create/Fetch example project ... https://github.com/spf3000/huts-api
0. Install sbt 1.0 or later 
1. cd into huts-api directory
1. execute sbt
(In another terminal window)
0. cd into huts-api directory
1. Type some errors
2. :w 

## Current behavior
Errors markings are displayed when opening a file containing errors and typing :w. However when you type a new error there is no error symbol displayed.  This only occurs once I plug in deoplete - it is working fine without it.  I have added some relevant error messages below.
## Expected behavior
Error symbols should be displayed when you type an error and then write the file.

##ERROR MESSAGE:
14:22:12 ERROR main src/vim.rs:59 Error handling message: timed out waiting on channel                                                                                              

  Message: {"jsonrpc":"2.0","method":"languageClient/omniComplete","params":{"buftype":"","character":3,"filename":"/home/atlantic-development-operations/dev/projects/XmlConverter/sr
  c/main/scala/com/elsevier/entellect/xml-transform-api/XmlRecurse.scala","handle":false,"languageId":"scala","line":20},"id":1}                                                      

  Error: Timeout      
autozimu commented 6 years ago

Please try increase the timeout setting https://github.com/autozimu/LanguageClient-neovim/blob/5e968547dea733a25de74c1f9babd9e77459598a/doc/LanguageClient.txt#L261-L267

spf3000 commented 6 years ago

@autozimu I set it to 30 - still same problem - timeout. I got it working by switching to ncm2 instead of deoplete - even if I don't understand what the issue was still. I know sbt-server is not going to give you completions - so perhaps there is an issue with using a server without completions when paired with deoplete?

autozimu commented 6 years ago

Seems like because language server doesn't support completion and doesn't respond timely, language client keeps waiting until timing out, which blocks processing other messages.