save_showInlayHints = false
enddef
+# Toggle (enable or disable) inlay hints.
+export def InlayHintsToggle()
+ if opt.lspOptions.showInlayHints
+ InlayHintsDisable()
+ else
+ InlayHintsEnable()
+ endif
+enddef
+
# Some options are changed. If 'showInlayHints' option is changed, then
# either enable or disable inlay hints.
export def LspInlayHintsOptionsChanged()
inlayhints.InlayHintsEnable()
elseif ctl == 'disable'
inlayhints.InlayHintsDisable()
+ elseif ctl == 'toggle'
+ inlayhints.InlayHintsToggle()
else
util.ErrMsg($'LspInlayHints - Unsupported argument "{ctl}"')
endif
# Command-line completion for the ":LspInlayHints" command
export def LspInlayHintsComplete(arglead: string, cmdline: string, cursorPos: number): list<string>
- var l = ['enable', 'disable']
+ var l = ['enable', 'disable', 'toggle']
return filter(l, (_, val) => val =~ $'^{arglead}')
enddef
in a popup window.
:LspIncomingCalls Display the list of symbols calling the current symbol
in a window.
-:LspInlayHints Enable or disable inlay hints.
+:LspInlayHints Enable or disable or toggle inlay hints.
:LspOutgoingCalls Display the list of symbols called by the current
symbol in a window.
:LspOutline Show the list of symbols defined in the current file
not all the language servers support this feature.
*:LspInlayHints*
-:LspInlayHints Enable or disable inlay hints. Supports the "enable"
- and "disable" arguments. When "enable" is specified,
- enables the inlay hints for all the buffers with a
- language server that supports inlay hints. When
- "disable" is specified, disables the inlay hints.
+:LspInlayHints Enable or disable inlay hints. Supports the "enable",
+ "disable" and "toggle" arguments. When "enable" is
+ specified, enables the inlay hints for all the buffers
+ with a language server that supports inlay hints.
+ When "disable" is specified, disables the inlay hints.
+ When "toggle" is specified, either enables or disables
+ the inlay hints.
*:LspOutoingCalls*
:LspOutgoingCalls Display a hierarchy of symbols called by the symbol