-
-
Notifications
You must be signed in to change notification settings - Fork 10
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
Workaround with tailwindcss lsp #10
Comments
Isn't autocompletion part of a LSP? |
This is what i do for all the LSPs to get attached correctly. I don't know if it's a right method or not. But it works. vim.api.nvim_create_autocmd({ 'BufRead', 'BufEnter' }, {
group = vim.api.nvim_create_augroup('set-angular-filetype', { clear = true }),
pattern = '*.component.html',
callback = function()
-- Necessary for lsps to get attached.
vim.cmd([[set filetype=html]])
vim.cmd([[set filetype=angular.html]])
end,
})
|
I'm facing similar problems. Could you share the full example of your setup with tailwind? |
That's all I do regarding file type setup. It's still buggy, though. You have to open any TypeScript file before going into a template for the Tailwind LSP to work correctly. If you need more details, You can check out my nvim config repo here: nvim. |
Thanks for the quick response @Ask-786 ! My problem was that I still had the setup steps from the docs present. I replaced it with your autocmd snipped and now both is working for me. Thank you! For anyone wondering, here is my full plugin code for this module using your fix: return {
{
'dlvandenberg/tree-sitter-angular',
dependencies = {
'nvim-treesitter/nvim-treesitter',
},
config = function()
vim.api.nvim_create_autocmd({ 'BufRead', 'BufEnter' }, {
group = vim.api.nvim_create_augroup('set-angular-filetype', { clear = true }),
pattern = '*.component.html',
callback = function()
-- Necessary for angular lsp to get attached.
vim.cmd [[set filetype=html]]
vim.cmd [[set filetype=angular.html]]
end,
})
end,
},
}
|
I think you don't need to explicitly install It just get installed automatically when you enter a template file. Sorry for the "Quick" reply by the way. was out of office for last few days. |
In the nightly neovim build, filetype detection is added for Angular Templates. You need to update to the latest nvim-treesitter version also, as the angular parser is coupled to the new filetype. |
I've created a pull request to And if you are formatting with none-ls and prettier or prettierd, I have updated it there too. note: as mentioned by @dlvandenberg, you need the nightly neovim build for this. |
Is there a known way to make the syntax highlighting work so that the tailwind autocomplete would work also in template files?
The text was updated successfully, but these errors were encountered: