diff options
author | Gustaf Rydholm <gustaf.rydholm@gmail.com> | 2022-10-16 01:40:16 +0200 |
---|---|---|
committer | Gustaf Rydholm <gustaf.rydholm@gmail.com> | 2022-10-16 01:40:16 +0200 |
commit | 6cb31718df762c6ebf764986074f08b19d6f82f8 (patch) | |
tree | 4bc60c9d94de082914ea9ab2d488114caff4edd4 /fnl/config/lsp | |
parent | 68c0f6bab06ea587b9b258d1ad3b0c9870bc163f (diff) |
Refactor loading of plugins with packer
Diffstat (limited to 'fnl/config/lsp')
-rw-r--r-- | fnl/config/lsp/handlers.fnl | 6 | ||||
-rw-r--r-- | fnl/config/lsp/init.fnl | 10 | ||||
-rw-r--r-- | fnl/config/lsp/mason-lspconfig.fnl | 6 | ||||
-rw-r--r-- | fnl/config/lsp/mason-null-ls.fnl | 4 | ||||
-rw-r--r-- | fnl/config/lsp/mason.fnl | 4 | ||||
-rw-r--r-- | fnl/config/lsp/null-ls.fnl | 4 | ||||
-rw-r--r-- | fnl/config/lsp/settings/jsonls.fnl | 4 |
7 files changed, 14 insertions, 24 deletions
diff --git a/fnl/config/lsp/handlers.fnl b/fnl/config/lsp/handlers.fnl index c892a22..913a5a2 100644 --- a/fnl/config/lsp/handlers.fnl +++ b/fnl/config/lsp/handlers.fnl @@ -1,5 +1,5 @@ ;; Handlers for the requests and responses from and to the lsp server. -(module config.lsp.handlers {autoload {: util nvim aniseed.nvim}}) +(module config.lsp.handlers {autoload {:util :config.util nvim aniseed.nvim}}) (def- signs [{:name :DiagnosticSignError :text ""} {:name :DiagnosticSignWarn :text ""} @@ -55,5 +55,5 @@ (let [capabilities (vim.lsp.protocol.make_client_capabilities)] (set capabilities.textDocument.completion.completionItem.snippetSupport true) - (let [cmp-nvim-lsp (util.load-plugin :cmp_nvim_lsp)] - (cmp-nvim-lsp.update_capabilities capabilities)))) + (let [cmp-nvim-lsp (util.prequire :cmp_nvim_lsp)] + (cmp-nvim-lsp.default_capabilities capabilities)))) diff --git a/fnl/config/lsp/init.fnl b/fnl/config/lsp/init.fnl deleted file mode 100644 index 378473e..0000000 --- a/fnl/config/lsp/init.fnl +++ /dev/null @@ -1,10 +0,0 @@ -;; Loads the LSP functionality. -(module config.lsp.init {autoload {: util}}) - -(require :config.lsp.mason) -(require :config.lsp.mason-lspconfig) -(let [handlers (require :config.lsp.handlers)] - (handlers.setup)) - -(require :config.lsp.null-ls) -(require :config.lsp.mason-null-ls) diff --git a/fnl/config/lsp/mason-lspconfig.fnl b/fnl/config/lsp/mason-lspconfig.fnl index a2bd714..7a03ced 100644 --- a/fnl/config/lsp/mason-lspconfig.fnl +++ b/fnl/config/lsp/mason-lspconfig.fnl @@ -1,5 +1,5 @@ ;; TBD -(module config.lsp.mason-lspconfig {autoload {: util}}) +(module config.lsp.mason-lspconfig {autoload {:util :config.util}}) (def- servers [:bashls :clangd @@ -49,9 +49,9 @@ (def- opts {:ensure_installed servers :automatic_installation true}) -(util.use-config :mason-lspconfig opts) +(util.setup :mason-lspconfig opts) -(let [lspconfig (util.load-plugin :lspconfig)] +(let [lspconfig (util.prequire :lspconfig)] (each [_ server (ipairs servers)] (let [server-config (. lspconfig server)] (server-config.setup (get-server-opts server))))) diff --git a/fnl/config/lsp/mason-null-ls.fnl b/fnl/config/lsp/mason-null-ls.fnl index 42b3715..e739b9b 100644 --- a/fnl/config/lsp/mason-null-ls.fnl +++ b/fnl/config/lsp/mason-null-ls.fnl @@ -1,5 +1,5 @@ ;; Ensure that tools needed for null-ls are installed. -(module config.mason-null-ls {autoload {: util}}) +(module config.mason-null-ls {autoload {:util :config.util}}) (def- opts {:ensure_installed [:flake8 :golangci-lint @@ -23,4 +23,4 @@ :auto_update true :automatic_installation true}) -(util.use-config :mason-null-ls opts) +(util.setup :mason-null-ls opts) diff --git a/fnl/config/lsp/mason.fnl b/fnl/config/lsp/mason.fnl index 66963cb..7c58d94 100644 --- a/fnl/config/lsp/mason.fnl +++ b/fnl/config/lsp/mason.fnl @@ -1,9 +1,9 @@ ;; Mason manages external tooling, e.g. lsp, formatters, and linters. -(module config.lsp.mason {autoload {: util}}) +(module config.lsp.mason {autoload {:util :config.util}}) (def- opts {:ui {:icons {:package_installed "✓" :package_pending "➜" :package_uninstalled "✗"}} :max_concurrent_installers 10}) -(util.use-config :mason opts) +(util.setup :mason opts) diff --git a/fnl/config/lsp/null-ls.fnl b/fnl/config/lsp/null-ls.fnl index 9ad1fed..7efb079 100644 --- a/fnl/config/lsp/null-ls.fnl +++ b/fnl/config/lsp/null-ls.fnl @@ -1,7 +1,7 @@ ;; Adds LSP diagnostics and formatting. -(module config.lsp.null-ls {autoload {: util}}) +(module config.lsp.null-ls {autoload {:util :config.util}}) -(let [null-ls (util.load-plugin :null-ls)] +(let [null-ls (util.prequire :null-ls)] (let [formatting null-ls.builtins.formatting diagnostics null-ls.builtins.diagnostics] (null-ls.setup {:debug false diff --git a/fnl/config/lsp/settings/jsonls.fnl b/fnl/config/lsp/settings/jsonls.fnl index a2cb78c..3fe9299 100644 --- a/fnl/config/lsp/settings/jsonls.fnl +++ b/fnl/config/lsp/settings/jsonls.fnl @@ -1,7 +1,7 @@ ;; Json schema store catalog language server. -(module config.lsp.settings.jsonls {autoload {: util}}) +(module config.lsp.settings.jsonls {autoload {:util :config.util}}) -(let [schemastore (util.load-plugin :schemastore)] +(let [schemastore (util.prequire :schemastore)] {:init_options {:providerFormatter false} :settings {:json {:schemas (schemastore.json.schemas)}} :setup {:commands {:Format [(fn [] |