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", + }, + }, + }, }, }