@@ -201,12 +201,15 @@ export async function checkConnection(clearCookies = false, uri?: vscode.Uri): P
201201 let api = new AtelierAPI ( apiTarget , false ) ;
202202 const { active, host = "" , port = 0 , username, ns = "" } = api . config ;
203203 vscode . commands . executeCommand ( "setContext" , "vscode-objectscript.connectActive" , active ) ;
204+ if ( ! panel . text ) {
205+ panel . text = `${ PANEL_LABEL } ` ;
206+ }
204207 if ( ! host . length && ! port && ! ns . length ) {
205208 panel . text = `${ PANEL_LABEL } ` ;
206209 panel . tooltip = `No connection configured` ;
207210 return ;
208211 }
209- let connInfo = ` ${ host } : ${ port } [ ${ ns } ]` ;
212+ let connInfo = api . connInfo ;
210213 if ( ! active ) {
211214 if ( ! host . length || ! port || ! ns . length ) {
212215 connInfo = `incompletely specified server ${ connInfo } ` ;
@@ -215,12 +218,12 @@ export async function checkConnection(clearCookies = false, uri?: vscode.Uri): P
215218 panel . tooltip = `Connection to ${ connInfo } is disabled` ;
216219 return ;
217220 }
218- panel . text = connInfo ;
219- panel . tooltip = `Connected as ${ username } ` ;
221+
220222 if ( ! workspaceState . get ( configName + ":port" ) && ! api . externalServer ) {
221223 try {
222- const { port : dockerPort , docker : withDocker } = await portFromDockerCompose ( ) ;
224+ const { port : dockerPort , docker : withDocker , service } = await portFromDockerCompose ( ) ;
223225 workspaceState . update ( configName + ":docker" , withDocker ) ;
226+ workspaceState . update ( configName + ":dockerService" , service ) ;
224227 if ( withDocker ) {
225228 if ( ! dockerPort ) {
226229 const errorMessage = `Something is wrong with your docker-compose connection settings, or your service is not running.` ;
@@ -241,6 +244,8 @@ export async function checkConnection(clearCookies = false, uri?: vscode.Uri): P
241244 } catch ( error ) {
242245 outputChannel . appendError ( error ) ;
243246 workspaceState . update ( configName + ":docker" , true ) ;
247+ panel . text = `${ PANEL_LABEL } $(error)` ;
248+ panel . tooltip = error ;
244249 return ;
245250 }
246251 }
@@ -262,6 +267,8 @@ export async function checkConnection(clearCookies = false, uri?: vscode.Uri): P
262267 api
263268 . serverInfo ( )
264269 . then ( ( info ) => {
270+ panel . text = api . connInfo ;
271+ panel . tooltip = `Connected as ${ username } ` ;
265272 const hasHS = info . result . content . features . find ( ( el ) => el . name === "HEALTHSHARE" && el . enabled ) !== undefined ;
266273 reporter &&
267274 reporter . sendTelemetryEvent ( "connected" , {
@@ -454,12 +461,12 @@ export async function activate(context: vscode.ExtensionContext): Promise<any> {
454461 posPanel . show ( ) ;
455462
456463 panel = vscode . window . createStatusBarItem ( vscode . StatusBarAlignment . Left , 1 ) ;
457-
458- const debugAdapterFactory = new ObjectScriptDebugAdapterDescriptorFactory ( ) ;
459-
464+ panel . text = `${ PANEL_LABEL } ` ;
460465 panel . command = "vscode-objectscript.serverActions" ;
461466 panel . show ( ) ;
462467
468+ const debugAdapterFactory = new ObjectScriptDebugAdapterDescriptorFactory ( ) ;
469+
463470 // Check one time (flushing cookies) each connection that is used by the workspace.
464471 // This gets any prompting for missing credentials done upfront, for simplicity.
465472 const toCheck = new Map < string , vscode . Uri > ( ) ;
@@ -675,6 +682,8 @@ export async function activate(context: vscode.ExtensionContext): Promise<any> {
675682
676683 context . subscriptions . push (
677684 reporter ,
685+ panel ,
686+ posPanel ,
678687 vscode . extensions . onDidChange ( async ( ) => {
679688 const languageServerExt2 = languageServer ( false ) ;
680689 if ( typeof languageServerExt !== typeof languageServerExt2 ) {
0 commit comments