Skip to content
This repository has been archived by the owner on Jul 31, 2023. It is now read-only.

Language server crashes on startup #533

Closed
AlexVPopov opened this issue Sep 17, 2019 · 24 comments
Closed

Language server crashes on startup #533

AlexVPopov opened this issue Sep 17, 2019 · 24 comments
Assignees

Comments

@AlexVPopov
Copy link

Your environment

  • vscode-ruby version: 0.25.3
  • Ruby version: 2.6.0
  • Ruby version manager (if any): rbenv
  • VS Code version: 1.38.1
  • Operating System: macOS 10.14.6
  • Using language server? (eg useLanguageServer is true?)
{
  "ruby.codeCompletion": "rcodetools",
  "ruby.intellisense": "rubyLocate",
  "ruby.lint": {
    "rubocop": true
  },
  "ruby.useBundler": true,
  "ruby.useLanguageServer": true,
  "ruby.format": "rubocop",
  "[ruby]": {
    "editor.defaultFormatter": "misogi.ruby-rubocop"
  }
}

With all extentions disabled and only vscode-ruby enabled, when I open VS Code:

Expected behavior

I expect the language server to start.

Actual behavior

The language server crashes 3 times:

[Info  - 17:43:16] Initializing Ruby language server...
Loading Ruby tree-sitter syntax from /Users/xxxxxxxxxxxxxxxx/.vscode/extensions/rebornix.ruby-0.25.3/dist/server/tree-sitter-ruby.wasm
/Users/xxxxxxxxxxxxxxxx/.vscode/extensions/rebornix.ruby-0.25.3/dist/server/index.js:16
var r=function(t,e){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)};function i(t,e){function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}},function(t,e,n){"use strict";n.d(e,"a",function(){return l});var r=n(0),i=n(25),o=n(57),s=n(5),u=n(41),a=n(14),c=n(35),l=function(t){function e(n,r,i){var s=t.call(this)||this;switch(s.syncErrorValue=null,s.syncErrorThrown=!1,s.syncErrorThrowable=!1,s.isStopped=!1,arguments.length){case 0:s.destination=o.a;break;case 1:if(!n){s.destination=o.a;break}if("object"==typeof n){n instanceof e?(s.syncErrorThrowable=n.syncErrorThrowable,s.destination=n,n.add(s)):(s.syncErrorThrowable=!0,s.destination=new f(s,n));break}default:s.syncErrorThrowable=!0,s.destination=new f(s,n,r,i)}return s}return r.a(e,t),e.prototype[u.a]=funct

Error: [UriError]: Scheme is missing: {scheme: "", authority: "", path: "undefined", query: "", fragment: ""}
    at /Users/xxxxxxxxxxxxxxxx/.vscode/extensions/rebornix.ruby-0.25.3/dist/server/index.js:16:130279
    at e.t (/Users/xxxxxxxxxxxxxxxx/.vscode/extensions/rebornix.ruby-0.25.3/dist/server/index.js:16:130899)
    at new e (/Users/xxxxxxxxxxxxxxxx/.vscode/extensions/rebornix.ruby-0.25.3/dist/server/index.js:16:132561)
    at Function.t.parse (/Users/xxxxxxxxxxxxxxxx/.vscode/extensions/rebornix.ruby-0.25.3/dist/server/index.js:16:131794)
    at /Users/xxxxxxxxxxxxxxxx/.vscode/extensions/rebornix.ruby-0.25.3/dist/server/index.js:16:285178
    at Object.keys.map.r (/Users/xxxxxxxxxxxxxxxx/.vscode/extensions/rebornix.ruby-0.25.3/dist/server/index.js:16:285225)
    at Array.map (<anonymous>)
    at e.o.from.pipe.s.mergeMap [as project] (/Users/xxxxxxxxxxxxxxxx/.vscode/extensions/rebornix.ruby-0.25.3/dist/server/index.js:16:285012)
    at e._tryNext (/Users/xxxxxxxxxxxxxxxx/.vscode/extensions/rebornix.ruby-0.25.3/dist/server/index.js:16:30596)
    at e._next (/Users/xxxxxxxxxxxxxxxx/.vscode/extensions/rebornix.ruby-0.25.3/dist/server/index.js:16:30498)
[Info  - 17:43:16] Connection to server got closed. Server will restart.

This and the next section should include screenshots, code samples, console output, etc. The more information we have to reproduce the better!

@wingrunr21
Copy link
Collaborator

Does this happen to be a remote environment?

@AlexVPopov
Copy link
Author

Hello,

Thank you very much for the quick reply and your support. No, this happens on my local machine, however I am connected to a VPN network. After disconnecting from the VPN, the problem doesn't happen anymore. Could you share what seems to cause this problem?

@wingrunr21
Copy link
Collaborator

wingrunr21 commented Sep 17, 2019

I'm not sure. I've seen similar errors happen when users are using VSCode's remote environment support. I'm currently working on extension updates to support that.

When you connect to your VPN, do you route all traffic (including DNS) through the VPN? Also, is this a corporate VPN or a public one?

@AlexVPopov
Copy link
Author

It is a corporate VPN. I'm note sure about the DNS, but I suppose so. Thank you very much for your quick help!

@wingrunr21
Copy link
Collaborator

Hi,

Thanks. I'm going to reopen the issue so that I remember to check on it while I do the work for the remote environment.

Thanks!

@wingrunr21 wingrunr21 reopened this Sep 17, 2019
@wingrunr21 wingrunr21 self-assigned this Sep 17, 2019
@AlexVPopov
Copy link
Author

It's good, that you reopened this issue, because the problem also happens when I'm not connected to the VPN :(

@wingrunr21
Copy link
Collaborator

What's the name of the file you are opening?

@AlexVPopov
Copy link
Author

Nope, my bad, I was still having a running process, which had a port forwarded. After killing the process and restarting, the Language server started normally.

@aurelien-reeves
Copy link

aurelien-reeves commented Oct 8, 2019

Hi,

I encounter that same issue but I do not have specific network configuration.

Our company has a VPN but it is at the level of our router. Nothing is installed or configured on my computer.

There is no forwarded port, or anything.

Loading Ruby tree-sitter syntax from /home/aurelien/.vscode/extensions/rebornix.ruby-0.25.3/dist/server/tree-sitter-ruby.wasm
/home/aurelien/.vscode/extensions/rebornix.ruby-0.25.3/dist/server/index.js:16
var r=function(t,e){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)};function i(t,e){function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}},function(t,e,n){"use strict";n.d(e,"a",function(){return l});var r=n(0),i=n(25),o=n(57),s=n(5),u=n(41),a=n(14),c=n(35),l=function(t){function e(n,r,i){var s=t.call(this)||this;switch(s.syncErrorValue=null,s.syncErrorThrown=!1,s.syncErrorThrowable=!1,s.isStopped=!1,arguments.length){case 0:s.destination=o.a;break;case 1:if(!n){s.destination=o.a;break}if("object"==typeof n){n instanceof e?(s.syncErrorThrowable=n.syncErrorThrowable,s.destination=n,n.add(s)):(s.syncErrorThrowable=!0,s.destination=new f(s,n));break}default:s.syncErrorThrowable=!0,s.destination=new f(s,n,r,i)}return s}return r.a(e,t),e.prototype[u.a]=function(){re

Error: [UriError]: Scheme is missing: {scheme: "", authority: "", path: "undefined", query: "", fragment: ""}
    at /home/aurelien/.vscode/extensions/rebornix.ruby-0.25.3/dist/server/index.js:16:130279
    at e.t (/home/aurelien/.vscode/extensions/rebornix.ruby-0.25.3/dist/server/index.js:16:130899)
    at new e (/home/aurelien/.vscode/extensions/rebornix.ruby-0.25.3/dist/server/index.js:16:132561)
    at Function.t.parse (/home/aurelien/.vscode/extensions/rebornix.ruby-0.25.3/dist/server/index.js:16:131794)
    at /home/aurelien/.vscode/extensions/rebornix.ruby-0.25.3/dist/server/index.js:16:285178
    at Object.keys.map.r (/home/aurelien/.vscode/extensions/rebornix.ruby-0.25.3/dist/server/index.js:16:285225)
    at Array.map (<anonymous>)
    at e.o.from.pipe.s.mergeMap [as project] (/home/aurelien/.vscode/extensions/rebornix.ruby-0.25.3/dist/server/index.js:16:285012)
    at e._tryNext (/home/aurelien/.vscode/extensions/rebornix.ruby-0.25.3/dist/server/index.js:16:30596)
    at e._next (/home/aurelien/.vscode/extensions/rebornix.ruby-0.25.3/dist/server/index.js:16:30498)
[Error - 09:03:15] Connection to server got closed. Server will not be restarted.

@dARKaRK
Copy link

dARKaRK commented Oct 11, 2019

I'm facing the same issue but I don't think my org uses VPN.
Our gateway is filtered through Fortiguard though. So, don't know if that can also cause this issue.

Loading Ruby tree-sitter syntax from /home/ashutosh/.vscode/extensions/rebornix.ruby-0.25.3/dist/server/tree-sitter-ruby.wasm
/home/ashutosh/.vscode/extensions/rebornix.ruby-0.25.3/dist/server/index.js:16
var r=function(t,e){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)};function i(t,e){function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}},function(t,e,n){"use strict";n.d(e,"a",function(){return l});var r=n(0),i=n(25),o=n(57),s=n(5),u=n(41),a=n(14),c=n(35),l=function(t){function e(n,r,i){var s=t.call(this)||this;switch(s.syncErrorValue=null,s.syncErrorThrown=!1,s.syncErrorThrowable=!1,s.isStopped=!1,arguments.length){case 0:s.destination=o.a;break;case 1:if(!n){s.destination=o.a;break}if("object"==typeof n){n instanceof e?(s.syncErrorThrowable=n.syncErrorThrowable,s.destination=n,n.add(s)):(s.syncErrorThrowable=!0,s.destination=new f(s,n));break}default:s.syncErrorThrowable=!0,s.destination=new f(s,n,r,i)}return s}return r.a(e,t),e.prototype[u.a]=function(){re

Error: [UriError]: Scheme is missing: {scheme: "", authority: "", path: "undefined", query: "", fragment: ""}
    at /home/ashutosh/.vscode/extensions/rebornix.ruby-0.25.3/dist/server/index.js:16:130279
    at e.t (/home/ashutosh/.vscode/extensions/rebornix.ruby-0.25.3/dist/server/index.js:16:130899)
    at new e (/home/ashutosh/.vscode/extensions/rebornix.ruby-0.25.3/dist/server/index.js:16:132561)
    at Function.t.parse (/home/ashutosh/.vscode/extensions/rebornix.ruby-0.25.3/dist/server/index.js:16:131794)
    at /home/ashutosh/.vscode/extensions/rebornix.ruby-0.25.3/dist/server/index.js:16:285178
    at Object.keys.map.r (/home/ashutosh/.vscode/extensions/rebornix.ruby-0.25.3/dist/server/index.js:16:285225)
    at Array.map (<anonymous>)
    at e.o.from.pipe.s.mergeMap [as project] (/home/ashutosh/.vscode/extensions/rebornix.ruby-0.25.3/dist/server/index.js:16:285012)
    at e._tryNext (/home/ashutosh/.vscode/extensions/rebornix.ruby-0.25.3/dist/server/index.js:16:30596)
    at e._next (/home/ashutosh/.vscode/extensions/rebornix.ruby-0.25.3/dist/server/index.js:16:30498)
[Error - 3:24:48 PM] Connection to server got closed. Server will not be restarted.```

@jcw-
Copy link

jcw- commented Oct 31, 2019

I can reproduce this (no VPN) in two steps:

  1. Open a new tab
  2. Click at bottom right to set language to Ruby

I'm guessing it's related to the file being unsaved? Once I do this, re-opening VS Code causes the problem on start-up (presumably because VS Code restores the unsaved Ruby tab).

  "ruby.lint": {
    "rubocop": true,
  },
  "ruby.specCommand": "spring rspec",
  "ruby.useLanguageServer": true,
  "ruby.intellisense": "rubyLocate",
  "ruby.format": "rubocop",
  "ruby.codeCompletion": "rcodetools",
Error: [UriError]: Scheme is missing: {scheme: "", authority: "", path: "undefined", query: "", fragment: ""}
[Info  - 2:14:45 AM] Initializing Ruby language server...
Loading Ruby tree-sitter syntax from /Users/jcw/.vscode/extensions/rebornix.ruby-0.25.3/dist/server/tree-sitter-ruby.wasm
/Users/jcw/.vscode/extensions/rebornix.ruby-0.25.3/dist/server/index.js:16
var r=function(t,e){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)};function i(t,e){function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}},function(t,e,n){"use strict";n.d(e,"a",function(){return l});var r=n(0),i=n(25),o=n(57),s=n(5),u=n(41),a=n(14),c=n(35),l=function(t){function e(n,r,i){var s=t.call(this)||this;switch(s.syncErrorValue=null,s.syncErrorThrown=!1,s.syncErrorThrowable=!1,s.isStopped=!1,arguments.length){case 0:s.destination=o.a;break;case 1:if(!n){s.destination=o.a;break}if("object"==typeof n){n instanceof e?(s.syncErrorThrowable=n.syncErrorThrowable,s.destination=n,n.add(s)):(s.syncErrorThrowable=!0,s.destination=new f(s,n));break}default:s.syncErrorThrowable=!0,s.destination=new f(s,n,r,i)}return s}return r.a(e,t),e.prototype[u.a]=function(){return

Error: [UriError]: Scheme is missing: {scheme: "", authority: "", path: "undefined", query: "", fragment: ""}
    at /Users/jcw/.vscode/extensions/rebornix.ruby-0.25.3/dist/server/index.js:16:130279
    at e.t (/Users/jcw/.vscode/extensions/rebornix.ruby-0.25.3/dist/server/index.js:16:130899)
    at new e (/Users/jcw/.vscode/extensions/rebornix.ruby-0.25.3/dist/server/index.js:16:132561)
    at Function.t.parse (/Users/jcw/.vscode/extensions/rebornix.ruby-0.25.3/dist/server/index.js:16:131794)
    at /Users/jcw/.vscode/extensions/rebornix.ruby-0.25.3/dist/server/index.js:16:285178
    at Object.keys.map.r (/Users/jcw/.vscode/extensions/rebornix.ruby-0.25.3/dist/server/index.js:16:285225)
    at Array.map (<anonymous>)
    at e.o.from.pipe.s.mergeMap [as project] (/Users/jcw/.vscode/extensions/rebornix.ruby-0.25.3/dist/server/index.js:16:285012)
    at e._tryNext (/Users/jcw/.vscode/extensions/rebornix.ruby-0.25.3/dist/server/index.js:16:30596)
    at e._next (/Users/jcw/.vscode/extensions/rebornix.ruby-0.25.3/dist/server/index.js:16:30498)
[Info  - 8:03:51 AM] Connection to server got closed. Server will restart.
[Info  - 8:03:52 AM] Initializing Ruby language server...
Loading Ruby tree-sitter syntax from /Users/jcw/.vscode/extensions/rebornix.ruby-0.25.3/dist/server/tree-sitter-ruby.wasm
/Users/jcw/.vscode/extensions/rebornix.ruby-0.25.3/dist/server/index.js:16
var r=function(t,e){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)};function i(t,e){function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}},function(t,e,n){"use strict";n.d(e,"a",function(){return l});var r=n(0),i=n(25),o=n(57),s=n(5),u=n(41),a=n(14),c=n(35),l=function(t){function e(n,r,i){var s=t.call(this)||this;switch(s.syncErrorValue=null,s.syncErrorThrown=!1,s.syncErrorThrowable=!1,s.isStopped=!1,arguments.length){case 0:s.destination=o.a;break;case 1:if(!n){s.destination=o.a;break}if("object"==typeof n){n instanceof e?(s.syncErrorThrowable=n.syncErrorThrowable,s.destination=n,n.add(s)):(s.syncErrorThrowable=!0,s.destination=new f(s,n));break}default:s.syncErrorThrowable=!0,s.destination=new f(s,n,r,i)}return s}return r.a(e,t),e.prototype[u.a]=function(){return

Error: [UriError]: Scheme is missing: {scheme: "", authority: "", path: "undefined", query: "", fragment: ""}
    at /Users/jcw/.vscode/extensions/rebornix.ruby-0.25.3/dist/server/index.js:16:130279
    at e.t (/Users/jcw/.vscode/extensions/rebornix.ruby-0.25.3/dist/server/index.js:16:130899)
    at new e (/Users/jcw/.vscode/extensions/rebornix.ruby-0.25.3/dist/server/index.js:16:132561)
    at Function.t.parse (/Users/jcw/.vscode/extensions/rebornix.ruby-0.25.3/dist/server/index.js:16:131794)
    at /Users/jcw/.vscode/extensions/rebornix.ruby-0.25.3/dist/server/index.js:16:285178
    at Object.keys.map.r (/Users/jcw/.vscode/extensions/rebornix.ruby-0.25.3/dist/server/index.js:16:285225)
    at Array.map (<anonymous>)
    at e.o.from.pipe.s.mergeMap [as project] (/Users/jcw/.vscode/extensions/rebornix.ruby-0.25.3/dist/server/index.js:16:285012)
    at e._tryNext (/Users/jcw/.vscode/extensions/rebornix.ruby-0.25.3/dist/server/index.js:16:30596)
    at e._next (/Users/jcw/.vscode/extensions/rebornix.ruby-0.25.3/dist/server/index.js:16:30498)
[Info  - 8:03:52 AM] Connection to server got closed. Server will restart.
[Info  - 8:03:52 AM] Initializing Ruby language server...
Loading Ruby tree-sitter syntax from /Users/jcw/.vscode/extensions/rebornix.ruby-0.25.3/dist/server/tree-sitter-ruby.wasm
/Users/jcw/.vscode/extensions/rebornix.ruby-0.25.3/dist/server/index.js:16
var r=function(t,e){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)};function i(t,e){function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}},function(t,e,n){"use strict";n.d(e,"a",function(){return l});var r=n(0),i=n(25),o=n(57),s=n(5),u=n(41),a=n(14),c=n(35),l=function(t){function e(n,r,i){var s=t.call(this)||this;switch(s.syncErrorValue=null,s.syncErrorThrown=!1,s.syncErrorThrowable=!1,s.isStopped=!1,arguments.length){case 0:s.destination=o.a;break;case 1:if(!n){s.destination=o.a;break}if("object"==typeof n){n instanceof e?(s.syncErrorThrowable=n.syncErrorThrowable,s.destination=n,n.add(s)):(s.syncErrorThrowable=!0,s.destination=new f(s,n));break}default:s.syncErrorThrowable=!0,s.destination=new f(s,n,r,i)}return s}return r.a(e,t),e.prototype[u.a]=function(){return

Error: [UriError]: Scheme is missing: {scheme: "", authority: "", path: "undefined", query: "", fragment: ""}
    at /Users/jcw/.vscode/extensions/rebornix.ruby-0.25.3/dist/server/index.js:16:130279
    at e.t (/Users/jcw/.vscode/extensions/rebornix.ruby-0.25.3/dist/server/index.js:16:130899)
    at new e (/Users/jcw/.vscode/extensions/rebornix.ruby-0.25.3/dist/server/index.js:16:132561)
    at Function.t.parse (/Users/jcw/.vscode/extensions/rebornix.ruby-0.25.3/dist/server/index.js:16:131794)
    at /Users/jcw/.vscode/extensions/rebornix.ruby-0.25.3/dist/server/index.js:16:285178
    at Object.keys.map.r (/Users/jcw/.vscode/extensions/rebornix.ruby-0.25.3/dist/server/index.js:16:285225)
    at Array.map (<anonymous>)
    at e.o.from.pipe.s.mergeMap [as project] (/Users/jcw/.vscode/extensions/rebornix.ruby-0.25.3/dist/server/index.js:16:285012)
    at e._tryNext (/Users/jcw/.vscode/extensions/rebornix.ruby-0.25.3/dist/server/index.js:16:30596)
    at e._next (/Users/jcw/.vscode/extensions/rebornix.ruby-0.25.3/dist/server/index.js:16:30498)
[Info  - 8:03:52 AM] Connection to server got closed. Server will restart.
[Info  - 8:03:53 AM] Initializing Ruby language server...
Loading Ruby tree-sitter syntax from /Users/jcw/.vscode/extensions/rebornix.ruby-0.25.3/dist/server/tree-sitter-ruby.wasm
/Users/jcw/.vscode/extensions/rebornix.ruby-0.25.3/dist/server/index.js:16
var r=function(t,e){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)};function i(t,e){function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}},function(t,e,n){"use strict";n.d(e,"a",function(){return l});var r=n(0),i=n(25),o=n(57),s=n(5),u=n(41),a=n(14),c=n(35),l=function(t){function e(n,r,i){var s=t.call(this)||this;switch(s.syncErrorValue=null,s.syncErrorThrown=!1,s.syncErrorThrowable=!1,s.isStopped=!1,arguments.length){case 0:s.destination=o.a;break;case 1:if(!n){s.destination=o.a;break}if("object"==typeof n){n instanceof e?(s.syncErrorThrowable=n.syncErrorThrowable,s.destination=n,n.add(s)):(s.syncErrorThrowable=!0,s.destination=new f(s,n));break}default:s.syncErrorThrowable=!0,s.destination=new f(s,n,r,i)}return s}return r.a(e,t),e.prototype[u.a]=function(){return

Error: [UriError]: Scheme is missing: {scheme: "", authority: "", path: "undefined", query: "", fragment: ""}
    at /Users/jcw/.vscode/extensions/rebornix.ruby-0.25.3/dist/server/index.js:16:130279
    at e.t (/Users/jcw/.vscode/extensions/rebornix.ruby-0.25.3/dist/server/index.js:16:130899)
    at new e (/Users/jcw/.vscode/extensions/rebornix.ruby-0.25.3/dist/server/index.js:16:132561)
    at Function.t.parse (/Users/jcw/.vscode/extensions/rebornix.ruby-0.25.3/dist/server/index.js:16:131794)
    at /Users/jcw/.vscode/extensions/rebornix.ruby-0.25.3/dist/server/index.js:16:285178
    at Object.keys.map.r (/Users/jcw/.vscode/extensions/rebornix.ruby-0.25.3/dist/server/index.js:16:285225)
    at Array.map (<anonymous>)
    at e.o.from.pipe.s.mergeMap [as project] (/Users/jcw/.vscode/extensions/rebornix.ruby-0.25.3/dist/server/index.js:16:285012)
    at e._tryNext (/Users/jcw/.vscode/extensions/rebornix.ruby-0.25.3/dist/server/index.js:16:30596)
    at e._next (/Users/jcw/.vscode/extensions/rebornix.ruby-0.25.3/dist/server/index.js:16:30498)
[Info  - 8:03:53 AM] Connection to server got closed. Server will restart.
[Info  - 8:03:53 AM] Initializing Ruby language server...
Loading Ruby tree-sitter syntax from /Users/jcw/.vscode/extensions/rebornix.ruby-0.25.3/dist/server/tree-sitter-ruby.wasm
/Users/jcw/.vscode/extensions/rebornix.ruby-0.25.3/dist/server/index.js:16
var r=function(t,e){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)};function i(t,e){function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}},function(t,e,n){"use strict";n.d(e,"a",function(){return l});var r=n(0),i=n(25),o=n(57),s=n(5),u=n(41),a=n(14),c=n(35),l=function(t){function e(n,r,i){var s=t.call(this)||this;switch(s.syncErrorValue=null,s.syncErrorThrown=!1,s.syncErrorThrowable=!1,s.isStopped=!1,arguments.length){case 0:s.destination=o.a;break;case 1:if(!n){s.destination=o.a;break}if("object"==typeof n){n instanceof e?(s.syncErrorThrowable=n.syncErrorThrowable,s.destination=n,n.add(s)):(s.syncErrorThrowable=!0,s.destination=new f(s,n));break}default:s.syncErrorThrowable=!0,s.destination=new f(s,n,r,i)}return s}return r.a(e,t),e.prototype[u.a]=function(){return

Error: [UriError]: Scheme is missing: {scheme: "", authority: "", path: "undefined", query: "", fragment: ""}
    at /Users/jcw/.vscode/extensions/rebornix.ruby-0.25.3/dist/server/index.js:16:130279
    at e.t (/Users/jcw/.vscode/extensions/rebornix.ruby-0.25.3/dist/server/index.js:16:130899)
    at new e (/Users/jcw/.vscode/extensions/rebornix.ruby-0.25.3/dist/server/index.js:16:132561)
    at Function.t.parse (/Users/jcw/.vscode/extensions/rebornix.ruby-0.25.3/dist/server/index.js:16:131794)
    at /Users/jcw/.vscode/extensions/rebornix.ruby-0.25.3/dist/server/index.js:16:285178
    at Object.keys.map.r (/Users/jcw/.vscode/extensions/rebornix.ruby-0.25.3/dist/server/index.js:16:285225)
    at Array.map (<anonymous>)
    at e.o.from.pipe.s.mergeMap [as project] (/Users/jcw/.vscode/extensions/rebornix.ruby-0.25.3/dist/server/index.js:16:285012)
    at e._tryNext (/Users/jcw/.vscode/extensions/rebornix.ruby-0.25.3/dist/server/index.js:16:30596)
    at e._next (/Users/jcw/.vscode/extensions/rebornix.ruby-0.25.3/dist/server/index.js:16:30498)
[Error - 8:03:53 AM] Connection to server got closed. Server will not be restarted.

@AntonTrapp
Copy link

Same here. No VPN, same error. As we have multiple people - should we try to find similarities? Installed extensions, asdf, rvm, rbenv, ...?

@e1senh0rn
Copy link

e1senh0rn commented Nov 20, 2019

Seems like "new file" is causing it.
Steps to reproduce that work for me:

  1. Open VSCode.
  2. Open ruby file (extension starts, so far so good)
  3. From command palette:
    3.1 File: New Untitled File
    3.2 Change Language Mode -> Ruby.

This results language server to crash multiple times, and then stop restarting.

Because language server is stopped, checks are not performed on existing ruby files anymore.

PS: vscode-ruby version: 0.26.0, but I think I saw it in 0.25.3 too.

@wingrunr21
Copy link
Collaborator

Thanks @jcw- and @e1senh0rn, that gave me reproduction steps. I think I know where this is happening

@wingrunr21
Copy link
Collaborator

Ok here's what's happening:

The language server is attempting to get the configuration from VSCode for the new file's workspace. But, this file doesn't exist anywhere except in VSCode's memory. VSCode is falling back to just returning the global configuration for the ruby extension. All this is good so far.

The problem manifests if that global configuration specifies linter or format settings. Those tools need to have a working directory in order to execute so that they can pick up artifacts like rubocop.yml during the execution. But, that new file is not assigned to a workspace root, so the lookup for that information returns undefined. vscode-uri bombs on the undefined and you get the error above.

I'm significantly out of date on vscode-uri. Upgrading it appears to mitigate the error. However, I'm concerned the behavior is inconsistent for users. If you only have a single workspace root and/or a single Rubocop config file, you're probably fine and this will work as advertised. However, users of nested configs or multiroot workspaces may see the tooling executed in an arbitrary directory so this new file could be inconsistent with everything else.

So for a general question for the group: when you create a new, unsaved file in VSCode, are you expecting linting and formatting with tooling like RuboCop to work? If yes, in what directory would you expect those tools to source their configuration?

@AntonTrapp
Copy link

Personally I would not care about new files, but as it is happening when starting the editor for existing projects/files (for me) I uninstalled it and I'm using ruby-rubocop. Has problems when starting via bookmarks extension, but is working great when starting with code . after rvm changed the environment.

@wingrunr21
Copy link
Collaborator

How are you opening the editor? ruby-rubocop actually ignores any files that are not listed with the scheme "file". New files have a scheme of "untitled" from VSCode.

@e1senh0rn
Copy link

Out of curiosity I checked how ESLint does work. For untitled files it just says

[Warn  - 3:53:40 PM] 
No ESLint configuration (e.g .eslintrc) found for file: Untitled-1
File will not be validated. Alternatively you can disable ESLint by executing the 'Disable ESLint' command.

When you try to save "untitled" file in multi-root workspace, it suggests the folder of last opened file.

For my case I have no multi-root workspaces at all.

Simples solution seems like to skip liniting in multi-root workspace.
Another option might be to lint against project settings for the last opened file.

@wingrunr21
Copy link
Collaborator

What I think I'm going to do is fall back to the first workspace folder that's available. The VSCode docs say that corresponds to the legacy workspace root thing. From there, if no runtime directory can be determined, I may just do what ESLint does

@orthodoX
Copy link

orthodoX commented Dec 2, 2019

@wingrunr21 Will this be released any time soon?

@jaime-rave-conichi
Copy link

@wingrunr21 Will this be released any time soon?

This is already released in version 0.26.0 if I'm not mistaken.

@orthodoX
Copy link

orthodoX commented Dec 4, 2019

@jaime-rave-conichi I'm on 0.26.0 and still have this issue. And besides the commit a888116 is after the 0.26.0 release on the master branch, I checked that as well 🙂

@JonnieCache
Copy link

I am still having this problem on 0.26.0.

I attempted to install this extension from the master branch but the build process wasn't immediately obvious (I am new to vscode) so I haven't checked that, sorry.

@e1senh0rn
Copy link

@wingrunr21 Could you make a release with this fix included?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

10 participants