yaegassy / coc-intelephense

intelephense (PHP language server) extension for coc.nvim. intelephense’s various LSP features and this extension's additional features are available.
https://www.npmjs.com/package/@yaegassy/coc-intelephense
MIT License
98 stars 4 forks source link

feat(codeaction): add removeUnusedImports action #43

Closed yaegassy closed 2 years ago

yaegassy commented 2 years ago

Description

Added code action to remove all unused imports in the "use" statement. It only works if intelephense is emitting a diagnostics message regarding the use statement.

If you need more features, such as sorting use statements, we recommend using a formatter like php-cs-fixer. An extension for "coc.nvim" is also available.

DEMO (mp4)

https://user-images.githubusercontent.com/188642/175935031-8ff36f34-9621-4bc4-9a35-bca1190ff59a.mp4