Add lsp-tailwindcss to emacs

This commit is contained in:
Paul-Henri Froidmont 2023-04-03 10:13:40 +02:00
parent cd260b6104
commit 87d2a6f304
Signed by: phfroidmont
GPG key ID: BE948AFD7E7873BE
3 changed files with 12 additions and 4 deletions

View file

@ -6,10 +6,10 @@
treemacs-git-mode 'extended) treemacs-git-mode 'extended)
;; Enable nice rendering of diagnostics like compile errors. ;; Enable nice rendering of diagnostics like compile errors.
(use-package flycheck (use-package! flycheck
:init (global-flycheck-mode)) :init (global-flycheck-mode))
(use-package lsp-mode (use-package! lsp-mode
;; Optional - enable lsp-mode automatically in scala files ;; Optional - enable lsp-mode automatically in scala files
;; You could also swap out lsp for lsp-deffered in order to defer loading ;; You could also swap out lsp for lsp-deffered in order to defer loading
:hook (scala-mode . lsp) :hook (scala-mode . lsp)
@ -31,3 +31,11 @@
(use-package! consult (use-package! consult
:config :config
(defun consult--ripgrep-builder (&rest args) (apply (consult--ripgrep-make-builder) args))) (defun consult--ripgrep-builder (&rest args) (apply (consult--ripgrep-make-builder) args)))
(use-package! lsp-tailwindcss
:init
(setq lsp-tailwindcss-add-on-mode t)
(setq lsp-tailwindcss-major-modes '(rjsx-mode web-mode html-mode css-mode typescript-mode typescript-tsx-mode tsx-ts-mode scala-mode))
(setq lsp-tailwindcss-experimental-class-regex [
[ "cls\\(([^)]*)\\)" "\"([^']*)\"" ]
[ "cls\\s*:=\\s*\\(?([^,^\\n^\\)]*)" "\"([^']*)\"" ]]))

View file

@ -169,7 +169,7 @@
;;solidity ; do you need a blockchain? No. ;;solidity ; do you need a blockchain? No.
;;swift ; who asked for emoji variables? ;;swift ; who asked for emoji variables?
;;terra ; Earth and Moon in alignment for performance. ;;terra ; Earth and Moon in alignment for performance.
(web +tree-sitter) ; the tubes (web +lsp +tree-sitter) ; the tubes
yaml ; JSON, but readable yaml ; JSON, but readable
;;zig ; C, but simpler ;;zig ; C, but simpler

View file

@ -1 +1 @@
;;(package! lsp-metals :pin "5c0cdd35e09ba6e5daf21c196cf269b38c3e1eef") (package! lsp-tailwindcss)