aboutsummaryrefslogtreecommitdiffstats
path: root/lua/config/diagnostic.lua
blob: 011d83a56a0e4891267a50c9f528022042e4f2ec (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
vim.diagnostic.config {
  virtual_text = false,
  signs = {
    text = {
      [vim.diagnostic.severity.ERROR] = '',
      [vim.diagnostic.severity.WARN] = '',
      [vim.diagnostic.severity.INFO] = '',
      [vim.diagnostic.severity.HINT] = ''
    },
    -- linehl = {
    --   [vim.diagnostic.severity.ERROR] = 'ErrorMsg',
    -- },
    -- numhl = {
    --   [vim.diagnostic.severity.WARN] = 'WarningMsg',
    -- },
  },
  update_in_insert = true,
  underline = true,
  severity_sort = true,
  float = {
    -- focusable = true,
    -- style = "minimal",
    border = "rounded",
    source = "if_many",
    -- header = "",
    -- prefix = "",
  },
}

-- vim.lsp.handlers["textDocument/hover"] = vim.lsp.with(vim.lsp.handlers.hover, {
-- 	border = "rounded",
-- 	-- width = 100,
-- 	-- height = 10,
-- 	position = "center",
-- 	header = "",
-- 	prefix = "",
-- 	source = "always",
-- 	style = "minimal",
-- 	focusable = true,
-- })

-- vim.lsp.handlers["textDocument/signatureHelp"] = vim.lsp.with(vim.lsp.handlers.signature_help, {
-- 	border = "rounded",
-- })

vim.lsp.handlers["textDocument/publishDiagnostics"] = vim.lsp.with(vim.lsp.diagnostic.on_publish_diagnostics, {
	-- delay update diagnostics
	update_in_insert = false,
})