lsp-tailwindcss won't start when using Volar and Nuxt 3
Thank you for the bug report
- [X] I am using the latest version of
lsp-moderelated packages. - [X] I checked FAQ and Troubleshooting sections
- [ ] You may also try reproduce the issue using clean environment using the following command:
M-x lsp-start-plain
Bug description
Hello everyone,
I have tried vls + lsp-tailwindcss on Nuxt 3 project recently and got it working properly. Today, I managed to get volar working by adding .volarrc file into the root of the project directory but tailwindcss language server won't start. I have tried checking lsp-describe-session and I couldn't find it there so I think there is something wrong here.
Steps to reproduce
By adding .volarrc to the root of the project in other to use volar language server
Expected behavior
Both volar and lsp-tailwindcss should start altogether without any problem like vls and lsp-tailwindcss.
Which Language Server did you use?
volar and lsp-tailwindcss
OS
Linux
Error callstack
No response
Anything else?
No response
Do you have (require 'lsp-tailwindcss) in your init.el? What is the content of \*lsp-log\*?
Since I am using Doom Emacs, I have lsp-tailwindcss config as:
- Packages.el
(package! lsp-tailwindcss)
- config.el
(use-package! lsp-tailwindcss)
- As for lsp-log:
Command "/home/pc/.emacs.d/.local/etc/lsp/npm/@tailwindcss/language-server/bin/tailwindcss-language-server --stdio" is present on the path.
Command "/home/pc/.emacs.d/.local/etc/lsp/npm/vls/bin/vls" is present on the path.
Command "/home/pc/.emacs.d/.local/etc/lsp/npm/@volar/vue-language-server/bin/vue-language-server --stdio" is present on the path.
Command "/home/pc/.emacs.d/.local/etc/lsp/npm/@volar/vue-language-server/bin/vue-language-server --stdio" is present on the path.
Command "/home/pc/.emacs.d/.local/etc/lsp/npm/@volar/vue-language-server/bin/vue-language-server --stdio" is present on the path.
Command "/home/pc/.emacs.d/.local/etc/lsp/npm/@tailwindcss/language-server/bin/tailwindcss-language-server --stdio" is present on the path.
Command "/home/pc/.emacs.d/.local/etc/lsp/npm/vls/bin/vls" is present on the path.
Command "/home/pc/.emacs.d/.local/etc/lsp/npm/@volar/vue-language-server/bin/vue-language-server --stdio" is present on the path.
Command "/home/pc/.emacs.d/.local/etc/lsp/npm/@volar/vue-language-server/bin/vue-language-server --stdio" is present on the path.
Command "/home/pc/.emacs.d/.local/etc/lsp/npm/@volar/vue-language-server/bin/vue-language-server --stdio" is present on the path.
Found the following clients for /home/pc/Desktop/my-project/components/Image.vue: (server-id tailwindcss, priority -1), (server-id eslint, priority -1), (server-id vls, priority -1), (server-id volar-api, priority 0), (server-id volar-doc, priority 0), (server-id volar-html, priority 0)
The following clients were selected based on priority: (server-id volar-api, priority 0), (server-id eslint, priority -1), (server-id volar-doc, priority 0), (server-id volar-html, priority 0)
ESLint server running in node v16.11.0
Creating watchers for following 30 folders:
/home/pc/Desktop/my-project
/home/pc/Desktop/my-project/.log
/home/pc/Desktop/my-project/.nuxt
/home/pc/Desktop/my-project/.nuxt/dev
/home/pc/Desktop/my-project/.nuxt/types
/home/pc/Desktop/my-project/.nuxt/views
...
ESLint library loaded from: /home/pc/Desktop/my-project/node_modules/eslint/lib/api.js
Cancelling textDocument/hover(33) in hook after-change-functions
Cancelling textDocument/documentHighlight(32) in hook after-change-functions
Cancelling textDocument/documentLink(31) in hook after-change-functions
Cancelling textDocument/codeLens(29) in hook after-change-functions
Cancelling textDocument/documentLink(25) in hook after-change-functions
Cancelling textDocument/documentLink(22) in hook after-change-functions
Cancelling textDocument/documentLink(16) in hook after-change-functions
Cancelling textDocument/documentLink(13) in hook after-change-functions
Cancelling textDocument/documentLink(7) in hook after-change-functions
Cancelling textDocument/codeLens(39) in hook after-change-functions
Cancelling textDocument/hover(38) in hook after-change-functions
Cancelling textDocument/documentHighlight(37) in hook after-change-functions
Cancelling textDocument/documentLink(36) in hook after-change-functions
Cancelling textDocument/codeAction(35) in hook after-change-functions
Cancelling textDocument/documentHighlight(51) in hook after-change-functions
Cancelling textDocument/documentLink(50) in hook after-change-functions
Cancelling textDocument/codeAction(49) in hook after-change-functions
Cancelling textDocument/codeLens(48) in hook after-change-functions
Cancelling textDocument/hover(47) in hook after-change-functions
Cancelling textDocument/documentLink(45) in hook after-change-functions
Cancelling textDocument/hover(63) in hook after-change-functions
Cancelling textDocument/documentHighlight(76) in hook after-change-functions
Cancelling textDocument/documentLink(75) in hook after-change-functions
Cancelling textDocument/codeAction(74) in hook after-change-functions
Cancelling textDocument/codeLens(73) in hook after-change-functions
Cancelling textDocument/hover(72) in hook after-change-functions
Cancelling textDocument/documentLink(70) in hook after-change-functions
Command "/home/pc/.emacs.d/.local/etc/lsp/npm/@tailwindcss/language-server/bin/tailwindcss-language-server --stdio" is present on the path.
Command "/home/pc/.emacs.d/.local/etc/lsp/npm/vls/bin/vls" is present on the path.
Command "/home/pc/.emacs.d/.local/etc/lsp/npm/@volar/vue-language-server/bin/vue-language-server --stdio" is present on the path.
Command "/home/pc/.emacs.d/.local/etc/lsp/npm/@volar/vue-language-server/bin/vue-language-server --stdio" is present on the path.
Command "/home/pc/.emacs.d/.local/etc/lsp/npm/@volar/vue-language-server/bin/vue-language-server --stdio" is present on the path.
Command "/home/pc/.emacs.d/.local/etc/lsp/npm/@tailwindcss/language-server/bin/tailwindcss-language-server --stdio" is present on the path.
Command "/home/pc/.emacs.d/.local/etc/lsp/npm/vls/bin/vls" is present on the path.
Command "/home/pc/.emacs.d/.local/etc/lsp/npm/@volar/vue-language-server/bin/vue-language-server --stdio" is present on the path.
Command "/home/pc/.emacs.d/.local/etc/lsp/npm/@volar/vue-language-server/bin/vue-language-server --stdio" is present on the path.
Command "/home/pc/.emacs.d/.local/etc/lsp/npm/@volar/vue-language-server/bin/vue-language-server --stdio" is present on the path.
Found the following clients for /home/pc/Desktop/my-project/components/Image.vue: (server-id tailwindcss, priority -1), (server-id eslint, priority -1), (server-id vls, priority -1), (server-id volar-api, priority 0), (server-id volar-doc, priority 0), (server-id volar-html, priority 0)
The following clients were selected based on priority: (server-id volar-api, priority 0), (server-id eslint, priority -1), (server-id volar-doc, priority 0), (server-id volar-html, priority 0)
Cancelling textDocument/codeLens(103) in hook after-change-functions
Cancelling textDocument/hover(102) in hook after-change-functions
Cancelling textDocument/documentHighlight(101) in hook after-change-functions
Cancelling textDocument/documentLink(100) in hook after-change-functions
Cancelling textDocument/codeAction(99) in hook after-change-functions
Cancelling textDocument/documentLink(96) in hook after-change-functions
Cancelling textDocument/documentLink(93) in hook after-change-functions
Cancelling textDocument/documentLink(90) in hook after-change-functions
Cancelling textDocument/documentLink(87) in hook after-change-functions
And for the session:

~~This is because the priority of Volar is set hign (server-id volar-doc, priority 0), (server-id volar-html, priority 0) , mainly to take over the ts-ls's work. So (server-id tailwindcss, priority -1) cannot be enabled together.
https://github.com/merrickluo/lsp-tailwindcss/blob/09377d5bbb742f11c458481905ddbb022dd2b0da/lsp-tailwindcss.el#L319
You can try to set this to 0.~~
Try this?
(use-package lsp-tailwindcss
:init
(setq lsp-tailwindcss-add-on-mode t))
Thanks @jadestrong. I have tried adding you snip above into my config.el and it is working now.
(use-package lsp-tailwindcss
:init
(setq lsp-tailwindcss-add-on-mode t))