[vscode] allow registering existing commands

This commit is contained in:
2021-04-04 14:50:27 -06:00
parent 4efafb5f57
commit e3791e5b50

View File

@@ -11,6 +11,9 @@
(defalias &call inputBox Vscode.window.showInputBox)
(defalias &call quickPick Vscode.window.showQuickPick)
// commands
(defalias &call executeCommand Vscode.commands.executeCommand)
// ui
(defalias &ident activeTextEditor Vscode.window.activeTextEditor)
@@ -199,6 +202,10 @@
(whenLet [keyboardShortcut (extractKeyboardShortcuts description)]
(registerShortcut (keyboardShortcut.split "") description)))
// Register a VSCode command (built-in, or from an extension)
(defun registerExistingCommand [description command]
(registerCommand description (lambda :Void [&opt _] (executeCommand command))))
(defun :Void registerBuiltins []
(set Prelude.print
->[v] {