You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Jul 31, 2023. It is now read-only.
Repository navigation
This repository was archived by the owner on Jul 31, 2023. It is now read-only.
deletes the contents of the entire file This and the next section should include screenshots, code samples, console output, etc. The more information we have to reproduce the better!
Well just to start: what formatter? What's your configuration? What's the console output? Do you see a Format: call in the console?
Basically the part in the issue template that wasn't filled out: This and the next section should include screenshots, code samples, console output, etc. The more information we have to reproduce the better!
Oh, you are right. I posted Lint output, welp. I'm using rubocop.
I do see format call: Format: executing bundle exec rubocop -s somefile.rb -a...
I noticed that when I launch/reload vscode it throws error rubocop failed with code=1 but I don't see any more details. I can find rubocop in the terminal, though.
Ok. It is this specific line + this ternary that's doing that. I'll have to take another pass as I introduced those to fix other bugs with selection formatting.
No, I think I'm going to have to combine the fix with #435. I need to introduce a buffer on all stdout and then process that output based on the return code from the linter/formatter.
Almost...
If you have "ruby.useBundler": true in config and no rubocop in Gemfile it deletes content of the file and writes this instead:
load command: rubocop (/home/username/.asdf/installs/ruby/2.5.1/bin/rubocop)
Gem::Exception: can't find executable rubocop for gem rubocop. rubocop is not currently included in the bundle, perhaps you meant to add it to your Gemfile?
/home/username/.asdf/installs/ruby/2.5.1/lib/ruby/gems/2.5.0/gems/bundler-1.17.2/lib/bundler/rubygems_integration.rb:462:in `block in replace_bin_path'
/home/username/.asdf/installs/ruby/2.5.1/lib/ruby/gems/2.5.0/gems/bundler-1.17.2/lib/bundler/rubygems_integration.rb:482:in `block in replace_bin_path'
/home/username/.asdf/installs/ruby/2.5.1/bin/rubocop:23:in `<top (required)>'
Well, replacing the file contents is probably not correct. The problem I'm trying to work around is that bundler doesn't distinguish between stdout and stderr until v2 (see rubygems/bundler#3353) so I can't just assume stdout is good and stderr is bad.
I'll add a test case for it. This is actually a different issue than originally though so I'll probably open a new one and link them.
Activity
wingrunr21 commentedon Mar 1, 2019
You are going to have to provide more information
adamzapasnik commentedon Mar 4, 2019
Same here.
vscode-rubyversion:0.22.2Ruby version:
ruby 2.5.1p57 (2018-03-29 revision 63029) [x86_64-linux]Ruby version manager:
asdfVS code version: 1.31.0
Operating system: Ubuntu 18.04.2 LTS
Using language server? yes
What other information do you need?
This is an output from OUTPUT tab.
wingrunr21 commentedon Mar 4, 2019
Well just to start: what formatter? What's your configuration? What's the console output? Do you see a
Format:call in the console?Basically the part in the issue template that wasn't filled out: This and the next section should include screenshots, code samples, console output, etc. The more information we have to reproduce the better!
adamzapasnik commentedon Mar 4, 2019
Oh, you are right. I posted Lint output, welp. I'm using rubocop.
I do see format call:
Format: executing bundle exec rubocop -s somefile.rb -a...I noticed that when I launch/reload vscode it throws error
rubocop failed with code=1but I don't see any more details. I can findrubocopin the terminal, though.configuratioon:
wingrunr21 commentedon Mar 4, 2019
Do you have a lot of lint errors in that file? I wonder if it's related to another issue where the RuboCop output is really long
adamzapasnik commentedon Mar 4, 2019
It happens even to a file with only 1 lint error.
wingrunr21 commentedon Mar 4, 2019
Ok. It is this specific line + this ternary that's doing that. I'll have to take another pass as I introduced those to fix other bugs with selection formatting.
adamzapasnik commentedon Mar 4, 2019
:) Glad you found the cause. Do you need any help with that?
wingrunr21 commentedon Mar 4, 2019
No, I think I'm going to have to combine the fix with #435. I need to introduce a buffer on all
stdoutand then process that output based on the return code from the linter/formatter.adamzapasnik commentedon Mar 4, 2019
Seems like a good solution 👍 Good luck then. Feel free to ping me to test the fix.
wingrunr21 commentedon Mar 6, 2019
v0.22.3 has the bugfix for this
adamzapasnik commentedon Mar 6, 2019
Almost...
If you have
"ruby.useBundler": truein config and no rubocop inGemfileit deletes content of the file and writes this instead:Or is it correct behaviour?
wingrunr21 commentedon Mar 6, 2019
Well, replacing the file contents is probably not correct. The problem I'm trying to work around is that bundler doesn't distinguish between
stdoutandstderruntil v2 (see rubygems/bundler#3353) so I can't just assumestdoutis good andstderris bad.I'll add a test case for it. This is actually a different issue than originally though so I'll probably open a new one and link them.
adamzapasnik commentedon Mar 6, 2019
I see, thanks for the information and the fix 👍
wingrunr21 commentedon Mar 6, 2019
Can you post the full Output you are seeing? Having trouble reproducing
adamzapasnik commentedon Mar 6, 2019
Which Output exactly?
wingrunr21 commentedon Mar 6, 2019
The
Ruby Language Serverstuff. I want to see what format command it is attempting to runadamzapasnik commentedon Mar 6, 2019
Format: executing bundle exec rubocop -s somefile.rb -a...This is what I can see printed from
Formatwingrunr21 commentedon Mar 6, 2019
Interesting. When I try and reproduce this setup:
ruby.useBundler: trueGemfilein project withoutrubocopI get a correctly handled language server error. Are you using a binstub?
adamzapasnik commentedon Mar 6, 2019
AFAIK, no, I don't.
wingrunr21 commentedon Mar 6, 2019
ok but you have rubocop installed globally?
/home/username/.asdf/installs/ruby/2.5.1/bin/rubocopseems to suggest yesadamzapasnik commentedon Mar 6, 2019
Yes, I do.
wingrunr21 commentedon Mar 6, 2019
Reproduced it. Thanks
arminanton commentedon May 3, 2022
Was this solved? I'm having the same issue.
kristof-mattei commentedon Oct 31, 2022
So this is funny, I just hit this issue. And I switched to .asdf yesterday...