diff --git a/lua/taken/plugins/lsp/ts-tools.lua b/lua/taken/plugins/lsp/ts-tools.lua index dfc98a4..a2abf18 100644 --- a/lua/taken/plugins/lsp/ts-tools.lua +++ b/lua/taken/plugins/lsp/ts-tools.lua @@ -44,7 +44,14 @@ return { settings = { cmd = { cmd, "--stdio" }, tsserver_file_preferences = { - includeCompletionsForModuleExports = true, + includeInlayParameterNameHints = "all", + includeInlayParameterNameHintsWhenArgumentMatchesName = true, + includeInlayFunctionParameterTypeHints = true, + includeInlayVariableTypeHints = true, + includeInlayVariableTypeHintsWhenTypeMatchesName = true, + includeInlayPropertyDeclarationTypeHints = true, + includeInlayFunctionLikeReturnTypeHints = true, + includeInlayEnumMemberValueHints = true, quotePreference = "auto", }, }, diff --git a/lua/taken/utils/on_attach.lua b/lua/taken/utils/on_attach.lua index 17f61d9..a1d4334 100644 --- a/lua/taken/utils/on_attach.lua +++ b/lua/taken/utils/on_attach.lua @@ -27,6 +27,17 @@ local on_attach = function(client, bufnr) vim.keymap.set("n", "vrn", function() vim.lsp.buf.rename() end, opts("Rename symbol")) + vim.keymap.set("n", "vih", function() + if vim.fn.has("nvim-0.10.0") == 0 then + vim.notify("Inlay hints are only available in Neovim 0.10.0 and above", vim.log.levels.ERROR) + return + end + + if client.server_capabilities.inlayHintProvider then + local current_state = vim.lsp.inlay_hint.is_enabled(bufnr) + vim.lsp.inlay_hint.enable(bufnr, not current_state) + end + end, opts("Toggle inlay hints")) vim.keymap.set("n", "[d", function() vim.diagnostic.goto_next() end, opts("Go to next diagnostic"))