From eb92903342a7ac12185c62bb63b5caa4c80ce7dc Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Fri, 21 Apr 2023 16:50:12 +0200 Subject: [PATCH] feat(tsserver): set some tsserver formatting settings to their Neovim equivalents. Also used for organize imports --- lua/lazyvim/plugins/extras/lang/typescript.lua | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/lua/lazyvim/plugins/extras/lang/typescript.lua b/lua/lazyvim/plugins/extras/lang/typescript.lua index baabd58c..8023b11a 100644 --- a/lua/lazyvim/plugins/extras/lang/typescript.lua +++ b/lua/lazyvim/plugins/extras/lang/typescript.lua @@ -20,6 +20,20 @@ return { ---@type lspconfig.options.tsserver tsserver = { 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, },