Skip to content
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

Add "Sort Selection" command #851

Merged
merged 13 commits into from
Aug 31, 2023
Merged

Add "Sort Selection" command #851

merged 13 commits into from
Aug 31, 2023

Conversation

bradlc
Copy link
Contributor

@bradlc bradlc commented Aug 31, 2023

This PR adds a new "Sort Selection" command to the extension. When activated this command will sort the selection(s) in the same way that prettier-plugin-tailwindcss sorts lists of CSS classes.

This useful when you want to sort a list of classes that prettier-plugin-tailwindcss does not handle, e.g.

const myVar = 'these classes here'
Sort.Selection.Demo.mov

The command is only available when:

  • The editor has one or more active text selections
  • There is an active Tailwind project for the current active file
  • The Tailwind version for the active Tailwind project is at least 3.0.0
  • The active file is not excluded (via tailwindCSS.files.exclude)

@bradlc bradlc merged commit 1cc8e62 into master Aug 31, 2023
@bradlc bradlc deleted the sort-selection branch August 31, 2023 14:53
@Benbinbin
Copy link

really need "sort classes name" as the built-in feature the extension, maybe take a further step to make this feature as "sort on save" will be more convenient

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants