From 46d1d9092d4f353de878d70f2f349636460d30bc Mon Sep 17 00:00:00 2001 From: Alexander Rosenberg Date: Wed, 3 May 2023 23:11:28 -0700 Subject: [PATCH] Reorganize lsp stuff --- fnl/plugin.fnl | 22 +--------------------- fnl/plugin/lsp.fnl | 26 ++++++++++++++++++++++++-- 2 files changed, 25 insertions(+), 23 deletions(-) diff --git a/fnl/plugin.fnl b/fnl/plugin.fnl index eaf8690..dfe09d4 100644 --- a/fnl/plugin.fnl +++ b/fnl/plugin.fnl @@ -189,27 +189,7 @@ (use! :jose-elias-alvarez/null-ls.nvim :after :nvim-lspconfig :config - (let [builtins (. (require :null-ls) :builtins)] - (setup! :null-ls - :sources [ - builtins.formatting.astyle - builtins.formatting.prettier - builtins.formatting.yapf - builtins.formatting.fnlfmt - builtins.formatting.shfmt - builtins.formatting.cmake_format - builtins.formatting.latexindent - builtins.formatting.stylua - builtins.code_actions.shellcheck - (builtins.completion.spell.with { :filetypes [ :text - :markdown - :tex ]}) - builtins.diagnostics.cmake_lint - builtins.diagnostics.codespell - builtins.diagnostics.shellcheck - (builtins.diagnostics.glslc.with - { :extra_args [ "--target-env=opengl" ]}) - ]))) + (module-call! :plugin.lsp :setup-null-ls)) (use! :j-hui/fidget.nvim :after :nvim-lspconfig diff --git a/fnl/plugin/lsp.fnl b/fnl/plugin/lsp.fnl index 874b8e1..fa04cd4 100644 --- a/fnl/plugin/lsp.fnl +++ b/fnl/plugin/lsp.fnl @@ -1,6 +1,6 @@ ;;; lsp.fnl - lsp configurations -(import-macros {: bind!} :macros) +(import-macros {: bind! : setup!} :macros) (fn on-attach [client buf] ((. (. (require :cmp) :setup) :buffer) { @@ -109,4 +109,26 @@ :diagnostics { :globals [ "vim" ] }}}))) -{ : configure : on-attach : get-data-dir } +(fn setup-null-ls [] + (let [builtins (. (require :null-ls) :builtins)] + (setup! :null-ls + :sources [ + builtins.formatting.astyle + builtins.formatting.prettier + builtins.formatting.yapf + builtins.formatting.fnlfmt + builtins.formatting.shfmt + builtins.formatting.cmake_format + builtins.formatting.latexindent + builtins.formatting.stylua + builtins.code_actions.shellcheck + (builtins.completion.spell.with { :filetypes [ :text + :markdown + :tex ]}) + builtins.diagnostics.cmake_lint + builtins.diagnostics.codespell + builtins.diagnostics.shellcheck + (builtins.diagnostics.glslc.with + { :extra_args [ "--target-env=opengl" ]})]))) + +{ : configure : on-attach : get-data-dir : setup-null-ls }