[vscode] allow registering existing commands
This commit is contained in:
@@ -11,6 +11,9 @@
|
|||||||
(defalias &call inputBox Vscode.window.showInputBox)
|
(defalias &call inputBox Vscode.window.showInputBox)
|
||||||
(defalias &call quickPick Vscode.window.showQuickPick)
|
(defalias &call quickPick Vscode.window.showQuickPick)
|
||||||
|
|
||||||
|
// commands
|
||||||
|
(defalias &call executeCommand Vscode.commands.executeCommand)
|
||||||
|
|
||||||
// ui
|
// ui
|
||||||
(defalias &ident activeTextEditor Vscode.window.activeTextEditor)
|
(defalias &ident activeTextEditor Vscode.window.activeTextEditor)
|
||||||
|
|
||||||
@@ -199,6 +202,10 @@
|
|||||||
(whenLet [keyboardShortcut (extractKeyboardShortcuts description)]
|
(whenLet [keyboardShortcut (extractKeyboardShortcuts description)]
|
||||||
(registerShortcut (keyboardShortcut.split "") 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 []
|
(defun :Void registerBuiltins []
|
||||||
(set Prelude.print
|
(set Prelude.print
|
||||||
->[v] {
|
->[v] {
|
||||||
|
Reference in New Issue
Block a user