From 7f285fe9091c1409b6786fc47bae263c21183f45 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Torbj=C3=B8rn=20Vatn?= Date: Mon, 30 Dec 2024 19:57:17 +0100 Subject: [PATCH] fix: move the default Phoenix settings from setup to opts When the settings is defined with defaults in opts LazyVim will automatically merge them with any additional opts.settings that the user adds --- lua/lazyvim/plugins/extras/lang/tailwind.lua | 25 ++++++++++---------- 1 file changed, 12 insertions(+), 13 deletions(-) diff --git a/lua/lazyvim/plugins/extras/lang/tailwind.lua b/lua/lazyvim/plugins/extras/lang/tailwind.lua index bdd11d01..87216212 100644 --- a/lua/lazyvim/plugins/extras/lang/tailwind.lua +++ b/lua/lazyvim/plugins/extras/lang/tailwind.lua @@ -24,9 +24,20 @@ return { filetypes_include = {}, -- to fully override the default_config, change the below -- filetypes = {} + -- additional settings for the server, e.g: -- tailwindCSS = { includeLanguages = { someLang = "html" } } - settings = {}, + -- can be addeded to the settings table and will be merged with + -- this defaults for Phoenix projects + settings = { + tailwindCSS = { + includeLanguages = { + elixir = "html-eex", + eelixir = "html-eex", + heex = "html-eex", + }, + }, + }, }, }, setup = { @@ -43,18 +54,6 @@ return { return not vim.tbl_contains(opts.filetypes_exclude or {}, ft) end, opts.filetypes) - -- Add additional settings from opts - opts.settings = vim.tbl_deep_extend("error", { - tailwindCSS = { - -- Additional settings for Phoenix projects - includeLanguages = { - elixir = "html-eex", - eelixir = "html-eex", - heex = "html-eex", - }, - }, - }, opts.settings or {}) - -- Add additional filetypes vim.list_extend(opts.filetypes, opts.filetypes_include or {}) end,