add: update

This commit is contained in:
asep.komarudin 2024-06-29 08:00:30 +07:00
parent 14207d8f21
commit 9b41753fd4
9 changed files with 348 additions and 189 deletions

View file

@ -1,14 +1,10 @@
local ok, null_ls = pcall(require, "null-ls")
local null_ls = require("null-ls")
local M = {}
M.list_registered = function(filetype)
if ok then
local method = null_ls.methods.FORMATTING
local registered_providers = require("user.utils.lsp").list_registered_providers_names(filetype)
return registered_providers[method] or {}
else
return {}
end
local method = null_ls.methods.FORMATTING
local registered_providers = require("user.utils.lsp").list_registered_providers_names(filetype)
return registered_providers[method] or {}
end
M.list_registered_all = function()

View file

@ -1,27 +1,19 @@
local ok, null_ls = pcall(require, "null-ls")
local null_ls = require("null-ls")
local M = {}
if ok then
M.alternative_methods = {
null_ls.methods.DIAGNOSTICS,
null_ls.methods.DIAGNOSTICS_ON_OPEN,
null_ls.methods.DIAGNOSTICS_ON_SAVE,
}
else
M.alternative_methods = {}
end
M.alternative_methods = {
null_ls.methods.DIAGNOSTICS,
null_ls.methods.DIAGNOSTICS_ON_OPEN,
null_ls.methods.DIAGNOSTICS_ON_SAVE,
}
M.linter_list_registered = function(filetype)
if ok then
local registered_providers = require("user.utils.lsp").list_registered_providers_names(filetype)
local providers_for_methods = vim.iter(vim.tbl_map(function(m)
return registered_providers[m] or {}
end, M.alternative_methods))
local registered_providers = require("user.utils.lsp").list_registered_providers_names(filetype)
local providers_for_methods = vim.iter(vim.tbl_map(function(m)
return registered_providers[m] or {}
end, M.alternative_methods))
return providers_for_methods
else
return {}
end
return providers_for_methods
end
return M

View file

@ -93,8 +93,7 @@ return {
if type(msg) == "boolean" or #msg == 0 then
return "LSP Inactive"
end
-- return msg
table.insert(buf_client_names, msg)
return msg
end
-- add client
for _, client in pairs(buf_clients) do