summaryrefslogtreecommitdiff
path: root/fnl/config/lsp
diff options
context:
space:
mode:
authorGustaf Rydholm <gustaf.rydholm@gmail.com>2022-04-07 22:32:53 +0200
committerGustaf Rydholm <gustaf.rydholm@gmail.com>2022-04-07 22:32:53 +0200
commit71d538630b226da37e4ef21c5a84d6fad5f55421 (patch)
tree5f87a9c1194a556d12ffca79ea98a08d76af548e /fnl/config/lsp
parentfa9a5c6b80b5b0ffdcddc4b1d1c6cfe887d0bb04 (diff)
fix(load plugin): correct loading err
Diffstat (limited to 'fnl/config/lsp')
-rw-r--r--fnl/config/lsp/init.fnl13
-rw-r--r--fnl/config/lsp/lsp-installer.fnl11
-rw-r--r--fnl/config/lsp/null-ls.fnl50
-rw-r--r--fnl/config/lsp/settings/jsonls.fnl25
4 files changed, 47 insertions, 52 deletions
diff --git a/fnl/config/lsp/init.fnl b/fnl/config/lsp/init.fnl
index 56d4096..aa61f61 100644
--- a/fnl/config/lsp/init.fnl
+++ b/fnl/config/lsp/init.fnl
@@ -2,11 +2,8 @@
(module config.lsp.init
{autoload {util util}})
-(let [(ok? _) util.load-plugin :lspconfig]
- (when ok?
- (do
- (require :config.lsp.lsp-installer)
- ((require :config.lsp.handlers).setup)
- (require :config.lsp.null-ls))))
-
-
+(let [_ (util.load-plugin :lspconfig)]
+ (do
+ (require :config.lsp.lsp-installer)
+ ((require :config.lsp.handlers).setup)
+ (require :config.lsp.null-ls)))
diff --git a/fnl/config/lsp/lsp-installer.fnl b/fnl/config/lsp/lsp-installer.fnl
index b5ebb36..7946fdf 100644
--- a/fnl/config/lsp/lsp-installer.fnl
+++ b/fnl/config/lsp/lsp-installer.fnl
@@ -3,7 +3,7 @@
{autoload {util util}})
(def- opts
- {:on_attach: ((require :config.lsp.handlers).on_attach)
+ {:on_attach: (require :config.lsp.handlers).on_attach
:capabilities ((require :config.lsp.handlers).capabilities)})
(defn- get-server-opts [server]
@@ -18,8 +18,7 @@
(vim.tbl_deep_extend :force pyright-opts opts))))
-(let [(ok? lsp-installer) util.load-plugin :lsp-installer]
- (when ok?
- (lsp-installer.on_server_ready (fn [server]
- (let [opts (get-server-opts server)]
- server:setup opts)))))
+(let [lsp-installer (util.load-plugin :lsp-installer)]
+ (lsp-installer.on_server_ready (fn [server]
+ (let [opts (get-server-opts server)]
+ server:setup opts)))))
diff --git a/fnl/config/lsp/null-ls.fnl b/fnl/config/lsp/null-ls.fnl
index b2bc1e2..0f9e459 100644
--- a/fnl/config/lsp/null-ls.fnl
+++ b/fnl/config/lsp/null-ls.fnl
@@ -2,28 +2,28 @@
(module config.lsp.null-ls
{autoload {util util}})
-(let [(ok? null-ls) util.load-plugin :null-ls]
- (when ok?
- (let [formatting null_ls.builtins.formatting diagnostics null_ls.builtins.diagnostics])
- (null-ls.setup
- {:debug false
- :sources [
- (diagnostics.flake8)
- (diagnostics.golangci_lint)
- (diagnostics.jsonlint)
- (diagnostics.shellcheck)
- (diagnostics.yamllint)
- (formatting.black.with { extra_args [ "--fast" ] })
- (formatting.erlfmt)
- (formatting.fourmolu)
- (formatting.gofmt)
- (formatting.goimports)
- (formatting.nixfmt)
- (formatting.prettier.with {
- extra_args [ "--no-semi" "--single-quote" "--jsx-single-quote" ]
- })
- (formatting.rustfmt)
- (formatting.shfmt)
- (formatting.sqlformat)
- (formatting.stylua)
- (formatting.terraform_fmt)]})))
+(let [null-ls (util.load-plugin :null-ls)]
+ (let [formatting null_ls.builtins.formatting
+ diagnostics null_ls.builtins.diagnostics])
+ (null-ls.setup
+ {:debug false
+ :sources [
+ (diagnostics.flake8)
+ (diagnostics.golangci_lint)
+ (diagnostics.jsonlint)
+ (diagnostics.shellcheck)
+ (diagnostics.yamllint)
+ (formatting.black.with { extra_args [ "--fast" ] })
+ (formatting.erlfmt)
+ (formatting.fourmolu)
+ (formatting.gofmt)
+ (formatting.goimports)
+ (formatting.nixfmt)
+ (formatting.prettier.with {
+ extra_args [ "--no-semi" "--single-quote" "--jsx-single-quote" ]
+ })
+ (formatting.rustfmt)
+ (formatting.shfmt)
+ (formatting.sqlformat)
+ (formatting.stylua)
+ (formatting.terraform_fmt)]}))
diff --git a/fnl/config/lsp/settings/jsonls.fnl b/fnl/config/lsp/settings/jsonls.fnl
index 1475fd1..5f4b18b 100644
--- a/fnl/config/lsp/settings/jsonls.fnl
+++ b/fnl/config/lsp/settings/jsonls.fnl
@@ -2,16 +2,15 @@
(module config.lsp.settings.jsonls
{autoload {util util}})
-(let [(ok? schemastore) util.load-plugin :schemastore]
- (when ok?
- (schemastore.setup
- {:init_options {
- :providerFormatter false}
- :settings {
- :json {
- :schemas (schemastore.json.schemas)}}
- :setup {
- :commands {
- :Format {
- (fn []
- (vim.lsp.buf.range_formatting {} [ 0 0 ] [ (vim.fn.line "$" 0) ]))}}}})))
+(let [schemastore (util.load-plugin :schemastore)]
+ (schemastore.setup
+ {:init_options {
+ :providerFormatter false}
+ :settings {
+ :json {
+ :schemas (schemastore.json.schemas)}}
+ :setup {
+ :commands {
+ :Format {
+ (fn []
+ (vim.lsp.buf.range_formatting {} [ 0 0 ] [ (vim.fn.line "$" 0) ]))}}}})))