vscode on save got incredibly slow after rubocop 1.90 upgrade + UseProjectIndex
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 45/100
- Issue type
- Bug
- Clarity
- Mostly clear
- Activity status
- Active
- Tech stack
- ruby, vscode
- Domain
- developer-experience, performance, tooling
Research direction
Start with the Ruby LSP RuboCop-on-save integration and its RuboCop CLI invocation, then compare behavior with RuboCop 1.90's UseProjectIndex and rubydex documentation. Done means the reindexing slowdown is reproduced or bounded and the integration documents or avoids redundant project indexing; no file or test is named.
Written by the indexing model from the issue text.
Description
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.
- Dominant language
- Ruby
- Stars
- 2k
- Forks
- 282
- Avg merge
- 12h 23m
- Merged PRs (30d)
- 9
Getting set up
Starts the project's dev container in your browser, under your own GitHub account.
- No Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from Shopify/ruby-lsp
-
bug Stale
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
Shopify/ruby-lsp#4181 · 1 comment · 1 reaction ·
Maintainers usually reply within 1 day
-
bug help-wanted pinned
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
Shopify/ruby-lsp#3503 · 8 comments · 1 reaction ·
Maintainers usually reply within 1 day
-
check-labels intermittently fails due to the organization IP allow listPossibly taken @soutaro claimed this 1 day ago. Open
Shopify/ruby-lsp#4219 · 1 assignee ·
Maintainers usually reply within 1 day
-
bug
Difficulty 4/5 3-5 days Newbie friendliness 38/100
Maintainers usually reply within 1 day
-
bug
Difficulty 4/5 3-5 days Newbie friendliness 68/100
Maintainers usually reply within 1 day
All issues in Shopify/ruby-lsp
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
rom-rb/rom-factory#99 ·
-
accessibility
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
slovensko-digital/autogram-portal#370 · 3 comments ·
Maintainers usually reply within 21 days
-
needs triage
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
Maintainers usually reply within 5 days
-
security
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
CircuitVerse/CircuitVerse#7967 · 1 comment · 1 reaction ·
Maintainers usually reply within 1 day