PHP imports formatter for Visual Studio Code.
vscode-php-imports.init
: PHP Imports: Initvscode-php-imports.format
: PHP Imports: Format
php-imports.formatOnSave
: Automatically format imports before saving PHP file.php-imports.order
: Order of import sets and empty lines between them. An array of enums with possible values:emptyLine
all.all
all.class
all.function
all.const
singleUses.all
singleUses.class
singleUses.function
singleUses.const
groupedUses.all
groupedUses.class
groupedUses.function
groupedUses.const
php-imports.sort.order
: Order of first-level imports. Possible values:default
(alphabetical) ornatural
(first longest, alphabetical).php-imports.sort.nestedOrder
: Order of second-level imports. Possible values:default
(alphabetical) ornatural
(first longest, alphabetical).php-imports.print.emptyLinesAfterImports
: Count of empty lines between last import and the declaration after it.php-imports.print.wrap.all
: If set to false, multiple imports will be placed in single line wrapped only after exceeding line limit.php-imports.print.wrap.limit
: Line length limit before starting wrapping grouped imports. Set to false if you want to remove line length limit.php-imports.psr12.enable
: Enable PSR-12 imports formatting.php-imports.psr12.isolateModifiers
: Whether to put different modifiers (without modifier, const and function) to different groups.php-imports.psr12.minNestedGroupNestedUsesCount
: Minimum count of nested uses to make a nested group with them.php-imports.psr12.minNestedGroupUsesCount
: Mimimum count of uses to make a nested group with them.php-imports.psr12.minGroupUsesCount
: Mimimum count of uses of same namespace to make a group with them.php-imports.custom.enable
: Enable custom imports formatting.php-imports.custom.isolateModifiers
: Whether to put different modifiers (without modifier, const and function) to different groups.php-imports.custom.include
: A list of namespaces that should always be grouped. Can be used with wildcards (*) and double wildcards (**).php-imports.custom.exclude
: A list of namespaces that should never be grouped.php-imports.unused.enable
: Clean up unused imports.
- Updated php-imports library to 0.5.2
- Fixed release notes
- Updated php-imports library to 0.5.0
- Added grouped imports wrapping configuration
- Added support for PHP
declare
syntax
- Added init command that creates
.phpimportsrc
config from current workspace configuration - Added option to clean unused imports
- Improved
.phpimportsrc
support - Better error and warning reporting
- Updated php-imports library
.phpimportsrc
file support- Allow trailing comma in group uses when parsing
- Fix issue with namespaces or imports containing digits
- Disable formatting in files without uses
- Finally done with GitHub Actions
- Use Github Actions instead of Travis CI for deployment
- Fix issue when there is namespace and use with the same name and parent
- Fixed indents detection
- Activate extension when php file is opened
- Update php-imports library
- Detect file indentation when formatting before saving
- Initial release
The project is released under the MIT license. Read the license for more information.