aboutsummaryrefslogtreecommitdiffstats
path: root/lua
diff options
context:
space:
mode:
authorAriel D'Alessandro <dalessandro.ariel@gmail.com>2023-03-19 16:23:44 +0100
committerAriel D'Alessandro <dalessandro.ariel@gmail.com>2023-03-19 16:23:44 +0100
commit62a159413b68f6f121338ada0f38f23f96c77772 (patch)
treefdfa3a99ca2d15fd2d545c0ffab770b5192e71bd /lua
parent2102a092434c9c15f71416c889e4f7093796b664 (diff)
downloadnvim-conf-62a159413b68f6f121338ada0f38f23f96c77772.tar.gz
nvim-conf-62a159413b68f6f121338ada0f38f23f96c77772.zip
feat(inlay-hints): install & config
Diffstat (limited to 'lua')
-rw-r--r--lua/alpha/lsp/servers.lua46
-rw-r--r--lua/plugins/lsp.lua19
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 = {