LoranKloeze / vscode-ruby-rubocop-revived

Rubocop extension for Visual Studio Code
https://marketplace.visualstudio.com/items?itemName=LoranKloeze.ruby-rubocop-revived
MIT License
26 stars 8 forks source link

Extension causes editor lag when cursor is over violations #28

Closed akowalz closed 1 year ago

akowalz commented 1 year ago

I've installed the extension and noticed that it causes lag in my editor when my cursor is over editor violations.

In the extension's output channel, I notice that whenever my cursor is over something highlighted by Rubocop, the extension is running bundle show rubocop. This causes a brief lag spike and eats my inputs, making my editor feel noticeably laggy. In a file with a lot of violations, the editor becomes basically unuseable.

How to replicate

  1. Open a few file with the plugin active
  2. Create a few lines with violations
  3. Navigate around those lines with your arrow keys

Here's a video where you can clearly see the editor lag in areas with violations, compared with areas without violations. Also notice how often the extension is running bundle show rubocop

https://github.com/LoranKloeze/vscode-ruby-rubocop-revived/assets/3599657/20d79665-936e-4269-b362-95dcf6e77a53

VSCode version details:

Commit: abd2f3db4bdb28f9e95536dfa84d8479f1eb312d
Date: 2023-09-14T05:59:47.790Z (2 wks ago)
Electron: 25.8.1
ElectronBuildId: 23779380
Chromium: 114.0.5735.289
Node.js: 18.15.0
V8: 11.4.183.29-electron.0
OS: Darwin arm64 22.6.0

macOS Ventura 13.5.1 on a modern Macbook Pro.

akowalz commented 1 year ago

Update: I've noticed that setting useBundler in the config actually fixes this issue. This is great, but I'm going to leave this issue open as I still think it's in an issue that this command runs so frequently and causes lag without the config set. The useBundler config is also undocumented and I only found it by digging through the source code trying to find the root of this issue.