Added inlay hints for tsserver
This commit is contained in:
@@ -1,6 +1,7 @@
|
|||||||
return {
|
return {
|
||||||
"pmizio/typescript-tools.nvim",
|
"pmizio/typescript-tools.nvim",
|
||||||
dependencies = {
|
dependencies = {
|
||||||
|
"lvimuser/lsp-inlayhints.nvim",
|
||||||
"nvim-lua/plenary.nvim",
|
"nvim-lua/plenary.nvim",
|
||||||
"neovim/nvim-lspconfig",
|
"neovim/nvim-lspconfig",
|
||||||
"hrsh7th/cmp-nvim-lsp",
|
"hrsh7th/cmp-nvim-lsp",
|
||||||
@@ -8,10 +9,27 @@ return {
|
|||||||
config = function()
|
config = function()
|
||||||
local typescript_tools = require("typescript-tools")
|
local typescript_tools = require("typescript-tools")
|
||||||
local cmp_nvim_lsp = require("cmp_nvim_lsp")
|
local cmp_nvim_lsp = require("cmp_nvim_lsp")
|
||||||
|
local lsp_inlayhints = require("lsp-inlayhints")
|
||||||
|
|
||||||
local on_attach = require("taken.core.on_attach")
|
local on_attach = require("taken.core.on_attach")
|
||||||
local capabilities = cmp_nvim_lsp.default_capabilities()
|
local capabilities = cmp_nvim_lsp.default_capabilities()
|
||||||
|
|
||||||
|
lsp_inlayhints.setup({})
|
||||||
|
|
||||||
|
vim.api.nvim_create_augroup("LspAttach_inlayhints", {})
|
||||||
|
vim.api.nvim_create_autocmd("LspAttach", {
|
||||||
|
group = "LspAttach_inlayhints",
|
||||||
|
callback = function(args)
|
||||||
|
if not (args.data and args.data.client_id) then
|
||||||
|
return
|
||||||
|
end
|
||||||
|
|
||||||
|
local bufnr = args.buf
|
||||||
|
local client = vim.lsp.get_client_by_id(args.data.client_id)
|
||||||
|
require("lsp-inlayhints").on_attach(client, bufnr)
|
||||||
|
end,
|
||||||
|
})
|
||||||
|
|
||||||
typescript_tools.setup({
|
typescript_tools.setup({
|
||||||
capabilities = capabilities,
|
capabilities = capabilities,
|
||||||
on_attach = on_attach,
|
on_attach = on_attach,
|
||||||
@@ -21,6 +39,18 @@ return {
|
|||||||
includeCompletionsForModuleExports = true,
|
includeCompletionsForModuleExports = true,
|
||||||
quotePreference = "auto",
|
quotePreference = "auto",
|
||||||
},
|
},
|
||||||
|
javascript = {
|
||||||
|
inlayHints = {
|
||||||
|
includeInlayParameterNameHints = "all",
|
||||||
|
includeInlayParameterNameHintsWhenArgumentMatchesName = false,
|
||||||
|
includeInlayFunctionParameterTypeHints = true,
|
||||||
|
includeInlayVariableTypeHints = true,
|
||||||
|
includeInlayVariableTypeHintsWhenTypeMatchesName = false,
|
||||||
|
includeInlayPropertyDeclarationTypeHints = true,
|
||||||
|
includeInlayFunctionLikeReturnTypeHints = true,
|
||||||
|
includeInlayEnumMemberValueHints = true,
|
||||||
|
},
|
||||||
|
},
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
end,
|
end,
|
||||||
|
|||||||
Reference in New Issue
Block a user