From cbd9d700dc964cf8c90759f8482911d03c72edc4 Mon Sep 17 00:00:00 2001 From: Iordanis Petkakis Date: Sun, 21 Jan 2024 21:28:16 +0200 Subject: [PATCH] fix(typescript): don't hardcode values in lua table (#2254) * 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. * fix(typescript): remove format settings entirely * fix(typescript): add back comment and Lua annotations * fix(typescript): bring back function call completion snippets --- lua/lazyvim/plugins/extras/lang/typescript.lua | 16 ++-------------- 1 file changed, 2 insertions(+), 14 deletions(-) diff --git a/lua/lazyvim/plugins/extras/lang/typescript.lua b/lua/lazyvim/plugins/extras/lang/typescript.lua index 4f53ae8c..4bb280d6 100644 --- a/lua/lazyvim/plugins/extras/lang/typescript.lua +++ b/lua/lazyvim/plugins/extras/lang/typescript.lua @@ -46,21 +46,8 @@ return { desc = "Remove Unused Imports", }, }, + ---@diagnostic disable-next-line: missing-fields settings = { - typescript = { - format = { - indentSize = vim.o.shiftwidth, - convertTabsToSpaces = vim.o.expandtab, - tabSize = vim.o.tabstop, - }, - }, - javascript = { - format = { - indentSize = vim.o.shiftwidth, - convertTabsToSpaces = vim.o.expandtab, - tabSize = vim.o.tabstop, - }, - }, completions = { completeFunctionCalls = true, }, @@ -69,6 +56,7 @@ return { }, }, }, + { "mfussenegger/nvim-dap", optional = true,