Open joachim-n opened 4 months ago
The sorting is compatible with PHPStorm. I was not able to find specification of the order between \
and _
in PSR 12. I'm ok to merge PR that will make this configurable.
I'd argue that the coding standard and PHPStorm are correct here and that VSCode is wrong. VSCode is sorting the strings as-is whereas the coding standards and PHPStorm are more aware that we're dealing with "nested sections". If we alphabetically sort words then "action_link" would come before "action_link_formatter_links".
We can see that PHP treats these as nested "paths" because the following is uncommon but valid PHP:
use Drupal\action_link\{
Ajax\ActionLinkMessageCommand,
Entity\ActionLinkInterface,
Plugin\ActionLinkStyle\Ajax,
};
use Drupal\action_link_formatter_links\{
DisplayBuildAlter,
};
We should probably file a PHP issue with VSCode instead.
The coding standard wants the lines to be like this:
But if I select them in VSCode and do 'Sort lines ascending' I get this: