configure inlay typehints in nvim lsp
This commit is contained in:
@ -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
|
||||
|
||||
Reference in New Issue
Block a user