From 4f9de09297dfb2058ded4f8c07e3ebfd463991b2 Mon Sep 17 00:00:00 2001 From: Vladislav Date: Sun, 14 Apr 2024 05:28:06 +0200 Subject: [PATCH] Enable inlay hints toggle for the supporting servers --- init.lua | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/init.lua b/init.lua index 496f45b8..dfd48a40 100644 --- a/init.lua +++ b/init.lua @@ -518,6 +518,16 @@ require('lazy').setup({ callback = vim.lsp.buf.clear_references, }) end + + -- The following autocommand is used to enable inlay hints in your + -- code, if the language server you are using supports them + -- + -- This may be unwanted, since they displace some of your code + if client and client.server_capabilities.inlayHintProvider and vim.lsp.inlay_hint then + map('th', function() + vim.lsp.inlay_hint.enable(0, not vim.lsp.inlay_hint.is_enabled()) + end, '[T]oggle Inlay [H]ints') + end end, })