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 }