mirror of
https://github.com/pojokcodeid/nvim-lazy.git
synced 2025-06-23 01:08:53 +02:00
add: tidy up the code, more modular
This commit is contained in:
parent
1545d8335d
commit
1f424a1225
10 changed files with 583 additions and 522 deletions
19
lua/user/utils/linter.lua
Normal file
19
lua/user/utils/linter.lua
Normal file
|
@ -0,0 +1,19 @@
|
|||
local null_ls = require("null-ls")
|
||||
local M = {}
|
||||
|
||||
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)
|
||||
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
|
||||
end
|
||||
|
||||
return M
|
Loading…
Add table
Add a link
Reference in a new issue