castwide / vscode-solargraph

A Visual Studio Code extension for Solargraph.
Other
423 stars 25 forks source link

Unrecognized cop when formatting #202

Closed brianlow closed 3 years ago

brianlow commented 3 years ago

Running Format Document in VSCode shows this error in the Ruby Language Server output:

Request textDocument/formatting failed.
  Message: [RuboCop::ValidationError] 
     unrecognized cop Lint/DuplicateBranch found in .rubocop_todo.yml, 
     unrecognized cop Lint/EmptyBlock found in .rubocop_todo.yml, 
     unrecognized cop Lint/EmptyClass found in .rubocop_todo.yml, 
     unrecognized cop Style/NegatedIfElseCondition found in .rubocop_todo.yml
  Code: -32603 

I recently updated ruby 2.6.3 -> 2.7.2 and rubocop 1.1.0 -> 1.3.1. The problematic cops are new to rubocop 1.3 (e.g. Lint/DuplicateBranch) or were updated (e.g. Lint/EmptyBlock).

Perhaps an older version of rubocop is being invoked.

Any ideas on how I can troubleshoot?

VSCode: 1.51.1 ruby: ruby 2.6.3p62 (2019-04-16 revision 67580) [x86_64-darwin19] ruby version manager: asdf v0.8.0-c6145d0 solargraph: 0.39.17, installed globally (not in Gemfile) rubocop: 1.3.1

jenskdsgn commented 3 years ago

I am having the same problem and annoyingly, everytime I trigger solargraph by saving a document it jumps to the output tab in vscode to show me the error code.

VSCode: Version: 1.51.1

ruby 2.7.2p137 (2020-10-01 revision 5445e04352) [x86_64-darwin19] solargraph: 0.39.17 (also installed globally) solargraph vscode extension: v0.21.1

$ gem info rubocop

*** LOCAL GEMS ***

rubocop (1.5.2, 1.3.0, 0.93.1)
brianlow commented 3 years ago

Working now. Updated VSCode (Nov 1.52 release) and solargraph 0.40