Skip to content
This repository was archived by the owner on Aug 29, 2025. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@ Here is the default configuration:
},
on_attach = function(client, bufnr) end, -- callback executed when the language server gets attached to a buffer
root_dir = function(fname) end, -- overrides the default function for resolving the root directory
filetypes = {}, -- extends the filetypes from nvim-lspconfig
},
document_color = {
enabled = true, -- can be toggled by commands
Expand Down
1 change: 1 addition & 0 deletions doc/tailwind-tools.nvim.txt
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,7 @@ Here is the default configuration:
},
on_attach = function(client, bufnr) end, -- callback executed when the language server gets attached to a buffer
root_dir = function(fname) end, -- overrides the default function for resolving the root directory
filetypes = {}, -- extends the filetypes from nvim-lspconfig
},
document_color = {
enabled = true, -- can be toggled by commands
Expand Down
1 change: 1 addition & 0 deletions lua/tailwind-tools/config.lua
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ local units = require("tailwind-tools.units")
---@field on_attach? vim.lsp.client.on_attach_cb
---@field root_dir? fun(fname: string): string | nil
---@field capabilities vim.lsp.ClientCapabilities
---@field filetypes? string[]

---@class TailwindTools.SettingsOption
---@field tailwindCSS? TailwindTools.SettingsOption
Expand Down
5 changes: 5 additions & 0 deletions lua/tailwind-tools/lsp.lua
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,11 @@ M.setup = function(server_config, lspconfig)
conf.capabilities.textDocument.colorProvider = {
dynamicRegistration = true,
}
conf.filetypes = vim.tbl_extend(
"keep",
server_config.filetypes or {},
lspconfig.tailwindcss.document_config.default_config.filetypes -- Yes, this is where the default config is
)

lspconfig.tailwindcss.setup(conf)
end
Expand Down