-
Notifications
You must be signed in to change notification settings - Fork 37.6k
Closed as not planned
Labels
*duplicateIssue identified as a duplicate of another issue(s)Issue identified as a duplicate of another issue(s)
Description
Does this issue occur when all extensions are disabled?: Yes
- VS Code Version: 1.84.2
- OS Version: Linux x64 5.14.0-1054-oem
Steps to Reproduce:
- Open an SCSS file with the following content:
@import 'file-a-aaa';
@import 'file-a';
@import 'file-a-ccc';
@import 'file-a-bbb';- select all lines
- CTRL+P then trigger "Sort line ascending"
Result:
@import 'file-a-aaa';
@import 'file-a-bbb';
@import 'file-a-ccc';
@import 'file-a';NB: last line is position here because in the sort algorithm of Int.Collator the character - (e.g. line 3: @import 'file-a- <-- this one) comes before the character '.
Expected result:
@import 'file-a';
@import 'file-a-aaa';
@import 'file-a-bbb';
@import 'file-a-ccc';NB: it feels more "natural" to me to have @import 'file-a'; on the first line when sorting. For this we might ignore punctuation when sorting by explicitly setting it here
SortLinesCommand._COLLATOR = new Intl.Collator(undefined, { ignorePunctuation: true });I see two ways to fix the problem:
- Hard ignoring punctuation considering it is a better default
- Introduce a new setting for line sorting:
ignorePunctuation : true | false (default)to keep current behavior but make it possible to change it
Metadata
Metadata
Assignees
Labels
*duplicateIssue identified as a duplicate of another issue(s)Issue identified as a duplicate of another issue(s)