vscode-cssvar icon indicating copy to clipboard operation
vscode-cssvar copied to clipboard

[Bug] variables sorting does not consider numbers

Open massimo-cassandro opened this issue 1 year ago • 6 comments

Describe the bug Variables are sorted alphabetically and numbers suffix or prefix are not in the right sequence

Screenshot 2024-09-24 alle 12 11 03

Expected behavior Variable must be sorted in natural order:

--var-1
--var-2
...
--var-10
--var-11

Details (please complete the following information):

  • OS: OSX Ventura 13.7
  • VSCode version 1.93.1
  • Extension version 2.6.4

massimo-cassandro avatar Sep 24 '24 10:09 massimo-cassandro

Try using cssvar.disableSort extension setting.

phoenisx avatar Sep 24 '24 15:09 phoenisx

I tried, but it doesn't solve the issue

massimo-cassandro avatar Sep 24 '24 15:09 massimo-cassandro

Screenshot from 2024-09-24 22-50-48

It's working fine for me. Did u restart/reload your VSCode Window after changing the extension settings?

phoenisx avatar Sep 24 '24 17:09 phoenisx

You are right: after reloading my vscode window, the extension seems to work as expected.

But this leads to another problem: I usually load custom properties from more than one file and when I disable sorting, they get merged in an unpredictable way:

Screenshot_2024-09-25_alle_14_18_35

massimo-cassandro avatar Sep 25 '24 12:09 massimo-cassandro

Agreed! That needs to be fixed. I have low bandwidth. I'll keep this issue open to work on this later.

If you are interested, care to open a PR?

phoenisx avatar Sep 25 '24 13:09 phoenisx

If you are interested, care to open a PR?

I'd like to, but I dont know if I will have time. Anyway I'll give it a look

Thanks

massimo-cassandro avatar Sep 25 '24 13:09 massimo-cassandro