Skip to content

vscode on save got incredibly slow after rubocop 1.90 upgrade + UseProjectIndex #4208

Description

@HoneyryderChuck

Description

Ruby LSP Information


### Ruby LSP Information

#### VS Code Version

1.137.0

#### Ruby LSP Extension Version

0.10.6

#### Ruby LSP Server Version

0.26.11

#### Ruby LSP Add-ons

- Tapioca (0.1.3)
- Ruby LSP Rails (0.4.8)
- RuboCop (1.90.0)

#### Ruby Version

4.0.6

#### Ruby Version Manager

asdf

#### Installed Extensions

<details>
<summary>Click to expand</summary>

- claude-code (2.1.270)
- remote-containers (0.469.0)
- ruby-extensions-pack (0.1.14)
- ruby-lsp (0.10.6)
- sorbet-vscode-extension (0.3.47)
- terraform (0.2.5)
- vim (1.32.4)
- vscode-containers (2.5.0)
- vscode-jsonnet (0.7.4)
</details>

#### Ruby LSP Settings

<details>
<summary>Click to expand</summary>

##### Workspace

```json
{
  "indexing": {
    "excluded_patterns": [
      "/bin/**",
      "/cypress/**",
      "/front-end/**",
      "/kubernetes/**",
      "/public/**",
      "/secrets/**",
      "/semgrep/**"
    ],
    "excluded_gems": [
      "annotate",
      "better_errors",
      "binding_of_caller",
      "brakeman",
      "bullet",
      "bundler_audit",
      "danger",
      "danger-rubocop",
      "debase",
      "guard",
      "guard-rspec",
      "knapsack_pro",
      "listen",
      "parallel_tests",
      "rspec_junit_formatter",
      "rubocop",
      "rubocop-daemon",
      "rubocop-rails",
      "rubocop-rspec",
      "ruby-debug-ide",
      "ruby-lsp",
      "solargraph",
      "spring-commands-rpsec",
      "squasher",
      "super_diff"
    ]
  }
}
User
{
  "enabledFeatures": {
    "codeActions": true,
    "diagnostics": true,
    "documentHighlights": true,
    "documentLink": true,
    "documentSymbols": true,
    "foldingRanges": true,
    "formatting": true,
    "hover": true,
    "inlayHint": true,
    "onTypeFormatting": true,
    "selectionRanges": true,
    "semanticHighlighting": true,
    "completion": true,
    "codeLens": true,
    "definition": true,
    "workspaceSymbol": true,
    "signatureHelp": true,
    "typeHierarchy": true
  },
  "featuresConfiguration": {},
  "addonSettings": {},
  "rubyVersionManager": {
    "identifier": "auto"
  },
  "customRubyCommand": "",
  "formatter": "auto",
  "linters": null,
  "bundleGemfile": "",
  "testTimeout": 30,
  "pullDiagnosticsOn": "both",
  "useBundlerCompose": false,
  "bypassTypechecker": false,
  "rubyExecutablePath": "",
  "indexing": {
    "excluded_patterns": [
      "/bin/**",
      "/cypress/**",
      "/front-end/**",
      "/kubernetes/**",
      "/public/**",
      "/secrets/**",
      "/semgrep/**"
    ],
    "excluded_gems": [
      "annotate",
      "better_errors",
      "binding_of_caller",
      "brakeman",
      "bullet",
      "bundler_audit",
      "danger",
      "danger-rubocop",
      "debase",
      "guard",
      "guard-rspec",
      "knapsack_pro",
      "listen",
      "parallel_tests",
      "rspec_junit_formatter",
      "rubocop",
      "rubocop-daemon",
      "rubocop-rails",
      "rubocop-rspec",
      "ruby-debug-ide",
      "ruby-lsp",
      "solargraph",
      "spring-commands-rpsec",
      "squasher",
      "super_diff"
    ]
  },
  "erbSupport": true,
  "featureFlags": {},
  "sigOpacityLevel": "1"
}
```

Reproduction steps

The reproduction is hard without a sufficiently large app. As mentioned above, after upgrading to rubocop 1.90, and enabling the UseProjectIndex config, which enables their rubydex integration, rubocop-on-save suddenly started taking >30s, up to the point where I'm constantly pressing "Skip" when running the rubocop formatter.

My understanding is that ruby-lsp's rubocop integration just runs rubocop cli command on save. My guess, and based on what's written here, is that when the integration is enabled, rubocop will reindex the whole project before running cops.

This may not be a ruby-lsp problem, but it does result in visible DX impact for ruby-lsp users, which will perceive the tool as being slow. This being an experimental flag, the goal is to document this, so that the integration can be reworked so that rubocop's add-on piggy backs on ruby-lsp's already indexed workspace and skips this step.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingpinnedThis issue or pull request is pinned and won't be marked as stale

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions