LanguageClient-neovim icon indicating copy to clipboard operation
LanguageClient-neovim copied to clipboard

Error when using haxe language server

Open vushu opened this issue 5 years ago • 4 comments

  • Did you upgrade to latest plugin version? Yes

  • Did you upgrade to/compile latest binary? Run shell command Yes bin/languageclient --version to get its version number. > languageclient 0.1.141

  • (Neovim users only) Did you check output of :checkhealth LanguageClient? Everything looks good, see screenshot Screenshot from 2019-03-08 20-38-31

  • Did you check [troubleshooting]? Yes

Describe the bug

When installing this plugin while using haxe-language-server https://github.com/vshaxe/haxe-language-server I get this following error: [LC] Error: Failure { jsonrpc: Some(V2), error: Error { code: MethodNotFound, message: "Unhandled method textDocument/completion", data: None }, id: Num(3) }

Environment

  • neovim/vim version (nvim --version or vim --version): NVIM v0.3.1
  • This plugin version (git rev-parse --short HEAD): 2b1350c
  • Minimal vimrc content (A minimal vimrc is the smallest vimrc that could reproduce the issue. Refer to an example here):
call plug#begin('~/.local/share/nvim/plugged')

Plug 'autozimu/LanguageClient-neovim', {
    \ 'branch': 'next',
    \ 'do': 'bash install.sh',
    \ }

Plug 'ncm2/ncm2'
Plug 'roxma/nvim-yarp'

call plug#end()

set hidden                                                                                                                                                                                             
augroup autocomplete_triggers                                                                                                                                                                          
     autocmd BufEnter * call ncm2#enable_for_buffer()                                                                                                                                                     
     autocmd TextChangedI * call ncm2#auto_trigger()                                                                                                                                                      
augroup END                                                                                                                                                                                                                                                                                                                                                  
set completeopt=noinsert,menuone,noselect                                                                                                                                                              
set shortmess+=c     
let g:LanguageClient_serverCommands = {
    \ 'haxe': ['node', '~/.vscode/extensions/nadako.vshaxe-2.7.0/server/bin/server.js'],
    \ }

let g:LanguageClient_autoStart = 1
let g:LanguageClient_loadSettings = 1
let g:LanguageClient_loggingFile = '/tmp/lc.log'
let g:LanguageClient_loggingLevel = 'DEBUG'


  • Language server link and version: https://github.com/vshaxe/haxe-language-server/tree/6108ca6e6b6dc099f9cb9343ee830b15a581677b

To Reproduce

Steps to reproduce the behavior:

  • Install vscode
  • ctrl+p ext install haxe language

after installing the haxe language server is build: ~/.vscode/extensions/nadako.vshaxe-2.7.0/server/bin/server.js create a simple Main.hx file:

class Main {
  static public function main(): Void {
    trace("hello world");
  }
}

Start vim using the minimal vimrc open Main.hx Error show up

Current behavior

Displays described error and nothing happens.

Expected behavior

Expect to autocomplete

Screenshots

Screenshot from 2019-03-08 20-34-03

vushu avatar Mar 08 '19 19:03 vushu

I'm getting similar errors using this language server for javascript

https://github.com/theia-ide/typescript-language-server

That exact error appears and then some others depending the codeaction

raaffaaeell avatar Mar 12 '19 22:03 raaffaaeell

Try Coc.nvim with typescript.

vushu avatar Mar 13 '19 08:03 vushu

[LC] Error: Failure { jsonrpc: Some(V2), error: Error { code: MethodNotFound, message: "Unhandled method textDocument/completion", data: None }, id: Num(3) }

I think you should post log file defined by let g:LanguageClient_loggingFile = '/tmp/lc.log', so that we could inspect the lsp traffic to prove that this is LanguageClient-neovim issue or haxe-language-server issue.

roxma avatar Mar 13 '19 09:03 roxma

The haxe-language-server listens to a didChangeConfiguration event at start and needs some initializationOptions

https://github.com/vshaxe/vshaxe/issues/328

vushu avatar Mar 13 '19 09:03 vushu