ycm-core / lsp-examples

Use any language server with YouCompleteMe.
https://ycm-core.github.io/YouCompleteMe
Apache License 2.0
82 stars 26 forks source link

Installation failed, vueCompleter Server State: Dead #7

Closed nbossard closed 4 years ago

nbossard commented 5 years ago

Hello tried, to make project work on vue files. I have followed installation process but does not seem to work, here is debug info telling that server is dead

Printing YouCompleteMe debug information...
-- Client logfile: /var/folders/f3/zmf684px0_31cvv2cf463zqr0000gn/T/ycm__u27rimx.log
-- Server Python interpreter: /usr/bin/python
-- Server Python version: 2.7.10
-- Server has Clang support compiled in: False
-- Clang version: None
-- Extra configuration file found and loaded
-- Extra configuration path: /Users/nbossard/OtherProjects/mahali/front/webapp/.ycm_extra_conf.py
-- GenericLSP completer debug information:
--   vueCompleter not running
--   vueCompleter executable: ['/Users/nbossard/.vim/bundle/lsp-examples/vue/node_modules/.bin/vls']
--   vueCompleter logfiles:
--     /var/folders/f3/zmf684px0_31cvv2cf463zqr0000gn/T/vuecompleter_stderr42NXPM.log
**--   vueCompleter Server State: Dead**
--   vueCompleter Project Directory: /Users/nbossard/OtherProjects/mahali/front/webapp
--   vueCompleter Settings: {}
-- Server running at: http://127.0.0.1:49699
-- Server process ID: 60603
-- Server logfiles:
--   /var/folders/f3/zmf684px0_31cvv2cf463zqr0000gn/T/ycmd_49699_stdout_21gu97xr.log
--   /var/folders/f3/zmf684px0_31cvv2cf463zqr0000gn/T/ycmd_49699_stderr_dt97yaf6.log

and here is an extract of log file

33 2019-08-25.15:13:18,448.-.INFO.-.Received.filetype.completion.available.request
  34 2019-08-25.15:13:21,165.-.INFO.-.Received.extra.conf.load.request
  35 2019-08-25.15:13:21,170.-.INFO.-.Received.event.notification
  36 2019-08-25.15:13:21,170.-.INFO.-.Adding.buffer.identifiers.for.file:./Users/nbossard/OtherProjects/mahali/front/webapp/src/views/About.vue
  37 2019-08-25.15:13:21,176.-.INFO.-.Starting.vueCompleter:.[u'/Users/nbossard/.vim/bundle/lsp-examples/vue/node_modules/.bin/vls']
  38 2019-08-25.15:13:21,183.-.INFO.-.vueCompleter.started
  39 2019-08-25.15:13:21,734.-.ERROR.-.The.language.server.communication.channel.closed.unexpectedly..Issue.a.RestartServer.command.to.recover.
  40 Traceback.(most.recent.call.last):
  41 ..File."/Users/nbossard/.vim/bundle/YouCompleteMe/third_party/ycmd/ycmd/completers/language_server/language_server_completer.py",.line.318,.in.run
  42 ....self._ReadMessages()
  43 ..File."/Users/nbossard/.vim/bundle/YouCompleteMe/third_party/ycmd/ycmd/completers/language_server/language_server_completer.py",.line.473,.in._ReadMessages
  44 ....self._DispatchMessage(.lsp.Parse(.content.).)
  45 ..File."/Users/nbossard/.vim/bundle/YouCompleteMe/third_party/ycmd/ycmd/completers/language_server/language_server_completer.py",.line.549,.in._DispatchMessage
  46 ....self._responses[.message_id.].ResponseReceived(.message.)
  47 ..File."/Users/nbossard/.vim/bundle/YouCompleteMe/third_party/ycmd/ycmd/completers/language_server/language_server_completer.py",.line.174,.in.ResponseReceived
  48 ....self._response_callback(.self,.message.)
  49 ..File."/Users/nbossard/.vim/bundle/YouCompleteMe/third_party/ycmd/ycmd/completers/language_server/language_server_completer.py",.line.1564,.in.response_handler
  50 ....self._HandleInitializeInPollThread(.message.)
  51 ..File."/Users/nbossard/.vim/bundle/YouCompleteMe/third_party/ycmd/ycmd/completers/language_server/language_server_completer.py",.line.1587,.in._HandleInitializeInPollThread
  52 ....self._server_capabilities.=.response[.'result'.][.'capabilities'.]
  53 KeyError:.u'result'

and if I start vls by hand I get :

/Users/nbossard/.vim/bundle/lsp-examples/vue/node_modules/.bin/vls -v              SIGINT(2) ↵  3 ⚙  5428  15:50:50
/Users/nbossard/.vim/bundle/lsp-examples/vue/node_modules/vscode-languageserver/lib/main.js:799
        throw new Error("Connection input stream is not set. " + commandLineMessage);
        ^

Error: Connection input stream is not set. Use arguments of createConnection or set command line parameters: '--node-ipc', '--stdio' or '--socket={number}'
    at _createConnection (/Users/nbossard/.vim/bundle/lsp-examples/vue/node_modules/vscode-languageserver/lib/main.js:799:15)
    at Object.createConnection (/Users/nbossard/.vim/bundle/lsp-examples/vue/node_modules/vscode-languageserver/lib/main.js:746:12)
    at Object.<anonymous> (/Users/nbossard/.vim/bundle/lsp-examples/vue/node_modules/vue-language-server/dist/vueServerMain.js:13:145)
    at Module._compile (internal/modules/cjs/loader.js:759:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:770:10)
    at Module.load (internal/modules/cjs/loader.js:628:32)
    at Function.Module._load (internal/modules/cjs/loader.js:555:12)
    at Module.require (internal/modules/cjs/loader.js:666:19)
    at require (internal/modules/cjs/helpers.js:16:16)
    at Object.<anonymous> (/Users/nbossard/.vim/bundle/lsp-examples/vue/node_modules/vue-language-server/bin/vls:2:1)
 ~/OtherProjects/mahali/front/webapp   feature/install_help_other_browsers ✚ ● ? ⍟2    
puremourning commented 5 years ago

Ned the full server log files. Both the ycmd and the vue language server ones.

puremourning commented 5 years ago

I think you’re not passing —stdio argument to vls. Adding that would probably work

nbossard commented 5 years ago

I tried replacing config in .vimrc from

  \   { 'name': 'vue',
  \     'filetypes': [ 'vue' ], 
  \     'cmdline': [ expand( '$HOME/.vim/bundle/lsp-examples/vue/node_modules/.bin/vls' ) ]
  \   },

to

  \   { 'name': 'vue',
  \     'filetypes': [ 'vue' ], 
  \     'cmdline': [ expand( '$HOME/.vim/bundle/lsp-examples/vue/node_modules/.bin/vls' ), '--stdio' ]
  \   },

and got


2019-08-25 16:42:13,155 - INFO - Starting vueCompleter: [u'/Users/nbossard/.vim/bundle/lsp-examples/vue/node_modules/.bin/vls', u'--stdio']
2019-08-25 16:42:13,162 - INFO - vueCompleter started
2019-08-25 16:42:13,990 - ERROR - The language server communication channel closed unexpectedly. Issue a RestartServer command to recover.
Traceback (most recent call last):
  File "/Users/nbossard/.vim/bundle/YouCompleteMe/third_party/ycmd/ycmd/completers/language_server/language_server_completer.py", line 318, in run
    self._ReadMessages()
  File "/Users/nbossard/.vim/bundle/YouCompleteMe/third_party/ycmd/ycmd/completers/language_server/language_server_completer.py", line 473, in _ReadMessages
    self._DispatchMessage( lsp.Parse( content ) )
  File "/Users/nbossard/.vim/bundle/YouCompleteMe/third_party/ycmd/ycmd/completers/language_server/language_server_completer.py", line 549, in _DispatchMessage
    self._responses[ message_id ].ResponseReceived( message )
  File "/Users/nbossard/.vim/bundle/YouCompleteMe/third_party/ycmd/ycmd/completers/language_server/language_server_completer.py", line 174, in ResponseReceived
    self._response_callback( self, message )
  File "/Users/nbossard/.vim/bundle/YouCompleteMe/third_party/ycmd/ycmd/completers/language_server/language_server_completer.py", line 1564, in response_handler
    self._HandleInitializeInPollThread( message )
  File "/Users/nbossard/.vim/bundle/YouCompleteMe/third_party/ycmd/ycmd/completers/language_server/language_server_completer.py", line 1587, in _HandleInitializeInPollThread
    self._server_capabilities = response[ 'result' ][ 'capabilities' ]
KeyError: u'result'
2019-08-25 16:42:24,548 - INFO - Received debug info request
"
nbossard commented 5 years ago

Any idea where I can find vue language server log files?

puremourning commented 5 years ago

YcmDebugInfo

puremourning commented 5 years ago

Sorry YcmToggleLogs

nbossard commented 5 years ago

thanks, but unfortunately vuecompleter_stderrjDN5Co.log is empty :-(

puremourning commented 5 years ago

what happens if you run /path/to/vls --stdio manually (from the directory that you started vim) ?

puremourning commented 5 years ago

wait never mind. Could you please reproduce with "debug" logging on and paste the full ycmd log file? check YCM's CONTRIBUTING.md for how to do that. It looks like the server may be sending a bogus response to the initialise method but without the debug logging it's hard to tell.

nbossard commented 5 years ago

what happens if you run /path/to/vls --stdio manually (from the directory that you started vim) ?

Application just starts and blocks without displaying anything

nbossard commented 5 years ago

wait never mind. Could you please reproduce with "debug" logging on and paste the full ycmd log file? check YCM's CONTRIBUTING.md for how to do that. It looks like the server may be sending a bogus response to the initialise method but without the debug logging it's hard to tell.

Done what you asked, here are interesting logs :

2019-08-26 23:37:34,862 - INFO - Received event notification
2019-08-26 23:37:34,863 - DEBUG - Event name: BufferVisit
2019-08-26 23:37:34,864 - INFO - Received event notification
2019-08-26 23:37:34,865 - DEBUG - Event name: FileReadyToParse
2019-08-26 23:37:34,865 - INFO - Adding buffer identifiers for file: /Users/nbossard/OtherProjects/mahali/front/webapp/src/App.vue
2019-08-26 23:37:34,872 - INFO - Starting vueCompleter: [u'/usr/local/bin/vls', u'--stdio']
2019-08-26 23:37:34,879 - INFO - vueCompleter started
2019-08-26 23:37:34,879 - DEBUG - TX: Sending message: b'Content-Length: 431\r\n\r\n{"id": "1", "jsonrpc": "2.0", "method": "initialize", "params": {"capabilities": {"textDocument": {"completion": {"completionItemKind": {"valueSet": [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25]}}}}, "initializationOptions": {}, "processId": 23433, "rootPath": "/Users/nbossard/OtherProjects/mahali/front/webapp", "rootUri": "file:///Users/nbossard/OtherProjects/mahali/front/webapp"}}'
2019-08-26 23:37:35,270 - INFO - Received filetype completion available request
2019-08-26 23:37:35,934 - DEBUG - RX: Received message: b'{"jsonrpc":"2.0","method":"window/logMessage","params":{"type":4,"message":"Loaded bundled typescript@3.5.3."}}'
2019-08-26 23:37:35,978 - DEBUG - RX: Received message: b'{"jsonrpc":"2.0","id":"1","error":{"code":-32603,"message":"Request initialize failed with message: The \\"path\\" argument must be of type string. Received type undefined"}}'
2019-08-26 23:37:35,978 - ERROR - The language server communication channel closed unexpectedly. Issue a RestartServer command to recover.
Traceback (most recent call last):
  File "/Users/nbossard/.vim/bundle/YouCompleteMe/third_party/ycmd/ycmd/completers/language_server/language_server_completer.py", line 318, in run
    self._ReadMessages()
  File "/Users/nbossard/.vim/bundle/YouCompleteMe/third_party/ycmd/ycmd/completers/language_server/language_server_completer.py", line 473, in _ReadMessages
    self._DispatchMessage( lsp.Parse( content ) )
  File "/Users/nbossard/.vim/bundle/YouCompleteMe/third_party/ycmd/ycmd/completers/language_server/language_server_completer.py", line 549, in _DispatchMessage
    self._responses[ message_id ].ResponseReceived( message )
  File "/Users/nbossard/.vim/bundle/YouCompleteMe/third_party/ycmd/ycmd/completers/language_server/language_server_completer.py", line 174, in ResponseReceived
    self._response_callback( self, message )
  File "/Users/nbossard/.vim/bundle/YouCompleteMe/third_party/ycmd/ycmd/completers/language_server/language_server_completer.py", line 1564, in response_handler
    self._HandleInitializeInPollThread( message )
  File "/Users/nbossard/.vim/bundle/YouCompleteMe/third_party/ycmd/ycmd/completers/language_server/language_server_completer.py", line 1587, in _HandleInitializeInPollThread
    self._server_capabilities = response[ 'result' ][ 'capabilities' ]
KeyError: u'result'
2019-08-26 23:37:44,108 - INFO - Received debug info request
2019-08-26 23:37:53,848 - INFO - Received debug info request
2019-08-26 23:38:24,449 - INFO - Received debug info request
2019-08-26 23:39:08,228 - INFO - Received debug info request
2019-08-26 23:41:22,015 - INFO - Received event notification
2019-08-26 23:41:22,016 - DEBUG - Event name: CurrentIdentifierFinished
2019-08-26 23:41:22,018 - INFO - Received completion request
2019-08-26 23:41:22,018 - DEBUG - Using filetype completion: False
2019-08-26 23:41:23,097 - INFO - Received completion request
2019-08-26 23:41:23,098 - DEBUG - Using filetype completion: False
2019-08-26 23:41:23,299 - INFO - Received completion request
2019-08-26 23:41:23,299 - DEBUG - Using filetype completion: False
2019-08-26 23:41:23,412 - INFO - Received completion request
2019-08-26 23:41:23,413 - DEBUG - Using filetype completion: False
2019-08-26 23:41:23,568 - INFO - Received completion request
2019-08-26 23:41:23,568 - DEBUG - Using filetype completion: False
2019-08-26 23:41:24,756 - INFO - Received event notification
2019-08-26 23:41:24,756 - DEBUG - Event name: CurrentIdentifierFinished
2019-08-26 23:41:24,758 - INFO - Received completion request
2019-08-26 23:41:24,758 - DEBUG - Using filetype completion: False
2019-08-26 23:41:24,764 - INFO - Adding ONE buffer identifier for file: /Users/nbossard/OtherProjects/mahali/front/webapp/src/App.vue
2019-08-26 23:41:28,409 - INFO - Received completion request
2019-08-26 23:41:28,409 - DEBUG - Using filetype completion: False
2019-08-26 23:41:28,640 - INFO - Received event notification
2019-08-26 23:41:28,641 - DEBUG - Event name: CurrentIdentifierFinished
2019-08-26 23:41:31,236 - INFO - Received completion request
2019-08-26 23:41:31,236 - DEBUG - Using filetype completion: False
2019-08-26 23:41:31,340 - INFO - Received completion request
2019-08-26 23:41:31,340 - DEBUG - Using filetype completion: False
2019-08-26 23:41:31,448 - INFO - Received completion request
2019-08-26 23:41:31,448 - DEBUG - Using filetype completion: False
2019-08-26 23:41:31,769 - INFO - Received completion request
2019-08-26 23:41:31,770 - DEBUG - Using filetype completion: False
2019-08-26 23:41:32,929 - INFO - Received event notification
2019-08-26 23:41:32,930 - DEBUG - Event name: CurrentIdentifierFinished
2019-08-26 23:41:32,931 - INFO - Received completion request
2019-08-26 23:41:32,931 - DEBUG - Using filetype completion: False
2019-08-26 23:41:32,937 - INFO - Adding ONE buffer identifier for file: /Users/nbossard/OtherProjects/mahali/front/webapp/src/App.vue
2019-08-26 23:41:35,172 - INFO - Received event notification
2019-08-26 23:41:35,173 - DEBUG - Event name: FileReadyToParse
2019-08-26 23:41:35,173 - INFO - Adding buffer identifiers for file: /Users/nbossard/OtherProjects/mahali/front/webapp/src/App.vue
2019-08-26 23:41:35,174 - INFO - Received event notification
2019-08-26 23:41:35,175 - DEBUG - Event name: InsertLeave
bstaletic commented 5 years ago

2019-08-26 23:37:35,978 - DEBUG - RX: Received message: b'{"jsonrpc":"2.0","id":"1","error":{"code":-32603,"message":"Request initialize failed with message: The \\"path\\" argument must be of type string. Received type undefined"}}'

The \"path\" argument must be of type string. Received type undefined

And it happened on an initialize request. There are two things going on:

The second part is on us. We can fix it fairly easily, but it won't make vue work once again because of the first bullet point.

Since we are not vls developers and there's no log saying "this thing broke", I personally couldn't find where the path thing is coming from. This needs to be reported on vls issue tracker with the following part of the log:

2019-08-26 23:37:34,879 - DEBUG - TX: Sending message: b'Content-Length: 431\r\n\r\n{"id": "1", "jsonrpc": "2.0", "method": "initialize", "params": {"capabilities": {"textDocument": {"completion": {"completionItemKind": {"valueSet": [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25]}}}}, "initializationOptions": {}, "processId": 23433, "rootPath": "/Users/nbossard/OtherProjects/mahali/front/webapp", "rootUri": "file:///Users/nbossard/OtherProjects/mahali/front/webapp"}}'
2019-08-26 23:37:35,978 - DEBUG - RX: Received message: b'{"jsonrpc":"2.0","id":"1","error":{"code":-32603,"message":"Request initialize failed with message: The \\"path\\" argument must be of type string. Received type undefined"}}'

Note: ycmd doesn't send server configuration in the initialize request, but rather follows that request with a didChangeConfiguration notification.

bstaletic commented 4 years ago

According to https://github.com/vuejs/vetur/issues/1426 the fix will be there in the next release.