[vscode] allow registering existing commands
This commit is contained in:
@@ -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] {
|
||||
|
Reference in New Issue
Block a user