autozimu / LanguageClient-neovim

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

Language server exited unexpectedly #259

Closed piouPiouM closed 6 years ago

piouPiouM commented 6 years ago

When I edit a simple PHP (<?php echo 'Hello World!';) or JS file (document.getElementById('test-table'); ) the following error occurs:

"test.php" 1L, 26C
Language server (php) exited unexpectedly!^@^@language server stderr:
Language server (php) exited unexpectedly!^@^@language server stderr:
Language server (php) exited unexpectedly!^@^@language server stderr:
Language server (php) exited unexpectedly!^@^@language server stderr:

or

"test.js" 1L, 39C
Language server (javascript.jsx) exited unexpectedly!^@^@language server stderr:
Language server is not running for: javascript
Language server is not running for: javascript
Language server (javascript) exited unexpectedly!^@^@language server stderr:
Language server is not running for: javascript
Language server is not running for: javascript
Language server is not running for: javascript.jsx
Language server is not running for: javascript.jsx
Language server is not running for: javascript.jsx
Language server is not running for: javascript.jsx

Notes:


Tested with the following minimal vimrc:

call plug#begin('~/.local/share/nvim/bundle')

Plug 'autozimu/LanguageClient-neovim', { 'branch': 'next', 'do': './install.sh' }
Plug 'roxma/LanguageServer-php-neovim',  {
      \ 'do': 'composer install && composer run-script parse-stubs'
      \ }

call plug#end()

let g:LanguageClient_serverCommands = {
      \ 'javascript':     ['javascript-typescript-stdio', '--logfile', '/tmp/javascript-typescript-stdio']
      \ }
autozimu commented 6 years ago

At least for the javascript case, it is more likely to be a language server issue.

If I put the js file in /tmp, like the experiment you did, got error in /tmp/LanguageServer.log,

/usr/local/lib/node_modules/javascript-typescript-langserver/lib/util.js:46
    const pathParts = parts.pathname.split('/').map(segment => encodeURIComponent(decodeURIComponent(segment)));
                                                                                  ^

URIError: URI malformed
    at decodeURIComponent (<anonymous>)
    at parts.pathname.split.map.segment (/usr/local/lib/node_modules/javascript-typescript-langserver/lib/util.js:46:83)
    at Array.map (<anonymous>)
    at Object.normalizeUri (/usr/local/lib/node_modules/javascript-typescript-langserver/lib/util.js:46:49)
    at Glob.globber.on (/usr/local/lib/node_modules/javascript-typescript-langserver/lib/fs.js:62:40)
    at Glob.emit (events.js:159:13)
    at Glob._emitMatch (/usr/local/lib/node_modules/javascript-typescript-langserver/node_modules/glob/glob.js:489:8)
    at Glob._processSimple2 (/usr/local/lib/node_modules/javascript-typescript-langserver/node_modules/glob/glob.js:705:8)
    at /usr/local/lib/node_modules/javascript-typescript-langserver/node_modules/glob/glob.js:676:10
    at Glob._stat2 (/usr/local/lib/node_modules/javascript-typescript-langserver/node_modules/glob/glob.js:789:10)

But if I create another folder inside home dir, say sample-js and copy the same file into it, then everything works properly.

I'm guessing the issue might be related to pericularity of the macOS /tmp folder, but not sure what it is yet.

autozimu commented 6 years ago

The offending uri is file:///private/tmp/nvim/%Users%ljunf%.cargo%config, which is not send by languageclient but read directly by javascript-typescript-langserver.

autozimu commented 6 years ago

Language server issue. Tracking in https://github.com/sourcegraph/javascript-typescript-langserver/issues/422

Herz3h commented 6 years ago

I have the same issue on NVIM 0.2.2, python3 is installed and using LanguageServer-php-neovim. When I open a php file it says :

Language server (php) exited unexpectedly!^@^@language server stderr:

laomafeima commented 6 years ago

I have the same issue, OS: macOS High Sierra 10.13.2 Vim version: VIM - Vi IMproved 8.0 (2016 Sep 12, compiled Jan 14 2018 11:28:58)

and i use LanguageServer-php-neovim too.

autozimu commented 6 years ago

Guys, for the JavaScript case, it's definitely a language server issue and has been tracked on language server side.

If you're sure this is also the case for php language server, file a issue on their side, there is no point commenting here. If you believe this is a language client issue, follow the issue template to file new issue.

Herz3h commented 6 years ago

The thing is I have no idea wether this is a server or client issue, how would I know ? The error occurs for me in PHP files, so it could be either one.

autozimu commented 6 years ago

Did you read my first comment this thread? Can you at least try follow the steps?

geekjam commented 6 years ago

Absolutely cannot work in windows for php, whether it is Vim8 or Neovim.

When I open a php file it says :

Language server (php) exited unexpectedly!^@^@language server stderr:

cvlmtg commented 6 years ago

@autozimu I had the same problem (macOS with the javascript language server) with the latest neovim compiled from HEAD, but if I switch back to neovim 0.2.2 the error no longer happens, so I'd say the error is not in the language server but probably in neovim. The config is the same, the plugins are the same, the javascript files are the same... I can get the error by just installing neovim from HEAD instead of 0.2.2

this is what is written in the logs:

LanguageClient.log

2018-02-26T20:59:57.887943+01:00 ERROR languageclient::languageclient - RPC-javascript thread error: Language server (javascript) exited unexpectedly!

language server stderr:

2018-02-26T20:59:57.895308+01:00 WARN languageclient::languageclient - Language server is not running for: javascript
2018-02-26T20:59:57.910337+01:00 WARN languageclient::languageclient - Language server is not running for: javascript
2018-02-26T21:00:19.725579+01:00 ERROR languageclient::languageclient - RPC-javascript thread error: failed to fill whole buffer

LanguageServer.log

ERROR Stream was closed without shutdown notification