initial
This commit is contained in:
62
.config/nvim/lua/user/lsp/handlers.lua
Normal file
62
.config/nvim/lua/user/lsp/handlers.lua
Normal file
@ -0,0 +1,62 @@
|
||||
local M = {}
|
||||
|
||||
-- TODO: backfill this to template
|
||||
M.setup = function()
|
||||
local signs = {
|
||||
{ name = "DiagnosticSignError", text = "" },
|
||||
{ name = "DiagnosticSignWarn", text = "" },
|
||||
{ name = "DiagnosticSignHint", text = "" },
|
||||
{ name = "DiagnosticSignInfo", text = "" },
|
||||
}
|
||||
|
||||
for _, sign in ipairs(signs) do
|
||||
vim.fn.sign_define(sign.name, { texthl = sign.name, text = sign.text, numhl = "" })
|
||||
end
|
||||
|
||||
local config = {
|
||||
-- disable virtual text
|
||||
-- virtual_text = false,
|
||||
-- show signs
|
||||
signs = {
|
||||
active = signs,
|
||||
},
|
||||
update_in_insert = true,
|
||||
underline = true,
|
||||
severity_sort = true,
|
||||
float = {
|
||||
focusable = false,
|
||||
style = "minimal",
|
||||
border = "rounded",
|
||||
source = "always",
|
||||
header = "",
|
||||
prefix = "",
|
||||
},
|
||||
}
|
||||
|
||||
vim.diagnostic.config(config)
|
||||
|
||||
vim.lsp.handlers["textDocument/hover"] = vim.lsp.with(vim.lsp.handlers.hover, {
|
||||
border = "rounded",
|
||||
width = 60,
|
||||
})
|
||||
|
||||
vim.lsp.handlers["textDocument/signatureHelp"] = vim.lsp.with(vim.lsp.handlers.signature_help, {
|
||||
border = "rounded",
|
||||
width = 60,
|
||||
})
|
||||
end
|
||||
|
||||
-- local function lsp_highlight_document(client)
|
||||
-- -- Set autocommands conditional on server_capabilities
|
||||
-- local status_ok, illuminate = pcall(require, "illuminate")
|
||||
-- if not status_ok then
|
||||
-- return
|
||||
-- end
|
||||
-- illuminate.on_attach(client)
|
||||
-- end
|
||||
|
||||
-- M.on_attach = function(client, bufnr)
|
||||
-- lsp_highlight_document(client)
|
||||
-- end
|
||||
|
||||
return M
|
||||
Reference in New Issue
Block a user