From 60a8a057a521cb974e3d19aa7dae8a439745ff8c Mon Sep 17 00:00:00 2001 From: Oliver Ladner Date: Fri, 4 Apr 2025 11:36:20 +0200 Subject: [PATCH] feat: add Tailwind CSS LSP --- lsp/tailwind.lua | 34 ++++++++++++++++++++++++++++++++++ lua/weeheavy/prefs.lua | 1 + 2 files changed, 35 insertions(+) create mode 100644 lsp/tailwind.lua diff --git a/lsp/tailwind.lua b/lsp/tailwind.lua new file mode 100644 index 0000000..b0b93c2 --- /dev/null +++ b/lsp/tailwind.lua @@ -0,0 +1,34 @@ +---@type vim.lsp.Config +return { + cmd = { "tailwindcss-language-server", "--stdio" }, + root_markers = { "tailwind.config.js" }, + filetypes = { "javascript", "htmldjango", "css" }, + settings = { + tailwindCSS = { + validate = true, + lint = { + cssConflict = "warning", + invalidApply = "error", + invalidScreen = "error", + invalidVariant = "error", + invalidConfigPath = "error", + invalidTailwindDirective = "error", + recommendedVariantOrder = "warning", + }, + classAttributes = { + "class", + "className", + "class:list", + "classList", + "ngClass", + }, + includeLanguages = { + eelixir = "html-eex", + eruby = "erb", + templ = "html", + htmlangular = "html", + htmldjango = "html", + }, + }, + }, +} diff --git a/lua/weeheavy/prefs.lua b/lua/weeheavy/prefs.lua index f24f928..6312c93 100644 --- a/lua/weeheavy/prefs.lua +++ b/lua/weeheavy/prefs.lua @@ -6,6 +6,7 @@ vim.lsp.enable({ "yaml", "ansible", "marksman", + "tailwind", }) -- Set highlight on search