diff options
Diffstat (limited to 'lua')
| -rw-r--r-- | lua/alpha/lsp/servers.lua | 46 | ||||
| -rw-r--r-- | lua/plugins/lsp.lua | 19 |
2 files changed, 58 insertions, 7 deletions
diff --git a/lua/alpha/lsp/servers.lua b/lua/alpha/lsp/servers.lua index e4adacb..f09f523 100644 --- a/lua/alpha/lsp/servers.lua +++ b/lua/alpha/lsp/servers.lua @@ -5,11 +5,11 @@ local lsp_flags = { } local default = function() - return { - on_attach = lsp_attach, - flags = lsp_flags, - } - end + return { + on_attach = lsp_attach, + flags = lsp_flags, + } +end return { ["emmet_ls"] = function() @@ -49,6 +49,9 @@ return { telemetry = { enable = false, }, + hint = { + enable = true, + } }, }, } @@ -84,13 +87,42 @@ return { } end, ["svelte"] = default, - ["tailwindcss"] = function () + ["tailwindcss"] = function() return { on_attach = lsp_attach, flags = lsp_flags, filetypes = { "blade", "html", "svelte" }, } end, - ["tsserver"] = default, + ["tsserver"] = function() + return { + on_attach = lsp_attach, + flags = lsp_flags, + settings = { + typescript = { + inlayHints = { + includeInlayParameterNameHints = "all", + includeInlayParameterNameHintsWhenArgumentMatchesName = false, + includeInlayFunctionParameterTypeHints = true, + includeInlayVariableTypeHints = true, + includeInlayPropertyDeclarationTypeHints = true, + includeInlayFunctionLikeReturnTypeHints = true, + includeInlayEnumMemberValueHints = true, + }, + }, + javascript = { + inlayHints = { + includeInlayParameterNameHints = "all", + includeInlayParameterNameHintsWhenArgumentMatchesName = false, + includeInlayFunctionParameterTypeHints = true, + includeInlayVariableTypeHints = true, + includeInlayPropertyDeclarationTypeHints = true, + includeInlayFunctionLikeReturnTypeHints = true, + includeInlayEnumMemberValueHints = true, + }, + }, + }, + } + end, ["volar"] = default, } diff --git a/lua/plugins/lsp.lua b/lua/plugins/lsp.lua index 9ae6b0b..ef07653 100644 --- a/lua/plugins/lsp.lua +++ b/lua/plugins/lsp.lua @@ -11,6 +11,25 @@ return { "williamboman/mason-lspconfig.nvim", "WhoIsSethDaniel/mason-tool-installer.nvim", { + "lvimuser/lsp-inlayhints.nvim", + config = function() + require("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, false) + end, + }) + end, + }, + { "j-hui/fidget.nvim", opts = { window = { |