@@ -253,6 +253,40 @@ export const checkConnection = (clearCookies = false): void => {
253253 } ) ;
254254} ;
255255
256+ async function serverManager ( ) : Promise < void > {
257+ const extId = "intersystems-community.servermanager" ;
258+ const ignore =
259+ config ( "ignoreInstallServerManager" ) ||
260+ vscode . workspace . getConfiguration ( "intersystems.servers" ) . get ( "/ignore" , false ) ;
261+ if ( ignore || vscode . extensions . getExtension ( extId ) ) {
262+ return ;
263+ }
264+ return vscode . window
265+ . showInformationMessage (
266+ `Extension InterSystems® Server Manager have not installed,
267+ it's recommended to install it.` ,
268+ "Install" ,
269+ "Skip" ,
270+ "Ignore"
271+ )
272+ . then ( async ( action ) => {
273+ switch ( action ) {
274+ case "Install" :
275+ await vscode . commands . executeCommand ( "workbench.extensions.installExtension" , extId ) ;
276+ // eslint-disable-next-line no-fallthrough
277+ case "View" :
278+ await vscode . commands . executeCommand ( "workbench.extensions.search" , `@tag:"intersystems"` ) ;
279+ await vscode . commands . executeCommand ( "extension.open" , extId ) ;
280+ break ;
281+ case "Ignore" :
282+ config ( ) . update ( "ignoreInstallServerManager" , true , vscode . ConfigurationTarget . Global ) ;
283+ break ;
284+ case "Skip" :
285+ default :
286+ }
287+ } ) ;
288+ }
289+
256290export async function activate ( context : vscode . ExtensionContext ) : Promise < void > {
257291 if ( ! packageJson . version . includes ( "SNAPSHOT" ) ) {
258292 reporter = new TelemetryReporter ( extensionId , extensionVersion , aiKey ) ;
@@ -540,6 +574,9 @@ export async function activate(context: vscode.ExtensionContext): Promise<void>
540574 ...proposed
541575 ) ;
542576 reporter && reporter . sendTelemetryEvent ( "extensionActivated" ) ;
577+
578+ // offer to install servermanager extension
579+ await serverManager ( ) ;
543580}
544581
545582export function deactivate ( ) : void {
0 commit comments