mirror of
https://github.com/zoriya/dotfiles.git
synced 2026-06-07 20:30:34 +00:00
Addnig a fidget for metals messages
This commit is contained in:
@@ -13,13 +13,35 @@ vim.cmd [[
|
|||||||
augroup end
|
augroup end
|
||||||
]]
|
]]
|
||||||
|
|
||||||
|
|
||||||
|
local function metals_status_handler(_, status, ctx)
|
||||||
|
-- https://github.com/scalameta/nvim-metals/blob/main/lua/metals/status.lua#L36-L50
|
||||||
|
local val = {}
|
||||||
|
if status.hide then
|
||||||
|
val = {kind = "end"}
|
||||||
|
elseif status.show then
|
||||||
|
val = {kind = "begin", title = " "} -- status.text title is ignored else messages are duplicated
|
||||||
|
elseif status.text then
|
||||||
|
val = {kind = "report", message = status.text}
|
||||||
|
else
|
||||||
|
return
|
||||||
|
end
|
||||||
|
local info = {client_id = ctx.client_id}
|
||||||
|
local msg = {token = "metals", value = val}
|
||||||
|
-- call fidget progress handler
|
||||||
|
vim.lsp.handlers["$/progress"](nil, msg, info)
|
||||||
|
end
|
||||||
|
|
||||||
metals_config = metals.bare_config()
|
metals_config = metals.bare_config()
|
||||||
metals_config.settings = {
|
metals_config.settings = {
|
||||||
showImplicitArguments = true,
|
showImplicitArguments = true,
|
||||||
showInferredType = true,
|
showInferredType = true,
|
||||||
showImplicitConversionsAndClasses = true,
|
showImplicitConversionsAndClasses = true,
|
||||||
}
|
}
|
||||||
-- metals_config.init_options.statusBarProvider = "on"
|
metals_config.init_options.statusBarProvider = "on"
|
||||||
|
metals_config.handlers = {
|
||||||
|
['metals/status'] = metals_status_handler,
|
||||||
|
}
|
||||||
|
|
||||||
metals_config.on_attach = function(client, bufnr)
|
metals_config.on_attach = function(client, bufnr)
|
||||||
metals.setup_dap()
|
metals.setup_dap()
|
||||||
|
|||||||
Reference in New Issue
Block a user