Skip to content
| Marketplace
Sign in
Visual Studio Code>Other>PHP Group ImportsNew to Visual Studio Code? Get it now.
PHP Group Imports

PHP Group Imports

M Razin Shaikh

|
185 installs
| (0) | Free
To merge same namespace imports to single import statement
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

PHP Group imports

Command Pallet > PHP Group Imports

  • sample-input
  • sample-output

Requirements

VS Code version - 1.87.0

Known Issues

  • ~~[x] Namespaces duplicated when commented import statement exist.~~
  • ~~[x] having first import statement commented with # or /* will be duplicated in output.~~ see: #4
  • ~~[x] Allow Customization via extension setting.~~ see #7 - #9
    • ~~[x] Sort classes inside group if enabled from settings (phpGroupImports.sortAlgorithm)~~ see: #7
    • ~~[x] Order imports by type and php-cs imports-order rule defined from settings~~ see #9

Extension Setting

  • phpGroupImports.notifyOnComplete - To show the notification on group import operation completion or not. default true. see: release v1.1.2
  • phpGroupImports.sortAlgorithm - Order the grouped imports by. 'alpha', 'length', 'null'. default alpha. see: release v1.1.3
  • phpGroupImports.importsOrder - Order the use statements by type. ['const', 'class', 'function']. default null. see: release v1.1.4
  • phpGroupImports.importStatementOrder - Order import statements in ascending order. (True => ascending order, False => descending order.). see: release v1.1.4

Coming soon....

Change Log

See CHANGELOG.md

Enjoy!

  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
© 2025 Microsoft