kcmr / vsce-remove-unused-imports

VS Code extension to remove unused ES6 imports inside JavaScript and TypeScript files
https://marketplace.visualstudio.com/items?itemName=kuscamara.remove-unused-imports
MIT License
17 stars 5 forks source link

Syntax highlighting flashes on save #28

Open kredenac opened 1 year ago

kredenac commented 1 year ago

Hello, thanks for this awesome extension.

I have a few code actions on save:

 "editor.codeActionsOnSave": [
      "source.addMissingImports",
      "source.fixAll.eslint"
    ]

When I add "source.removeUnusedImports" to the list, then the whole text in the file flashes on save. This happens even when there are no imports to remove.

It seems like syntax highlighting gets disabled and quickly enabled, causing the flashing sensation. I'm guessing it's because it reinserts the whole file content, even though it's not changed.

kcmr commented 1 year ago

Wow, weird behavior 😅 I have never experienced that. Does it happen with every theme?

Anyway, I'll add to the list of improvements the possibility of not rewriting the file if it hasn't changed or there aren't imports to remove.

Thank you for using it.