merrickluo/lsp-tailwindcss

How to setup with elixir .heex file?

RobinBeekhof opened this issue · 6 comments

Hi,

I'm trying to configure lsp-tailwindcss for .heex files in Doom emacs. I have done the setup as you described and added to my config.el:

(use-package! lsp-tailwindcss :init (setq! lsp-tailwindcss-add-on-mode t))
(add-to-list 'lsp-language-id-configuration '(".*\\.heex$" . "html"))

both html-ls and tailwind-ls seem to start fine
LSP :: Connected to [html-ls:29522/starting][tailwindcss:29523/starting]. LSP :: tailwindcss:29523 initialized successfully in folders: (/****) LSP :: html-ls:29522 initialized successfully in folders: (/****)

However, It is not really working. For example, when editing the .heex file, I'm not getting any tailwind suggestions.

image

I don't know what I'm doing wrong. I hope somebody can help :)

I'm not sure about heex, but it did work for me in leex files. The lsp log indicates that servers are starting, but might not start correctly, can you try

  • M-x lsp-describe-session // and find your current project to see if both servers are started
  • check if lsp-mode is still enabled in this buffer (this happened to me before, it turns of somehow after I revert the buffer)

image

This is what I get when running M-x lsp-describe-session. I guess red means it is off? How can I restart it?

Red is fine, it looks normal to me. does html-ls work?

Yes, it's strange... HTML-ls seems to work fine

image

it might be a project-specific problem then, can you try lsp-toggle-trace-io and then lsp-workspace-show-log to see if any error is reported by the tailwindcss server?

yes that worked! With lsp-toggle-trace-io and then lsp-workspace-show-log I found a mistake in my project setup... Now It works like a charm! Thanks! I will close this issue