-
Notifications
You must be signed in to change notification settings - Fork 48
Make ServerManager extension as optional, do not prevent this extension working. #188
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -253,6 +253,40 @@ export const checkConnection = (clearCookies = false): void => { | |
}); | ||
}; | ||
|
||
async function serverManager(): Promise<void> { | ||
const extId = "intersystems-community.servermanager"; | ||
const ignore = | ||
config("ignoreInstallServerManager") || | ||
vscode.workspace.getConfiguration("intersystems.servers").get("/ignore", false); | ||
if (ignore || vscode.extensions.getExtension(extId)) { | ||
return; | ||
} | ||
return vscode.window | ||
.showInformationMessage( | ||
`Extension InterSystems® Server Manager have not installed, | ||
it's recommended to install it.`, | ||
daimor marked this conversation as resolved.
Show resolved
Hide resolved
|
||
"Install", | ||
"Skip", | ||
"Ignore" | ||
) | ||
.then(async (action) => { | ||
switch (action) { | ||
case "Install": | ||
await vscode.commands.executeCommand("workbench.extensions.installExtension", extId); | ||
// eslint-disable-next-line no-fallthrough | ||
case "View": | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. showInformationMessage doesn't offer "View" option There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. My thoughts were, do not offer too many buttons, and was not sure if it's a good idea to install it from information message, not from extension page There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. In which case why is |
||
await vscode.commands.executeCommand("workbench.extensions.search", `@tag:"intersystems"`); | ||
gjsjohnmurray marked this conversation as resolved.
Show resolved
Hide resolved
|
||
await vscode.commands.executeCommand("extension.open", extId); | ||
break; | ||
case "Ignore": | ||
config().update("ignoreInstallServerManager", true, vscode.ConfigurationTarget.Global); | ||
break; | ||
case "Skip": | ||
default: | ||
} | ||
}); | ||
} | ||
|
||
export async function activate(context: vscode.ExtensionContext): Promise<void> { | ||
if (!packageJson.version.includes("SNAPSHOT")) { | ||
reporter = new TelemetryReporter(extensionId, extensionVersion, aiKey); | ||
|
@@ -540,6 +574,9 @@ export async function activate(context: vscode.ExtensionContext): Promise<void> | |
...proposed | ||
); | ||
reporter && reporter.sendTelemetryEvent("extensionActivated"); | ||
|
||
// offer to install servermanager extension | ||
await serverManager(); | ||
} | ||
|
||
export function deactivate(): void { | ||
|
Uh oh!
There was an error while loading. Please reload this page.