From f210c68bc2dc51d07264c30f8def6e037c091cea Mon Sep 17 00:00:00 2001 From: "Gustavo L de Mello (Guz)" Date: Fri, 3 Jan 2025 10:19:40 -0300 Subject: [PATCH] feat: use templ if it is installed in path --- lua/dot013/plugins/lsp.lua | 12 +++++++++++- neovim.nix | 1 - 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/lua/dot013/plugins/lsp.lua b/lua/dot013/plugins/lsp.lua index 633bfd7..95cf214 100644 --- a/lua/dot013/plugins/lsp.lua +++ b/lua/dot013/plugins/lsp.lua @@ -79,7 +79,13 @@ local lsps = { root_dir = nil, }, -- ["tailwindcss"] = {}, - ["templ"] = {}, + ["templ"] = function() + if vim.fn.executable("templ") then + return {} + else + return nil + end + end, ["ts_ls"] = {}, ["rust_analyzer"] = {}, ["unocss"] = function() @@ -103,6 +109,10 @@ return { v = v() end + if v == nil then + return + end + v.capabilities = require("blink.cmp").get_lsp_capabilities(v.capabilities) lsp[k].setup(v) end diff --git a/neovim.nix b/neovim.nix index 3fcbf29..2b67b63 100644 --- a/neovim.nix +++ b/neovim.nix @@ -80,7 +80,6 @@ lua-language-server nil tailwindcss-language-server - templ typescript-language-server rust-analyzer vscode-langservers-extracted