summaryrefslogtreecommitdiff
path: root/.config/nvim/lua/lsp/null-ls
diff options
context:
space:
mode:
authorGustaf Rydholm <gustaf.rydholm@gmail.com>2021-11-08 23:13:05 +0100
committerGustaf Rydholm <gustaf.rydholm@gmail.com>2021-11-08 23:13:05 +0100
commitc9e2adbbc8fd7a5398c8c66d21f0e02dc7b60203 (patch)
tree274263ba15e0197180af8bb681e22c4780d5de05 /.config/nvim/lua/lsp/null-ls
parente4ea22e223bbd6b4091610c6fa093862cbd32f75 (diff)
Add new lunarvin updates
Diffstat (limited to '.config/nvim/lua/lsp/null-ls')
-rw-r--r--.config/nvim/lua/lsp/null-ls/formatters.lua3
-rw-r--r--.config/nvim/lua/lsp/null-ls/init.lua17
-rw-r--r--.config/nvim/lua/lsp/null-ls/linters.lua3
3 files changed, 5 insertions, 18 deletions
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