From c9e2adbbc8fd7a5398c8c66d21f0e02dc7b60203 Mon Sep 17 00:00:00 2001 From: Gustaf Rydholm Date: Mon, 8 Nov 2021 23:13:05 +0100 Subject: Add new lunarvin updates --- .config/nvim/lua/lsp/null-ls/formatters.lua | 3 ++- .config/nvim/lua/lsp/null-ls/init.lua | 17 +---------------- .config/nvim/lua/lsp/null-ls/linters.lua | 3 ++- 3 files changed, 5 insertions(+), 18 deletions(-) (limited to '.config/nvim/lua/lsp/null-ls') diff --git a/.config/nvim/lua/lsp/null-ls/formatters.lua b/.config/nvim/lua/lsp/null-ls/formatters.lua index 577a0d9..991f613 100644 --- a/.config/nvim/lua/lsp/null-ls/formatters.lua +++ b/.config/nvim/lua/lsp/null-ls/formatters.lua @@ -4,7 +4,7 @@ local null_ls = require "null-ls" local services = require "lsp.null-ls.services" local Log = require "core.log" -function M.list_supported_names(filetype) +function M.list_registered_providers(filetype) local null_ls_methods = require "null-ls.methods" local formatter_method = null_ls_methods.internal["FORMATTING"] local registered_providers = services.list_registered_providers_names(filetype) @@ -24,6 +24,7 @@ function M.list_available(filetype) end end + table.sort(formatters) return formatters end diff --git a/.config/nvim/lua/lsp/null-ls/init.lua b/.config/nvim/lua/lsp/null-ls/init.lua index a18209b..9560240 100644 --- a/.config/nvim/lua/lsp/null-ls/init.lua +++ b/.config/nvim/lua/lsp/null-ls/init.lua @@ -1,8 +1,6 @@ local M = {} local Log = require "core.log" -local formatters = require "lsp.null-ls.formatters" -local linters = require "lsp.null-ls.linters" function M:setup() local status_ok, null_ls = pcall(require, "null-ls") @@ -17,21 +15,8 @@ function M:setup() if vim.tbl_isempty(options.lsp.null_ls.setup or {}) then options.lsp.null_ls.setup = default_opts end + require("lspconfig")["null-ls"].setup(options.lsp.null_ls.setup) - for filetype, config in pairs(options.lang) do - if not vim.tbl_isempty(config.formatters) then - vim.tbl_map(function(c) - c.filetypes = { filetype } - end, config.formatters) - formatters.setup(config.formatters) - end - if not vim.tbl_isempty(config.linters) then - vim.tbl_map(function(c) - c.filetypes = { filetype } - end, config.formatters) - linters.setup(config.linters) - end - end end return M diff --git a/.config/nvim/lua/lsp/null-ls/linters.lua b/.config/nvim/lua/lsp/null-ls/linters.lua index 3f834ba..85555ba 100644 --- a/.config/nvim/lua/lsp/null-ls/linters.lua +++ b/.config/nvim/lua/lsp/null-ls/linters.lua @@ -4,7 +4,7 @@ local null_ls = require "null-ls" local services = require "lsp.null-ls.services" local Log = require "core.log" -function M.list_supported_names(filetype) +function M.list_registered_providers(filetype) local null_ls_methods = require "null-ls.methods" local linter_method = null_ls_methods.internal["DIAGNOSTICS"] local registered_providers = services.list_registered_providers_names(filetype) @@ -24,6 +24,7 @@ function M.list_available(filetype) end end + table.sort(linters) return linters end -- cgit v1.2.3-70-g09d2