From c1254fd7a657bd590d212781129e98eb7267eb9f Mon Sep 17 00:00:00 2001 From: Thomas Smallwood Date: Tue, 25 Nov 2025 17:43:06 +0000 Subject: [PATCH] tsserver safety buffer exits and settings --- lua/config/options.lua | 7 +++++++ lua/plugins/typescript.lua | 15 ++++++++++++++- 2 files changed, 21 insertions(+), 1 deletion(-) diff --git a/lua/config/options.lua b/lua/config/options.lua index 1396c2b..e3c1d7d 100644 --- a/lua/config/options.lua +++ b/lua/config/options.lua @@ -9,3 +9,10 @@ vim.o.scrolloff = 10 -- Semantic highlighting vim.g.lazyvim_semantic_highlighting = false + +-- Kill any orphaned tsserver processes when Neovim exits +vim.api.nvim_create_autocmd("ExitPre", { + callback = function() + vim.fn.system("pkill -f 'tsserver.js'") + end, +}) diff --git a/lua/plugins/typescript.lua b/lua/plugins/typescript.lua index f5f7891..98bd3c0 100644 --- a/lua/plugins/typescript.lua +++ b/lua/plugins/typescript.lua @@ -19,6 +19,19 @@ return { "javascript", "javascriptreact", }, - opts = {}, + opts = { + settings = { + tsserver_file_preferences = { + disableSuggestions = false, + includeInlayParameterNameHints = "all", + includeCompletionsForModuleExports = true, + }, + tsserver_enable_partial_semantic_mode = true, + tsserver_watch_options = { + watchFile = "useFsEvents", -- recommended for remote/container + watchDirectory = "useFsEvents", + }, + }, + }, }, }