this post was submitted on 05 Oct 2023
4 points (100.0% liked)

Emacs

311 readers
3 users here now

A community for the timeless and infinitely powerful editor. Want to see what Emacs is capable of?!

Get Emacs

Rules

  1. Posts should be emacs related
  2. Be kind please
  3. Yes, we already know: Google results for "emacs" and "vi" link to each other. We good.

Emacs Resources

Emacs Tutorials

Useful Emacs configuration files and distributions

Quick pain-saver tip

founded 1 year ago
MODERATORS
 

Having difficulty while setting lsp with tailwind css

when i open any tailwind css related files it doesnt give an explanation

is there something am missing?

i followed this site https://github.com/merrickluo/lsp-tailwindcss instructed me to do but i couldn't get it work. my project is next js project if that helps. i also chaged the variable default lsp-tailwindcss-major-modes to js-jsx-mode if there is somthing that i am missing pls let me know am also new comer to emacs and stupid things may confuse me

(set-face-attribute 'default nil :font "JetBrains Mono" :height 128)

(setq package-archives '(("melpa" . "https://melpa.org/packages/")
			 ("org" . "https://orgmode.org/elpa")
			 ("elpa" . "https://elpa.gnu.org/packages/")))

(package-initialize)
(unless package-archive-contents
  (package-refresh-contents))

(unless (package-installed-p 'use-package)
  (package-install 'use-package))

(setq use-package-always-ensure t)
(use-package json-mode)


(custom-set-variables
 ;; custom-set-variables was added by Custom.
 ;; If you edit it by hand, you could mess it up, so be careful.
 ;; Your init file should contain only one such instance.
 ;; If there is more than one, they won't work right.
 '(package-selected-packages
   '(json-mode lsp-treemacs lsp-ivy lsp-tailwindcss lsp-mode gcmh company company-mode evil evil-mode use-package)))
(custom-set-faces
 ;; custom-set-faces was added by Custom.
 ;; If you edit it by hand, you could mess it up, so be careful.
 ;; Your init file should contain only one such instance.
 ;; If there is more than one, they won't work right.
 )


(use-package evil
:config (evil-mode 1)
  )


(use-package company
  :config (global-company-mode t)
  )


(use-package gcmh
  :config (gcmh-mode 1)
  )

lsp mode is here

(use-package lsp-mode)
(use-package lsp-tailwindcss
  :init
  (setq lsp-tailwindcss-add-on-mode t)
)
 (load-theme 'tango-dark)


(use-package lsp-ivy :commands lsp-ivy-workspace-symbol)
(use-package lsp-treemacs :commands lsp-treemacs-errors-list)

(setq lsp-log-io nil)
(setq read-process-output-max (* 1024 1024)) ;; 1mb
(setq create-lockfiles nil)
(fset #'jsonrpc--log-event #'ignore)


(advice-add 'jsonrpc--log-event :override #'ignore)

(use-package rjsx-mode)

(use-package lsp-tailwindcss
  :init
  (setq lsp-tailwindcss-add-on-mode t)
)
 (load-theme 'tango-dark)


(use-package lsp-ivy :commands lsp-ivy-workspace-symbol)
(use-package lsp-treemacs :commands lsp-treemacs-errors-list)

(setq lsp-log-io nil)
(setq read-process-output-max (* 1024 1024)) ;; 1mb
(setq create-lockfiles nil)
(fset #'jsonrpc--log-event #'ignore)


(advice-add 'jsonrpc--log-event :override #'ignore)
all 1 comments
sorted by: hot top controversial new old