From a20745c7a2cb0fdc13c1188293aa23a2293e3601 Mon Sep 17 00:00:00 2001 From: Chloe Kudryavtsev Date: Sun, 7 May 2023 17:33:32 -0400 Subject: nvim: improve lsp option handling, add zls --- dot_config/nvim/lua/plugins/lsp/init.lua | 43 +++++++++++++++++++------------- 1 file changed, 26 insertions(+), 17 deletions(-) (limited to 'dot_config/nvim/lua/plugins/lsp') diff --git a/dot_config/nvim/lua/plugins/lsp/init.lua b/dot_config/nvim/lua/plugins/lsp/init.lua index 97a8b79..76b01b1 100644 --- a/dot_config/nvim/lua/plugins/lsp/init.lua +++ b/dot_config/nvim/lua/plugins/lsp/init.lua @@ -1,3 +1,28 @@ +-- lsp options + runtime bindings +-- technically I could do some tree transforms, but that's a pain and I haven't done fennel stuff yet +-- + I'm not sure how feasible fennel stuff is in bootstrap-phase +-- anyway this is here to be in front of everything, so you can edit the settings you actually care about +local gopts = function(plist) + return { + clangd = {}, + clojure_lsp = { + root_dir = plist('project.clj', 'deps.edn', 'bb.edn', 'build.boot', 'shadow-cljs.edn', '.git'), + }, + denols = { + autostart = false, + root_dir = plist('deno.json', 'deno.jsonc'), + }, + gopls = {}, + ltex = {}, + lua_ls = {}, + tsserver = { + autostart = false, + root_dir = plist('tsconfig.json', 'package.json'), + }, + zls = {}, + } +end + local attach = require 'plugins.lsp.attach' local caps = require 'plugins.lsp.capabilities' @@ -22,23 +47,7 @@ return { local p = require 'lspconfig.util'.root_pattern(...) return function(f) return p(f) end end - return { - clangd = {}, - clojure_lsp = { - root_dir = plist('project.clj', 'deps.edn', 'bb.edn', 'build.boot', 'shadow-cljs.edn', '.git'), - }, - denols = { - autostart = false, - root_dir = plist('deno.json', 'deno.jsonc'), - }, - gopls = {}, - ltex = {}, - lua_ls = {}, - tsserver = { - autostart = false, - root_dir = plist('tsconfig.json', 'package.json'), - }, - } + return gopts(plist) end }, } -- cgit v1.2.3