nvim/lua/plugins/lsp.lua

79 lines
2.2 KiB
Lua
Raw Permalink Normal View History

2023-06-08 16:38:02 -04:00
return {
{
"neovim/nvim-lspconfig",
init = function()
local format = function()
2023-11-01 14:12:01 -04:00
require("lazyvim.util").format({ force = true })
2023-06-08 16:38:02 -04:00
end
local keys = require("lazyvim.plugins.lsp.keymaps").get()
keys[#keys + 1] = { "<leader>lf", format, desc = "Format Document", has = "documentFormatting" }
keys[#keys + 1] = { "<leader>lf", format, desc = "Format Range", mode = "v", has = "documentRangeFormatting" }
2024-07-07 16:31:55 -04:00
keys[#keys + 1] = { "K", false } -- su puta madre!
vim.diagnostic.config({
float = { border = "rounded" },
})
2023-06-08 16:38:02 -04:00
end,
opts = {
2023-06-12 16:41:51 -04:00
diagnostics = {
update_in_insert = true,
},
2024-07-07 16:31:55 -04:00
setup = {
-- rust_analyzer = function()
-- return true
-- end,
2024-07-16 12:07:09 -04:00
tsserver = function()
return false
end,
vtsls = function()
return true
end,
2024-07-07 16:31:55 -04:00
},
servers = {
yamlls = {
settings = {
yaml = {
keyOrdering = false,
},
},
},
2023-11-01 14:12:01 -04:00
lua_ls = {
root_dir = function()
return vim.loop.cwd()
end,
-- ---@type LazyKeys[]
-- keys = {},
settings = {
Lua = {
workspace = {
checkThirdParty = false,
},
completion = {
callSnippet = "Replace",
},
},
},
2023-06-18 12:59:41 -04:00
},
2024-07-16 12:07:09 -04:00
vtsls = { enabled = false },
tsserver = {
enabled = true,
settings = {
typescript = {
inlayHints = {
includeInlayEnumMemberValueHints = true,
includeInlayFunctionLikeReturnTypeHints = true,
includeInlayFunctionParameterTypeHints = true,
includeInlayParameterNameHints = "literals",
includeInlayParameterNameHintsWhenArgumentMatchesName = false,
includeInlayPropertyDeclarationTypeHints = true,
includeInlayVariableTypeHints = false,
includeInlayVariableTypeHintsWhenTypeMatchesName = false,
},
},
},
},
},
2023-06-08 16:38:02 -04:00
},
},
}