From cc75f12e3f2e531ed94622cbda2ebc645af12af8 Mon Sep 17 00:00:00 2001 From: Sanchayan Maity Date: Mon, 15 Nov 2021 13:25:06 +0530 Subject: [PATCH] nvim: lsp: Enable inlay hints for TypeScript/JavaScript --- nvim/.config/nvim/lua/lsp.lua | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/nvim/.config/nvim/lua/lsp.lua b/nvim/.config/nvim/lua/lsp.lua index 1a0bd05..a0a8bc5 100644 --- a/nvim/.config/nvim/lua/lsp.lua +++ b/nvim/.config/nvim/lua/lsp.lua @@ -79,6 +79,9 @@ local ts_utils_setup = function(client, bufnr, opts) filter_out_diagnostics_by_severity = {}, filter_out_diagnostics_by_code = {}, + + auto_inlay_hints = true, + inlay_hints_highlight = "Hint", } ts_utils.setup_client(client) @@ -244,7 +247,7 @@ local rust_tool_opts = { }, } -local servers = { 'hls', 'pylsp', 'tsserver' } +local servers = { 'hls', 'pylsp' } for _, lsp in ipairs(servers) do nvim_lsp[lsp].setup { on_attach = on_attach, @@ -296,3 +299,8 @@ nvim_lsp.sumneko_lua.setup { }, }, } + +nvim_lsp.tsserver.setup { + init_options = require("nvim-lsp-ts-utils").init_options, + on_attach = on_attach, +}