Files
dotfiles/config/nvim/lua/plugins/nvim-lspconfig.lua
2024-03-29 18:45:39 +01:00

49 lines
1.1 KiB
Lua

return {
"neovim/nvim-lspconfig",
---@class PluginLspOpts
opts = {
---@type lspconfig.options
servers = {
pyright = {},
marksman = {},
--@type lspconfig.options.tsserver
tsserver = {
keys = {
{
"<leader>co",
function()
vim.lsp.buf.code_action({
apply = true,
context = {
only = { "source.organizeImports.ts" },
diagnostics = {},
},
})
end,
desc = "Organize Imports",
},
{
"<leader>cR",
function()
vim.lsp.buf.code_action({
apply = true,
context = {
only = { "source.removeUnused.ts" },
diagnostics = {},
},
})
end,
desc = "Remove Unused Imports",
},
},
---@diagnostic disable-next-line: missing-fields
settings = {
completions = {
completeFunctionCalls = true,
},
},
},
},
},
}