diff --git a/package.json b/package.json index f1aeeba..809b162 100644 --- a/package.json +++ b/package.json @@ -36,7 +36,11 @@ }, "main": "bin/extension.js", "activationEvents": [ - "workspaceContains:.haxerc" + "onLanguage:haxe", + "workspaceContains:.haxerc", + "workspaceContains:haxe_libraries", + "workspaceContains:./*.hxml", + "onCommand:lix.selectHaxeVersion" ], "contributes": { "commands": [ diff --git a/src/HaxeVersionSelector.hx b/src/HaxeVersionSelector.hx index 2fefcce..43d7126 100644 --- a/src/HaxeVersionSelector.hx +++ b/src/HaxeVersionSelector.hx @@ -24,12 +24,12 @@ class HaxeVersionSelector { } public function updateStatusBarItem() { + var scope = Scope.seek({cwd: cwd}); var activeEditor = window.activeTextEditor; - if (activeEditor == null || activeEditor.document.languageId != "haxe") { + if (activeEditor == null || activeEditor.document.languageId != "haxe" || scope.isGlobal) { statusBarItem.hide(); return; } - var scope = Scope.seek({cwd: cwd}); statusBarItem.text = scope.haxeInstallation.version; statusBarItem.show(); } @@ -63,6 +63,8 @@ class HaxeVersionSelector { select: installAnotherVersion.bind(items.map(item -> item.label)) }); + // TODO: switch to path + showSelectableQuickPick(items, "Select an installed Haxe version to switch to"); }); });