@@ -9,6 +9,7 @@ import { exportAll, exportExplorerItem } from './commands/export';
9
9
import { xml2doc } from './commands/xml2doc' ;
10
10
import { subclass } from './commands/subclass' ;
11
11
import { superclass } from './commands/superclass' ;
12
+ import { serverActions } from './commands/serverActions' ;
12
13
13
14
import { ObjectScriptClassSymbolProvider } from './providers/ObjectScriptClassSymbolProvider' ;
14
15
import { ObjectScriptRoutineSymbolProvider } from './providers/ObjectScriptRoutineSymbolProvider' ;
@@ -35,7 +36,7 @@ export const config = (config?: string, workspaceFolderName?: string): any => {
35
36
workspaceFolderName = workspaceFolderName || currentWorkspaceFolder ( ) ;
36
37
37
38
if ( [ 'conn' , 'export' ] . includes ( config ) ) {
38
- if ( workspaceFolderName !== '' ) {
39
+ if ( workspaceFolderName && workspaceFolderName !== '' ) {
39
40
const workspaceFolder = vscode . workspace . workspaceFolders . find (
40
41
el => el . name . toLowerCase ( ) === workspaceFolderName . toLowerCase ( )
41
42
) ;
@@ -74,31 +75,30 @@ export async function activate(context: vscode.ExtensionContext): Promise<void>
74
75
vscode . window . registerTreeDataProvider ( 'ObjectScriptExplorer' , explorerProvider ) ;
75
76
76
77
const panel = vscode . window . createStatusBarItem ( vscode . StatusBarAlignment . Left ) ;
77
- panel . command = 'vscode-objectscript.output' ;
78
- panel . tooltip = 'Open output' ;
78
+ panel . command = 'vscode-objectscript.serverActions' ;
79
79
panel . show ( ) ;
80
80
const checkConnection = ( ) => {
81
81
const conn = config ( 'conn' ) ;
82
+ const connInfo = `${ conn . host } :${ conn . port } /${ conn . ns } /` ;
83
+ panel . text = connInfo ;
84
+ panel . tooltip = '' ;
82
85
vscode . commands . executeCommand ( 'setContext' , 'vscode-objectscript.connectActive' , conn . active ) ;
83
86
if ( ! conn . active ) {
84
- panel . text = '' ;
87
+ panel . text = ` ${ connInfo } - Disabled` ;
85
88
return ;
86
89
}
87
- panel . text = `${ conn . label } : ${ conn . ns } ` ;
90
+ panel . text = `${ connInfo } ` ;
88
91
const api = new AtelierAPI ( ) ;
89
92
api
90
93
. serverInfo ( )
91
94
. then ( async info => {
92
- panel . text = `${ conn . label } :${ conn . ns } - Connected` ;
93
- if ( info && info . result && info . result . content && info . result . content . api > 0 ) {
94
- let apiVersion = info . result . content . api ;
95
- await vscode . workspace . getConfiguration ( ) . update ( 'objectscript.conn.version' , apiVersion ) ;
96
- }
95
+ panel . text = `${ connInfo } - Connected` ;
97
96
explorerProvider . refresh ( ) ;
98
97
} )
99
98
. catch ( ( error : Error ) => {
100
99
outputChannel . appendLine ( error . message ) ;
101
- panel . text = `${ conn . label } :${ conn . ns } - ERROR` ;
100
+ panel . text = `${ connInfo } - ERROR` ;
101
+ panel . tooltip = error . message ;
102
102
} ) ;
103
103
} ;
104
104
checkConnection ( ) ;
@@ -144,6 +144,7 @@ export async function activate(context: vscode.ExtensionContext): Promise<void>
144
144
vscode . commands . registerCommand ( 'vscode-objectscript.viewOthers' , viewOthers ) ,
145
145
vscode . commands . registerCommand ( 'vscode-objectscript.subclass' , subclass ) ,
146
146
vscode . commands . registerCommand ( 'vscode-objectscript.superclass' , superclass ) ,
147
+ vscode . commands . registerCommand ( 'vscode-objectscript.serverActions' , serverActions ) ,
147
148
vscode . commands . registerCommand ( 'vscode-objectscript.touchBar.viewOthers' , viewOthers ) ,
148
149
vscode . commands . registerCommand ( 'vscode-objectscript.explorer.refresh' , ( ) => explorerProvider . refresh ( ) ) ,
149
150
vscode . commands . registerCommand ( 'vscode-objectscript.explorer.openClass' , vscode . window . showTextDocument ) ,
0 commit comments