Bem-VSCode-Extension icon indicating copy to clipboard operation
Bem-VSCode-Extension copied to clipboard

Eager document validation slows down other extensions

Open jrieken opened this issue 2 years ago • 2 comments

👋 Hey. VS Code Team here.

This extension appeared as causing slow-downs of the extension host and thereby also other extensions. See https://github.com/microsoft/vscode/issues/155520#issuecomment-1268476595 for the related discussion on our end.

I took a quick glance and I believe this is due to "responsiveLinting" - it is too eager as it validates documents as you type without any kind of debouncing. See https://github.dev/Box-Of-Hats/Bem-VSCode-Extension/blob/4918250dbfc60a37e33ddb6f3f0bfd047bad737f/src/extension.ts#L72. Doing an expensive operation on such a high frequency event is discouraged and validation should be debounced/delayed by something like 500ms

jrieken avatar Oct 05 '22 14:10 jrieken

(OP of the problem in the linked issue) It appears also that this linting occurs while typing in files that don't apply for any BEM help (particularly typescript files). Maybe it's possible to lint only in applicable file types (css, scss, etc)?

markchagers avatar Oct 05 '22 15:10 markchagers

Hi both, thanks for raising this and giving so much detail :) I'll work on getting this fixed very soon

Box-Of-Hats avatar Oct 06 '22 18:10 Box-Of-Hats