-
Notifications
You must be signed in to change notification settings - Fork 2.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
tailwindcss-language-server
does not work with htmldjango
filetype
#2488
Comments
what does lspinfo say ? does tailwindcss attached this buffer? test with the min config it attached the htmldjango filetype buffer. |
Yes, the LSP connects to the buffer, but the language server does not recognise the filetype so it does not respond. Maybe you didn't understand the point of this issue? |
@glepnir Can you please re-open this issue? Or give an explanation as to why it was closed, please? |
I have the same problem. |
@rob32 the filetype has been added upstream in tailwindcss-intellisense tailwindlabs/tailwindcss-intellisense#721 |
@nulty hey thanks for the answer <3 I've been working on getting tailwindcss to run with djangohtml for several days now. Without success... I really don't get it. Whether with plain lspconfig and cmp, with zero-lsp or even with LazyVim and tailwindcss extra. Something is wrong here. LspInfo shows that tailwindcss is atached to the buffer with filetype=htmldjango, no issues with that. With "normal" html files there are no problems and autocomplete runs as expected... I'm truly clueless, if you have an idea or suggestion I would be extremely grateful ;) |
Have you monitored the logs of the lsp? Make sure the logging is verbose
|
Hey, thank you very much! I was able to find the error 🙏 In the end it was a problem with permissions... VsCode had no problems with it because of the |
Description
When editing a django template [1] the
tailwindcss-language-server
is registered but no completion is provided.In (n)vim, a django template is given the filetype
htmldjango
.tailwindcss-language-server
does provide responses forhtml
anddjango-html
filetypes, but nothtmldjango
[2].You can force vim to change the filetype for
htmldjango
with an autocommand, but this shouldn't be necessary.This issue was made apparent here when
htmldjango
was added to the filetypes table but not mapped todjango-html
in theinit_options
.It's clear from looking at the
nvim-lspconfig
for thetailwindcss-language-server
default configuration what needs to be done to fix this innvim-lspconfig
.So onto the reason I'm raising this issue and not instead raising a PR directly:
Should
tailwindcss-language-server
addhtmldjango
to it's list of accepted languages?( have not tested that this would work, I assume it would
Writing this report I've learned that every piece of software has a different name for django templates
markdown_inline =>
django
vim =>
htmldjango
vs-code, tailwindcss =>
django-html
Neovim version
NVIM v0.8.1
Build type: Release
LuaJIT 2.1.0-beta3
Nvim-lspconfig version
62856b2
Operating system and version
Ubuntu 20.20 Linux 5.15.0-60-generic
Affected language servers
tailwindcss-language-server
Steps to reproduce
nvim -nu minimal_init.lua django.html
:set ft
(returnshtmldjango
)class="|"
bg-red-500
)Actual behavior
No completion suggestions when django template has htmldjango filetype
Expected behavior
completion suggestions are provided.
Minimal config
LSP log
https://gist.github.com
The text was updated successfully, but these errors were encountered: