diff --git a/README.md b/README.md index 24b9cdf..a0721e6 100644 --- a/README.md +++ b/README.md @@ -17,5 +17,5 @@ vscode-langservers-extracted pyright lua-language-server` ## Tmux -Additinally you can use my tmux config to have a nice status bar. +Additionally you can use my tmux config to have a nice status bar. They are located in `tmux.conf`. diff --git a/lua/plugins/lsp.lua b/lua/plugins/lsp.lua index 7c26990..e048182 100644 --- a/lua/plugins/lsp.lua +++ b/lua/plugins/lsp.lua @@ -53,9 +53,6 @@ return { config = true, }, }, - opts = function(_, opts) - opts.inlay_hints.enabled = true - end, config = function() -- IMPORTANT: make sure to setup neodev BEFORE lspconfig require("neodev").setup() @@ -105,12 +102,14 @@ return { vim.keymap.set("n", "cwl", function() print(vim.inspect(vim.lsp.buf.list_workspace_folders())) end, { desc = "[L]ist Folders" }) - -- Enable inlay hints (depends on neovim 0.10) - if vim.lsp.inlay_hint then - vim.lsp.buf.inlay_hint(0, true) -- toggle on by default + -- Enable inlay hints + local client = vim.lsp.get_client_by_id(ev.data.client_id) + if client.supports_method("textDocument/inlayHint") then + vim.g.inlay_hints_visible = true + vim.lsp.inlay_hint(ev.buf, true) -- set the keymap to toggle on/off vim.keymap.set("n", "ch", function() - vim.lsp.inlay_hint(0, nil) + vim.lsp.inlay_hint(ev.buf, nil) end, { desc = "Toggle Inlay [H]ints" }) end end,