kiss-vscode add extensionPath variable to KissConfig
This commit is contained in:
@@ -34,6 +34,7 @@
|
||||
(var &mut :String lastCommand null)
|
||||
(var parser (new Parser))
|
||||
(var interp (new Interp))
|
||||
(var &mut :String extensionPath "")
|
||||
|
||||
/**
|
||||
* Functionality
|
||||
@@ -269,6 +270,9 @@
|
||||
random Std.random
|
||||
int Std.int)))
|
||||
|
||||
// Way to more forgivingly get long text inputs
|
||||
// (function :Promise<String> inputEditor [:String filename :String prompt] )
|
||||
|
||||
(#unless test
|
||||
(var :Array<KTxt2Conversion> conversions [])
|
||||
|
||||
|
@@ -26,6 +26,7 @@ typedef KissConfig = {
|
||||
runLastCommand:Command,
|
||||
runKeyboardShortcut:Command,
|
||||
tryLoadConfig:Command,
|
||||
extensionPath:String,
|
||||
#if !test
|
||||
conversions:Array<KTxt2Conversion>,
|
||||
#end
|
||||
|
@@ -107,18 +107,21 @@
|
||||
(requireConfigJs activeConfigFile)
|
||||
(Vscode.window.showInformationMessage "Config loaded successfully!"))))))
|
||||
|
||||
(var &mut extensionPath "")
|
||||
(function requireConfigJs [file]
|
||||
(let [uniqueConfigFile (joinPath activeConfigDir "$(.toShort (Uuid.v4)).js")]
|
||||
(File.copy file uniqueConfigFile)
|
||||
(set config (the KissConfig .KissConfig (Node.require uniqueConfigFile)))
|
||||
(set Prelude.printStr ->:Void s (Vscode.window.showInformationMessage s))
|
||||
(set config.tryLoadConfig ->[&opt _] (tryLoadConfig true false))
|
||||
(set config.extensionPath extensionPath)
|
||||
(config.prepareInterp)
|
||||
// User-defined init:
|
||||
(config.init)))
|
||||
|
||||
(#unless test
|
||||
(function _activate [:ExtensionContext context]
|
||||
(set extensionPath context.extensionPath)
|
||||
(context.subscriptions.push
|
||||
(Vscode.commands.registerCommand
|
||||
"kiss.reloadConfig"
|
||||
|
Reference in New Issue
Block a user