Closed zw963 closed 5 months ago
BTW: at the same time, the lsp builtin support mode, e.g. ruby mode with ruby-syntax-tree, so i consider there is something broken in lsp-tailwindcss, thanks
Hey there,
If that is the only config that you have, then you might not have lsp-mode configured to run when in web-mode. You may need to write a hook that initiates lsp-mode when in web-mode, i.e. (add-hook 'web-mode-hook #'lsp-deferred)
You may need to write a hook that initiates lsp-mode when in web-mode, i.e.
(add-hook 'web-mode-hook #'lsp-deferred)
I run lsp
manually instead.
Try to call M-x lsp-workspace-folders-add
first.
Try to call
M-x lsp-workspace-folders-add
first.
Thanks for help, if i run lsp
manually when opened a ???.erb
file use above configuration, i get following lsp candiates selection(check screenshot)
I assume there should be a candidate name same as the server-id tailwindcss
which defined in lsp-tailwindcss.el
, right? so, i disable above lsp candiates, use this:
(setq lsp-disabled-clients '(html-ls emmet-ls semgrep-ls))
then restart emacs and open same erb file, get following message:
LSP :: There are no language servers supporting current mode `web-mode' registered with `lsp-mode'.
This issue might be caused by:
1. The language you are trying to use does not have built-in support in `lsp-mode'. You must install the required support manually. Examples of this are `lsp-java' or `lsp-metals'.
2. The language server that you expect to run is not configured to run for major mode `web-mode'. You may check that by checking the `:major-modes' that are passed to `lsp-register-client'.
3. `lsp-mode' doesn't have any integration for the language behind `web-mode'. Refer to https://emacs-lsp.github.io/lsp-mode/page/languages and https://langserver.org/ .
4. You are over `tramp'. In this case follow https://emacs-lsp.github.io/lsp-mode/page/remote/.
5. You have disabled the `lsp-mode' clients for that file. (Check `lsp-enabled-clients' and `lsp-disabled-clients').
You can customize `lsp-warn-no-matched-clients' to disable this message.
lsp-workspace-folders-add
not help, because i can enable emmet-ls
successful, but, can't found lsp-tailwindcss get registered. but, i remember tailwindcss candidates available before.
@zw963 Do you have the latest lsp-tailwindcss
and lsp-mode
installed? I had to update the latter before the option to install the tailwind server appeared.
And lsp-tailwindcss
needs to be loaded (require
-d), of course.
@zw963 Do you have the latest
lsp-tailwindcss
andlsp-mode
installed? I had to update the latter before the option to install the tailwind server appeared.And
lsp-tailwindcss
needs to be loaded (require
-d), of course.
Yes, lsp-tailwindcss use latest master b363042, lsp-mode is same too.
Although, there is a concern, i never use any package manager, so, just copy latest code into local directory, then require it manually.
And lsp-tailwindcss needs to be loaded (require-d), of course.
Yes, i can saw those variable defined in lsp-tailwindcss.el
lsp-tailwindcss-major-modes is a variable defined in ‘lsp-tailwindcss.el’.
Its value is
(rjsx-mode web-mode html-mode css-mode typescript-mode typescript-tsx-mode tsx-ts-mode)
I can saw lsp-tailwindcss add into lsp-client-packaegs too.
lsp-client-packages is a variable defined in ‘lsp-mode.el’.
Its value is
(ccls ... lsp-tailwindcss ...)
Do you also have a config file in the workspace root that is recognized by this package?
See the definition of lsp-tailwindcss--has-config-file
for the detection logic.
Do you also have a config file in the workspace root that is recognized by this package?
See the definition of
lsp-tailwindcss--has-config-file
for the detection logic.
Oops, i forget add tailwindcss config for my test project, i thought this is the reason tailwindcss can't star.
See the definition of lsp-tailwindcss--has-config-file for the detection logic.
Yes, it return nil, tried on another project, it works, thanks!
Please check following logs.
my minimum config:
Then, after start emacs, open a html file use
.ecr
extension name, then runlsp
, get above error messages.lsp-mode version
lsp-mode latest master: 0f5723f9a web-mode latest master 848fce9 emacs 29.1.90