mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-17 02:51:36 -05:00
5283
src/sql/azdata.d.ts
vendored
5283
src/sql/azdata.d.ts
vendored
File diff suppressed because it is too large
Load Diff
5283
src/sql/azdata.proposed.d.ts
vendored
5283
src/sql/azdata.proposed.d.ts
vendored
File diff suppressed because it is too large
Load Diff
@@ -9,15 +9,23 @@ import { extHostNamedCustomer } from 'vs/workbench/api/common/extHostCustomers';
|
|||||||
import { dispose, IDisposable } from 'vs/base/common/lifecycle';
|
import { dispose, IDisposable } from 'vs/base/common/lifecycle';
|
||||||
import { IExtensionManagementService, ILocalExtension } from 'vs/platform/extensionManagement/common/extensionManagement';
|
import { IExtensionManagementService, ILocalExtension } from 'vs/platform/extensionManagement/common/extensionManagement';
|
||||||
import { URI } from 'vs/base/common/uri';
|
import { URI } from 'vs/base/common/uri';
|
||||||
|
import { IConfigurationService, ConfigurationTarget } from 'vs/platform/configuration/common/configuration';
|
||||||
|
import { INotificationService, Severity } from 'vs/platform/notification/common/notification';
|
||||||
|
import { localize } from 'vs/nls';
|
||||||
|
import { IWindowService } from 'vs/platform/windows/common/windows';
|
||||||
|
|
||||||
@extHostNamedCustomer(SqlMainContext.MainThreadExtensionManagement)
|
@extHostNamedCustomer(SqlMainContext.MainThreadExtensionManagement)
|
||||||
export class MainThreadExtensionManagement implements MainThreadExtensionManagementShape {
|
export class MainThreadExtensionManagement implements MainThreadExtensionManagementShape {
|
||||||
|
|
||||||
private _toDispose: IDisposable[];
|
private _toDispose: IDisposable[];
|
||||||
|
private _obsoleteExtensionApiUsageNotificationShown: boolean = false;
|
||||||
|
|
||||||
constructor(
|
constructor(
|
||||||
extHostContext: IExtHostContext,
|
extHostContext: IExtHostContext,
|
||||||
@IExtensionManagementService private _extensionService: IExtensionManagementService
|
@IExtensionManagementService private _extensionService: IExtensionManagementService,
|
||||||
|
@IConfigurationService private _configurationService: IConfigurationService,
|
||||||
|
@INotificationService private _notificationService: INotificationService,
|
||||||
|
@IWindowService protected readonly _windowService: IWindowService
|
||||||
) {
|
) {
|
||||||
this._toDispose = [];
|
this._toDispose = [];
|
||||||
}
|
}
|
||||||
@@ -29,4 +37,31 @@ export class MainThreadExtensionManagement implements MainThreadExtensionManagem
|
|||||||
public $install(vsixPath: string): Thenable<string> {
|
public $install(vsixPath: string): Thenable<string> {
|
||||||
return this._extensionService.install(URI.file(vsixPath)).then((value: ILocalExtension) => { return undefined; }, (reason: any) => { return reason ? reason.toString() : undefined; });
|
return this._extensionService.install(URI.file(vsixPath)).then((value: ILocalExtension) => { return undefined; }, (reason: any) => { return reason ? reason.toString() : undefined; });
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public $showObsoleteExtensionApiUsageNotification(message: string): void {
|
||||||
|
console.warn(message);
|
||||||
|
|
||||||
|
if (this._obsoleteExtensionApiUsageNotificationShown) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
let enableObsoleteAPINotification = this._configurationService.getValue('workbench')['enableObsoleteApiUsageNotification'];
|
||||||
|
if (enableObsoleteAPINotification !== undefined && !enableObsoleteAPINotification) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
this._notificationService.prompt(Severity.Warning,
|
||||||
|
localize('workbench.generalObsoleteApiNotification', "Some of the loaded extensions are using obsolete APIs, please find the detailed information in the Console tab of Developer Tools window"),
|
||||||
|
[{
|
||||||
|
label: localize('dontShowAgain', "Don't Show Again"),
|
||||||
|
run: () => {
|
||||||
|
this._configurationService.updateValue('workbench.enableObsoleteApiUsageNotification', false, ConfigurationTarget.USER);
|
||||||
|
},
|
||||||
|
isSecondary: true
|
||||||
|
}, {
|
||||||
|
label: localize('devTools', "Open Developer Tools"),
|
||||||
|
run: () => this._windowService.openDevTools()
|
||||||
|
}]);
|
||||||
|
this._obsoleteExtensionApiUsageNotificationShown = true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -19,4 +19,8 @@ export class ExtHostExtensionManagement implements ExtHostExtensionManagementSha
|
|||||||
$install(vsixPath: string): Thenable<string> {
|
$install(vsixPath: string): Thenable<string> {
|
||||||
return this._proxy.$install(vsixPath);
|
return this._proxy.$install(vsixPath);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$showObsoleteExtensionApiUsageNotification(message: string): void {
|
||||||
|
return this._proxy.$showObsoleteExtensionApiUsageNotification(message);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -931,8 +931,10 @@ export interface MainThreadNotebookDocumentsAndEditorsShape extends IDisposable
|
|||||||
|
|
||||||
export interface ExtHostExtensionManagementShape {
|
export interface ExtHostExtensionManagementShape {
|
||||||
$install(vsixPath: string): Thenable<string>;
|
$install(vsixPath: string): Thenable<string>;
|
||||||
|
$showObsoleteExtensionApiUsageNotification(message: string): void;
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface MainThreadExtensionManagementShape extends IDisposable {
|
export interface MainThreadExtensionManagementShape extends IDisposable {
|
||||||
$install(vsixPath: string): Thenable<string>;
|
$install(vsixPath: string): Thenable<string>;
|
||||||
|
$showObsoleteExtensionApiUsageNotification(message: string): void;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -42,6 +42,7 @@ import { ExtHostStorage } from 'vs/workbench/api/common/extHostStorage';
|
|||||||
import * as extHostTypes from 'vs/workbench/api/common/extHostTypes';
|
import * as extHostTypes from 'vs/workbench/api/common/extHostTypes';
|
||||||
import { IURITransformer } from 'vs/base/common/uriIpc';
|
import { IURITransformer } from 'vs/base/common/uriIpc';
|
||||||
import { mssqlProviderName } from 'sql/platform/connection/common/constants';
|
import { mssqlProviderName } from 'sql/platform/connection/common/constants';
|
||||||
|
import { localize } from 'vs/nls';
|
||||||
|
|
||||||
export interface ISqlExtensionApiFactory {
|
export interface ISqlExtensionApiFactory {
|
||||||
vsCodeFactory(extension: IExtensionDescription, registry: ExtensionDescriptionRegistry, configProvider: ExtHostConfigProvider): typeof vscode;
|
vsCodeFactory(extension: IExtensionDescription, registry: ExtensionDescriptionRegistry, configProvider: ExtHostConfigProvider): typeof vscode;
|
||||||
@@ -562,6 +563,7 @@ export function createApiFactory(
|
|||||||
// "sqlops" namespace provided for back-compat only, add new interfaces to "azdata"
|
// "sqlops" namespace provided for back-compat only, add new interfaces to "azdata"
|
||||||
sqlopsFactory: function (extension: IExtensionDescription): typeof sqlops {
|
sqlopsFactory: function (extension: IExtensionDescription): typeof sqlops {
|
||||||
|
|
||||||
|
extHostExtensionManagement.$showObsoleteExtensionApiUsageNotification(localize('ObsoleteApiModuleMessage', "The extension \"{0}\" is using sqlops module which has been replaced by azdata module, the sqlops module will be removed in a future release.", extension.identifier.value));
|
||||||
// namespace: connection
|
// namespace: connection
|
||||||
const connection: typeof sqlops.connection = {
|
const connection: typeof sqlops.connection = {
|
||||||
getActiveConnections(): Thenable<sqlops.connection.Connection[]> {
|
getActiveConnections(): Thenable<sqlops.connection.Connection[]> {
|
||||||
|
|||||||
@@ -47,3 +47,16 @@ Registry.as<IConfigurationRegistry>(ConfigExtensions.Configuration).registerConf
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
Registry.as<IConfigurationRegistry>(ConfigExtensions.Configuration).registerConfiguration({
|
||||||
|
'id': 'enableObsoleteApiUsageNotification',
|
||||||
|
'title': nls.localize('enableObsoleteApiUsageNotificationTitle', "Obsolete API Notification"),
|
||||||
|
'type': 'object',
|
||||||
|
'properties': {
|
||||||
|
'workbench.enableObsoleteApiUsageNotification': {
|
||||||
|
'type': 'boolean',
|
||||||
|
'default': true,
|
||||||
|
'description': nls.localize('enableObsoleteApiUsageNotification', "Enable/disable obsolete API usage notification")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user