configure inlay typehints in nvim lsp

This commit is contained in:
Johannes Knopp
2026-06-22 15:47:04 +02:00
parent 1c32b40669
commit 67085827b5
3 changed files with 22 additions and 5 deletions

View File

@ -28,6 +28,11 @@ return {
return { desc = desc, buffer = ev.buf, silent = true }
end
-- Render inlay hints (type/param/return) for servers that send them
if vim.lsp.inlay_hint then
vim.lsp.inlay_hint.enable(true, { bufnr = ev.buf })
end
keymap.set('n', 'gd', '<cmd>Telescope lsp_definitions<cr>', opts('Go to definition'))
keymap.set('n', 'gr', '<cmd>Telescope lsp_references<cr>', opts('Show LSP references'))
keymap.set('n', 'gD', vim.lsp.buf.declaration, opts('Go to declaration'))
@ -73,6 +78,15 @@ return {
init_options = {
hostInfo = 'neovim',
},
settings = {
typescript = {
inlayHints = {
includeInlayVariableTypeHints = true,
includeInlayParameterNameHints = 'all',
includeInlayFunctionLikeReturnTypeHints = true,
}
}
}
})
-- eslint: linting for JS/TS/React projects