vscode-postcss-sorting icon indicating copy to clipboard operation
vscode-postcss-sorting copied to clipboard

when I run this nothing happens

Open spam0115 opened this issue 3 years ago • 7 comments

Environment

  • VSCode Version: 1.66.2
  • OS Version: Windows 11

Actual behavior

nothing happens when I run "PostCSS Sorting: Run"

Expected behavior

it should sort

Steps to reproduce

press f1 and run "PostCSS Sorting: Run"

spam0115 avatar May 23 '22 03:05 spam0115

I've managed to run it by installing Sass extension

Pixel48 avatar Jul 21 '22 13:07 Pixel48

Even after installing that extension, it does nothing when I run it.

The following HTML file is unchanged when running "PostCSS Sorting: Run":

<html>
  <head>
    <title>foo</title>
    <style lang="css">
      p {
        display: inline-block;
        color: red;
      }
    </style>
  </head>
  <body>
    <p>foo</p>
  </body>
</html>

Yet if I reverse the order of the two entries under p and run the sort again, the file is still unchanged. They can't both be sorted correctly :)

(Just to save a bit of time — this extension does work in the <style> section of .svelte files, right? Because nothing else I've tried so far does, and that's what I need it for…)

unikitty37 avatar May 09 '23 07:05 unikitty37

(Just to save a bit of time — this extension does work in the <style> section of .svelte files, right? Because nothing else I've tried so far does, and that's what I need it for…)

I came here in my same search and had the same issue as you. Did you find any extension/plugin that worked?

aryadaroui avatar Jul 25 '23 01:07 aryadaroui

(Just to save a bit of time — this extension does work in the <style> section of .svelte files, right? Because nothing else I've tried so far does, and that's what I need it for…)

I came here in my same search and had the same issue as you. Did you find any extension/plugin that worked?

No; the only solution I found was to set up stylelint and add sorting rules (I used @p233/stylelint-config-scss) then manually reorder when lines were highlighted as being sorted incorrectly. (Having keyboard shortcuts bound to Move Line Up and Move Line Down is essential :)

It's more tedious than just hitting the reformat button, but the immediate feedback helps a lot.

unikitty37 avatar Jul 25 '23 10:07 unikitty37

(Just to save a bit of time — this extension does work in the <style> section of .svelte files, right? Because nothing else I've tried so far does, and that's what I need it for…)

I came here in my same search and had the same issue as you. Did you find any extension/plugin that worked?

No; the only solution I found was to set up stylelint and add sorting rules (I used @p233/stylelint-config-scss) then manually reorder when lines were highlighted as being sorted incorrectly. (Having keyboard shortcuts bound to Move Line Up and Move Line Down is essential :)

It's more tedious than just hitting the reformat button, but the immediate feedback helps a lot.

I basically came to the same conclusion! Thank you for the info and confirmation 🙂

aryadaroui avatar Jul 28 '23 06:07 aryadaroui

So does this mean this extension doesn't work anymore? is it a dead project?

Lefthandmedia avatar Aug 14 '23 09:08 Lefthandmedia

So does this mean this extension doesn't work anymore? is it a dead project?

Partially, it seems. Only alphabetical sorting works for me.

aryadaroui avatar Aug 15 '23 03:08 aryadaroui