-
-
Notifications
You must be signed in to change notification settings - Fork 171
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
AlphabeticallySortedUses disagrees with VSCode on alphabetical order of '\' and '_' characters #1667
Comments
The sorting is compatible with PHPStorm. I was not able to find specification of the order between |
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. |
Looks like there is an existing VSCode issue - microsoft/vscode#48123 |
JFYI, because of different preferences in the past, in another CS, we have added configurability here: https://github.com/mayflower/mo4-coding-standard?tab=readme-ov-file#mo4formattingalphabeticalusestatements - although persoanlly especially using a locale-dependent function is a bit too much, how high is the probability that a PR, introducing the same options, gets merged here? |
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:
The text was updated successfully, but these errors were encountered: