diff options
| author | seth <[email protected]> | 2023-04-02 21:14:36 -0400 |
|---|---|---|
| committer | seth <[email protected]> | 2023-04-02 21:14:36 -0400 |
| commit | 8a8be409c0f0d911eb19969c05e7f4a171a63767 (patch) | |
| tree | 3dcdd90daed9ef83527093396d185a7bfda9dbd5 /.config/nvim/lua/getchoo/lsp/config/null_ls.lua | |
| parent | d421be1222d6744c0d738e5fbf96ee6daafd61b2 (diff) | |
copy refactor from flake for neovim config
Diffstat (limited to '.config/nvim/lua/getchoo/lsp/config/null_ls.lua')
| -rw-r--r-- | .config/nvim/lua/getchoo/lsp/config/null_ls.lua | 42 |
1 files changed, 0 insertions, 42 deletions
diff --git a/.config/nvim/lua/getchoo/lsp/config/null_ls.lua b/.config/nvim/lua/getchoo/lsp/config/null_ls.lua deleted file mode 100644 index 16b1b3c..0000000 --- a/.config/nvim/lua/getchoo/lsp/config/null_ls.lua +++ /dev/null @@ -1,42 +0,0 @@ --- --- config for null_ls --- - -local sources = require("getchoo.lsp.config.sources") - -local M = {} - --- only use null-ls for formatting --- for neovim >= 8 -local lsp_formatting = function(bufnr) - vim.lsp.buf.format({ - filter = function(client) - return client.name == "null-ls" - end, - bufnr = bufnr, - }) -end - -local augroup = vim.api.nvim_create_augroup("LspFormatting", {}) -local formatting_on_attach = function(client, bufnr) - if client.supports_method("textDocument/formatting") then - vim.api.nvim_clear_autocmds({ group = augroup, buffer = bufnr }) - vim.api.nvim_create_autocmd("BufWritePre", { - group = augroup, - buffer = bufnr, - callback = function() - -- for neovim < 8 - ---- local params = require("vim.lsp.util").make_formatting_params({}) - ---- client.request("textDocument/formatting", params, nil, bufnr) - lsp_formatting(bufnr) -- neovim >= 8 - end, - }) - end -end - -M.config = { - on_attach = formatting_on_attach, - sources = sources.null_ls, -} - -return M |
