mirror of
https://github.com/pojokcodeid/nvim-lazy.git
synced 2025-06-24 17:58:46 +02:00
add: update
This commit is contained in:
parent
14207d8f21
commit
9b41753fd4
9 changed files with 348 additions and 189 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue