Skip to content

Commit

Permalink
feat(diagnostics): added icons
Browse files Browse the repository at this point in the history
  • Loading branch information
folke committed Dec 31, 2022
1 parent 43a97bc commit 8834510
Show file tree
Hide file tree
Showing 2 changed files with 45 additions and 2 deletions.
30 changes: 30 additions & 0 deletions lua/config/icons.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
return {
diagnostics = {
Error = "",
Warn = "",
Hint = "",
Info = "",
},
kinds = {
Class = "",
Color = "",
Constant = "",
Constructor = "",
Enum = "",
EnumMember = "",
Field = "",
File = "",
Folder = "",
Function = "",
Interface = "",
Keyword = "",
Method = "ƒ ",
Property = "",
Snippet = "",
Struct = "",
Text = "",
Unit = "",
Value = "",
Variable = "",
},
}
17 changes: 15 additions & 2 deletions lua/plugins/lsp/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,24 @@ return {
dependencies = {
{ "folke/neoconf.nvim", cmd = "Neoconf", config = true },
{ "folke/neodev.nvim", config = true },
{ "williamboman/mason.nvim", config = true },
{ "williamboman/mason-lspconfig.nvim", config = { ensure_installed = vim.tbl_keys(servers) } },
{ "williamboman/mason.nvim", config = true, cmd = "Mason" },
{ "williamboman/mason-lspconfig.nvim", config = { automatic_installation = true } },
"hrsh7th/cmp-nvim-lsp",
},
config = function()
-- diagnostics
for name, icon in pairs(require("config.icons").diagnostics) do
name = "DiagnosticSign" .. name
vim.fn.sign_define(name, { text = icon, texthl = name, numhl = "" })
end
vim.diagnostic.config({
underline = true,
update_in_insert = false,
virtual_text = { spacing = 4, prefix = "" },
severity_sort = true,
})

-- lspconfig
local capabilities = require("cmp_nvim_lsp").default_capabilities(vim.lsp.protocol.make_client_capabilities())
for server, opts in pairs(servers) do
opts.capabilities = capabilities
Expand Down

0 comments on commit 8834510

Please sign in to comment.