Config tailwincss LSP to support Rust as HTML template so the suggestion can work with rust files.

This commit is contained in:
tronglt 2023-10-22 23:20:59 +07:00
parent 28d7b96c12
commit 9301595e2b
1 changed files with 18 additions and 2 deletions

View File

@ -84,7 +84,7 @@ require('lazy').setup({
-- Useful status updates for LSP -- Useful status updates for LSP
-- NOTE: `opts = {}` is the same as calling `require('fidget').setup({})` -- NOTE: `opts = {}` is the same as calling `require('fidget').setup({})`
{ 'j-hui/fidget.nvim', opts = {} }, { 'j-hui/fidget.nvim', tag = 'legacy', opts = {} },
-- Additional lua configuration, makes nvim stuff amazing! -- Additional lua configuration, makes nvim stuff amazing!
'folke/neodev.nvim', 'folke/neodev.nvim',
@ -120,7 +120,7 @@ require('lazy').setup({
-- See `:help lualine.txt` -- See `:help lualine.txt`
opts = { opts = {
options = { options = {
icons_enabled = false, icons_enabled = true,
theme = 'kanagawa', theme = 'kanagawa',
component_separators = '|', component_separators = '|',
section_separators = '', section_separators = '',
@ -131,6 +131,7 @@ require('lazy').setup({
{ {
-- Add indentation guides even on blank lines -- Add indentation guides even on blank lines
'lukas-reineke/indent-blankline.nvim', 'lukas-reineke/indent-blankline.nvim',
main = "ibl",
-- Enable `lukas-reineke/indent-blankline.nvim` -- Enable `lukas-reineke/indent-blankline.nvim`
-- See `:help indent_blankline.txt` -- See `:help indent_blankline.txt`
opts = { opts = {
@ -475,6 +476,21 @@ mason_lspconfig.setup_handlers {
settings = servers[server_name], settings = servers[server_name],
} }
end, end,
["tailwindcss"] = function()
require("lspconfig").tailwindcss.setup {
filetypes = { "aspnetcorerazor", "astro", "astro-markdown", "blade", "clojure", "django-html", "htmldjango",
"edge", "eelixir", "elixir", "ejs", "erb", "eruby", "gohtml", "gohtmltmpl", "haml", "handlebars", "hbs", "html",
"html-eex", "heex", "jade", "leaf", "liquid", "markdown", "mdx", "mustache", "njk", "nunjucks", "php", "razor",
"slim", "twig", "css", "less", "postcss", "sass", "scss", "stylus", "sugarss", "javascript", "javascriptreact",
"reason", "rescript", "typescript", "typescriptreact", "vue", "svelte", "rust" },
init_options = {
userLanguages = {
rust = "html"
},
}
}
end
} }
-- nvim-cmp setup -- nvim-cmp setup