From a90219e7cd1f914d70c4356a88b200214282d602 Mon Sep 17 00:00:00 2001 From: Anish Lakhwara Date: Fri, 30 Dec 2022 23:04:47 +1000 Subject: [PATCH] working fennel-ls wowsa --- home/profiles/nvim/default.nix | 41 +++++++++++++++++----------------- 1 file changed, 21 insertions(+), 20 deletions(-) diff --git a/home/profiles/nvim/default.nix b/home/profiles/nvim/default.nix index 2db16308..51659f67 100644 --- a/home/profiles/nvim/default.nix +++ b/home/profiles/nvim/default.nix @@ -505,22 +505,6 @@ in format = lspkind.cmp_format({ mode = 'symbol_text', maxwidth = 50, - -- old format - -- format = function(entry, vim_item) - -- -- fancy icons and a name of kind - -- vim_item.kind = require("lspkind").presets.default[vim_item.kind] .. - -- " " .. vim_item.kind - -- -- set a name for each source - -- vim_item.menu = ({ - -- buffer = "[Buffer]", - -- nvim_lsp = "[LSP]", - -- look = "[Look]", - -- path = "[Path]", - -- spell = "[Spell]", - -- calc = "[Calc]", - -- })[entry.source.name] - -- return vim_item - -- end }) }, mapping = { @@ -625,11 +609,20 @@ in }, }) - local capabilities = vim.lsp.protocol.make_client_capabilities() - capabilities = require('cmp_nvim_lsp').default_capabilities(capabilities) + capabilities = require('cmp_nvim_lsp').default_capabilities() + -- fennel-ls is bleeding edge local lspconfig = require('lspconfig') - local servers = { 'clojure_lsp', 'terraform_lsp', 'zls', 'pyright', 'rust_analyzer', 'tsserver', 'sumneko_lua', 'fennel-ls' } + require("lspconfig.configs")["fennel-ls"] = { + default_config = { + cmd = {"fennel-ls"}, + filetypes = {"fennel"}, + root_dir = function(dir) return lspconfig.util.find_git_ancestor(dir) end, + settings = {} + } + } + + local servers = { 'clojure_lsp', 'terraform_lsp', 'zls', 'pyright', 'rust_analyzer', 'tsserver', 'sumneko_lua'} for _, lsp in ipairs(servers) do lspconfig[lsp].setup { on_attach = function(client, bufnr) @@ -640,12 +633,20 @@ in } end -- rnix doesn't support gps - require('lspconfig').rnix.setup { + lspconfig['rnix'].setup { on_attach = function(client, bufnr) format.on_attach(client) end, capabilities = capabilities, } + -- fennel-ls doesn't support gps + lspconfig['fennel-ls'].setup { + on_attach = function(client, bufnr) + format.on_attach(client) + end, + capabilities = capabilities, + } + -- deprecated pylsp -- require('lspconfig').pylsp.setup { -- on_attach = function(client, bufnr)