58 lines
2.1 KiB
Lua
58 lines
2.1 KiB
Lua
return {
|
|
"pmizio/typescript-tools.nvim",
|
|
dependencies = {
|
|
"lvimuser/lsp-inlayhints.nvim",
|
|
"nvim-lua/plenary.nvim",
|
|
"neovim/nvim-lspconfig",
|
|
"hrsh7th/cmp-nvim-lsp",
|
|
},
|
|
config = function()
|
|
local typescript_tools = require("typescript-tools")
|
|
local cmp_nvim_lsp = require("cmp_nvim_lsp")
|
|
local lsp_inlayhints = require("lsp-inlayhints")
|
|
|
|
local on_attach = require("taken.core.on_attach")
|
|
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({
|
|
capabilities = capabilities,
|
|
on_attach = on_attach,
|
|
settings = {
|
|
tsserver_file_preferences = {
|
|
includeInlayParameterNameHints = "all",
|
|
includeCompletionsForModuleExports = true,
|
|
quotePreference = "auto",
|
|
},
|
|
javascript = {
|
|
inlayHints = {
|
|
includeInlayParameterNameHints = "all",
|
|
includeInlayParameterNameHintsWhenArgumentMatchesName = false,
|
|
includeInlayFunctionParameterTypeHints = true,
|
|
includeInlayVariableTypeHints = true,
|
|
includeInlayVariableTypeHintsWhenTypeMatchesName = false,
|
|
includeInlayPropertyDeclarationTypeHints = true,
|
|
includeInlayFunctionLikeReturnTypeHints = true,
|
|
includeInlayEnumMemberValueHints = true,
|
|
},
|
|
},
|
|
},
|
|
})
|
|
end,
|
|
}
|