castwide / vscode-solargraph

A Visual Studio Code extension for Solargraph.
Other
425 stars 23 forks source link

Error in diagnostics: RuboCop returned invalid data #248

Open baelter opened 2 years ago

baelter commented 2 years ago

Often happens on syntax errors

Screenshot from 2022-06-10 15-19-36 Screenshot from 2022-06-10 15-17-03

baelter commented 2 years ago

Might be that solargraph can't handle warnings like

Warning: obsolete parameter `IgnoredPatterns` (for `Layout/LineLength`) found in .rubocop.yml
`IgnoredPatterns` has been renamed to `AllowedPatterns`.
baelter commented 2 years ago

Seems to happen when RubocopRunner.run does not produce any output, leading to trying to parse nil here: https://github.com/castwide/solargraph/blob/3254dec22a55bdb7b66382c7ebe08283a4cc1168/lib/solargraph/diagnostics/rubocop.rb#L29