fix(typescript): don't hardcode values in lua table

When a user changes `vim.opt.shiftwidth` with some auto-command, it's
not taken into account. Make `opts` a function, so that values get
evaluated when `lspconfig` loads instead.
This commit is contained in:
Iordanis Petkakis 2023-12-24 21:17:01 +02:00
parent 879e29504d
commit b9563799be

View file

@ -13,11 +13,8 @@ return {
-- correctly setup lspconfig -- correctly setup lspconfig
{ {
"neovim/nvim-lspconfig", "neovim/nvim-lspconfig",
opts = { opts = function(_, opts)
-- make sure mason installs the server opts.servers.tsserver = {
servers = {
---@type lspconfig.options.tsserver
tsserver = {
keys = { keys = {
{ {
"<leader>co", "<leader>co",
@ -65,10 +62,10 @@ return {
completeFunctionCalls = true, completeFunctionCalls = true,
}, },
}, },
}
end,
}, },
},
},
},
{ {
"mfussenegger/nvim-dap", "mfussenegger/nvim-dap",
optional = true, optional = true,