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