]> Sergey Matveev's repositories - vim-lsp.git/blobdiff - autoload/lsp/lsp.vim
Add support for enabling/disabling inlay hints
[vim-lsp.git] / autoload / lsp / lsp.vim
index adc8e7cb5c0a4f1a649ce44b414ab7c6a008cf7c..7b9ed6808a4182ab0b197e259a1cd2940ccc9e9c 100644 (file)
@@ -799,6 +799,23 @@ export def Hover(cmdmods: string)
   lspserver.hover(cmdmods)
 enddef
 
+# Enable or disable inlay hints
+export def InlayHints(ctl: string)
+  if ctl == 'enable'
+    inlayhints.InlayHintsEnable()
+  elseif ctl == 'disable'
+    inlayhints.InlayHintsDisable()
+  else
+    util.ErrMsg($'LspInlayHints - Unsupported argument "{ctl}"')
+  endif
+enddef
+
+# Command-line completion for the ":LspInlayHints" command
+export def LspInlayHintsComplete(arglead: string, cmdline: string, cursorPos: number): list<string>
+  var l = ['enable', 'disable']
+  return filter(l, (_, val) => val =~ $'^{arglead}')
+enddef
+
 # show symbol references
 export def ShowReferences(peek: bool)
   var lspserver: dict<any> = buf.CurbufGetServerChecked('references')