summaryrefslogtreecommitdiff
path: root/fnl/config/lsp
diff options
context:
space:
mode:
Diffstat (limited to 'fnl/config/lsp')
-rw-r--r--fnl/config/lsp/diagnostics.fnl34
-rw-r--r--fnl/config/lsp/init.fnl6
-rw-r--r--fnl/config/lsp/keymaps.fnl22
-rw-r--r--fnl/config/lsp/lspconfig.fnl40
-rw-r--r--fnl/config/lsp/mason.fnl11
-rw-r--r--fnl/config/lsp/null-ls.fnl43
-rw-r--r--fnl/config/lsp/servers.fnl29
7 files changed, 0 insertions, 185 deletions
diff --git a/fnl/config/lsp/diagnostics.fnl b/fnl/config/lsp/diagnostics.fnl
deleted file mode 100644
index db9ea19..0000000
--- a/fnl/config/lsp/diagnostics.fnl
+++ /dev/null
@@ -1,34 +0,0 @@
-;; Handlers for the requests and responses from and to the lsp server.
-(module config.lsp.handlers {autoload {util config.util nvim aniseed.nvim}})
-
-(def- signs [{:name :DiagnosticSignError :text ""}
- {:name :DiagnosticSignWarn :text ""}
- {:name :DiagnosticSignHint :text ""}
- {:name :DiagnosticSignInfo :text ""}])
-
-(defn- apply-signs [] (each [_ sign (ipairs signs)]
- (vim.fn.sign_define sign.name
- {:texthl sign.name
- :text sign.text
- :numhl ""})))
-
-(def- config {:virtual_text false
- :signs {:active signs}
- :update_in_insert false
- :underline true
- :severity_sort true
- :float {:focusable false
- :style :minimal
- :border :rounded
- :source :always
- :header ""
- :prefix ""}})
-
-(do
- (apply-signs)
- (vim.diagnostic.config config)
- (set vim.lsp.handlers.textDocument/hover
- (vim.lsp.with {:border :rounded :width 60}))
- (set vim.lsp.handlers.textDocument/signatureHelp
- (vim.lsp.with vim.lsp.handlers.signature_help
- {:border :rounded :width 60})))
diff --git a/fnl/config/lsp/init.fnl b/fnl/config/lsp/init.fnl
deleted file mode 100644
index 6166fa1..0000000
--- a/fnl/config/lsp/init.fnl
+++ /dev/null
@@ -1,6 +0,0 @@
-;; Lsp modules.
-
-(local plugins [:config.lsp.lspconfig :config.lsp.mason :config.lsp.null-ls])
-
-(let [util (require :config.util)]
- (util.load plugins))
diff --git a/fnl/config/lsp/keymaps.fnl b/fnl/config/lsp/keymaps.fnl
deleted file mode 100644
index c60dfa9..0000000
--- a/fnl/config/lsp/keymaps.fnl
+++ /dev/null
@@ -1,22 +0,0 @@
-;; Key mappings for lsp.
-(module config.lsp.keymaps {autoload {nvim aniseed.nvim}})
-
-(defn on-attach [bufnr] (let [opts {:noremap true :silent true}]
- (nvim.buf_set_keymap bufnr :n :gD
- "<cmd>lua vim.lsp.buf.declaration()<CR>"
- opts)
- (nvim.buf_set_keymap bufnr :n :gd
- "<cmd>lua vim.lsp.buf.definition()<CR>"
- opts)
- (nvim.buf_set_keymap bufnr :n :gI
- "<cmd>lua vim.lsp.buf.implementation()<CR>"
- opts)
- (nvim.buf_set_keymap bufnr :n :gr
- "<cmd>lua vim.lsp.buf.references()<CR>"
- opts)
- (nvim.buf_set_keymap bufnr :n :gl
- "<cmd>lua vim.diagnostic.open_float()<CR>"
- opts)
- (nvim.buf_set_keymap bufnr :n :gs
- "<cmd>lua vim.lsp.buf.signature_help()<CR>"
- opts)))
diff --git a/fnl/config/lsp/lspconfig.fnl b/fnl/config/lsp/lspconfig.fnl
deleted file mode 100644
index 74faa26..0000000
--- a/fnl/config/lsp/lspconfig.fnl
+++ /dev/null
@@ -1,40 +0,0 @@
-;; Setup of lsps.
-
-(fn on-attach []
- (vim.api.nvim_create_autocmd :LspAttach
- {:callback (fn [args]
- (let [keymaps (require :config.lsp.keymaps)
- bufnr (. args :buf)]
- (keymaps.on-attach bufnr)))}))
-
-(fn capabilities []
- (let [cmp-lsp (require :cmp_nvim_lsp)]
- (cmp-lsp.default_capabilities (vim.lsp.protocol.make_client_capabilities))))
-
-(fn mason-opts [servers]
- {:ensure_installed (vim.tbl_keys servers) :automatic_installation true})
-
-(fn setup []
- (require :config.lsp.diagnostics)
- (let [lspconfig (require :lspconfig)
- mason-lspconfig (require :mason-lspconfig)
- servers (require :config.lsp.servers)]
- (on-attach)
- (mason-lspconfig.setup (mason-opts servers))
- (mason-lspconfig.setup_handlers [(fn [server-name]
- (let [server-config (. lspconfig
- server-name)
- opts (or (. servers server-name)
- {})]
- (tset opts :capabilities
- (capabilities))
- (server-config.setup opts)))])))
-
-{1 :neovim/nvim-lspconfig
- :event :BufReadPre
- :dependencies [:mason.nvim
- :williamboman/mason-lspconfig.nvim
- :b0o/SchemaStore.nvim
- :hrsh7th/cmp-nvim-lsp]
- :config (fn []
- (setup))}
diff --git a/fnl/config/lsp/mason.fnl b/fnl/config/lsp/mason.fnl
deleted file mode 100644
index bf57de5..0000000
--- a/fnl/config/lsp/mason.fnl
+++ /dev/null
@@ -1,11 +0,0 @@
-;; Mason manages external tooling, e.g. lsp, formatters, and linters.
-
-(local opts {:ui {:icons {:package_installed " "
- :package_pending " "
- :package_uninstalled " "}}
- :max_concurrent_installers 10})
-
-{1 :williamboman/mason.nvim
- :cmd :Mason
- :keys [{1 :<leader>m 2 :<cmd>Mason<cr> :desc :Mason}]
- : opts}
diff --git a/fnl/config/lsp/null-ls.fnl b/fnl/config/lsp/null-ls.fnl
deleted file mode 100644
index 13dd493..0000000
--- a/fnl/config/lsp/null-ls.fnl
+++ /dev/null
@@ -1,43 +0,0 @@
-;; Adds LSP diagnostics and formatting.
-
-(local mason-opts {:ensure_installed nil
- :automatic_installation true
- :automatic_setup false})
-
-(fn setup []
- (let [null-ls (require :null-ls)
- mason-null-ls (require :mason-null-ls)]
- (let [formatting null-ls.builtins.formatting
- diagnostics null-ls.builtins.diagnostics]
- (null-ls.setup {:debug false
- :sources [diagnostics.codespell
- diagnostics.cpplint
- diagnostics.gitlint
- diagnostics.hadolint
- diagnostics.jsonlint
- diagnostics.misspell
- diagnostics.ruff
- diagnostics.selene
- diagnostics.shellcheck
- diagnostics.sqlfluff
- diagnostics.write_good
- diagnostics.yamllint
- formatting.fnlfmt
- formatting.markdownlint
- formatting.prettierd
- formatting.ruff
- formatting.rustfmt
- formatting.shellharden
- formatting.shfmt
- formatting.sqlfluff
- formatting.stylua
- formatting.terraform_fmt]}))
- (mason-null-ls.setup mason-opts)))
-
-{1 :jose-elias-alvarez/null-ls.nvim
- :dependencies [:mason.nvim
- :jayp0521/mason-null-ls.nvim
- :nvim-lua/plenary.nvim]
- :event :BufReadPre
- :config (fn []
- (setup))}
diff --git a/fnl/config/lsp/servers.fnl b/fnl/config/lsp/servers.fnl
deleted file mode 100644
index 2403c1a..0000000
--- a/fnl/config/lsp/servers.fnl
+++ /dev/null
@@ -1,29 +0,0 @@
-;; List of lsp that should be automatically installed and supported.
-
-{:bashls {}
- :clangd {}
- :cssls {}
- :dockerls {}
- :hls {}
- :html {}
- :jsonls {:init_options {:providerFormatter false}
- :settings {:json {:schemas (let [schemastore (require :schemastore)]
- (schemastore.json.schemas))}}
- :setup {:commands {:Format [(fn []
- (vim.lsp.buf.range_formatting [] [0 0]
- [(vim.fn.line "$"
- 0)]))]}}}
- :pyright {}
- :rust_analyzer {:settings {:rust-analyzer {:lens {:enable true}
- :checkOnSave {:command :clippy}}}}
- :sqls {}
- :sumneko_lua {:settings {:Lua {:completion {:callSnippet :Replace}
- :workspace {:checkThirdParty false}
- :runtime {:version :LuaJIT
- :path (vim.split package.path ";")}}}}
- :taplo {}
- :terraformls {}
- :texlab {}
- :tflint {}
- :yamlls {}
- :zk {}}