94 lines
4.1 KiB
Lua
94 lines
4.1 KiB
Lua
return {
|
|
{
|
|
"neovim/nvim-lspconfig",
|
|
init = function()
|
|
local keys = require("lazyvim.plugins.lsp.keymaps").get()
|
|
keys[#keys + 1] = { "gd", "<CMD>Glance definitions<CR>", desc = "Goto definition" }
|
|
keys[#keys + 1] = { "gr", "<CMD>Glance references<CR>", desc = "References" }
|
|
keys[#keys + 1] = { "gy", "<CMD>Glance type_definitions<CR>", desc = "Goto t[y]pe definitions" }
|
|
keys[#keys + 1] = { "gI", "<CMD>Glance implementations<CR>", desc = "Goto implementations" }
|
|
end,
|
|
opts = {
|
|
-- options for vim.diagnostic.config()
|
|
diagnostics = {
|
|
underline = true,
|
|
update_in_insert = false,
|
|
virtual_text = {
|
|
spacing = 4,
|
|
source = "if_many",
|
|
prefix = "●",
|
|
-- this will set set the prefix to a function that returns the diagnostics icon based on the severity
|
|
-- this only works on a recent 0.10.0 build. Will be set to "●" when not supported
|
|
-- prefix = "icons",
|
|
float = {
|
|
border = {
|
|
{ "┌", "FloatBorder" },
|
|
{ "─", "FloatBorder" },
|
|
{ "┐", "FloatBorder" },
|
|
{ "│", "FloatBorder" },
|
|
{ "┘", "FloatBorder" },
|
|
{ "─", "FloatBorder" },
|
|
{ "└", "FloatBorder" },
|
|
{ "│", "FloatBorder" },
|
|
},
|
|
},
|
|
},
|
|
severity_sort = true,
|
|
},
|
|
-- Enable this to enable the builtin LSP inlay hints on Neovim >= 0.10.0
|
|
-- Be aware that you also will need to properly configure your LSP server to
|
|
-- provide the inlay hints.
|
|
inlay_hints = {
|
|
enabled = false,
|
|
},
|
|
-- add any global capabilities here
|
|
capabilities = {},
|
|
-- Automatically format on save
|
|
autoformat = true,
|
|
-- Enable this to show formatters used in a notification
|
|
-- Useful for debugging formatter issues
|
|
format_notify = false,
|
|
-- options for vim.lsp.buf.format
|
|
-- `bufnr` and `filter` is handled by the LazyVim formatter,
|
|
-- but can be also overridden when specified
|
|
format = {
|
|
formatting_options = nil,
|
|
timeout_ms = nil,
|
|
},
|
|
-- LSP Server Settings
|
|
---@type lspconfig.options
|
|
servers = {
|
|
jsonls = {},
|
|
lua_ls = {
|
|
-- mason = false, -- set to false if you don't want this server to be installed with mason
|
|
-- Use this to add any additional keymaps
|
|
-- for specific lsp servers
|
|
---@type LazyKeys[]
|
|
-- keys = {},
|
|
settings = {
|
|
Lua = {
|
|
workspace = {
|
|
checkThirdParty = false,
|
|
},
|
|
completion = {
|
|
callSnippet = "Replace",
|
|
},
|
|
},
|
|
},
|
|
},
|
|
},
|
|
-- you can do any additional lsp server setup here
|
|
-- return true if you don't want this server to be setup with lspconfig
|
|
---@type table<string, fun(server:string, opts:_.lspconfig.options):boolean?>
|
|
setup = {
|
|
-- example to setup with typescript.nvim
|
|
-- tsserver = function(_, opts)
|
|
-- require("typescript").setup({ server = opts })
|
|
-- return true
|
|
-- end,
|
|
-- Specify * to use this function as a fallback for any server
|
|
-- ["*"] = function(server, opts) end,
|
|
},
|
|
},
|
|
},
|
|
}
|