trying to enable inlayhints for vtsls

This commit is contained in:
markus.dieckmann 2025-05-23 11:08:07 +02:00
parent 73c3e42eb2
commit 657a1cdc06

View File

@ -4,8 +4,23 @@ return {
{ "williamboman/mason.nvim", opts = {} }, { "williamboman/mason.nvim", opts = {} },
"williamboman/mason-lspconfig.nvim", "williamboman/mason-lspconfig.nvim",
"WhoIsSethDaniel/mason-tool-installer.nvim", "WhoIsSethDaniel/mason-tool-installer.nvim",
"yioneko/nvim-vtsls",
opts = {
settings = {
typescript = {
inlayHints = {
parameterNames = { enabled = "literals" },
parameterTypes = { enabled = true },
variableTypes = { enabled = true },
propertyDeclarationTypes = { enabled = true },
functionLikeReturnTypes = { enabled = true },
enumMemberValues = { enabled = true },
},
},
},
},
{ "j-hui/fidget.nvim", opts = {} }, { "j-hui/fidget.nvim", opts = {} },
"saghen/blink.cmp", "saghen/blink.cmp",
}, },
@ -14,6 +29,8 @@ return {
diagnostics = { virtual_text = true }, diagnostics = { virtual_text = true },
}, },
config = function() config = function()
inlay_hints = { enabled = true }
diagnostics = { virtual_text = true }
vim.api.nvim_create_autocmd("LspAttach", { vim.api.nvim_create_autocmd("LspAttach", {
group = vim.api.nvim_create_augroup("kickstart-lsp-attach", { clear = true }), group = vim.api.nvim_create_augroup("kickstart-lsp-attach", { clear = true }),
callback = function(event) callback = function(event)
@ -70,7 +87,7 @@ return {
local client = vim.lsp.get_client_by_id(event.data.client_id) local client = vim.lsp.get_client_by_id(event.data.client_id)
if if
client and client_supports_method(client, vim.lsp.protocol.Methods.textDocument_documentHighlight, event.buf) client and client_supports_method(client, vim.lsp.protocol.Methods.textDocument_documentHighlight, event.buf)
then then
local highlight_augroup = vim.api.nvim_create_augroup("kickstart-lsp-highlight", { clear = false }) local highlight_augroup = vim.api.nvim_create_augroup("kickstart-lsp-highlight", { clear = false })
vim.api.nvim_create_autocmd({ "CursorHold", "CursorHoldI" }, { vim.api.nvim_create_autocmd({ "CursorHold", "CursorHoldI" }, {
@ -161,13 +178,44 @@ return {
rust_analyzer = {}, rust_analyzer = {},
vtsls = { vtsls = {
settings = {}, -- explicitly add default filetypes, so that we can extend
-- them in related extras
filetypes = {
"javascript",
"javascriptreact",
"javascript.jsx",
"typescript",
"typescriptreact",
"typescript.tsx",
},
settings = {
typescript = {
updateImportsOnFileMove = { enabled = "always" },
inlayHints = {
parameterNames = { enabled = "literals" },
parameterTypes = { enabled = true },
variableTypes = { enabled = true },
propertyDeclarationTypes = { enabled = true },
functionLikeReturnTypes = { enabled = true },
enumMemberValues = { enabled = true },
},
suggest = {
completeFunctionCalls = true,
},
},
},
}, },
bashls = {}, bashls = {},
prismals = {}, prismals = {},
gopls = {}, gopls = {},
jsonls = {}, jsonls = {},
eslint = {
vim.api.nvim_create_autocmd("BufWritePre", {
callback = function()
vim.lsp.buf.format()
end,
}),
},
lua_ls = { lua_ls = {
-- cmd = { ... }, -- cmd = { ... },
-- filetypes = { ... }, -- filetypes = { ... },
@ -183,11 +231,11 @@ return {
}, },
}, },
} }
local ensure_installed = vim.tbl_keys(servers or {}) local ensure_installed = vim.tbl_keys(servers or {})
vim.list_extend(ensure_installed, { vim.list_extend(ensure_installed, {
"stylua", -- Used to format Lua code "stylua", -- Used to format Lua code
"prettierd", "prettierd",
"eslint",
"codelldb", "codelldb",
"gitlab_ci_ls", "gitlab_ci_ls",
"js-debug-adapter", "js-debug-adapter",