mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-16 10:58:30 -05:00
Alanren/extension install (#6918)
* fix extension install * fix azure account open url issue
This commit is contained in:
@@ -18,6 +18,8 @@ import { AccountProviderAddedEventParams, UpdateAccountListEventParams } from 's
|
|||||||
import { IAccountManagementService } from 'sql/platform/accounts/common/interfaces';
|
import { IAccountManagementService } from 'sql/platform/accounts/common/interfaces';
|
||||||
import { Deferred } from 'sql/base/common/promise';
|
import { Deferred } from 'sql/base/common/promise';
|
||||||
import { localize } from 'vs/nls';
|
import { localize } from 'vs/nls';
|
||||||
|
import { IOpenerService } from 'vs/platform/opener/common/opener';
|
||||||
|
import { URI } from 'vs/base/common/uri';
|
||||||
|
|
||||||
export class AccountManagementService implements IAccountManagementService {
|
export class AccountManagementService implements IAccountManagementService {
|
||||||
// CONSTANTS ///////////////////////////////////////////////////////////
|
// CONSTANTS ///////////////////////////////////////////////////////////
|
||||||
@@ -46,7 +48,8 @@ export class AccountManagementService implements IAccountManagementService {
|
|||||||
private _mementoObj: object,
|
private _mementoObj: object,
|
||||||
@IInstantiationService private _instantiationService: IInstantiationService,
|
@IInstantiationService private _instantiationService: IInstantiationService,
|
||||||
@IStorageService private _storageService: IStorageService,
|
@IStorageService private _storageService: IStorageService,
|
||||||
@IClipboardService private _clipboardService: IClipboardService
|
@IClipboardService private _clipboardService: IClipboardService,
|
||||||
|
@IOpenerService private _openerService: IOpenerService
|
||||||
) {
|
) {
|
||||||
// Create the account store
|
// Create the account store
|
||||||
if (!this._mementoObj) {
|
if (!this._mementoObj) {
|
||||||
@@ -310,7 +313,7 @@ export class AccountManagementService implements IAccountManagementService {
|
|||||||
*/
|
*/
|
||||||
public copyUserCodeAndOpenBrowser(userCode: string, uri: string): void {
|
public copyUserCodeAndOpenBrowser(userCode: string, uri: string): void {
|
||||||
this._clipboardService.writeText(userCode);
|
this._clipboardService.writeText(userCode);
|
||||||
window.open(uri);
|
this._openerService.open(URI.parse(uri));
|
||||||
}
|
}
|
||||||
|
|
||||||
// SERVICE MANAGEMENT METHODS //////////////////////////////////////////
|
// SERVICE MANAGEMENT METHODS //////////////////////////////////////////
|
||||||
|
|||||||
@@ -567,7 +567,7 @@ function getTestState(): AccountManagementState {
|
|||||||
let mockMemento = {};
|
let mockMemento = {};
|
||||||
|
|
||||||
// Create the account management service
|
// Create the account management service
|
||||||
let ams = new AccountManagementService(mockMemento, mockInstantiationService.object, new TestStorageService(), null);
|
let ams = new AccountManagementService(mockMemento, mockInstantiationService.object, new TestStorageService(), null, null);
|
||||||
|
|
||||||
// Wire up event handlers
|
// Wire up event handlers
|
||||||
let evUpdate = new EventVerifierSingle<UpdateAccountListEventParams>();
|
let evUpdate = new EventVerifierSingle<UpdateAccountListEventParams>();
|
||||||
|
|||||||
@@ -39,8 +39,8 @@ import { IModeService } from 'vs/editor/common/services/modeService';
|
|||||||
import { IProductService } from 'vs/platform/product/common/product';
|
import { IProductService } from 'vs/platform/product/common/product';
|
||||||
import { asDomUri } from 'vs/base/browser/dom';
|
import { asDomUri } from 'vs/base/browser/dom';
|
||||||
|
|
||||||
// {{SQL CARBON EDIT}}
|
import { isEngineValid } from 'vs/platform/extensions/common/extensionValidator'; // {{SQL CARBON EDIT}}
|
||||||
import { isEngineValid } from 'vs/platform/extensions/common/extensionValidator';
|
import { IOpenerService } from 'vs/platform/opener/common/opener'; // {{SQL CARBON EDIT}}
|
||||||
|
|
||||||
interface IExtensionStateProvider<T> {
|
interface IExtensionStateProvider<T> {
|
||||||
(extension: Extension): T;
|
(extension: Extension): T;
|
||||||
@@ -516,7 +516,8 @@ export class ExtensionsWorkbenchService extends Disposable implements IExtension
|
|||||||
@IExtensionManagementServerService private readonly extensionManagementServerService: IExtensionManagementServerService,
|
@IExtensionManagementServerService private readonly extensionManagementServerService: IExtensionManagementServerService,
|
||||||
@IStorageService private readonly storageService: IStorageService,
|
@IStorageService private readonly storageService: IStorageService,
|
||||||
@IModeService private readonly modeService: IModeService,
|
@IModeService private readonly modeService: IModeService,
|
||||||
@IProductService private readonly productService: IProductService
|
@IProductService private readonly productService: IProductService,
|
||||||
|
@IOpenerService private readonly openerService: IOpenerService // {{SQL CARBON EDIT}}
|
||||||
) {
|
) {
|
||||||
super();
|
super();
|
||||||
if (this.extensionManagementServerService.localExtensionManagementServer) {
|
if (this.extensionManagementServerService.localExtensionManagementServer) {
|
||||||
@@ -852,7 +853,7 @@ export class ExtensionsWorkbenchService extends Disposable implements IExtension
|
|||||||
// {{SQL CARBON EDIT}}
|
// {{SQL CARBON EDIT}}
|
||||||
private downloadOrBrowse(ext: IExtension): Promise<any> {
|
private downloadOrBrowse(ext: IExtension): Promise<any> {
|
||||||
if (ext.gallery.assets.downloadPage && ext.gallery.assets.downloadPage.uri) {
|
if (ext.gallery.assets.downloadPage && ext.gallery.assets.downloadPage.uri) {
|
||||||
window.open(ext.gallery.assets.downloadPage.uri);
|
this.openerService.open(URI.parse(ext.gallery.assets.downloadPage.uri));
|
||||||
return Promise.resolve(undefined);
|
return Promise.resolve(undefined);
|
||||||
} else {
|
} else {
|
||||||
return this.extensionService.installFromGallery(ext.gallery);
|
return this.extensionService.installFromGallery(ext.gallery);
|
||||||
|
|||||||
Reference in New Issue
Block a user