Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CPU usage high and status bar flickers when works with VSCode Vim #153

Closed
houkanshan opened this issue Nov 15, 2017 · 7 comments
Closed

Comments

@houkanshan
Copy link

houkanshan commented Nov 15, 2017

Hi, thank you for your extremely useful extension. This problem happened when I just upgrade several things including VSCode@1.18.0, VSCodeVim@0.10.4

ENV:
macOS Sierra 10.12.6
VSCode@1.18.0
VSCodeVim@0.10.4
Code Spell Checker@1.4.12

2017-11-15 11_25_31

In the GIF, the status bar is flickering between these 2 states

image

image

Also, the count of spell errors in the red circle will occasionally change from 25 to 39.

It will happen when I disabled all the extensions except Code Spell Checker & VSCodeVim, and the VSCodeVim has enabled statusBarColorControl like this:

    "vim.statusBarColorControl": true,
    "vim.statusBarColors": {
      "normal": "#005f5f",
      "insert": "#5f0000",
      "visual": "#5f00af",
      "visualline": "#005f87",
      "visualblock": "#86592d",
      "replace": "#000000"
    },

This problem can be solved temporarily by re-save the settings.json. Or just disabled the vim.statusBarColorControl feature.

Since it could be a bug of VSCode or VSCodeVim, and the status bar color is unnecessary to me, I just put this issue here in case you or others will find it useful.

@Jason3S
Copy link
Collaborator

Jason3S commented Nov 15, 2017

Wow, thank you for such a great and explicit example!

I'll see if I can figure out how the two extensions are conflicting.

Can you try:

"vim.statusBarColorControl": true,
"cSpell.showStatus": false,

and check to see if the High CPU still happens?

@houkanshan
Copy link
Author

houkanshan commented Nov 16, 2017

Hi, thanks for replying.

After setting "cSpell.showStatus": false, the clock icon disappeared. But the count of spell errors is still flickering, and CPU is still high.

2017-11-16 11_30_03

And I figure out what the flickering numbers are – in the GIF above, 5 is the warning count of the current file, 19 is the count of all the open files (= 14 + 5).

This will only happen when I'm editing normal files (typing, saving, opening, closing...). But once I open the setting.json, it turns stable:

screen shot 2017-11-16 at 11 45 28 am

But, after I close the setting.json, it becomes crazy again. :(

@Jason3S
Copy link
Collaborator

Jason3S commented Nov 16, 2017

Wow, it is acting like something is changing settings.json in the background.

Whenever settings.json is changed, the spell checker has to reload all the settings and start the spell checking process from scratch. The clock is displayed while that is happening.

@houkanshan
Copy link
Author

houkanshan commented Nov 17, 2017

You are right. With vim.statusBarColorControl enabled, every time I change the Vim editing mode, the update time of setting.json will change. I think VSCode Vim is changing it.

Also, it seems Spell Checker is not the only extension that has such conflict with Vim, I found this issue: VSCodeVim/Vim#2124

It should be a problem of VSCode Vim or VSCode@1.18.0, I'm closing this issue, thank you for your help!

@Jason3S
Copy link
Collaborator

Jason3S commented Nov 17, 2017

Thank you for reporting this.

I am guessing that the Vim extension is changing the settings.json file (possibly through the VS Code configuration api workspace.getConfiguration().update()) to change the status-bar color.

If VS Code does not correctly filter out the changes, it will cause the spell checker to re-load all configuration and re-check ALL open files. I think this is fixed in VS Code 1.19: microsoft/vscode#36475

@houkanshan
Copy link
Author

Great, waiting for the stable build of 1.19

You are really helpful. 🥇

@github-actions
Copy link
Contributor

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 11, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants