@@ -3,6 +3,24 @@ import type { QuickPickItem } from "vscode";
33
44import { createPlugin } from "../plugins.ts" ;
55import { immediateOnce } from "../utils/immediate-once.ts" ;
6+ import type { LocalStackStatus } from "../utils/localstack-status.ts" ;
7+ import type { SetupStatus } from "../utils/setup-status.ts" ;
8+
9+ function getStatusText ( options : {
10+ cliStatus : SetupStatus ;
11+ localStackStatus : LocalStackStatus ;
12+ cliOutdated : boolean | undefined ;
13+ } ) {
14+ if ( options . cliStatus === "ok" ) {
15+ return options . localStackStatus ;
16+ }
17+
18+ if ( options . cliOutdated ) {
19+ return "CLI outdated" ;
20+ }
21+
22+ return "CLI not installed" ;
23+ }
624
725export default createPlugin (
826 "status-bar" ,
@@ -83,6 +101,7 @@ export default createPlugin(
83101 const setupStatus = setupStatusTracker . status ( ) ;
84102 const localStackStatus = localStackStatusTracker . status ( ) ;
85103 const cliStatus = cliStatusTracker . status ( ) ;
104+ const cliOutdated = cliStatusTracker . outdated ( ) ;
86105 outputChannel . trace (
87106 `[status-bar] setupStatus=${ setupStatus } localStackStatus=${ localStackStatus } cliStatus=${ cliStatus } ` ,
88107 ) ;
@@ -111,8 +130,11 @@ export default createPlugin(
111130 ? "$(sync~spin)"
112131 : "$(localstack-logo)" ;
113132
114- const statusText =
115- cliStatus === "ok" ? `${ localStackStatus } ` : "not installed" ;
133+ const statusText = getStatusText ( {
134+ cliOutdated,
135+ cliStatus,
136+ localStackStatus,
137+ } ) ;
116138 statusBarItem . text = `${ icon } LocalStack: ${ statusText } ` ;
117139
118140 statusBarItem . tooltip = "Show LocalStack commands" ;
0 commit comments