[IntelliSense] Add "Sort Tailwind Classes" Source Action #17805
garrett-hopper
started this conversation in
Ideas
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I've written a VSCode extension which uses
__unstable__loadDesignSystem
andgetClassOrder
to automatically sort tailwind classes in Clojure hiccup style:class
string and keywords. It defines a source action which can then be added toeditor.codeActionsOnSave
by a user to enable automatic sorting. (tailwindcss-clojure-class-sorter/blob/main/index.js#L162)I believe such a source action would make more sense as part of the Tailwind CSS IntelliSense extension instead of being a separate extension. Its behavior would be driven by the regular expressions in
tailwindCSS.experimental.classRegex
(as well as the otherclassFunctions
,classAttributes
, etc.) to find classes to be sorted.This would allow for language-agnostic completions and sorting through a single configuration instead of requiring separte configuration of IntelliSense and sorting.
Potentially this could be part of the LSP as well to support non-VSCode editors as well? I'm not very familiar with what functionality is exposed by the LSP and what is limited to only the extension.
This relates to my other discussion requesting the
getClassOrder
be made a public API. (#17804)Beta Was this translation helpful? Give feedback.
All reactions