You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Prepare a Ruby file smaller than 103KB and confirm that Rubocop warnings are displayed on VSCode.
Add content to the file to exceed approximately 104KB, and observe that Rubocop warnings disappear from the screen
The text was updated successfully, but these errors were encountered:
cc-harashima
added
bug
Something isn't working
vscode
This pull request should be included in the VS Code extension's release notes
labels
Jan 23, 2025
Thank you for the report, but this is not a bug. Diagnostics run on every keypress, putting them in the critical flow for performance in language servers.
Unfortunately, in files that are too large, collecting RuboCop diagnostics starts taking too long. This is primarily due to the double-parse required, since RuboCop uses an API different from Prism and the fact that RuboCop doesn't use the listener approach included in the Prism API, which would allow the Ruby LSP to gather diagnostics in a single traversal of the AST (massively improving performance).
Since diagnostics starts taking 1 second or more after a certain file size, we intentionally disable it to avoid having the editor start lagging. Otherwise, it starts to become unresponsive and the experience degrades fast.
I believe finishing #1849 will improve the situation, as it gets rid of the double-parse.
Also, there should be a line in the output window saying: "The file (path) is too long. For performance reasons, semantic highlighting and diagnostics will be disabled."
Description
Ruby LSP Information
VS Code Version
1.96.0
Ruby LSP Extension Version
0.8.16
Ruby Version Manager
rbenv
gem Versions
rubocop 1.68.0
Reproduction steps
The text was updated successfully, but these errors were encountered: