From 3a6d776fc894ba8142210e5153f7ff628c3ceed2 Mon Sep 17 00:00:00 2001 From: Price Hiller Date: Mon, 11 Sep 2023 16:33:38 -0500 Subject: [PATCH] refactor(nvim): improve typescript tools --- dots/.config/nvim/lua/plugins/configs/lsp.lua | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/dots/.config/nvim/lua/plugins/configs/lsp.lua b/dots/.config/nvim/lua/plugins/configs/lsp.lua index bda2643f..e2f2b11f 100644 --- a/dots/.config/nvim/lua/plugins/configs/lsp.lua +++ b/dots/.config/nvim/lua/plugins/configs/lsp.lua @@ -68,6 +68,7 @@ return { "b0o/schemastore.nvim", { "pmizio/typescript-tools.nvim", + build = "npm i -g @styled/typescript-styled-plugin typescript", dependencies = { "nvim-lua/plenary.nvim" }, }, { @@ -459,6 +460,17 @@ return { require("typescript-tools").setup({ on_attach = on_attach, settings = { + tsserver_path = vim.fn.stdpath("data") .. "/mason/packages/typescript-language-server/node_modules/typescript/lib/tsserver.js", + expose_as_code_action = { + "fix_all", + "add_missing_imports", + "remove_unused", + "remove_unused_imports", + "organize_imports" + }, + tsserver_plugins = { + "@styled/typescript-styled-plugin" + }, tsserver_file_preferences = { includeInlayParameterNameHints = "all", includeInlayEnumMemberValueHints = true,