@@ -2,15 +2,24 @@ import { commands, QuickPickItemKind, ThemeColor, window } from "vscode";
22import type { QuickPickItem } from "vscode" ;
33
44import { createPlugin } from "../plugins.ts" ;
5+ import { checkLocalstackInstalled } from "../utils/install.ts" ;
56
67export default createPlugin (
78 "status-bar" ,
8- ( { context, statusBarItem, localStackStatusTracker, setupStatusTracker } ) => {
9+ ( {
10+ context,
11+ statusBarItem,
12+ localStackStatusTracker,
13+ setupStatusTracker,
14+ outputChannel,
15+ } ) => {
916 context . subscriptions . push (
1017 commands . registerCommand ( "localstack.showCommands" , async ( ) => {
11- const shouldShowLocalStackStart = ( ) =>
18+ const shouldShowLocalStackStart = async ( ) =>
19+ ( await checkLocalstackInstalled ( outputChannel ) ) &&
1220 localStackStatusTracker . status ( ) === "stopped" ;
13- const shouldShowLocalStackStop = ( ) =>
21+ const shouldShowLocalStackStop = async ( ) =>
22+ ( await checkLocalstackInstalled ( outputChannel ) ) &&
1423 localStackStatusTracker . status ( ) === "running" ;
1524 const shouldShowRunSetupWizard = ( ) =>
1625 setupStatusTracker . status ( ) === "setup_required" ;
@@ -23,14 +32,14 @@ export default createPlugin(
2332 kind : QuickPickItemKind . Separator ,
2433 } ) ;
2534
26- if ( shouldShowLocalStackStart ( ) ) {
35+ if ( await shouldShowLocalStackStart ( ) ) {
2736 commands . push ( {
2837 label : "Start LocalStack" ,
2938 command : "localstack.start" ,
3039 } ) ;
3140 }
3241
33- if ( shouldShowLocalStackStop ( ) ) {
42+ if ( await shouldShowLocalStackStop ( ) ) {
3443 commands . push ( {
3544 label : "Stop LocalStack" ,
3645 command : "localstack.stop" ,
@@ -70,6 +79,7 @@ export default createPlugin(
7079
7180 context . subscriptions . push (
7281 commands . registerCommand ( "localstack.refreshStatusBar" , ( ) => {
82+ // TODO
7383 const setupStatus = setupStatusTracker . status ( ) ;
7484
7585 if ( setupStatus === "setup_required" ) {
0 commit comments