From dd8b44d476f6e429b2e05cd11aa22d7f0f5eaabe Mon Sep 17 00:00:00 2001 From: "Gustavo L de Mello (Guz)" Date: Wed, 11 Dec 2024 21:38:31 -0300 Subject: [PATCH] feat: unocss lsp --- lua/dot013/plugins/lsp.lua | 12 ++++++++++++ neovim.nix | 5 +++++ 2 files changed, 17 insertions(+) diff --git a/lua/dot013/plugins/lsp.lua b/lua/dot013/plugins/lsp.lua index 15f7eb1..4f76f0d 100644 --- a/lua/dot013/plugins/lsp.lua +++ b/lua/dot013/plugins/lsp.lua @@ -81,6 +81,14 @@ local lsps = { ["templ"] = {}, ["ts_ls"] = {}, ["rust_analyzer"] = {}, + ["unocss"] = function() + -- local unocss = require("lspconfig.configs")["unocss"] + return { + filetypes = { + "templ", + }, + } + end, } return { @@ -90,6 +98,10 @@ return { after = function() local lsp = require("lspconfig") for k, v in pairs(lsps) do + if type(v) == "function" then + v = v() + 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 84f4af4..96e298c 100644 --- a/neovim.nix +++ b/neovim.nix @@ -83,6 +83,11 @@ typescript-language-server rust-analyzer vscode-langservers-extracted + + # Temporally solution since there isn't a easy way to install pnpm packages + (pkgs.writeShellScriptBin "unocss-language-server" '' + ${lib.getExe pkgs.bun} x unocss-language-server@0.1.5 "$@" + '') ]; packages = with pkgs; [