diff options
author | Luca Matei Pintilie <lucafulger@gmail.com> | 2022-11-13 14:11:02 +0000 |
---|---|---|
committer | Luca Matei Pintilie <lucafulger@gmail.com> | 2022-11-13 14:11:02 +0000 |
commit | 8497608cef900bd8820195364acd9307dd8b3d4c (patch) | |
tree | 347881e334cfaede9ade21c6b005c67b7a0d8cf7 /.config/nvim/lua/lsp.lua | |
parent | 57dcd8648a80cf632d7295afa1e6e3912a8b2930 (diff) | |
download | dotfiles-8497608cef900bd8820195364acd9307dd8b3d4c.tar dotfiles-8497608cef900bd8820195364acd9307dd8b3d4c.tar.gz dotfiles-8497608cef900bd8820195364acd9307dd8b3d4c.tar.bz2 dotfiles-8497608cef900bd8820195364acd9307dd8b3d4c.tar.lz dotfiles-8497608cef900bd8820195364acd9307dd8b3d4c.tar.xz dotfiles-8497608cef900bd8820195364acd9307dd8b3d4c.tar.zst dotfiles-8497608cef900bd8820195364acd9307dd8b3d4c.zip |
Upgrade to neovim 0.8
Diffstat (limited to '.config/nvim/lua/lsp.lua')
-rw-r--r-- | .config/nvim/lua/lsp.lua | 55 |
1 files changed, 51 insertions, 4 deletions
diff --git a/.config/nvim/lua/lsp.lua b/.config/nvim/lua/lsp.lua index 5610629..9f9253a 100644 --- a/.config/nvim/lua/lsp.lua +++ b/.config/nvim/lua/lsp.lua @@ -66,18 +66,53 @@ cmp.setup({ local on_attach = function(client, bufnr) vim.api.nvim_buf_set_option(bufnr, "omnifunc", "v:lua.vim.lsp.omnifunc") - local inlayhints = require("lsp-inlayhints") - inlayhints.setup() - inlayhints.on_attach(client, bufnr) local lsp_signature = require("lsp_signature") lsp_signature.on_attach({ bind = true }, bufnr) + require("lsp-inlayhints").setup() + require("lsp-inlayhints").on_attach(client, bufnr) end +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; +}) + local lsputils = require("lspconfig").util require("lspconfig").tsserver.setup({ on_attach = on_attach; root_dir = lsputils.root_pattern("package.json", "tsconfig.json"); + settings = { + typescript = { + inlayHints = { + includeInlayParameterNameHints = "all"; + includeInlayParameterNameHintsWhenArgumentMatchesName = true; + includeInlayFunctionParameterTypeHints = true; + includeInlayVariableTypeHints = true; + includeInlayPropertyDeclarationTypeHints = true; + includeInlayFunctionLikeReturnTypeHints = true; + includeInlayEnumMemberValueHints = true; + }; + }; + javascript = { + inlayHints = { + includeInlayParameterNameHints = "all"; + includeInlayParameterNameHintsWhenArgumentMatchesName = true; + includeInlayFunctionParameterTypeHints = true; + includeInlayVariableTypeHints = true; + includeInlayPropertyDeclarationTypeHints = true; + includeInlayFunctionLikeReturnTypeHints = true; + includeInlayEnumMemberValueHints = true; + }; + }; + }; }) require("deno-nvim").setup({ @@ -85,7 +120,19 @@ require("deno-nvim").setup({ root_dir = vim.loop.cwd; capabilities = capabilities; on_attach = on_attach; - settings = { enable = true; unstable = true; config = "./deno.jsonc" }; + settings = { + deno = { + unstable = true; + inlayHints = { + enumMemberValues = { enabled = true }; + functionLikeReturnTypes = { enabled = true }; + parameterNames = { enabled = "all" }; + parameterTypes = { enabled = true }; + propertyDeclarationTypes = { enabled = true }; + variableTypes = { enabled = true; suppressWhenTypeMatchesName = false }; + }; + }; + }; }; }); |