-
Notifications
You must be signed in to change notification settings - Fork 285
Language server doesn't like a particular line of code #693
Comments
I did a search for '<<' in my codebase and those files also trigger this issue. I could rewrite them all, but... |
Hmm that stack trace looks like a bug in the tree sitter Ruby grammar. The Output pane is VSCode behavior. I’ll investigate if there’s a way to squash that somehow. I’ll look at this tomorrow. Sorry for the disruption! |
No worries, I figured out how to revert to the previous version (Extensions: Install Specific Version of Extension...). |
@anamba thanks for reporting this. I had the same issue. I had to use the previous version of vscode-ruby as well. I'm on Ubuntu. |
I also get a lot of errors like that since the last update. Pasting some of them here if it helps in the debugging:
|
Same thing happens on mine, but on a different line Bundler::Dsl::DSLError:
[!] There was an error parsing `Gemfile`: No such file or directory @ rb_sysopen - .ruby-version. Bundler cannot continue.
# from /Users/.../Gemfile:4
# -------------------------------------------
#
> ruby File.read('.ruby-version').chomp Works fine if I use |
Same problem here. I worked around it downgrading to 0.27.0, as other people mentioned in the previous comments. |
I had the same issue
|
@qortex thanks for the output. All of those errors point to an inability to parse the source file. Are you also having issues with The downgrade works because I upgraded the Ruby grammar in this version. If necessary I'll downgrade it again and cut a new release for folks. Either way I'll get something out today so people can still use some of the other stuff in the new version. |
Thanks everyone for the report. It does appear to be something to do with @vassyz it is not related to Ruby version. The language server does not ever load Ruby to perform its analysis. All analysis is static or performed via shelling out to the appropriate command (eg RuboCop). |
@wingrunr21 Might be just a coincidence, but I haven't changed the Gemfile in ages and after updating to the latest version the Terminal kept switching to the Output panel showing this error. |
Makes sense, I have quite a bunch of heredocs snippets in my files. |
I temporarily fixed this by downgrading to 0.27. Seems like an issue with the newest release |
|
I updated to |
@wingrunr21 I can confirm that this issue only happens on 0.28.0 and also 0.28.1. It does come from the language server, but it's not being triggered by Ruby 0.27.0. |
Updating to 0.28.1 seems to have fixed the problem for me. Thanks! |
@vassyz are you referring to your issue with your |
@wingrunr21 The Gemfile, should I create another issue for it? Sorry, I commented here because I was encountering the same behaviour as the editor kept switching to the Output panel. |
@vassyz I believe your issue is different. It's definitely a Ruby error. Thinking about it some more, it may have been this commit: c1b87d3 Bundler will recursively check parent directories for a Gemfile. Your reference to the This issue isn't specific to the extension as it would also not work in your shell |
@anamba if you get a chance, can you see if |
0.28.1 is working for me. Thank you! |
Great! Have a great weekend! |
Just a note, I started to run into this issue with the same error messages in v0.28.1. It appeared to repro on an empty ruby file, so not sure if I just got into a really bad state. Downgrading to v0.27 fixed the issue. |
Same here - |
Your environment
vscode-ruby
version: 0.28.0useLanguageServer
is true in your configuration?) yesExpected behavior
Actual behavior
I ultimately narrowed it down to these two lines (part of a merge method):
If I reload the window, all is well until I switch to that particular tab again, and then after that, any time I click anywhere in any ruby file, I get more errors under Output.
Rewriting those lines to this helped:
🤷♂️
The text was updated successfully, but these errors were encountered: