mirror of
https://github.com/pojokcodeid/nvim-lazy.git
synced 2025-06-24 01:38:47 +02:00
add: config default java
This commit is contained in:
parent
24b3020b5c
commit
ef95246d88
5 changed files with 48 additions and 2 deletions
|
@ -161,6 +161,6 @@ pcode.active_golang_config = false
|
|||
pcode.active_python_config = false
|
||||
pcode.active_cpp_config = false
|
||||
pcode.active_java_config = {
|
||||
active = false,
|
||||
active = true,
|
||||
project = "gradle", -- gradle or maven
|
||||
}
|
||||
|
|
|
@ -7,4 +7,10 @@ M.list_registered = function(filetype)
|
|||
return registered_providers[method] or {}
|
||||
end
|
||||
|
||||
M.list_registered_all = function()
|
||||
local registered_providers = require("user.utils.lsp").list_all_registerd()
|
||||
local method = null_ls.methods.FORMATTING
|
||||
return registered_providers[method] or {}
|
||||
end
|
||||
|
||||
return M
|
||||
|
|
|
@ -13,4 +13,17 @@ M.list_registered_providers_names = function(filetype)
|
|||
return registered
|
||||
end
|
||||
|
||||
M.list_all_registerd = function()
|
||||
local s = require("null-ls.sources")
|
||||
local available_sources = s.get_all()
|
||||
local registered = {}
|
||||
for _, source in ipairs(available_sources) do
|
||||
for method in pairs(source.methods) do
|
||||
registered[method] = registered[method] or {}
|
||||
table.insert(registered[method], source.name)
|
||||
end
|
||||
end
|
||||
return registered
|
||||
end
|
||||
|
||||
return M
|
||||
|
|
|
@ -119,7 +119,7 @@ return {
|
|||
local lsp_clients = lsp_format.get_format_clients({ bufnr = bufnr })
|
||||
|
||||
if not vim.tbl_isempty(lsp_clients) then
|
||||
table.insert(buf_client_names, "LSP Formatter")
|
||||
table.insert(buf_client_names, "lsp_fmt")
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
27
lua/user/utils/mappigntest.lua
Normal file
27
lua/user/utils/mappigntest.lua
Normal file
|
@ -0,0 +1,27 @@
|
|||
-- local compare = {
|
||||
-- ["prettier"] = "prettier",
|
||||
-- ["stylua"] = "stylua",
|
||||
-- }
|
||||
--
|
||||
-- local unique_list = function(list)
|
||||
-- local seen = {}
|
||||
-- local result = {}
|
||||
--
|
||||
-- for _, val in ipairs(list) do
|
||||
-- if not seen[val] then
|
||||
-- table.insert(result, val)
|
||||
-- seen[val] = true
|
||||
-- end
|
||||
-- end
|
||||
--
|
||||
-- return result
|
||||
-- end
|
||||
--
|
||||
-- local formatter = require("user.utils.formatter").list_registered_all()
|
||||
-- local unique_client_names = unique_list(formatter)
|
||||
-- for _, value in ipairs(unique_client_names) do
|
||||
-- local out = compare[value]
|
||||
-- if out ~= nil then
|
||||
-- print(out)
|
||||
-- end
|
||||
-- end
|
Loading…
Add table
Add a link
Reference in a new issue