autozimu / LanguageClient-neovim

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

Error when using haxe language server #761

Open vushu opened 5 years ago

vushu commented 5 years ago

Environment

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'

To Reproduce

Steps to reproduce the behavior:

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

raaffaaeell commented 5 years ago

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

vushu commented 5 years ago

Try Coc.nvim with typescript.

roxma commented 5 years ago

[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.

vushu commented 5 years ago

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

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