From 99e22f267667fe4b2107443b9313753a89592d2a Mon Sep 17 00:00:00 2001 From: Nat Quayle Nelson Date: Sat, 18 Mar 2023 12:22:15 -0600 Subject: [PATCH] defCommand don't require prefix on id --- src/Util.kiss | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/Util.kiss b/src/Util.kiss index ba82e4c..b570784 100644 --- a/src/Util.kiss +++ b/src/Util.kiss @@ -167,11 +167,10 @@ // Example: /* - (defCommand myExt.customCommand "Custom command that does something" "C-; C-c" [] ) + (defCommand customCommand "Custom command that does something" "C-; C-c" [] ) */ -(defMacroVar extensionName "Kiss-Vscode") (defMacro defCommand [context id description shortcut argList &body body] - (let [id (symbolNameValue id) + (let [functionName id description (eval description) shortcut (eval shortcut) shortcutWithHyphensProcessed @@ -188,12 +187,14 @@ "++" "-+") packageJson (Json.parse (File.getContent "package.json")) + extensionName + packageJson.name keybindings packageJson.contributes.keybindings commands packageJson.contributes.commands - functionName - (symbol (StringTools.replace id "." "_")) + id + "${extensionName}.${id}" &mut keyBindingIndex null &mut commandIndex null] (doFor [idx binding] (enumerate keybindings)