From 6c73e775cfc8e23cbe2bb43873933458383804c5 Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Sun, 8 Jan 2023 15:52:00 +0100 Subject: [PATCH] feat(typescript): added extras for typescript --- .../plugins/extras/lang/typescript.lua | 29 +++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 lua/lazyvim/plugins/extras/lang/typescript.lua diff --git a/lua/lazyvim/plugins/extras/lang/typescript.lua b/lua/lazyvim/plugins/extras/lang/typescript.lua new file mode 100644 index 00000000..574f9877 --- /dev/null +++ b/lua/lazyvim/plugins/extras/lang/typescript.lua @@ -0,0 +1,29 @@ +vim.notify("adding typescript") +return { + + -- add typescript to treesitter + { + "nvim-treesitter/nvim-treesitter", + opts = function(_, opts) + table.insert(opts.ensure_installed, "typescript") + end, + }, + + -- correctly setup lspconfig + { + "neovim/nvim-lspconfig", + dependencies = { "jose-elias-alvarez/typescript.nvim" }, + opts = { + -- make sure mason installs the server + servers = { + tsserver = {}, + }, + setup = { + tsserver = function(_, opts) + require("typescript").setup({ server = opts }) + return true + end, + }, + }, + }, +}