VS Code: rubocop/linting change how many lines are underlined

Viewed 169

I'm looking to find a way to change which lines of my code are underlined when a methed or class rule is violated. i.e. I just want the line class WhateverClass < ApplicationRecord to be underlined with the error rather than every line in the class being underlined.

I'm working on an older rails app and, unsurprisingly, just about every class and method has too many lines or too great a complexity. In my VIM setup this isn't an issue (visually) because just the class or def line will be underlined. In VS Code every line is underlined which makes the file hard to read and other violations impossible to find.

Is there a way to change this, or should I just grab another extension?

I'm using the Ruby extension by Peng Lv, here is my my settings.json:

{
    "telemetry.enableTelemetry": false,
    "editor.tabSize": 2,
    "diffEditor.renderSideBySide": false,
    "files.trimTrailingWhitespace": true,
    "editor.renderWhitespace": "trailing",
    "editor.fontFamily": "'Cascadia Code PL', Consolas, 'Courier New', monospace",
    "editor.inlineHints.fontFamily": "'Cascadia Code PL', Consolas, 'Courier New', monospace",
    "ruby.useBundler": true,
    "ruby.useLanguageServer": true,
    "ruby.lint": {
        "rubocop": {
            "useBundler": true
          }
    },
    "ruby.format": "rubocop",
    "ruby.codeCompletion": "rcodetools"
}
0 Answers
Related