diff --git a/build/gulpfile.hygiene.js b/build/gulpfile.hygiene.js index 7842c1f58e..d2a0b0f59c 100644 --- a/build/gulpfile.hygiene.js +++ b/build/gulpfile.hygiene.js @@ -246,6 +246,7 @@ const tslintHygieneFilter = [ 'src/**/*.ts', 'test/**/*.ts', 'extensions/**/*.ts', + '!src/vs/workbench/contrib/extensions/browser/extensionTipsService.ts', // {{SQL CARBON EDIT}} known formatting issue do to commenting out code ...tslintBaseFilter ]; diff --git a/src/sql/base/test/browser/ui/table/gridFormatters.test.ts b/src/sql/base/test/browser/ui/table/gridFormatters.test.ts index 80f32dcfe5..fe460df88b 100644 --- a/src/sql/base/test/browser/ui/table/gridFormatters.test.ts +++ b/src/sql/base/test/browser/ui/table/gridFormatters.test.ts @@ -15,7 +15,6 @@ suite('Grid shared services tests', () => { cellValue.displayValue = testText; cellValue.isNull = false; let formattedHtml = SharedServices.textFormatter(undefined, undefined, cellValue, undefined, undefined); - let hyperlink = SharedServices.hyperLinkFormatter(undefined, undefined, cellValue, undefined, undefined); // Then the result is HTML for a span element containing the cell value's display value as plain text verifyFormattedHtml(formattedHtml, testText); diff --git a/src/sql/base/test/common/event.ts b/src/sql/base/test/common/event.ts index 29a5cd6dc1..5ab0a13c7c 100644 --- a/src/sql/base/test/common/event.ts +++ b/src/sql/base/test/common/event.ts @@ -4,7 +4,6 @@ *--------------------------------------------------------------------------------------------*/ import * as assert from 'assert'; -import { find } from 'vs/base/common/arrays'; export class EventVerifierSingle { private _eventArgument: T; diff --git a/src/sql/platform/accounts/test/common/accountActions.test.ts b/src/sql/platform/accounts/test/common/accountActions.test.ts deleted file mode 100644 index 39dcbd875a..0000000000 --- a/src/sql/platform/accounts/test/common/accountActions.test.ts +++ /dev/null @@ -1,190 +0,0 @@ -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the Source EULA. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - -import * as assert from 'assert'; -import * as azdata from 'azdata'; -import * as TypeMoq from 'typemoq'; -import { AddAccountAction, RemoveAccountAction } from 'sql/platform/accounts/common/accountActions'; -import { TestAccountManagementService } from 'sql/platform/accounts/test/common/testAccountManagementService'; -// import { MessageServiceStub } from 'sqltest/stubs/messageServiceStub'; -import { TestErrorMessageService } from 'sql/platform/errorMessage/test/common/testErrorMessageService'; - -let testAccount = { - key: { - providerId: 'azure', - accountId: 'testAccount' - }, - displayInfo: { - accountType: 'test', - displayName: 'Test Account', - contextualDisplayName: 'Azure Account' - }, - isStale: false -}; - -suite('Account Management Dialog Actions Tests', () => { - test('AddAccount - Success', (done) => { - done(); - // // Setup: Create an AddAccountAction object - // let param = 'azure'; - // let mocks = createAddAccountAction(true, true, param); - - // // If: I run the action when it will resolve - // mocks.action.run() - // .then(result => { - // // Then: - // // ... I should have gotten true back - // assert.ok(result); - - // // ... The account management service should have gotten a add account request - // mocks.accountMock.verify(x => x.addAccount(param), TypeMoq.Times.once()); - // }) - // .then( - // () => done(), - // err => done(err) - // ); - }); - - // test('AddAccount - Failure', (done) => { - // // // Setup: Create an AddAccountAction object - // // let param = 'azure'; - // // let mocks = createAddAccountAction(false, true, param); - - // // // If: I run the action when it will reject - // // mocks.action.run().then(result => { - // // // Then: - // // // ... The result should be false since the operation failed - // // assert.ok(!result); - // // // ... The account management service should have gotten a add account request - // // mocks.accountMock.verify(x => x.addAccount(param), TypeMoq.Times.once()); - // // done(); - // // }, error => { - // // // Should fail as rejected actions cause the debugger to crash - // // done(error); - // // }); - // }); - - // test('RemoveAccount - Confirm Success', (done) => { - // // // Setup: Create an AddAccountAction object - // // let ams = getMockAccountManagementService(true); - // // let ms = getMockMessageService(true); - // // let es = getMockErrorMessageService(); - // // let action = new RemoveAccountAction(testAccount, ms.object, es.object, ams.object); - - // // // If: I run the action when it will resolve - // // action.run() - // // .then(result => { - // // // Then: - // // // ... I should have gotten true back - // // assert.ok(result); - - // // // ... A confirmation dialog should have opened - // // ms.verify(x => x.confirm(TypeMoq.It.isAny()), TypeMoq.Times.once()); - - // // // ... The account management service should have gotten a remove account request - // // ams.verify(x => x.removeAccount(TypeMoq.It.isValue(testAccount.key)), TypeMoq.Times.once()); - // // }) - // // .then( - // // () => done(), - // // err => done(err) - // // ); - // }); - - // test('RemoveAccount - Declined Success', (done) => { - // // // Setup: Create an AddAccountAction object - // // let ams = getMockAccountManagementService(true); - // // let ms = getMockMessageService(false); - // // let es = getMockErrorMessageService(); - // // let action = new RemoveAccountAction(testAccount, ms.object, es.object, ams.object); - - // // // If: I run the action when it will resolve - // // action.run() - // // .then(result => { - // // try { - // // // Then: - // // // ... I should have gotten false back - // // assert.ok(!result); - - // // // ... A confirmation dialog should have opened - // // ms.verify(x => x.confirm(TypeMoq.It.isAny()), TypeMoq.Times.once()); - - // // // ... The account management service should not have gotten a remove account request - // // ams.verify(x => x.removeAccount(TypeMoq.It.isAny()), TypeMoq.Times.never()); - - // // done(); - // // } catch (e) { - // // done(e); - // // } - // // }); - // }); - - // test('RemoveAccount - Failure', (done) => { - // // // Setup: Create an AddAccountAction object - // // let ams = getMockAccountManagementService(false); - // // let ms = getMockMessageService(true); - // // let es = getMockErrorMessageService(); - // // let action = new RemoveAccountAction(testAccount, ms.object, es.object, ams.object); - - // // // If: I run the action when it will reject - // // action.run().then(result => { - // // // Then: - // // // ... The result should be false since the operation failed - // // assert.ok(!result); - // // // ... The account management service should have gotten a remove account request - // // ams.verify(x => x.removeAccount(TypeMoq.It.isValue(testAccount.key)), TypeMoq.Times.once()); - // // done(); - // // }, error => { - // // // Should fail as rejected actions cause the debugger to crash - // // done(error); - // // }); - // }); -}); - -// function createAddAccountAction(resolve: boolean, confirm: boolean, param: string): IAddActionMocks { -// let ams = getMockAccountManagementService(resolve); -// let mockMessageService = getMockMessageService(confirm); -// let mockErrorMessageService = getMockErrorMessageService(); -// return { -// accountMock: ams, -// messageMock: mockMessageService, -// errorMessageMock: mockErrorMessageService, -// action: new AddAccountAction(param, mockMessageService.object, -// mockErrorMessageService.object, ams.object) -// }; -// } - -// function getMockAccountManagementService(resolve: boolean): TypeMoq.Mock { -// let mockAccountManagementService = TypeMoq.Mock.ofType(AccountManagementTestService); - -// mockAccountManagementService.setup(x => x.addAccount(TypeMoq.It.isAnyString())) -// .returns(resolve ? () => Promise.resolve(null) : () => Promise.reject(null)); -// mockAccountManagementService.setup(x => x.removeAccount(TypeMoq.It.isAny())) -// .returns(resolve ? () => Promise.resolve(true) : () => Promise.reject(null).then()); - -// return mockAccountManagementService; -// } - -// function getMockMessageService(confirm: boolean): TypeMoq.Mock { -// let mockMessageService = TypeMoq.Mock.ofType(MessageServiceStub); - -// mockMessageService.setup(x => x.confirm(TypeMoq.It.isAny())) -// .returns(() => undefined); - -// return mockMessageService; -// } - -// function getMockErrorMessageService(): TypeMoq.Mock { -// let mockMessageService = TypeMoq.Mock.ofType(ErrorMessageServiceStub); -// mockMessageService.setup(x => x.showDialog(TypeMoq.It.isAny(), TypeMoq.It.isAny(), TypeMoq.It.isAny())); -// return mockMessageService; -// } - -// interface IAddActionMocks -// { -// accountMock: TypeMoq.Mock; -// messageMock: TypeMoq.Mock; -// errorMessageMock: TypeMoq.Mock; -// action: AddAccountAction; -// } diff --git a/src/sql/platform/connection/common/constants.ts b/src/sql/platform/connection/common/constants.ts index 8dbc54e502..a101ce272d 100644 --- a/src/sql/platform/connection/common/constants.ts +++ b/src/sql/platform/connection/common/constants.ts @@ -3,8 +3,6 @@ * Licensed under the Source EULA. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { localize } from 'vs/nls'; - // constants export const sqlConfigSectionName = 'sql'; export const outputChannelName = 'MSSQL'; diff --git a/src/sql/platform/connection/test/common/testConfigurationService.ts b/src/sql/platform/connection/test/common/testConfigurationService.ts index 9dbe8b7960..a37a2f3d10 100644 --- a/src/sql/platform/connection/test/common/testConfigurationService.ts +++ b/src/sql/platform/connection/test/common/testConfigurationService.ts @@ -3,7 +3,7 @@ * Licensed under the Source EULA. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { getConfigurationKeys, IConfigurationOverrides, IConfigurationService, getConfigurationValue, isConfigurationOverrides, ConfigurationTarget } from 'vs/platform/configuration/common/configuration'; +import { getConfigurationKeys, IConfigurationOverrides, IConfigurationService, getConfigurationValue, ConfigurationTarget } from 'vs/platform/configuration/common/configuration'; export class TestConfigurationService implements IConfigurationService { public _serviceBrand: undefined; diff --git a/src/sql/platform/connection/test/node/connectionStatusManager.test.ts b/src/sql/platform/connection/test/node/connectionStatusManager.test.ts index 9ad006b877..1a43501ed5 100644 --- a/src/sql/platform/connection/test/node/connectionStatusManager.test.ts +++ b/src/sql/platform/connection/test/node/connectionStatusManager.test.ts @@ -100,7 +100,6 @@ suite('SQL ConnectionStatusManager tests', () => { test('findConnection should return connection given valid id', () => { let id: string = connection1Id; - let expected = connectionProfileObject; let actual = connections.findConnection(id); assert.equal(connectionProfileObject.matches(actual.connectionProfile), true); }); @@ -114,7 +113,6 @@ suite('SQL ConnectionStatusManager tests', () => { test('getConnectionProfile should return connection given valid id', () => { let id: string = connection1Id; - let expected = connectionProfileObject; let actual = connections.getConnectionProfile(id); assert.equal(connectionProfileObject.matches(actual), true); }); diff --git a/src/sql/platform/credentials/common/credentialsService.ts b/src/sql/platform/credentials/common/credentialsService.ts index 3a7ff1d76e..f9b93e0c3d 100644 --- a/src/sql/platform/credentials/common/credentialsService.ts +++ b/src/sql/platform/credentials/common/credentialsService.ts @@ -4,7 +4,7 @@ *--------------------------------------------------------------------------------------------*/ import { IDisposable } from 'vs/base/common/lifecycle'; -import { createDecorator, ServiceIdentifier } from 'vs/platform/instantiation/common/instantiation'; +import { createDecorator } from 'vs/platform/instantiation/common/instantiation'; import * as azdata from 'azdata'; import { Deferred } from 'sql/base/common/promise'; diff --git a/src/sql/platform/jobManagement/browser/jobActions.ts b/src/sql/platform/jobManagement/browser/jobActions.ts index 47274e1203..174d37d318 100644 --- a/src/sql/platform/jobManagement/browser/jobActions.ts +++ b/src/sql/platform/jobManagement/browser/jobActions.ts @@ -21,7 +21,6 @@ import * as TelemetryKeys from 'sql/platform/telemetry/common/telemetryKeys'; import { IErrorMessageService } from 'sql/platform/errorMessage/common/errorMessageService'; import { JobManagementView } from 'sql/workbench/parts/jobManagement/browser/jobManagementView'; import { NotebooksViewComponent } from 'sql/workbench/parts/jobManagement/browser/notebooksView.component'; -import { NotebookHistoryComponent } from 'sql/workbench/parts/jobManagement/browser/notebookHistory.component'; export const successLabel: string = nls.localize('jobaction.successLabel', "Success"); export const errorLabel: string = nls.localize('jobaction.faillabel', "Error"); @@ -177,9 +176,7 @@ export class OpenMaterializedNotebookAction extends Action { public static ID = 'notebookAction.openNotebook'; public static LABEL = nls.localize('notebookAction.openNotebook', "Open"); - constructor( - @ICommandService private _commandService: ICommandService - ) { + constructor() { super(OpenMaterializedNotebookAction.ID, OpenMaterializedNotebookAction.LABEL, 'openNotebook'); } @@ -610,9 +607,7 @@ export class OpenTemplateNotebookAction extends Action { public static ID = 'notebookaction.openTemplate'; public static LABEL = nls.localize('notebookaction.openNotebook', "Open Template Notebook"); - constructor( - @ICommandService private _commandService: ICommandService - ) { + constructor() { super(OpenTemplateNotebookAction.ID, OpenTemplateNotebookAction.LABEL, 'opennotebook'); } @@ -673,9 +668,7 @@ export class PinNotebookMaterializedAction extends Action { public static ID = 'notebookaction.openTemplate'; public static LABEL = nls.localize('notebookaction.pinNotebook', "Pin"); - constructor( - @ICommandService private _commandService: ICommandService - ) { + constructor() { super(PinNotebookMaterializedAction.ID, PinNotebookMaterializedAction.LABEL); } @@ -689,9 +682,7 @@ export class DeleteMaterializedNotebookAction extends Action { public static ID = 'notebookaction.deleteMaterializedNotebook'; public static LABEL = nls.localize('notebookaction.deleteMaterializedNotebook', "Delete"); - constructor( - @ICommandService private _commandService: ICommandService - ) { + constructor() { super(DeleteMaterializedNotebookAction.ID, DeleteMaterializedNotebookAction.LABEL); } @@ -705,9 +696,7 @@ export class UnpinNotebookMaterializedAction extends Action { public static ID = 'notebookaction.unpinNotebook'; public static LABEL = nls.localize('notebookaction.unpinNotebook', "Unpin"); - constructor( - @ICommandService private _commandService: ICommandService - ) { + constructor() { super(UnpinNotebookMaterializedAction.ID, UnpinNotebookMaterializedAction.LABEL); } @@ -721,9 +710,7 @@ export class RenameNotebookMaterializedAction extends Action { public static ID = 'notebookaction.openTemplate'; public static LABEL = nls.localize('notebookaction.renameNotebook', "Rename"); - constructor( - @ICommandService private _commandService: ICommandService, - ) { + constructor() { super(RenameNotebookMaterializedAction.ID, RenameNotebookMaterializedAction.LABEL); } @@ -737,9 +724,7 @@ export class OpenLatestRunMaterializedNotebook extends Action { public static ID = 'notebookaction.openLatestRun'; public static LABEL = nls.localize('notebookaction.openLatestRun', "Open Latest Run"); - constructor( - @ICommandService private _commandService: ICommandService, - ) { + constructor() { super(OpenLatestRunMaterializedNotebook.ID, OpenLatestRunMaterializedNotebook.LABEL); } diff --git a/src/sql/platform/jobManagement/test/common/jobManagementService.test.ts b/src/sql/platform/jobManagement/test/common/jobManagementService.test.ts index 38b3883158..08de3f1eb0 100644 --- a/src/sql/platform/jobManagement/test/common/jobManagementService.test.ts +++ b/src/sql/platform/jobManagement/test/common/jobManagementService.test.ts @@ -4,6 +4,7 @@ *--------------------------------------------------------------------------------------------*/ import { JobManagementService } from 'sql/platform/jobManagement/common/jobManagementService'; +import * as assert from 'assert'; // TESTS /////////////////////////////////////////////////////////////////// suite('Job Management service tests', () => { @@ -13,5 +14,6 @@ suite('Job Management service tests', () => { test('Construction - Job Service Initialization', () => { // ... Create instance of the service and reder account picker let service = new JobManagementService(undefined); + assert(service); }); }); diff --git a/src/sql/platform/metadata/common/metadataService.ts b/src/sql/platform/metadata/common/metadataService.ts index c8610cc42e..697f0e055c 100644 --- a/src/sql/platform/metadata/common/metadataService.ts +++ b/src/sql/platform/metadata/common/metadataService.ts @@ -3,7 +3,7 @@ * Licensed under the Source EULA. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { createDecorator, ServiceIdentifier } from 'vs/platform/instantiation/common/instantiation'; +import { createDecorator } from 'vs/platform/instantiation/common/instantiation'; import { IConnectionManagementService } from 'sql/platform/connection/common/connectionManagement'; import * as azdata from 'azdata'; diff --git a/src/sql/platform/scripting/common/scriptingService.ts b/src/sql/platform/scripting/common/scriptingService.ts index 3374eae64d..6c1dcee979 100644 --- a/src/sql/platform/scripting/common/scriptingService.ts +++ b/src/sql/platform/scripting/common/scriptingService.ts @@ -3,7 +3,7 @@ * Licensed under the Source EULA. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { createDecorator, ServiceIdentifier } from 'vs/platform/instantiation/common/instantiation'; +import { createDecorator } from 'vs/platform/instantiation/common/instantiation'; import { IConnectionManagementService } from 'sql/platform/connection/common/connectionManagement'; import * as azdata from 'azdata'; import { ILogService } from 'vs/platform/log/common/log'; diff --git a/src/sql/platform/tasks/browser/tasksRegistry.ts b/src/sql/platform/tasks/browser/tasksRegistry.ts index c4bad62bbb..92aed2d119 100644 --- a/src/sql/platform/tasks/browser/tasksRegistry.ts +++ b/src/sql/platform/tasks/browser/tasksRegistry.ts @@ -78,7 +78,7 @@ export abstract class Task { private readonly _iconClass?: string; private readonly _description?: ITaskHandlerDescription; - constructor(private opts: ITaskOptions) { + constructor(opts: ITaskOptions) { this.id = opts.id; this.title = opts.title; if (opts.iconPath) { diff --git a/src/sql/platform/tasks/common/tasks.ts b/src/sql/platform/tasks/common/tasks.ts index 9795d733ca..0995061c5e 100644 --- a/src/sql/platform/tasks/common/tasks.ts +++ b/src/sql/platform/tasks/common/tasks.ts @@ -10,7 +10,6 @@ import { ILocalizedString, ICommandAction } from 'vs/platform/actions/common/act import { Event } from 'vs/base/common/event'; import { IDisposable } from 'vs/base/common/lifecycle'; import { ContextKeyExpr } from 'vs/platform/contextkey/common/contextkey'; -import { IdGenerator } from 'vs/base/common/idGenerator'; import { ServicesAccessor } from 'vs/platform/instantiation/common/instantiation'; export interface ITaskOptions { diff --git a/src/sql/workbench/api/browser/mainThreadModelView.ts b/src/sql/workbench/api/browser/mainThreadModelView.ts index 084b7c5daf..d3247532c8 100644 --- a/src/sql/workbench/api/browser/mainThreadModelView.ts +++ b/src/sql/workbench/api/browser/mainThreadModelView.ts @@ -72,7 +72,6 @@ export class MainThreadModelView extends Disposable implements MainThreadModelVi } $registerEvent(handle: number, componentId: string): Thenable { - let properties: { [key: string]: any; } = { eventName: this.onEvent }; return this.execModelViewAction(handle, (modelView) => { this._register(modelView.onEvent(e => { if (e.componentId && e.componentId === componentId) { diff --git a/src/sql/workbench/api/browser/mainThreadModelViewDialog.ts b/src/sql/workbench/api/browser/mainThreadModelViewDialog.ts index e414362ab8..0caae074f9 100644 --- a/src/sql/workbench/api/browser/mainThreadModelViewDialog.ts +++ b/src/sql/workbench/api/browser/mainThreadModelViewDialog.ts @@ -16,7 +16,6 @@ import { ModelViewInput, ModelViewInputModel, ModeViewSaveHandler } from 'sql/wo import * as vscode from 'vscode'; import * as azdata from 'azdata'; -import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry'; @extHostNamedCustomer(SqlMainContext.MainThreadModelViewDialog) export class MainThreadModelViewDialog implements MainThreadModelViewDialogShape { @@ -33,8 +32,7 @@ export class MainThreadModelViewDialog implements MainThreadModelViewDialogShape constructor( context: IExtHostContext, @IInstantiationService private _instatiationService: IInstantiationService, - @IEditorService private _editorService: IEditorService, - @ITelemetryService private _telemetryService: ITelemetryService + @IEditorService private _editorService: IEditorService ) { this._proxy = context.getProxy(SqlExtHostContext.ExtHostModelViewDialog); this._dialogService = new CustomDialogService(_instatiationService); diff --git a/src/sql/workbench/api/common/extHostDashboard.ts b/src/sql/workbench/api/common/extHostDashboard.ts index 7971215341..ace31cf533 100644 --- a/src/sql/workbench/api/common/extHostDashboard.ts +++ b/src/sql/workbench/api/common/extHostDashboard.ts @@ -8,7 +8,7 @@ import { Event, Emitter } from 'vs/base/common/event'; import * as azdata from 'azdata'; -import { ExtHostDashboardShape, MainThreadDashboardShape, SqlMainContext } from './sqlExtHost.protocol'; +import { ExtHostDashboardShape } from './sqlExtHost.protocol'; export class ExtHostDashboard implements ExtHostDashboardShape { private _onDidOpenDashboard = new Emitter(); @@ -17,10 +17,7 @@ export class ExtHostDashboard implements ExtHostDashboardShape { private _onDidChangeToDashboard = new Emitter(); public readonly onDidChangeToDashboard: Event = this._onDidChangeToDashboard.event; - private _proxy: MainThreadDashboardShape; - constructor(mainContext: IMainContext) { - this._proxy = mainContext.getProxy(SqlMainContext.MainThreadDashboard); } $onDidOpenDashboard(dashboard: azdata.DashboardDocument) { diff --git a/src/sql/workbench/api/common/extHostModelView.ts b/src/sql/workbench/api/common/extHostModelView.ts index 955767137b..5b283e9d6f 100644 --- a/src/sql/workbench/api/common/extHostModelView.ts +++ b/src/sql/workbench/api/common/extHostModelView.ts @@ -24,7 +24,6 @@ class ModelBuilderImpl implements azdata.ModelBuilder { constructor( private readonly _proxy: MainThreadModelViewShape, private readonly _handle: number, - private readonly _mainContext: IMainContext, private readonly _extHostModelViewTree: ExtHostModelViewTreeViewsShape, private readonly _extension: IExtensionDescription ) { @@ -742,14 +741,6 @@ class ComponentWithIconWrapper extends ComponentWrapper { } } -class ContainerWrapper extends ComponentWrapper implements azdata.Container { - - constructor(proxy: MainThreadModelViewShape, handle: number, type: ModelComponentTypes, id: string) { - super(proxy, handle, type, id); - } - -} - class CardWrapper extends ComponentWrapper implements azdata.CardComponent { constructor(proxy: MainThreadModelViewShape, handle: number, id: string) { @@ -1580,11 +1571,10 @@ class ModelViewImpl implements azdata.ModelView { private readonly _handle: number, private readonly _connection: azdata.connection.Connection, private readonly _serverInfo: azdata.ServerInfo, - private readonly mainContext: IMainContext, private readonly _extHostModelViewTree: ExtHostModelViewTreeViewsShape, _extension: IExtensionDescription ) { - this._modelBuilder = new ModelBuilderImpl(this._proxy, this._handle, this.mainContext, this._extHostModelViewTree, _extension); + this._modelBuilder = new ModelBuilderImpl(this._proxy, this._handle, this._extHostModelViewTree, _extension); } public get onClosed(): vscode.Event { @@ -1637,7 +1627,7 @@ export class ExtHostModelView implements ExtHostModelViewShape { private readonly _handlers = new Map void>(); private readonly _handlerToExtension = new Map(); constructor( - private _mainContext: IMainContext, + _mainContext: IMainContext, private _extHostModelViewTree: ExtHostModelViewTreeViewsShape ) { this._proxy = _mainContext.getProxy(SqlMainContext.MainThreadModelView); @@ -1657,7 +1647,7 @@ export class ExtHostModelView implements ExtHostModelViewShape { $registerWidget(handle: number, id: string, connection: azdata.connection.Connection, serverInfo: azdata.ServerInfo): void { let extension = this._handlerToExtension.get(id); - let view = new ModelViewImpl(this._proxy, handle, connection, serverInfo, this._mainContext, this._extHostModelViewTree, extension); + let view = new ModelViewImpl(this._proxy, handle, connection, serverInfo, this._extHostModelViewTree, extension); this._modelViews.set(handle, view); this._handlers.get(id)(view); } diff --git a/src/sql/workbench/browser/modelComponents/button.component.ts b/src/sql/workbench/browser/modelComponents/button.component.ts index c2511fe9ee..a8465bc7fd 100644 --- a/src/sql/workbench/browser/modelComponents/button.component.ts +++ b/src/sql/workbench/browser/modelComponents/button.component.ts @@ -36,7 +36,7 @@ export default class ButtonComponent extends ComponentWithIconBase implements IC @Input() descriptor: IComponentDescriptor; @Input() modelStore: IModelStore; private _button: Button; - private fileType: string = '.sql'; + public fileType: string = '.sql'; @ViewChild('input', { read: ElementRef }) private _inputContainer: ElementRef; @ViewChild('fileInput', { read: ElementRef }) private _fileInputContainer: ElementRef; @@ -153,11 +153,11 @@ export default class ButtonComponent extends ComponentWithIconBase implements IC this.setPropertyFromUI(this.setValueProperties, newValue); } - private get isFile(): boolean { + public get isFile(): boolean { return this.getPropertyOrDefault((props) => props.isFile, false); } - private set isFile(newValue: boolean) { + public set isFile(newValue: boolean) { this.setPropertyFromUI(this.setFileProperties, newValue); } @@ -188,8 +188,4 @@ export default class ButtonComponent extends ComponentWithIconBase implements IC private set title(newValue: string) { this.setPropertyFromUI((properties, title) => { properties.title = title; }, newValue); } - - private setFileType(value: string) { - this.properties.fileType = value; - } } diff --git a/src/sql/workbench/browser/modelComponents/card.component.ts b/src/sql/workbench/browser/modelComponents/card.component.ts index 1bc6c24859..eb674fd9b1 100644 --- a/src/sql/workbench/browser/modelComponents/card.component.ts +++ b/src/sql/workbench/browser/modelComponents/card.component.ts @@ -186,7 +186,7 @@ export default class CardComponent extends ComponentWithIconBase implements ICom this._changeRef.detectChanges(); } - private onDidActionClick(action: ActionDescriptor): void { + public onDidActionClick(action: ActionDescriptor): void { this.fireEvent({ eventType: ComponentEventType.onDidClick, args: action diff --git a/src/sql/workbench/browser/modelComponents/checkbox.component.ts b/src/sql/workbench/browser/modelComponents/checkbox.component.ts index 62fc5b9958..a0ad9d53c4 100644 --- a/src/sql/workbench/browser/modelComponents/checkbox.component.ts +++ b/src/sql/workbench/browser/modelComponents/checkbox.component.ts @@ -13,7 +13,6 @@ import * as azdata from 'azdata'; import { ComponentBase } from 'sql/workbench/browser/modelComponents/componentBase'; import { IComponent, IComponentDescriptor, IModelStore, ComponentEventType } from 'sql/workbench/browser/modelComponents/interfaces'; import { Checkbox, ICheckboxOptions } from 'sql/base/browser/ui/checkbox/checkbox'; -import { CommonServiceInterface } from 'sql/workbench/services/bootstrap/browser/commonServiceInterface.service'; import { attachCheckboxStyler } from 'sql/platform/theme/common/styler'; import { IWorkbenchThemeService } from 'vs/workbench/services/themes/common/workbenchThemeService'; @@ -30,7 +29,6 @@ export default class CheckBoxComponent extends ComponentBase implements ICompone @ViewChild('input', { read: ElementRef }) private _inputContainer: ElementRef; constructor( - @Inject(forwardRef(() => CommonServiceInterface)) private _commonService: CommonServiceInterface, @Inject(forwardRef(() => ChangeDetectorRef)) changeRef: ChangeDetectorRef, @Inject(IWorkbenchThemeService) private themeService: IWorkbenchThemeService, @Inject(forwardRef(() => ElementRef)) el: ElementRef, ) { diff --git a/src/sql/workbench/browser/modelComponents/declarativeTable.component.ts b/src/sql/workbench/browser/modelComponents/declarativeTable.component.ts index 976eb4aff0..5bdf33e4c3 100644 --- a/src/sql/workbench/browser/modelComponents/declarativeTable.component.ts +++ b/src/sql/workbench/browser/modelComponents/declarativeTable.component.ts @@ -6,7 +6,7 @@ import 'vs/css!./media/declarativeTable'; import { - Component, Input, Inject, ChangeDetectorRef, forwardRef, ViewChild, ElementRef, OnDestroy, AfterViewInit + Component, Input, Inject, ChangeDetectorRef, forwardRef, ElementRef, OnDestroy, AfterViewInit } from '@angular/core'; import * as azdata from 'azdata'; @@ -39,8 +39,8 @@ export enum DeclarativeDataType { - - + + {{cellData}} @@ -55,7 +55,6 @@ export default class DeclarativeTableComponent extends ComponentBase implements @Input() descriptor: IComponentDescriptor; @Input() modelStore: IModelStore; - @ViewChild('container', { read: ElementRef }) private _tableContainer: ElementRef; constructor( @Inject(forwardRef(() => ChangeDetectorRef)) changeRef: ChangeDetectorRef, @Inject(forwardRef(() => ElementRef)) el: ElementRef @@ -80,12 +79,12 @@ export default class DeclarativeTableComponent extends ComponentBase implements this.baseDestroy(); } - private isCheckBox(cell: number): boolean { + public isCheckBox(cell: number): boolean { let column: azdata.DeclarativeTableColumn = this.columns[cell]; return column.valueType === DeclarativeDataType.boolean; } - private isControlEnabled(cell: number): boolean { + public isControlEnabled(cell: number): boolean { let column: azdata.DeclarativeTableColumn = this.columns[cell]; return !column.isReadOnly; } @@ -95,20 +94,20 @@ export default class DeclarativeTableComponent extends ComponentBase implements return column.isReadOnly && column.valueType === DeclarativeDataType.string; } - private isChecked(row: number, cell: number): boolean { + public isChecked(row: number, cell: number): boolean { let cellData = this.data[row][cell]; return cellData; } - private onInputBoxChanged(e: string, row: number, cell: number): void { + public onInputBoxChanged(e: string, row: number, cell: number): void { this.onCellDataChanged(e, row, cell); } - private onCheckBoxChanged(e: boolean, row: number, cell: number): void { + public onCheckBoxChanged(e: boolean, row: number, cell: number): void { this.onCellDataChanged(e, row, cell); } - private onSelectBoxChanged(e: ISelectData | string, row: number, cell: number): void { + public onSelectBoxChanged(e: ISelectData | string, row: number, cell: number): void { let column: azdata.DeclarativeTableColumn = this.columns[cell]; if (column.categoryValues) { @@ -139,7 +138,7 @@ export default class DeclarativeTableComponent extends ComponentBase implements }); } - private isSelectBox(cell: number): boolean { + public isSelectBox(cell: number): boolean { let column: azdata.DeclarativeTableColumn = this.columns[cell]; return column.valueType === DeclarativeDataType.category; } @@ -149,22 +148,22 @@ export default class DeclarativeTableComponent extends ComponentBase implements return column.valueType === DeclarativeDataType.editableCategory; } - private isInputBox(cell: number): boolean { + public isInputBox(cell: number): boolean { let column: azdata.DeclarativeTableColumn = this.columns[cell]; return column.valueType === DeclarativeDataType.string && !column.isReadOnly; } - private getColumnWidth(cell: number): string { + public getColumnWidth(cell: number): string { let column: azdata.DeclarativeTableColumn = this.columns[cell]; return this.convertSize(column.width, '30px'); } - private GetOptions(cell: number): string[] { + public getOptions(cell: number): string[] { let column: azdata.DeclarativeTableColumn = this.columns[cell]; return column.categoryValues ? column.categoryValues.map(x => x.displayName) : []; } - private GetSelectedOptionDisplayName(row: number, cell: number): string { + public getSelectedOptionDisplayName(row: number, cell: number): string { let column: azdata.DeclarativeTableColumn = this.columns[cell]; let cellData = this.data[row][cell]; if (cellData && column.categoryValues) { @@ -181,7 +180,7 @@ export default class DeclarativeTableComponent extends ComponentBase implements } } - private getAriaLabel(row: number, column: number): string { + public getAriaLabel(row: number, column: number): string { const cellData = this.data[row][column]; return this.isLabel(column) ? (cellData && cellData !== '' ? cellData : localize('blankValue', "blank")) : ''; } diff --git a/src/sql/workbench/browser/modelComponents/diffeditor.component.ts b/src/sql/workbench/browser/modelComponents/diffeditor.component.ts index d718b2a7cb..3f52af539a 100644 --- a/src/sql/workbench/browser/modelComponents/diffeditor.component.ts +++ b/src/sql/workbench/browser/modelComponents/diffeditor.component.ts @@ -47,7 +47,6 @@ export default class DiffEditorComponent extends ComponentBase implements ICompo private _languageMode: string; private _isAutoResizable: boolean; private _minimumHeight: number; - private _instancetiationService: IInstantiationService; protected _title: string; constructor( diff --git a/src/sql/workbench/browser/modelComponents/divContainer.component.ts b/src/sql/workbench/browser/modelComponents/divContainer.component.ts index a542d7867b..7ac08cd57c 100644 --- a/src/sql/workbench/browser/modelComponents/divContainer.component.ts +++ b/src/sql/workbench/browser/modelComponents/divContainer.component.ts @@ -133,7 +133,7 @@ export default class DivContainer extends ContainerBase im return this.getPropertyOrDefault((props) => props.clickable, false); } - private onKey(e: KeyboardEvent) { + public onKey(e: KeyboardEvent) { let event = new StandardKeyboardEvent(e); if (event.equals(KeyCode.Enter) || event.equals(KeyCode.Space)) { this.onClick(); @@ -141,10 +141,10 @@ export default class DivContainer extends ContainerBase im } } - private getItemOrder(item: DivItem): number { + public getItemOrder(item: DivItem): number { return item.config ? item.config.order : 0; } - private getItemStyles(item: DivItem): { [key: string]: string } { + public getItemStyles(item: DivItem): { [key: string]: string } { return item.config && item.config.CSSStyles ? item.config.CSSStyles : {}; } } diff --git a/src/sql/workbench/browser/modelComponents/flexContainer.component.ts b/src/sql/workbench/browser/modelComponents/flexContainer.component.ts index 973179a142..aa08fb8ce5 100644 --- a/src/sql/workbench/browser/modelComponents/flexContainer.component.ts +++ b/src/sql/workbench/browser/modelComponents/flexContainer.component.ts @@ -113,13 +113,13 @@ export default class FlexContainer extends ContainerBase impleme return this._flexWrap; } - private getItemFlex(item: FlexItem): string { + public getItemFlex(item: FlexItem): string { return item.config ? item.config.flex : '1 1 auto'; } - private getItemOrder(item: FlexItem): number { + public getItemOrder(item: FlexItem): number { return item.config ? item.config.order : 0; } - private getItemStyles(item: FlexItem): { [key: string]: string } { + public getItemStyles(item: FlexItem): { [key: string]: string } { return item.config && item.config.CSSStyles ? item.config.CSSStyles : {}; } } diff --git a/src/sql/workbench/browser/modelComponents/formContainer.component.ts b/src/sql/workbench/browser/modelComponents/formContainer.component.ts index 5041462743..7b3b4cb47b 100644 --- a/src/sql/workbench/browser/modelComponents/formContainer.component.ts +++ b/src/sql/workbench/browser/modelComponents/formContainer.component.ts @@ -6,14 +6,13 @@ import 'vs/css!./media/formLayout'; import { Component, Input, Inject, ChangeDetectorRef, forwardRef, - ViewChild, ElementRef, OnDestroy, AfterViewInit + ElementRef, OnDestroy, AfterViewInit } from '@angular/core'; import { IComponent, IComponentDescriptor, IModelStore } from 'sql/workbench/browser/modelComponents/interfaces'; import { FormLayout, FormItemLayout } from 'azdata'; import { ContainerBase } from 'sql/workbench/browser/modelComponents/componentBase'; -import { CommonServiceInterface } from 'sql/workbench/services/bootstrap/browser/commonServiceInterface.service'; import { find } from 'vs/base/common/arrays'; export interface TitledFormItemLayout { @@ -95,10 +94,7 @@ export default class FormContainer extends ContainerBase impleme private _alignContent: string; private _formLayout: FormLayout; - @ViewChild('container', { read: ElementRef }) private _container: ElementRef; - constructor( - @Inject(forwardRef(() => CommonServiceInterface)) private _commonService: CommonServiceInterface, @Inject(forwardRef(() => ChangeDetectorRef)) changeRef: ChangeDetectorRef, @Inject(forwardRef(() => ElementRef)) el: ElementRef) { super(changeRef, el); @@ -129,39 +125,39 @@ export default class FormContainer extends ContainerBase impleme return this._alignContent; } - private getFormWidth(): string { + public getFormWidth(): string { return this.convertSize(this._formLayout && this._formLayout.width, ''); } - private getFormPadding(): string { + public getFormPadding(): string { return this._formLayout && this._formLayout.padding ? this._formLayout.padding : '10px 30px 0px 30px'; } - private getFormHeight(): string { + public getFormHeight(): string { return this.convertSize(this._formLayout && this._formLayout.height, ''); } - private getComponentWidth(item: FormItem): string { + public getComponentWidth(item: FormItem): string { let itemConfig = item.config; return (itemConfig && itemConfig.componentWidth) ? this.convertSize(itemConfig.componentWidth, '') : ''; } - private getRowHeight(item: FormItem): string { + public getRowHeight(item: FormItem): string { let itemConfig = item.config; return (itemConfig && itemConfig.componentHeight) ? this.convertSize(itemConfig.componentHeight, '') : ''; } - private isItemRequired(item: FormItem): boolean { + public isItemRequired(item: FormItem): boolean { let itemConfig = item.config; return itemConfig && itemConfig.required; } - private getItemInfo(item: FormItem): string { + public getItemInfo(item: FormItem): string { let itemConfig = item.config; return itemConfig && itemConfig.info; } - private itemHasInfo(item: FormItem): boolean { + public itemHasInfo(item: FormItem): boolean { let itemConfig = item.config; return itemConfig && itemConfig.info !== undefined; } @@ -172,11 +168,11 @@ export default class FormContainer extends ContainerBase impleme return itemConfig ? itemConfig.title : ''; } - private hasItemTitle(item: FormItem): boolean { + public hasItemTitle(item: FormItem): boolean { return this.getItemTitle(item) !== ''; } - private getItemTitleFontSize(item: FormItem): string { + public getItemTitleFontSize(item: FormItem): string { let defaultFontSize = '14px'; if (this.isInGroup(item)) { defaultFontSize = '12px'; @@ -185,7 +181,7 @@ export default class FormContainer extends ContainerBase impleme return itemConfig && itemConfig.titleFontSize ? this.convertSize(itemConfig.titleFontSize, defaultFontSize) : defaultFontSize; } - private getActionComponents(item: FormItem): FormItem[] { + public getActionComponents(item: FormItem): FormItem[] { let items = this.items; let itemConfig = item.config; if (itemConfig && itemConfig.actions) { @@ -200,7 +196,7 @@ export default class FormContainer extends ContainerBase impleme return []; } - private isGroupLabel(item: FormItem): boolean { + public isGroupLabel(item: FormItem): boolean { return item && item.config && item.config.isGroupLabel; } @@ -208,11 +204,11 @@ export default class FormContainer extends ContainerBase impleme return item && item.config && item.config.isInGroup; } - private isFormComponent(item: FormItem): boolean { + public isFormComponent(item: FormItem): boolean { return item && item.config && item.config.isFormComponent; } - private itemHasActions(item: FormItem): boolean { + public itemHasActions(item: FormItem): boolean { let itemConfig = item.config; return itemConfig && itemConfig.actions !== undefined && itemConfig.actions.length > 0; } @@ -222,11 +218,11 @@ export default class FormContainer extends ContainerBase impleme this.layout(); } - private isHorizontal(item: FormItem): boolean { + public isHorizontal(item: FormItem): boolean { return item && item.config && item.config.horizontal; } - private isVertical(item: FormItem): boolean { + public isVertical(item: FormItem): boolean { return item && item.config && !item.config.horizontal; } } diff --git a/src/sql/workbench/browser/modelComponents/groupContainer.component.ts b/src/sql/workbench/browser/modelComponents/groupContainer.component.ts index ce05627228..45063e5aec 100644 --- a/src/sql/workbench/browser/modelComponents/groupContainer.component.ts +++ b/src/sql/workbench/browser/modelComponents/groupContainer.component.ts @@ -6,7 +6,7 @@ import 'vs/css!./media/groupLayout'; import { Component, Input, Inject, ChangeDetectorRef, forwardRef, - ViewChild, ElementRef, OnDestroy, AfterViewInit + ElementRef, OnDestroy, AfterViewInit } from '@angular/core'; import { IComponent, IComponentDescriptor, IModelStore } from 'sql/workbench/browser/modelComponents/interfaces'; @@ -39,8 +39,6 @@ export default class GroupContainer extends ContainerBase implement private _containerLayout: GroupLayout; - @ViewChild('container', { read: ElementRef }) private _container: ElementRef; - constructor( @Inject(forwardRef(() => ChangeDetectorRef)) changeRef: ChangeDetectorRef, @Inject(forwardRef(() => ElementRef)) el: ElementRef) { @@ -83,7 +81,7 @@ export default class GroupContainer extends ContainerBase implement return this.hasHeader() && this._containerLayout.collapsible === true; } - private getContainerWidth(): string { + public getContainerWidth(): string { if (this._containerLayout && this._containerLayout.width) { let width: string = this._containerLayout.width.toString(); if (!endsWith(width, '%') && !endsWith(width.toLowerCase(), 'px')) { @@ -95,11 +93,11 @@ export default class GroupContainer extends ContainerBase implement } } - private getContainerDisplayStyle(): string { + public getContainerDisplayStyle(): string { return !this.isCollapsible() || !this.collapsed ? 'block' : 'none'; } - private getHeaderClass(): string { + public getHeaderClass(): string { if (this.isCollapsible()) { let modifier = this.collapsed ? 'collapsed' : 'expanded'; return `modelview-group-header-collapsible ${modifier}`; @@ -108,7 +106,7 @@ export default class GroupContainer extends ContainerBase implement } } - private changeState(): void { + public changeState(): void { if (this.isCollapsible()) { this.collapsed = !this.collapsed; this._changeRef.detectChanges(); diff --git a/src/sql/workbench/browser/modelComponents/image.component.ts b/src/sql/workbench/browser/modelComponents/image.component.ts index faf4b35d00..1790c14e32 100644 --- a/src/sql/workbench/browser/modelComponents/image.component.ts +++ b/src/sql/workbench/browser/modelComponents/image.component.ts @@ -65,7 +65,7 @@ export default class ImageComponent extends ComponentWithIconBase implements ICo /** * Helper to get the size string for the background-size CSS property */ - private getImageSize(): string { + public getImageSize(): string { return `${this.getIconWidth()} ${this.getIconHeight()}`; } } diff --git a/src/sql/workbench/browser/modelComponents/loadingComponent.component.ts b/src/sql/workbench/browser/modelComponents/loadingComponent.component.ts index 55c45a6667..7c2d280d27 100644 --- a/src/sql/workbench/browser/modelComponents/loadingComponent.component.ts +++ b/src/sql/workbench/browser/modelComponents/loadingComponent.component.ts @@ -25,7 +25,7 @@ import * as nls from 'vs/nls'; ` }) export default class LoadingComponent extends ComponentBase implements IComponent, OnDestroy, AfterViewInit { - private readonly _loadingTitle = nls.localize('loadingMessage', "Loading"); + public readonly _loadingTitle = nls.localize('loadingMessage', "Loading"); private _component: IComponentDescriptor; @Input() descriptor: IComponentDescriptor; diff --git a/src/sql/workbench/browser/modelComponents/loadingSpinner.component.ts b/src/sql/workbench/browser/modelComponents/loadingSpinner.component.ts index c532b9188a..172438d5e3 100644 --- a/src/sql/workbench/browser/modelComponents/loadingSpinner.component.ts +++ b/src/sql/workbench/browser/modelComponents/loadingSpinner.component.ts @@ -17,7 +17,7 @@ import * as nls from 'vs/nls'; ` }) export default class LoadingSpinner { - private readonly _loadingTitle = nls.localize('loadingMessage', "Loading"); + public readonly _loadingTitle = nls.localize('loadingMessage', "Loading"); @Input() loading: boolean; } diff --git a/src/sql/workbench/browser/modelComponents/modelStore.ts b/src/sql/workbench/browser/modelComponents/modelStore.ts index 693369b5ee..c6d31ef256 100644 --- a/src/sql/workbench/browser/modelComponents/modelStore.ts +++ b/src/sql/workbench/browser/modelComponents/modelStore.ts @@ -15,7 +15,6 @@ class ComponentDescriptor implements IComponentDescriptor { } export class ModelStore implements IModelStore { - private static baseId = 0; private _descriptorMappings: { [x: string]: IComponentDescriptor } = {}; private _componentMappings: { [x: string]: IComponent } = {}; diff --git a/src/sql/workbench/browser/modelComponents/modelViewContent.component.ts b/src/sql/workbench/browser/modelComponents/modelViewContent.component.ts index 7cb79465f9..0823833e6e 100644 --- a/src/sql/workbench/browser/modelComponents/modelViewContent.component.ts +++ b/src/sql/workbench/browser/modelComponents/modelViewContent.component.ts @@ -6,7 +6,6 @@ import { Component, forwardRef, Input, OnInit, Inject, ChangeDetectorRef } from '@angular/core'; import { Event, Emitter } from 'vs/base/common/event'; -import { IDisposable } from 'vs/base/common/lifecycle'; import { addDisposableListener, EventType } from 'vs/base/browser/dom'; import { memoize } from 'vs/base/common/decorators'; @@ -34,8 +33,6 @@ export class ModelViewContent extends ViewBase implements OnInit, IModelView { private _onMessage = new Emitter(); public readonly onMessage: Event = this._onMessage.event; - private _onMessageDisposable: IDisposable; - constructor( @Inject(forwardRef(() => CommonServiceInterface)) private _commonService: CommonServiceInterface, @Inject(forwardRef(() => ChangeDetectorRef)) changeRef: ChangeDetectorRef, diff --git a/src/sql/workbench/browser/modelComponents/splitviewContainer.component.ts b/src/sql/workbench/browser/modelComponents/splitviewContainer.component.ts index 167917dbff..0f39698f9b 100644 --- a/src/sql/workbench/browser/modelComponents/splitviewContainer.component.ts +++ b/src/sql/workbench/browser/modelComponents/splitviewContainer.component.ts @@ -162,13 +162,13 @@ export default class SplitViewContainer extends ContainerBase im return this._orientation.toString(); } - private getItemFlex(item: FlexItem): string { + public getItemFlex(item: FlexItem): string { return item.config ? item.config.flex : '1 1 auto'; } - private getItemOrder(item: FlexItem): number { + public getItemOrder(item: FlexItem): number { return item.config ? item.config.order : 0; } - private getItemStyles(item: FlexItem): { [key: string]: string } { + public getItemStyles(item: FlexItem): { [key: string]: string } { return item.config && item.config.CSSStyles ? item.config.CSSStyles : {}; } } diff --git a/src/sql/workbench/browser/modelComponents/text.component.ts b/src/sql/workbench/browser/modelComponents/text.component.ts index 8f96ba467c..7e0ec10492 100644 --- a/src/sql/workbench/browser/modelComponents/text.component.ts +++ b/src/sql/workbench/browser/modelComponents/text.component.ts @@ -99,7 +99,7 @@ export default class TextComponent extends TitledComponent implements IComponent return this.requiredIndicator || !!this.description; } - private onClick() { + public onClick() { this.fireEvent({ eventType: ComponentEventType.onDidClick, args: undefined diff --git a/src/sql/workbench/browser/modelComponents/toolbarContainer.component.ts b/src/sql/workbench/browser/modelComponents/toolbarContainer.component.ts index 91965a15b3..4dddd4287d 100644 --- a/src/sql/workbench/browser/modelComponents/toolbarContainer.component.ts +++ b/src/sql/workbench/browser/modelComponents/toolbarContainer.component.ts @@ -6,7 +6,7 @@ import 'vs/css!./media/toolbarLayout'; import { Component, Input, Inject, ChangeDetectorRef, forwardRef, - ViewChild, ElementRef, OnDestroy, AfterViewInit + ElementRef, OnDestroy, AfterViewInit } from '@angular/core'; import { Orientation, ToolbarLayout } from 'sql/workbench/api/common/sqlExtHostTypes'; @@ -14,7 +14,6 @@ import { Orientation, ToolbarLayout } from 'sql/workbench/api/common/sqlExtHostT import { IComponent, IComponentDescriptor, IModelStore } from 'sql/workbench/browser/modelComponents/interfaces'; import { ContainerBase } from 'sql/workbench/browser/modelComponents/componentBase'; -import { CommonServiceInterface } from 'sql/workbench/services/bootstrap/browser/commonServiceInterface.service'; export interface ToolbarItemConfig { title?: string; @@ -49,12 +48,9 @@ export default class ToolbarContainer extends ContainerBase i @Input() descriptor: IComponentDescriptor; @Input() modelStore: IModelStore; - @ViewChild('container', { read: ElementRef }) private _container: ElementRef; - private _orientation: Orientation; constructor( - @Inject(forwardRef(() => CommonServiceInterface)) private _commonService: CommonServiceInterface, @Inject(forwardRef(() => ChangeDetectorRef)) changeRef: ChangeDetectorRef, @Inject(forwardRef(() => ElementRef)) el: ElementRef) { super(changeRef, el); diff --git a/src/sql/workbench/browser/modelComponents/tree.component.ts b/src/sql/workbench/browser/modelComponents/tree.component.ts index 1a76c8e51b..305cc5613e 100644 --- a/src/sql/workbench/browser/modelComponents/tree.component.ts +++ b/src/sql/workbench/browser/modelComponents/tree.component.ts @@ -14,11 +14,9 @@ import * as azdata from 'azdata'; import { ComponentBase } from 'sql/workbench/browser/modelComponents/componentBase'; import { IComponent, IComponentDescriptor, IModelStore } from 'sql/workbench/browser/modelComponents/interfaces'; import { Tree } from 'vs/base/parts/tree/browser/treeImpl'; -import { CommonServiceInterface } from 'sql/workbench/services/bootstrap/browser/commonServiceInterface.service'; import { TreeComponentRenderer } from 'sql/workbench/browser/modelComponents/treeComponentRenderer'; import { TreeComponentDataSource } from 'sql/workbench/browser/modelComponents/treeDataSource'; import { IWorkbenchThemeService } from 'vs/workbench/services/themes/common/workbenchThemeService'; -import { IContextViewService } from 'vs/platform/contextview/browser/contextView'; import { attachListStyler } from 'vs/platform/theme/common/styler'; import { DefaultFilter, DefaultAccessibilityProvider, DefaultController } from 'vs/base/parts/tree/browser/treeDefaults'; import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation'; @@ -55,10 +53,8 @@ export default class TreeComponent extends ComponentBase implements IComponent, @ViewChild('input', { read: ElementRef }) private _inputContainer: ElementRef; constructor( - @Inject(forwardRef(() => CommonServiceInterface)) private _commonService: CommonServiceInterface, @Inject(forwardRef(() => ChangeDetectorRef)) changeRef: ChangeDetectorRef, @Inject(IWorkbenchThemeService) private themeService: IWorkbenchThemeService, - @Inject(IContextViewService) private contextViewService: IContextViewService, @Inject(IInstantiationService) private _instantiationService: IInstantiationService, @Inject(forwardRef(() => ElementRef)) el: ElementRef ) { diff --git a/src/sql/workbench/contrib/extensions/browser/extensionsActions.ts b/src/sql/workbench/contrib/extensions/browser/extensionsActions.ts index 77b9690c75..e5c4136eaa 100644 --- a/src/sql/workbench/contrib/extensions/browser/extensionsActions.ts +++ b/src/sql/workbench/contrib/extensions/browser/extensionsActions.ts @@ -7,13 +7,9 @@ import { localize } from 'vs/nls'; import { Action } from 'vs/base/common/actions'; import { IViewletService } from 'vs/workbench/services/viewlet/browser/viewlet'; import { IExtensionsWorkbenchService, VIEWLET_ID, IExtensionsViewlet } from 'vs/workbench/contrib/extensions/common/extensions'; -import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation'; -import { IExtensionRecommendation, IExtensionManagementServerService } from 'vs/workbench/services/extensionManagement/common/extensionManagement'; -import { INotificationService } from 'vs/platform/notification/common/notification'; -import { IOpenerService } from 'vs/platform/opener/common/opener'; +import { IExtensionRecommendation } from 'vs/workbench/services/extensionManagement/common/extensionManagement'; import { CancellationToken } from 'vs/base/common/cancellation'; import { PagedModel } from 'vs/base/common/paging'; -import { IConfigurationService } from 'vs/platform/configuration/common/configuration'; function getScenarioID(scenarioType: string) { return 'workbench.extensions.action.show' + scenarioType; @@ -46,12 +42,7 @@ export class InstallRecommendedExtensionsByScenarioAction extends Action { private readonly scenarioType: string, recommendations: IExtensionRecommendation[], @IViewletService private readonly viewletService: IViewletService, - @INotificationService private readonly notificationService: INotificationService, - @IInstantiationService private readonly instantiationService: IInstantiationService, - @IOpenerService private readonly openerService: IOpenerService, - @IExtensionsWorkbenchService private readonly extensionWorkbenchService: IExtensionsWorkbenchService, - @IConfigurationService private readonly configurationService: IConfigurationService, - @IExtensionManagementServerService private readonly extensionManagementServerService: IExtensionManagementServerService + @IExtensionsWorkbenchService private readonly extensionWorkbenchService: IExtensionsWorkbenchService ) { super(getScenarioID(scenarioType), localize('Install Extensions', "Install Extensions"), 'extension-action'); this.recommendations = recommendations; diff --git a/src/sql/workbench/parts/accounts/test/browser/firewallRuleDialogController.test.ts b/src/sql/workbench/parts/accounts/test/browser/firewallRuleDialogController.test.ts index 712a4ae617..2288dbb456 100644 --- a/src/sql/workbench/parts/accounts/test/browser/firewallRuleDialogController.test.ts +++ b/src/sql/workbench/parts/accounts/test/browser/firewallRuleDialogController.test.ts @@ -5,7 +5,7 @@ import * as azdata from 'azdata'; import * as TypeMoq from 'typemoq'; -import { Emitter, Event } from 'vs/base/common/event'; +import { Emitter } from 'vs/base/common/event'; import { IConnectionProfile } from 'sql/platform/connection/common/interfaces'; import { FirewallRuleDialog } from 'sql/workbench/parts/accounts/browser/firewallRuleDialog'; import { FirewallRuleViewModel } from 'sql/platform/accounts/common/firewallRuleViewModel'; diff --git a/src/sql/workbench/parts/backup/browser/backup.component.ts b/src/sql/workbench/parts/backup/browser/backup.component.ts index 2d769a0a86..91b89e57b0 100644 --- a/src/sql/workbench/parts/backup/browser/backup.component.ts +++ b/src/sql/workbench/parts/backup/browser/backup.component.ts @@ -28,7 +28,6 @@ import * as strings from 'vs/base/common/strings'; import { IWorkbenchThemeService } from 'vs/workbench/services/themes/common/workbenchThemeService'; import { IContextViewService } from 'vs/platform/contextview/browser/contextView'; import { IClipboardService } from 'vs/platform/clipboard/common/clipboardService'; -import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation'; import { ISelectOptionItem } from 'vs/base/browser/ui/selectBox/selectBox'; import { KeyCode } from 'vs/base/common/keyCodes'; import { ITheme } from 'vs/platform/theme/common/themeService'; @@ -148,7 +147,6 @@ export class BackupComponent extends AngularDisposable { private localizedStrings = LocalizedStrings; private _uri: string; - private _advancedHeaderSize = 32; private connection: IConnectionProfile; private databaseName: string; @@ -158,16 +156,15 @@ export class BackupComponent extends AngularDisposable { private containsBackupToUrl: boolean; // UI element disable flag - private disableFileComponent: boolean; - private disableTlog: boolean; + public disableTlog: boolean; - private selectedBackupComponent: string; + public selectedBackupComponent: string; private selectedFilesText: string; private selectedInitOption: string; private isTruncateChecked: boolean; private isTaillogChecked: boolean; private isFormatChecked: boolean; - private isEncryptChecked: boolean; + public isEncryptChecked: boolean; // Key: backup path, Value: device type private backupPathTypePairs: { [path: string]: number }; @@ -198,7 +195,6 @@ export class BackupComponent extends AngularDisposable { private continueOnErrorCheckBox: Checkbox; constructor( - @Inject(forwardRef(() => ElementRef)) private _el: ElementRef, @Inject(forwardRef(() => ChangeDetectorRef)) private _changeDetectorRef: ChangeDetectorRef, @Inject(IWorkbenchThemeService) private themeService: IWorkbenchThemeService, @Inject(IContextViewService) private contextViewService: IContextViewService, @@ -207,7 +203,6 @@ export class BackupComponent extends AngularDisposable { @Inject(IBackupService) private _backupService: IBackupService, @Inject(IClipboardService) private clipboardService: IClipboardService, @Inject(IConnectionManagementService) private connectionManagementService: IConnectionManagementService, - @Inject(IInstantiationService) private instantiationService: IInstantiationService ) { super(); this._backupUiService.onShowBackupEvent((param) => this.onGetBackupConfigInfo(param)); @@ -602,7 +597,7 @@ export class BackupComponent extends AngularDisposable { this.resetDialog(); } - private onChangeTlog(): void { + public onChangeTlog(): void { this.isTruncateChecked = !this.isTruncateChecked; this.isTaillogChecked = !this.isTaillogChecked; this.detectChange(); @@ -727,9 +722,6 @@ export class BackupComponent extends AngularDisposable { private setControlsForRecoveryModel(): void { if (this.recoveryModel === BackupConstants.recoveryModelSimple) { this.selectedBackupComponent = BackupConstants.labelDatabase; - this.disableFileComponent = true; - } else { - this.disableFileComponent = false; } this.populateBackupTypes(); @@ -778,20 +770,6 @@ export class BackupComponent extends AngularDisposable { } } - private isBackupToFile(controllerType: number): boolean { - let isfile = false; - if (controllerType === 102) { - isfile = true; - } else if (controllerType === 105) { - isfile = false; - } else if (controllerType === BackupConstants.backupDeviceTypeDisk) { - isfile = true; - } else if (controllerType === BackupConstants.backupDeviceTypeTape || controllerType === BackupConstants.backupDeviceTypeURL) { - isfile = false; - } - return isfile; - } - private enableMediaInput(enable: boolean): void { if (enable) { this.mediaNameBox.enable(); diff --git a/src/sql/workbench/parts/backup/browser/backup.contribution.ts b/src/sql/workbench/parts/backup/browser/backup.contribution.ts index 490295d2d0..f21f4fcade 100644 --- a/src/sql/workbench/parts/backup/browser/backup.contribution.ts +++ b/src/sql/workbench/parts/backup/browser/backup.contribution.ts @@ -4,7 +4,6 @@ *--------------------------------------------------------------------------------------------*/ import { CommandsRegistry, ICommandService } from 'vs/platform/commands/common/commands'; -import { ConnectedContext } from 'azdata'; import { TreeViewItemHandleArg } from 'sql/workbench/common/views'; import { BackupAction } from 'sql/workbench/parts/backup/browser/backupActions'; import { MenuRegistry, MenuId } from 'vs/platform/actions/common/actions'; diff --git a/src/sql/workbench/parts/charts/browser/interfaces.ts b/src/sql/workbench/parts/charts/browser/interfaces.ts index c5647c7120..cd9f341d26 100644 --- a/src/sql/workbench/parts/charts/browser/interfaces.ts +++ b/src/sql/workbench/parts/charts/browser/interfaces.ts @@ -6,7 +6,6 @@ import { Dimension } from 'vs/base/browser/dom'; import { mixin } from 'sql/base/common/objects'; import * as types from 'vs/base/common/types'; -import { Color } from 'vs/base/common/color'; import { IInsightOptions, InsightType, ChartType } from 'sql/workbench/parts/charts/common/interfaces'; export interface IPointDataSet { diff --git a/src/sql/workbench/parts/commandLine/test/electron-browser/commandLine.test.ts b/src/sql/workbench/parts/commandLine/test/electron-browser/commandLine.test.ts index 82b4bd0329..94a6bb8f7a 100644 --- a/src/sql/workbench/parts/commandLine/test/electron-browser/commandLine.test.ts +++ b/src/sql/workbench/parts/commandLine/test/electron-browser/commandLine.test.ts @@ -526,10 +526,8 @@ suite('commandLineService tests', () => { connectionManagementService.setup((c) => c.showConnectionDialog()).verifiable(TypeMoq.Times.never()); connectionManagementService.setup(c => c.hasRegisteredServers()).returns(() => true).verifiable(TypeMoq.Times.atMostOnce()); connectionManagementService.setup(c => c.getConnectionGroups(TypeMoq.It.isAny())).returns(() => []); - let originalProfile: IConnectionProfile = undefined; connectionManagementService.setup(c => c.connectIfNotConnected(TypeMoq.It.is(p => p.serverName === 'myserver' && p.authenticationType === Constants.sqlLogin), 'connection', true)) .returns((conn) => { - originalProfile = conn; return Promise.resolve('unused'); }) .verifiable(TypeMoq.Times.once()); diff --git a/src/sql/workbench/parts/connection/browser/connectionActions.ts b/src/sql/workbench/parts/connection/browser/connectionActions.ts index 32104ef627..3eaa4181be 100644 --- a/src/sql/workbench/parts/connection/browser/connectionActions.ts +++ b/src/sql/workbench/parts/connection/browser/connectionActions.ts @@ -17,7 +17,6 @@ import { EditDataInput } from 'sql/workbench/parts/editData/browser/editDataInpu import { DashboardInput } from 'sql/workbench/parts/dashboard/browser/dashboardInput'; import { IClipboardService } from 'vs/platform/clipboard/common/clipboardService'; import { IQuickInputService } from 'vs/platform/quickinput/common/quickInput'; -import { IObjectExplorerService } from 'sql/workbench/services/objectExplorer/browser/objectExplorerService'; import { find } from 'vs/base/common/arrays'; /** @@ -147,7 +146,6 @@ export class GetCurrentConnectionStringAction extends Action { label: string, @IConnectionManagementService private _connectionManagementService: IConnectionManagementService, @IEditorService private _editorService: IEditorService, - @IObjectExplorerService private _objectExplorerService: IObjectExplorerService, @INotificationService private readonly _notificationService: INotificationService, @IClipboardService private _clipboardService: IClipboardService, ) { diff --git a/src/sql/workbench/parts/dashboard/browser/containers/dashboardControlHostContainer.component.ts b/src/sql/workbench/parts/dashboard/browser/containers/dashboardControlHostContainer.component.ts index b884b06c86..fa20e1c76e 100644 --- a/src/sql/workbench/parts/dashboard/browser/containers/dashboardControlHostContainer.component.ts +++ b/src/sql/workbench/parts/dashboard/browser/containers/dashboardControlHostContainer.component.ts @@ -5,7 +5,7 @@ import 'vs/css!./dashboardControlHostContainer'; -import { Component, forwardRef, Input, AfterContentInit, ViewChild, OnChanges } from '@angular/core'; +import { Component, forwardRef, Input, AfterContentInit, ViewChild } from '@angular/core'; import { Event, Emitter } from 'vs/base/common/event'; diff --git a/src/sql/workbench/parts/dashboard/browser/containers/dashboardGridContainer.component.ts b/src/sql/workbench/parts/dashboard/browser/containers/dashboardGridContainer.component.ts index 08b095ade9..cc86d45c3b 100644 --- a/src/sql/workbench/parts/dashboard/browser/containers/dashboardGridContainer.component.ts +++ b/src/sql/workbench/parts/dashboard/browser/containers/dashboardGridContainer.component.ts @@ -56,7 +56,7 @@ export class DashboardGridContainer extends DashboardTab implements OnDestroy { public readonly onResize: Event = this._onResize.event; private cellWidth: number = 270; private cellHeight: number = 270; - private ScrollbarVisibility = ScrollbarVisibility; + public ScrollbarVisibility = ScrollbarVisibility; protected SKELETON_WIDTH = 5; diff --git a/src/sql/workbench/parts/dashboard/browser/containers/dashboardHomeContainer.component.ts b/src/sql/workbench/parts/dashboard/browser/containers/dashboardHomeContainer.component.ts index 94ec9397db..8c05062a63 100644 --- a/src/sql/workbench/parts/dashboard/browser/containers/dashboardHomeContainer.component.ts +++ b/src/sql/workbench/parts/dashboard/browser/containers/dashboardHomeContainer.component.ts @@ -39,7 +39,7 @@ export class DashboardHomeContainer extends DashboardWidgetContainer { @ViewChild('propertiesClass') private _propertiesClass: DashboardWidgetWrapper; @ContentChild(ScrollableDirective) private _scrollable: ScrollableDirective; - private ScrollbarVisibility = ScrollbarVisibility; + public ScrollbarVisibility = ScrollbarVisibility; constructor( @Inject(forwardRef(() => ChangeDetectorRef)) _cd: ChangeDetectorRef, diff --git a/src/sql/workbench/parts/dashboard/browser/containers/dashboardNavSection.component.ts b/src/sql/workbench/parts/dashboard/browser/containers/dashboardNavSection.component.ts index b562c28101..08bd2f199a 100644 --- a/src/sql/workbench/parts/dashboard/browser/containers/dashboardNavSection.component.ts +++ b/src/sql/workbench/parts/dashboard/browser/containers/dashboardNavSection.component.ts @@ -5,7 +5,7 @@ import 'vs/css!./dashboardNavSection'; -import { Component, Inject, Input, forwardRef, ViewChild, ElementRef, ViewChildren, QueryList, OnDestroy, ChangeDetectorRef, OnChanges, AfterContentInit } from '@angular/core'; +import { Component, Inject, Input, forwardRef, ViewChild, ViewChildren, QueryList, OnDestroy, ChangeDetectorRef, OnChanges, AfterContentInit } from '@angular/core'; import { CommonServiceInterface, SingleConnectionManagementService } from 'sql/workbench/services/bootstrap/browser/commonServiceInterface.service'; import { WidgetConfig, TabConfig, NavSectionConfig } from 'sql/workbench/parts/dashboard/browser/core/dashboardWidget'; diff --git a/src/sql/workbench/parts/dashboard/browser/containers/dashboardNavSection.contribution.ts b/src/sql/workbench/parts/dashboard/browser/containers/dashboardNavSection.contribution.ts index 4ee56c2cc2..957cdc452c 100644 --- a/src/sql/workbench/parts/dashboard/browser/containers/dashboardNavSection.contribution.ts +++ b/src/sql/workbench/parts/dashboard/browser/containers/dashboardNavSection.contribution.ts @@ -6,9 +6,7 @@ import { IExtensionPointUser } from 'vs/workbench/services/extensions/common/extensionsRegistry'; import { IJSONSchema } from 'vs/base/common/jsonSchema'; import * as nls from 'vs/nls'; -import { join } from 'vs/base/common/path'; import { createCSSRule, asCSSUrl } from 'vs/base/browser/dom'; -import { URI } from 'vs/base/common/uri'; import { IdGenerator } from 'vs/base/common/idGenerator'; import * as resources from 'vs/base/common/resources'; diff --git a/src/sql/workbench/parts/dashboard/browser/contents/controlHostContent.component.ts b/src/sql/workbench/parts/dashboard/browser/contents/controlHostContent.component.ts index 081e0e3162..29bca731b5 100644 --- a/src/sql/workbench/parts/dashboard/browser/contents/controlHostContent.component.ts +++ b/src/sql/workbench/parts/dashboard/browser/contents/controlHostContent.component.ts @@ -5,10 +5,9 @@ import 'vs/css!./controlHostContent'; -import { Component, forwardRef, Input, OnInit, Inject, ChangeDetectorRef, ElementRef, ViewChild } from '@angular/core'; +import { Component, forwardRef, Input, Inject, ChangeDetectorRef, ViewChild } from '@angular/core'; import { Event, Emitter } from 'vs/base/common/event'; -import { IDisposable } from 'vs/base/common/lifecycle'; import { CommonServiceInterface } from 'sql/workbench/services/bootstrap/browser/commonServiceInterface.service'; import * as azdata from 'azdata'; @@ -27,7 +26,6 @@ export class ControlHostContent { private _onMessage = new Emitter(); public readonly onMessage: Event = this._onMessage.event; - private _onMessageDisposable: IDisposable; private _type: string; /* Children components */ @@ -35,8 +33,7 @@ export class ControlHostContent { constructor( @Inject(forwardRef(() => CommonServiceInterface)) private _dashboardService: CommonServiceInterface, - @Inject(forwardRef(() => ChangeDetectorRef)) private _changeRef: ChangeDetectorRef, - @Inject(forwardRef(() => ElementRef)) private _el: ElementRef + @Inject(forwardRef(() => ChangeDetectorRef)) private _changeRef: ChangeDetectorRef ) { } diff --git a/src/sql/workbench/parts/dashboard/browser/core/dashboardPage.component.ts b/src/sql/workbench/parts/dashboard/browser/core/dashboardPage.component.ts index 3944f41cb7..8bcaa00d98 100644 --- a/src/sql/workbench/parts/dashboard/browser/core/dashboardPage.component.ts +++ b/src/sql/workbench/parts/dashboard/browser/core/dashboardPage.component.ts @@ -52,9 +52,6 @@ export abstract class DashboardPage extends AngularDisposable implements IConfig private _originalConfig: WidgetConfig[]; - private _widgetConfigLocation: string; - private _propertiesConfigLocation: string; - protected panelActions: Action[]; private _tabsDispose: Array = []; private _tabSettingConfigs: Array = []; @@ -115,7 +112,6 @@ export abstract class DashboardPage extends AngularDisposable implements IConfig }); } else { let tempWidgets = this.dashboardService.getSettings>([this.context, 'widgets'].join('.')); - this._widgetConfigLocation = 'default'; this._originalConfig = objects.deepClone(tempWidgets); let properties = this.getProperties(); this._configModifiers.forEach((cb) => { @@ -302,7 +298,6 @@ export abstract class DashboardPage extends AngularDisposable implements IConfig private getProperties(): Array { const properties = this.dashboardService.getSettings([this.context, 'properties'].join('.')); - this._propertiesConfigLocation = 'default'; if (types.isUndefinedOrNull(properties)) { return [this.propertiesWidget]; } else if (types.isBoolean(properties)) { diff --git a/src/sql/workbench/parts/dashboard/browser/dashboard.component.ts b/src/sql/workbench/parts/dashboard/browser/dashboard.component.ts index 7aaab9d091..ef546b6ef8 100644 --- a/src/sql/workbench/parts/dashboard/browser/dashboard.component.ts +++ b/src/sql/workbench/parts/dashboard/browser/dashboard.component.ts @@ -5,7 +5,7 @@ import 'vs/css!./dashboard'; -import { OnInit, Component, Inject, forwardRef, ElementRef, ChangeDetectorRef, ViewChild } from '@angular/core'; +import { OnInit, Component, Inject, forwardRef, ElementRef, ViewChild } from '@angular/core'; import { Router } from '@angular/router'; import { CommonServiceInterface } from 'sql/workbench/services/bootstrap/browser/commonServiceInterface.service'; @@ -38,7 +38,6 @@ export class DashboardComponent extends AngularDisposable implements OnInit { constructor( @Inject(forwardRef(() => CommonServiceInterface)) private _bootstrapService: CommonServiceInterface, @Inject(forwardRef(() => Router)) private _router: Router, - @Inject(forwardRef(() => ChangeDetectorRef)) private _changeRef: ChangeDetectorRef, @Inject(IWorkbenchThemeService) private themeService: IWorkbenchThemeService ) { super(); diff --git a/src/sql/workbench/parts/dashboard/browser/dashboardRegistry.ts b/src/sql/workbench/parts/dashboard/browser/dashboardRegistry.ts index 39b0e01eba..46e5a724ad 100644 --- a/src/sql/workbench/parts/dashboard/browser/dashboardRegistry.ts +++ b/src/sql/workbench/parts/dashboard/browser/dashboardRegistry.ts @@ -5,7 +5,7 @@ import { Registry } from 'vs/platform/registry/common/platform'; import { IConfigurationRegistry, Extensions as ConfigurationExtension } from 'vs/platform/configuration/common/configurationRegistry'; -import { IJSONSchema, IJSONSchemaMap } from 'vs/base/common/jsonSchema'; +import { IJSONSchema } from 'vs/base/common/jsonSchema'; import * as nls from 'vs/nls'; import { IExtensionPointUser, ExtensionsRegistry } from 'vs/workbench/services/extensions/common/extensionsRegistry'; @@ -42,7 +42,6 @@ class DashboardRegistry implements IDashboardRegistry { private _properties = new Map(); private _tabs = new Array(); private _configurationRegistry = Registry.as(ConfigurationExtension.Configuration); - private _dashboardTabContentSchemaProperties: IJSONSchemaMap = {}; /** * Register a dashboard widget diff --git a/src/sql/workbench/parts/dashboard/browser/widgets/insights/insightsWidget.component.ts b/src/sql/workbench/parts/dashboard/browser/widgets/insights/insightsWidget.component.ts index 266d8484e4..656afcf3fa 100644 --- a/src/sql/workbench/parts/dashboard/browser/widgets/insights/insightsWidget.component.ts +++ b/src/sql/workbench/parts/dashboard/browser/widgets/insights/insightsWidget.component.ts @@ -60,7 +60,7 @@ export class InsightsWidget extends DashboardWidget implements IDashboardWidget, private _typeKey: string; private _init: boolean = false; - private _loading: boolean = true; + public _loading: boolean = true; private _intervalTimer: IntervalTimer; public error: string; diff --git a/src/sql/workbench/parts/dashboard/browser/widgets/insights/views/charts/chartInsight.component.ts b/src/sql/workbench/parts/dashboard/browser/widgets/insights/views/charts/chartInsight.component.ts index ee02f3d018..558df58557 100644 --- a/src/sql/workbench/parts/dashboard/browser/widgets/insights/views/charts/chartInsight.component.ts +++ b/src/sql/workbench/parts/dashboard/browser/widgets/insights/views/charts/chartInsight.component.ts @@ -247,7 +247,7 @@ export abstract class ChartInsight extends Disposable implements IInsightsView { @ChartInsight.MEMOIZER - private get colors(): { backgroundColor: string[] }[] { + public get colors(): { backgroundColor: string[] }[] { if (this._config && this._config.colorMap) { const backgroundColor = this.labels.map((item) => { return this._config.colorMap[item]; diff --git a/src/sql/workbench/parts/dashboard/browser/widgets/insights/views/tableInsight.component.ts b/src/sql/workbench/parts/dashboard/browser/widgets/insights/views/tableInsight.component.ts index a14e75a9b6..64a6751b51 100644 --- a/src/sql/workbench/parts/dashboard/browser/widgets/insights/views/tableInsight.component.ts +++ b/src/sql/workbench/parts/dashboard/browser/widgets/insights/views/tableInsight.component.ts @@ -3,7 +3,7 @@ * Licensed under the Source EULA. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { Component, Input, Inject, ChangeDetectorRef, forwardRef, ElementRef, OnInit } from '@angular/core'; +import { Component, Input, Inject, forwardRef, ElementRef, OnInit } from '@angular/core'; import { getContentHeight, getContentWidth, Dimension } from 'vs/base/browser/dom'; import { Disposable } from 'vs/base/common/lifecycle'; @@ -25,7 +25,6 @@ export default class TableInsight extends Disposable implements IInsightsView, O private columns: Slick.Column[]; constructor( - @Inject(forwardRef(() => ChangeDetectorRef)) private _changeRef: ChangeDetectorRef, @Inject(forwardRef(() => ElementRef)) private _elementRef: ElementRef, @Inject(IWorkbenchThemeService) private themeService: IWorkbenchThemeService ) { diff --git a/src/sql/workbench/parts/dashboard/browser/widgets/properties/propertiesWidget.component.ts b/src/sql/workbench/parts/dashboard/browser/widgets/properties/propertiesWidget.component.ts index d0b06d1bc1..4391040bd7 100644 --- a/src/sql/workbench/parts/dashboard/browser/widgets/properties/propertiesWidget.component.ts +++ b/src/sql/workbench/parts/dashboard/browser/widgets/properties/propertiesWidget.component.ts @@ -64,7 +64,7 @@ export interface DisplayProperty { export class PropertiesWidgetComponent extends DashboardWidget implements IDashboardWidget, OnInit { private _connection: ConnectionManagementInfo; private _databaseInfo: DatabaseInfo; - private _clipped: boolean; + public _clipped: boolean; private properties: Array; private _hasInit = false; diff --git a/src/sql/workbench/parts/dataExplorer/browser/connectionViewletPanel.ts b/src/sql/workbench/parts/dataExplorer/browser/connectionViewletPanel.ts index 0ce1ac3fbf..016956783f 100644 --- a/src/sql/workbench/parts/dataExplorer/browser/connectionViewletPanel.ts +++ b/src/sql/workbench/parts/dataExplorer/browser/connectionViewletPanel.ts @@ -5,7 +5,6 @@ import 'vs/css!./media/connectionViewletPanel'; import * as DOM from 'vs/base/browser/dom'; -import { IDisposable } from 'vs/base/common/lifecycle'; import { IKeybindingService } from 'vs/platform/keybinding/common/keybinding'; import { IContextMenuService } from 'vs/platform/contextview/browser/contextView'; import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation'; diff --git a/src/sql/workbench/parts/editData/browser/editData.component.ts b/src/sql/workbench/parts/editData/browser/editData.component.ts index 71012abc37..fe0087d643 100644 --- a/src/sql/workbench/parts/editData/browser/editData.component.ts +++ b/src/sql/workbench/parts/editData/browser/editData.component.ts @@ -55,8 +55,6 @@ export class EditDataComponent extends GridParentComponent implements OnInit, On // All datasets private dataSet: IGridDataSet; private firstRender = true; - private totalElapsedTimeSpan: number; - private complete = false; // Current selected cell state private currentCell: { row: number, column: number, isEditable: boolean, isDirty: boolean }; private currentEditCellValue: string; @@ -153,8 +151,6 @@ export class EditDataComponent extends GridParentComponent implements OnInit, On self.placeHolderDataSets = []; self.renderedDataSets = self.placeHolderDataSets; this._cd.detectChanges(); - self.totalElapsedTimeSpan = undefined; - self.complete = false; // Hooking up edit functions this.onIsCellEditValid = (row, column, value): boolean => { @@ -318,8 +314,6 @@ export class EditDataComponent extends GridParentComponent implements OnInit, On } handleComplete(self: EditDataComponent, event: any): void { - self.totalElapsedTimeSpan = event.data; - self.complete = true; } handleEditSessionReady(self, event): void { @@ -441,8 +435,6 @@ export class EditDataComponent extends GridParentComponent implements OnInit, On protected tryHandleKeyEvent(e: StandardKeyboardEvent): boolean { let handled: boolean = false; - // If the esc key was pressed while in a create session - let currentNewRowIndex = this.dataSet.totalRows - 2; if (e.keyCode === KeyCode.Escape) { this.revertCurrentRow(); diff --git a/src/sql/workbench/parts/editData/browser/editDataActions.ts b/src/sql/workbench/parts/editData/browser/editDataActions.ts index 3c8d534c58..c7ce93f2cf 100644 --- a/src/sql/workbench/parts/editData/browser/editDataActions.ts +++ b/src/sql/workbench/parts/editData/browser/editDataActions.ts @@ -4,7 +4,7 @@ *--------------------------------------------------------------------------------------------*/ import { Action, IActionViewItem, IActionRunner } from 'vs/base/common/actions'; -import { DisposableStore, Disposable } from 'vs/base/common/lifecycle'; +import { Disposable } from 'vs/base/common/lifecycle'; import { IQueryModelService } from 'sql/platform/query/common/queryModel'; import { SelectBox } from 'sql/base/browser/ui/selectBox/selectBox'; import { IConnectionManagementService } from 'sql/platform/connection/common/connectionManagement'; @@ -133,7 +133,6 @@ export class ChangeMaxRowsAction extends EditDataAction { public static ID = 'changeMaxRowsAction'; constructor(editor: EditDataEditor, - @IQueryModelService private _queryModelService: IQueryModelService, @IConnectionManagementService _connectionManagementService: IConnectionManagementService ) { super(editor, ChangeMaxRowsAction.ID, undefined, _connectionManagementService); @@ -158,7 +157,6 @@ export class ChangeMaxRowsActionItem extends Disposable implements IActionViewIt private container: HTMLElement; private start: HTMLElement; private selectBox: SelectBox; - private context: any; private _options: string[]; private _currentOptionsIndex: number; @@ -183,7 +181,6 @@ export class ChangeMaxRowsActionItem extends Disposable implements IActionViewIt } public setActionContext(context: any): void { - this.context = context; } public isEnabled(): boolean { @@ -235,7 +232,6 @@ export class ShowQueryPaneAction extends EditDataAction { private readonly closeSqlLabel = nls.localize('editData.closeSql', "Close SQL Pane"); constructor(editor: EditDataEditor, - @IQueryModelService private _queryModelService: IQueryModelService, @IConnectionManagementService _connectionManagementService: IConnectionManagementService ) { super(editor, ShowQueryPaneAction.ID, ShowQueryPaneAction.EnabledClass, _connectionManagementService); diff --git a/src/sql/workbench/parts/grid/common/dataService.ts b/src/sql/workbench/parts/grid/common/dataService.ts index 95863f611c..59d3eb0f58 100644 --- a/src/sql/workbench/parts/grid/common/dataService.ts +++ b/src/sql/workbench/parts/grid/common/dataService.ts @@ -3,9 +3,7 @@ * Licensed under the Source EULA. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { Observable } from 'rxjs/Observable'; import { Subject } from 'rxjs/Subject'; -import { Observer } from 'rxjs/Observer'; import { EditUpdateCellResult, EditSubsetResult, EditCreateRowResult } from 'azdata'; import { IQueryModelService } from 'sql/platform/query/common/queryModel'; diff --git a/src/sql/workbench/parts/jobManagement/browser/agentView.component.ts b/src/sql/workbench/parts/jobManagement/browser/agentView.component.ts index 393fbf887e..239c46f98a 100644 --- a/src/sql/workbench/parts/jobManagement/browser/agentView.component.ts +++ b/src/sql/workbench/parts/jobManagement/browser/agentView.component.ts @@ -10,7 +10,6 @@ import { Component, Inject, forwardRef, ChangeDetectorRef, ViewChild, Injectable import { AgentJobInfo, AgentNotebookInfo } from 'azdata'; import { PanelComponent, IPanelOptions, NavigationBarLayout } from 'sql/base/browser/ui/panel/panel.component'; import { IJobManagementService } from 'sql/platform/jobManagement/common/interfaces'; -import { IDashboardService } from 'sql/platform/dashboard/browser/dashboardService'; export const DASHBOARD_SELECTOR: string = 'agentview-component'; @@ -40,14 +39,13 @@ export class AgentViewComponent { public proxiesIconClass: string = 'proxiesview-icon'; public operatorsIconClass: string = 'operatorsview-icon'; - private readonly jobsComponentTitle: string = nls.localize('jobview.Jobs', "Jobs"); - private readonly notebooksComponentTitle: string = nls.localize('jobview.Notebooks', "Notebooks"); - private readonly alertsComponentTitle: string = nls.localize('jobview.Alerts', "Alerts"); - private readonly proxiesComponentTitle: string = nls.localize('jobview.Proxies', "Proxies"); - private readonly operatorsComponentTitle: string = nls.localize('jobview.Operators', "Operators"); + public readonly jobsComponentTitle: string = nls.localize('jobview.Jobs', "Jobs"); + public readonly notebooksComponentTitle: string = nls.localize('jobview.Notebooks', "Notebooks"); + public readonly alertsComponentTitle: string = nls.localize('jobview.Alerts', "Alerts"); + public readonly proxiesComponentTitle: string = nls.localize('jobview.Proxies', "Proxies"); + public readonly operatorsComponentTitle: string = nls.localize('jobview.Operators', "Operators"); - // tslint:disable-next-line:no-unused-variable - private readonly panelOpt: IPanelOptions = { + public readonly panelOpt: IPanelOptions = { showTabsWhenOne: true, layout: NavigationBarLayout.vertical, showIcon: true @@ -55,8 +53,7 @@ export class AgentViewComponent { constructor( @Inject(forwardRef(() => ChangeDetectorRef)) private _cd: ChangeDetectorRef, - @Inject(IJobManagementService) jobManagementService: IJobManagementService, - @Inject(IDashboardService) dashboardService: IDashboardService, ) { + @Inject(IJobManagementService) jobManagementService: IJobManagementService) { this._expanded = new Map(); let self = this; diff --git a/src/sql/workbench/parts/jobManagement/browser/alertsView.component.ts b/src/sql/workbench/parts/jobManagement/browser/alertsView.component.ts index 09512882d3..bcc3df365a 100644 --- a/src/sql/workbench/parts/jobManagement/browser/alertsView.component.ts +++ b/src/sql/workbench/parts/jobManagement/browser/alertsView.component.ts @@ -14,7 +14,7 @@ import { Table } from 'sql/base/browser/ui/table/table'; import { AgentViewComponent } from 'sql/workbench/parts/jobManagement/browser/agentView.component'; import { IJobManagementService } from 'sql/platform/jobManagement/common/interfaces'; import { EditAlertAction, DeleteAlertAction, NewAlertAction } from 'sql/platform/jobManagement/browser/jobActions'; -import { JobManagementView, JobActionContext } from 'sql/workbench/parts/jobManagement/browser/jobManagementView'; +import { JobManagementView } from 'sql/workbench/parts/jobManagement/browser/jobManagementView'; import { CommonServiceInterface } from 'sql/workbench/services/bootstrap/browser/commonServiceInterface.service'; import { ICommandService } from 'vs/platform/commands/common/commands'; import { IContextMenuService } from 'vs/platform/contextview/browser/contextView'; @@ -58,7 +58,7 @@ export class AlertsViewComponent extends JobManagementView implements OnInit, On }; private dataView: any; - private _isCloud: boolean; + public _isCloud: boolean; private _alertsCacheObject: AlertsCacheObject; private _didTabChange: boolean; @@ -69,7 +69,6 @@ export class AlertsViewComponent extends JobManagementView implements OnInit, On constructor( @Inject(forwardRef(() => ChangeDetectorRef)) private _cd: ChangeDetectorRef, - @Inject(forwardRef(() => ElementRef)) private _el: ElementRef, @Inject(forwardRef(() => AgentViewComponent)) _agentViewComponent: AgentViewComponent, @Inject(IJobManagementService) private _jobManagementService: IJobManagementService, @Inject(ICommandService) private _commandService: ICommandService, diff --git a/src/sql/workbench/parts/jobManagement/browser/jobHistory.component.ts b/src/sql/workbench/parts/jobManagement/browser/jobHistory.component.ts index ccb0f7ff78..4d96fd5eac 100644 --- a/src/sql/workbench/parts/jobManagement/browser/jobHistory.component.ts +++ b/src/sql/workbench/parts/jobManagement/browser/jobHistory.component.ts @@ -53,17 +53,15 @@ export class JobHistoryComponent extends JobManagementView implements OnInit { private _treeFilter: JobHistoryFilter; @ViewChild('table') private _tableContainer: ElementRef; - @ViewChild('jobsteps') private _jobStepsView: ElementRef; @Input() public agentJobInfo: azdata.AgentJobInfo = undefined; @Input() public agentJobHistories: azdata.AgentJobHistoryInfo[] = undefined; public agentJobHistoryInfo: azdata.AgentJobHistoryInfo = undefined; - private _isVisible: boolean = false; private _stepRows: JobStepsViewRow[] = []; private _showSteps: boolean = undefined; private _showPreviousRuns: boolean = undefined; - private _runStatus: string = undefined; + public _runStatus: string = undefined; private _jobCacheObject: JobCacheObject; private _agentJobInfo: azdata.AgentJobInfo; private _noJobsAvailable: boolean = false; @@ -268,7 +266,7 @@ export class JobHistoryComponent extends JobManagementView implements OnInit { } } - private toggleCollapse(): void { + public toggleCollapse(): void { let arrow: HTMLElement = jQuery('.resultsViewCollapsible').get(0); let checkbox: any = document.getElementById('accordion'); if (arrow.className === 'resultsViewCollapsible' && checkbox.checked === false) { @@ -278,20 +276,10 @@ export class JobHistoryComponent extends JobManagementView implements OnInit { } } - private goToJobs(): void { - this._isVisible = false; + public goToJobs(): void { this._agentViewComponent.showHistory = false; } - private convertToJobHistoryRow(historyInfo: azdata.AgentJobHistoryInfo): JobHistoryRow { - let jobHistoryRow = new JobHistoryRow(); - jobHistoryRow.runDate = this.formatTime(historyInfo.runDate); - jobHistoryRow.runStatus = JobManagementUtilities.convertToStatusString(historyInfo.runStatus); - jobHistoryRow.instanceID = historyInfo.instanceId; - jobHistoryRow.jobID = historyInfo.jobId; - return jobHistoryRow; - } - private formatTime(time: string): string { return time.replace('T', ' '); } diff --git a/src/sql/workbench/parts/jobManagement/browser/jobHistoryTree.ts b/src/sql/workbench/parts/jobManagement/browser/jobHistoryTree.ts index c5dbb2ec8e..5b3bffa623 100644 --- a/src/sql/workbench/parts/jobManagement/browser/jobHistoryTree.ts +++ b/src/sql/workbench/parts/jobManagement/browser/jobHistoryTree.ts @@ -152,7 +152,6 @@ export class JobHistoryRenderer implements tree.IRenderer { } export class JobHistoryFilter implements tree.IFilter { - private _filterString: string; public isVisible(tree: tree.ITree, element: JobHistoryRow): boolean { return this._isJobVisible(); @@ -163,6 +162,5 @@ export class JobHistoryFilter implements tree.IFilter { } public set filterString(val: string) { - this._filterString = val; } } diff --git a/src/sql/workbench/parts/jobManagement/browser/jobStepsView.component.ts b/src/sql/workbench/parts/jobManagement/browser/jobStepsView.component.ts index 2e0d868ca9..f4f84d7d1d 100644 --- a/src/sql/workbench/parts/jobManagement/browser/jobStepsView.component.ts +++ b/src/sql/workbench/parts/jobManagement/browser/jobStepsView.component.ts @@ -6,7 +6,7 @@ import 'vs/css!./media/jobStepsView'; import * as nls from 'vs/nls'; import * as dom from 'vs/base/browser/dom'; -import { OnInit, Component, Inject, forwardRef, ElementRef, ChangeDetectorRef, ViewChild, AfterContentChecked } from '@angular/core'; +import { OnInit, Component, Inject, forwardRef, ElementRef, ViewChild, AfterContentChecked } from '@angular/core'; import { attachListStyler } from 'vs/platform/theme/common/styler'; import { Tree } from 'vs/base/parts/tree/browser/treeImpl'; import { ScrollbarVisibility } from 'vs/base/common/scrollable'; @@ -44,8 +44,6 @@ export class JobStepsViewComponent extends JobManagementView implements OnInit, @ViewChild('table') private _tableContainer: ElementRef; constructor( - @Inject(forwardRef(() => ElementRef)) el: ElementRef, - @Inject(forwardRef(() => ChangeDetectorRef)) private _cd: ChangeDetectorRef, @Inject(forwardRef(() => CommonServiceInterface)) commonService: CommonServiceInterface, @Inject(forwardRef(() => JobHistoryComponent)) private _jobHistoryComponent: JobHistoryComponent, @Inject(IWorkbenchThemeService) private themeService: IWorkbenchThemeService, diff --git a/src/sql/workbench/parts/jobManagement/browser/jobStepsViewTree.ts b/src/sql/workbench/parts/jobManagement/browser/jobStepsViewTree.ts index d104448401..cbf01198cc 100644 --- a/src/sql/workbench/parts/jobManagement/browser/jobStepsViewTree.ts +++ b/src/sql/workbench/parts/jobManagement/browser/jobStepsViewTree.ts @@ -162,7 +162,6 @@ export class JobStepsViewRenderer implements tree.IRenderer { } export class JobStepsViewFilter implements tree.IFilter { - private _filterString: string; public isVisible(tree: tree.ITree, element: JobStepsViewRow): boolean { return this._isJobVisible(); @@ -173,6 +172,5 @@ export class JobStepsViewFilter implements tree.IFilter { } public set filterString(val: string) { - this._filterString = val; } } diff --git a/src/sql/workbench/parts/jobManagement/browser/jobsView.component.ts b/src/sql/workbench/parts/jobManagement/browser/jobsView.component.ts index 282b6dc915..20a3efb6aa 100644 --- a/src/sql/workbench/parts/jobManagement/browser/jobsView.component.ts +++ b/src/sql/workbench/parts/jobManagement/browser/jobsView.component.ts @@ -80,7 +80,7 @@ export class JobsViewComponent extends JobManagementView implements OnInit, OnDe private rowDetail: RowDetailView; private filterPlugin: any; private dataView: any; - private _isCloud: boolean; + public _isCloud: boolean; private filterStylingMap: { [columnName: string]: [any]; } = {}; private filterStack = ['start']; private filterValueMap: { [columnName: string]: string[]; } = {}; @@ -98,7 +98,6 @@ export class JobsViewComponent extends JobManagementView implements OnInit, OnDe constructor( @Inject(forwardRef(() => CommonServiceInterface)) commonService: CommonServiceInterface, @Inject(forwardRef(() => ChangeDetectorRef)) private _cd: ChangeDetectorRef, - @Inject(forwardRef(() => ElementRef)) private _el: ElementRef, @Inject(forwardRef(() => AgentViewComponent)) _agentViewComponent: AgentViewComponent, @Inject(IJobManagementService) private _jobManagementService: IJobManagementService, @Inject(IWorkbenchThemeService) private _themeService: IWorkbenchThemeService, diff --git a/src/sql/workbench/parts/jobManagement/browser/notebookHistory.component.ts b/src/sql/workbench/parts/jobManagement/browser/notebookHistory.component.ts index d759746ec9..19c7674cd9 100644 --- a/src/sql/workbench/parts/jobManagement/browser/notebookHistory.component.ts +++ b/src/sql/workbench/parts/jobManagement/browser/notebookHistory.component.ts @@ -8,17 +8,14 @@ import 'vs/css!./media/jobHistory'; import * as azdata from 'azdata'; import * as nls from 'vs/nls'; import * as dom from 'vs/base/browser/dom'; -import { OnInit, Component, Inject, Input, forwardRef, ElementRef, ChangeDetectorRef, ViewChild, ChangeDetectionStrategy, Injectable, PipeTransform, Pipe } from '@angular/core'; +import { OnInit, Component, Inject, Input, forwardRef, ElementRef, ChangeDetectorRef, ViewChild, ChangeDetectionStrategy, Injectable } from '@angular/core'; import { Taskbar } from 'sql/base/browser/ui/taskbar/taskbar'; import { AgentViewComponent } from 'sql/workbench/parts/jobManagement/browser/agentView.component'; import { CommonServiceInterface } from 'sql/workbench/services/bootstrap/browser/commonServiceInterface.service'; -import { RunJobAction, StopJobAction, JobsRefreshAction, EditNotebookJobAction, EditJobAction, OpenMaterializedNotebookAction, OpenTemplateNotebookAction, RenameNotebookMaterializedAction, PinNotebookMaterializedAction, UnpinNotebookMaterializedAction, DeleteMaterializedNotebookAction } from 'sql/platform/jobManagement/browser/jobActions'; +import { RunJobAction, StopJobAction, JobsRefreshAction, EditNotebookJobAction, OpenMaterializedNotebookAction, OpenTemplateNotebookAction, RenameNotebookMaterializedAction, PinNotebookMaterializedAction, UnpinNotebookMaterializedAction, DeleteMaterializedNotebookAction } from 'sql/platform/jobManagement/browser/jobActions'; import { NotebookCacheObject } from 'sql/platform/jobManagement/common/jobManagementService'; -import { JobManagementUtilities } from 'sql/platform/jobManagement/browser/jobManagementUtilities'; import { IJobManagementService } from 'sql/platform/jobManagement/common/interfaces'; -import { JobHistoryRow } from 'sql/workbench/parts/jobManagement/browser/jobHistoryTree'; import { JobStepsViewRow } from 'sql/workbench/parts/jobManagement/browser/jobStepsViewTree'; -import { IWorkbenchThemeService } from 'vs/workbench/services/themes/common/workbenchThemeService'; import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation'; import { IAction } from 'vs/base/common/actions'; import { IContextMenuService } from 'vs/platform/contextview/browser/contextView'; @@ -30,7 +27,6 @@ import { IKeybindingService } from 'vs/platform/keybinding/common/keybinding'; import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry'; import * as TelemetryKeys from 'sql/platform/telemetry/common/telemetryKeys'; import { IQuickInputService } from 'vs/platform/quickinput/common/quickInput'; -import { find } from 'vs/base/common/arrays'; export const DASHBOARD_SELECTOR: string = 'notebookhistory-component'; export class GridSection { @@ -48,23 +44,16 @@ export class GridSection { @Injectable() export class NotebookHistoryComponent extends JobManagementView implements OnInit { - - @ViewChild('table') private _tableContainer: ElementRef; - @ViewChild('jobsteps') private _jobStepsView: ElementRef; - @ViewChild('notebookHistoryActionbarContainer') private _notebookHistoryActionbarView: ElementRef; - @ViewChild('notebookgriditem') private _notebookGridItem: ElementRef; @Input() public agentNotebookInfo: azdata.AgentNotebookInfo = undefined; @Input() public agentJobHistories: azdata.AgentJobHistoryInfo[] = undefined; public notebookHistories: azdata.AgentNotebookHistoryInfo[] = undefined; public agentNotebookHistoryInfo: azdata.AgentNotebookHistoryInfo = undefined; - private _isVisible: boolean = false; private _stepRows: JobStepsViewRow[] = []; private _showSteps: boolean = undefined; private _showPreviousRuns: boolean = undefined; - private _runStatus: string = undefined; private _notebookCacheObject: NotebookCacheObject; private _agentNotebookInfo: azdata.AgentNotebookInfo; private _noJobsAvailable: boolean = false; @@ -87,7 +76,6 @@ export class NotebookHistoryComponent extends JobManagementView implements OnIni @Inject(forwardRef(() => ChangeDetectorRef)) private _cd: ChangeDetectorRef, @Inject(forwardRef(() => CommonServiceInterface)) commonService: CommonServiceInterface, @Inject(forwardRef(() => AgentViewComponent)) _agentViewComponent: AgentViewComponent, - @Inject(IWorkbenchThemeService) private themeService: IWorkbenchThemeService, @Inject(IInstantiationService) private instantiationService: IInstantiationService, @Inject(IContextMenuService) contextMenuService: IContextMenuService, @Inject(IJobManagementService) private _jobManagementService: IJobManagementService, @@ -116,7 +104,6 @@ export class NotebookHistoryComponent extends JobManagementView implements OnIni this._parentComponent = this._agentViewComponent; this._agentNotebookInfo = this._agentViewComponent.agentNotebookInfo; this.initActionBar(); - const self = this; this._telemetryService.publicLog(TelemetryKeys.JobHistoryView); } @@ -166,53 +153,7 @@ export class NotebookHistoryComponent extends JobManagementView implements OnIni }); } - private setStepsTree(element: JobHistoryRow) { - const self = this; - let cachedHistory = self._notebookCacheObject.getNotebookHistory(element.jobID); - if (cachedHistory) { - self.agentNotebookHistoryInfo = find(cachedHistory, - history => self.formatTime(history.runDate) === self.formatTime(element.runDate)); - } - if (self.agentNotebookHistoryInfo) { - self.agentNotebookHistoryInfo.runDate = self.formatTime(self.agentNotebookHistoryInfo.runDate); - if (self.agentNotebookHistoryInfo.steps) { - let jobStepStatus = this.didJobFail(self.agentNotebookHistoryInfo); - self._stepRows = self.agentNotebookHistoryInfo.steps.map(step => { - let stepViewRow = new JobStepsViewRow(); - stepViewRow.message = step.message; - stepViewRow.runStatus = jobStepStatus ? JobManagementUtilities.convertToStatusString(0) : - JobManagementUtilities.convertToStatusString(step.runStatus); - self._runStatus = JobManagementUtilities.convertToStatusString(self.agentNotebookHistoryInfo.runStatus); - stepViewRow.stepName = step.stepDetails.stepName; - stepViewRow.stepId = step.stepDetails.id.toString(); - return stepViewRow; - }); - self._stepRows.unshift(new JobStepsViewRow()); - self._stepRows[0].rowID = 'stepsColumn' + self._agentNotebookInfo.jobId; - self._stepRows[0].stepId = nls.localize('stepRow.stepID', "Step ID"); - self._stepRows[0].stepName = nls.localize('stepRow.stepName', "Step Name"); - self._stepRows[0].message = nls.localize('stepRow.message', "Message"); - this._showSteps = self._stepRows.length > 1; - } else { - self._showSteps = false; - } - if (self._agentViewComponent.showNotebookHistory) { - self._cd.detectChanges(); - this.collapseGrid(); - } - } - } - - private didJobFail(job: azdata.AgentJobHistoryInfo): boolean { - for (let i = 0; i < job.steps.length; i++) { - if (job.steps[i].runStatus === 0) { - return true; - } - } - return false; - } - - private toggleCollapse(): void { + public toggleCollapse(): void { let arrow: HTMLElement = jQuery('.resultsViewCollapsible').get(0); let checkbox: any = document.getElementById('accordion'); if (arrow.className === 'resultsViewCollapsible' && checkbox.checked === false) { @@ -223,7 +164,7 @@ export class NotebookHistoryComponent extends JobManagementView implements OnIni } - private toggleGridCollapse(i): void { + public toggleGridCollapse(i): void { let notebookGrid = document.getElementById('notebook-grid' + i); let checkbox: any = document.getElementById('accordion' + i); let arrow = document.getElementById('history-grid-icon' + i); @@ -239,35 +180,16 @@ export class NotebookHistoryComponent extends JobManagementView implements OnIni } - private toggleHistoryDisplay(event): void { - let header = event.srcElement.attributes; - } - - private goToJobs(): void { - this._isVisible = false; + public goToJobs(): void { this._agentViewComponent.showNotebookHistory = false; } - private convertToJobHistoryRow(historyInfo: azdata.AgentJobHistoryInfo): JobHistoryRow { - let jobHistoryRow = new JobHistoryRow(); - jobHistoryRow.runDate = this.formatTime(historyInfo.runDate); - jobHistoryRow.runStatus = JobManagementUtilities.convertToStatusString(historyInfo.runStatus); - jobHistoryRow.instanceID = historyInfo.instanceId; - jobHistoryRow.jobID = historyInfo.jobId; - return jobHistoryRow; - } - - private formatTime(time: string): string { - - return time.replace('T', ' '); - } - - private formatDateTimetoLocaleDate(time: string) { + public formatDateTimetoLocaleDate(time: string) { let dateInstance = new Date(time); return dateInstance.toLocaleDateString(); } - private formatDateTimetoLocaleTime(time: string) { + public formatDateTimetoLocaleTime(time: string) { let dateInstance = new Date(time); return dateInstance.toLocaleTimeString(); } @@ -294,7 +216,6 @@ export class NotebookHistoryComponent extends JobManagementView implements OnIni let notebookHistories = this._notebookCacheObject.notebookHistories[this._agentViewComponent.notebookId]; if (notebookHistories) { if (notebookHistories.length > 0) { - const self = this; this._noJobsAvailable = false; if (this._notebookCacheObject.prevJobID === this._agentViewComponent.notebookId || notebookHistories[0].jobId === this._agentViewComponent.notebookId) { this._showPreviousRuns = true; @@ -405,7 +326,6 @@ export class NotebookHistoryComponent extends JobManagementView implements OnIni let notebookRunName = (history.materializedNotebookName === '') ? defaultDateTime : history.materializedNotebookName; let ownerUri: string = this._commonService.connectionManagementService.connectionInfo.ownerUri; let targetDatabase = this._agentViewComponent.agentNotebookInfo.targetDatabase; - let materializedNotebookId = history.materializedNotebookId; this._quickInputService.input({ placeHolder: notebookRunName }).then(async (value) => { if (value) { if (!/\S/.test(value)) { @@ -425,7 +345,6 @@ export class NotebookHistoryComponent extends JobManagementView implements OnIni public toggleNotebookPin(history: azdata.AgentNotebookHistoryInfo, pin: boolean) { let ownerUri: string = this._commonService.connectionManagementService.connectionInfo.ownerUri; let targetDatabase = this._agentViewComponent.agentNotebookInfo.targetDatabase; - let materializedNotebookId = history.materializedNotebookId; this._jobManagementService.updateNotebookMaterializedPin(ownerUri, history, targetDatabase, pin).then(async (result) => { if (result) { history.materializedNotebookPin = pin; @@ -440,8 +359,6 @@ export class NotebookHistoryComponent extends JobManagementView implements OnIni x: event.clientX, y: event.clientY }; - let runDate = event.target['runDate']; - let gridActions = this.getGridActions(); let actionContext = { component: this, history: history diff --git a/src/sql/workbench/parts/jobManagement/browser/notebooksView.component.ts b/src/sql/workbench/parts/jobManagement/browser/notebooksView.component.ts index 255faf0d11..29e2f2577e 100644 --- a/src/sql/workbench/parts/jobManagement/browser/notebooksView.component.ts +++ b/src/sql/workbench/parts/jobManagement/browser/notebooksView.component.ts @@ -14,7 +14,7 @@ import { Table } from 'sql/base/browser/ui/table/table'; import { AgentViewComponent } from 'sql/workbench/parts/jobManagement/browser/agentView.component'; import { RowDetailView } from 'sql/base/browser/ui/table/plugins/rowDetailView'; import { NotebookCacheObject } from 'sql/platform/jobManagement/common/jobManagementService'; -import { EditJobAction, NewNotebookJobAction, RunJobAction, EditNotebookJobAction, JobsRefreshAction, IJobActionInfo, DeleteNotebookAction, OpenLatestRunMaterializedNotebook } from 'sql/platform/jobManagement/browser/jobActions'; +import { NewNotebookJobAction, RunJobAction, EditNotebookJobAction, JobsRefreshAction, IJobActionInfo, DeleteNotebookAction, OpenLatestRunMaterializedNotebook } from 'sql/platform/jobManagement/browser/jobActions'; import { JobManagementUtilities } from 'sql/platform/jobManagement/browser/jobManagementUtilities'; import { HeaderFilter } from 'sql/base/browser/ui/table/plugins/headerFilter.plugin'; import { IJobManagementService } from 'sql/platform/jobManagement/common/interfaces'; @@ -79,7 +79,7 @@ export class NotebooksViewComponent extends JobManagementView implements OnInit, private rowDetail: RowDetailView; private filterPlugin: any; private dataView: any; - private _isCloud: boolean; + public _isCloud: boolean; private filterStylingMap: { [columnName: string]: [any]; } = {}; private filterStack = ['start']; private filterValueMap: { [columnName: string]: string[]; } = {}; @@ -97,7 +97,6 @@ export class NotebooksViewComponent extends JobManagementView implements OnInit, constructor( @Inject(forwardRef(() => CommonServiceInterface)) commonService: CommonServiceInterface, @Inject(forwardRef(() => ChangeDetectorRef)) private _cd: ChangeDetectorRef, - @Inject(forwardRef(() => ElementRef)) private _el: ElementRef, @Inject(forwardRef(() => AgentViewComponent)) _agentViewComponent: AgentViewComponent, @Inject(IJobManagementService) private _jobManagementService: IJobManagementService, @Inject(IWorkbenchThemeService) private _themeService: IWorkbenchThemeService, @@ -898,7 +897,6 @@ export class NotebooksViewComponent extends JobManagementView implements OnInit, } protected getTableActions(targetObject: JobActionContext): IAction[] { - const editAction = this._instantiationService.createInstance(EditJobAction); const editNotebookAction = this._instantiationService.createInstance(EditNotebookJobAction); const runJobAction = this._instantiationService.createInstance(RunJobAction); const openLatestRunAction = this._instantiationService.createInstance(OpenLatestRunMaterializedNotebook); diff --git a/src/sql/workbench/parts/jobManagement/browser/operatorsView.component.ts b/src/sql/workbench/parts/jobManagement/browser/operatorsView.component.ts index 23cc0cbc57..12f16ed14f 100644 --- a/src/sql/workbench/parts/jobManagement/browser/operatorsView.component.ts +++ b/src/sql/workbench/parts/jobManagement/browser/operatorsView.component.ts @@ -57,7 +57,7 @@ export class OperatorsViewComponent extends JobManagementView implements OnInit, }; private dataView: any; - private _isCloud: boolean; + public _isCloud: boolean; private _operatorsCacheObject: OperatorsCacheObject; private _didTabChange: boolean; @@ -68,7 +68,6 @@ export class OperatorsViewComponent extends JobManagementView implements OnInit, constructor( @Inject(forwardRef(() => ChangeDetectorRef)) private _cd: ChangeDetectorRef, - @Inject(forwardRef(() => ElementRef)) private _el: ElementRef, @Inject(forwardRef(() => AgentViewComponent)) _agentViewComponent: AgentViewComponent, @Inject(IJobManagementService) private _jobManagementService: IJobManagementService, @Inject(ICommandService) private _commandService: ICommandService, diff --git a/src/sql/workbench/parts/jobManagement/browser/proxiesView.component.ts b/src/sql/workbench/parts/jobManagement/browser/proxiesView.component.ts index c831dee556..37a07d41f9 100644 --- a/src/sql/workbench/parts/jobManagement/browser/proxiesView.component.ts +++ b/src/sql/workbench/parts/jobManagement/browser/proxiesView.component.ts @@ -36,9 +36,6 @@ export const ROW_HEIGHT: number = 45; export class ProxiesViewComponent extends JobManagementView implements OnInit, OnDestroy { - private NewProxyText: string = nls.localize('jobProxyToolbar-NewItem', "New Proxy"); - private RefreshText: string = nls.localize('jobProxyToolbar-Refresh', "Refresh"); - private columns: Array> = [ { name: nls.localize('jobProxiesView.accountName', "Account Name"), @@ -61,7 +58,7 @@ export class ProxiesViewComponent extends JobManagementView implements OnInit, O }; private dataView: any; - private _isCloud: boolean; + public _isCloud: boolean; private _proxiesCacheObject: ProxiesCacheObject; public proxies: azdata.AgentProxyInfo[]; @@ -72,7 +69,6 @@ export class ProxiesViewComponent extends JobManagementView implements OnInit, O constructor( @Inject(forwardRef(() => ChangeDetectorRef)) private _cd: ChangeDetectorRef, - @Inject(forwardRef(() => ElementRef)) private _el: ElementRef, @Inject(forwardRef(() => AgentViewComponent)) _agentViewComponent: AgentViewComponent, @Inject(IJobManagementService) private _jobManagementService: IJobManagementService, @Inject(ICommandService) private _commandService: ICommandService, diff --git a/src/sql/workbench/parts/notebook/browser/cellViews/collapse.component.ts b/src/sql/workbench/parts/notebook/browser/cellViews/collapse.component.ts index b35427dd48..6b6b2353b1 100644 --- a/src/sql/workbench/parts/notebook/browser/cellViews/collapse.component.ts +++ b/src/sql/workbench/parts/notebook/browser/cellViews/collapse.component.ts @@ -4,7 +4,7 @@ *--------------------------------------------------------------------------------------------*/ import 'vs/css!./code'; -import { OnInit, Component, Input, Inject, forwardRef, ElementRef, ChangeDetectorRef, ViewChild, SimpleChange, OnChanges } from '@angular/core'; +import { OnInit, Component, Input, ElementRef, ViewChild, SimpleChange, OnChanges } from '@angular/core'; import { CellView } from 'sql/workbench/parts/notebook/browser/cellViews/interfaces'; import { ICellModel } from 'sql/workbench/parts/notebook/browser/models/modelInterfaces'; @@ -22,9 +22,7 @@ export class CollapseComponent extends CellView implements OnInit, OnChanges { @Input() cellModel: ICellModel; @Input() activeCellId: string; - constructor( - @Inject(forwardRef(() => ChangeDetectorRef)) private _changeRef: ChangeDetectorRef, - ) { + constructor() { super(); } diff --git a/src/sql/workbench/parts/notebook/browser/cellViews/placeholderCell.component.ts b/src/sql/workbench/parts/notebook/browser/cellViews/placeholderCell.component.ts index 5bd8103bc8..4dd50558c7 100644 --- a/src/sql/workbench/parts/notebook/browser/cellViews/placeholderCell.component.ts +++ b/src/sql/workbench/parts/notebook/browser/cellViews/placeholderCell.component.ts @@ -4,7 +4,7 @@ *--------------------------------------------------------------------------------------------*/ import 'vs/css!./placeholder'; -import { OnInit, Component, Input, Inject, forwardRef, ElementRef, ChangeDetectorRef, OnDestroy, ViewChild, SimpleChange, OnChanges } from '@angular/core'; +import { OnInit, Component, Input, Inject, forwardRef, ChangeDetectorRef, SimpleChange, OnChanges } from '@angular/core'; import { CellView } from 'sql/workbench/parts/notebook/browser/cellViews/interfaces'; import { ICellModel } from 'sql/workbench/parts/notebook/browser/models/modelInterfaces'; import { NotebookModel } from 'sql/workbench/parts/notebook/browser/models/notebookModel'; diff --git a/src/sql/workbench/parts/notebook/browser/cellViews/stdin.component.ts b/src/sql/workbench/parts/notebook/browser/cellViews/stdin.component.ts index ae59685619..5805188ee9 100644 --- a/src/sql/workbench/parts/notebook/browser/cellViews/stdin.component.ts +++ b/src/sql/workbench/parts/notebook/browser/cellViews/stdin.component.ts @@ -6,7 +6,7 @@ import 'vs/css!./stdin'; import { - Component, Input, Inject, ChangeDetectorRef, forwardRef, + Component, Input, Inject, ViewChild, ElementRef, AfterViewInit, HostListener } from '@angular/core'; import { nb } from 'azdata'; @@ -16,7 +16,7 @@ import { IInputOptions } from 'vs/base/browser/ui/inputbox/inputBox'; import { IWorkbenchThemeService } from 'vs/workbench/services/themes/common/workbenchThemeService'; import { IContextViewService } from 'vs/platform/contextview/browser/contextView'; import { inputBackground, inputBorder } from 'vs/platform/theme/common/colorRegistry'; -import { StandardKeyboardEvent, IKeyboardEvent } from 'vs/base/browser/keyboardEvent'; +import { StandardKeyboardEvent } from 'vs/base/browser/keyboardEvent'; import { KeyCode } from 'vs/base/common/keyCodes'; import { InputBox } from 'sql/base/browser/ui/inputBox/inputBox'; @@ -43,10 +43,8 @@ export class StdInComponent extends AngularDisposable implements AfterViewInit { constructor( - @Inject(forwardRef(() => ChangeDetectorRef)) private changeRef: ChangeDetectorRef, @Inject(IWorkbenchThemeService) private themeService: IWorkbenchThemeService, - @Inject(IContextViewService) private contextViewService: IContextViewService, - @Inject(forwardRef(() => ElementRef)) private el: ElementRef + @Inject(IContextViewService) private contextViewService: IContextViewService ) { super(); } diff --git a/src/sql/workbench/parts/notebook/browser/cellViews/textCell.component.ts b/src/sql/workbench/parts/notebook/browser/cellViews/textCell.component.ts index 7b6534cb27..e536563da4 100644 --- a/src/sql/workbench/parts/notebook/browser/cellViews/textCell.component.ts +++ b/src/sql/workbench/parts/notebook/browser/cellViews/textCell.component.ts @@ -20,14 +20,12 @@ import * as DOM from 'vs/base/browser/dom'; import { IConfigurationService } from 'vs/platform/configuration/common/configuration'; import { toDisposable } from 'vs/base/common/lifecycle'; import { IMarkdownRenderResult } from 'vs/editor/contrib/markdown/markdownRenderer'; -import { IOpenerService } from 'vs/platform/opener/common/opener'; import { NotebookMarkdownRenderer } from 'sql/workbench/parts/notebook/browser/outputs/notebookMarkdown'; import { CellView } from 'sql/workbench/parts/notebook/browser/cellViews/interfaces'; import { ICellModel } from 'sql/workbench/parts/notebook/browser/models/modelInterfaces'; import { NotebookModel } from 'sql/workbench/parts/notebook/browser/models/notebookModel'; import { ISanitizer, defaultSanitizer } from 'sql/workbench/parts/notebook/browser/outputs/sanitizer'; import { CellToggleMoreActions } from 'sql/workbench/parts/notebook/browser/cellToggleMoreActions'; -import { CommonServiceInterface } from 'sql/workbench/services/bootstrap/browser/commonServiceInterface.service'; import { useInProcMarkdown, convertVscodeResourceToFileInSubDirectories } from 'sql/workbench/parts/notebook/browser/models/notebookUtils'; export const TEXT_SELECTOR: string = 'text-cell-component'; @@ -82,12 +80,10 @@ export class TextCellComponent extends CellView implements OnInit, OnChanges { private markdownResult: IMarkdownRenderResult; constructor( - @Inject(forwardRef(() => CommonServiceInterface)) private _bootstrapService: CommonServiceInterface, @Inject(forwardRef(() => ChangeDetectorRef)) private _changeRef: ChangeDetectorRef, @Inject(IInstantiationService) private _instantiationService: IInstantiationService, @Inject(IWorkbenchThemeService) private themeService: IWorkbenchThemeService, @Inject(ICommandService) private _commandService: ICommandService, - @Inject(IOpenerService) private readonly openerService: IOpenerService, @Inject(IConfigurationService) private configurationService: IConfigurationService, ) { diff --git a/src/sql/workbench/parts/notebook/browser/models/cell.ts b/src/sql/workbench/parts/notebook/browser/models/cell.ts index f51a843e8c..e1bbe0d85a 100644 --- a/src/sql/workbench/parts/notebook/browser/models/cell.ts +++ b/src/sql/workbench/parts/notebook/browser/models/cell.ts @@ -451,7 +451,6 @@ export class CellModel implements ICellModel { private handleReply(msg: nb.IShellMessage): void { // TODO #931 we should process this. There can be a payload attached which should be added to outputs. // In all other cases, it is a no-op - let output: nb.ICellOutput = msg.content as nb.ICellOutput; if (!this._future.inProgress) { this.disposeFuture(); @@ -460,7 +459,6 @@ export class CellModel implements ICellModel { private handleIOPub(msg: nb.IIOPubMessage): void { let msgType = msg.header.msg_type; - let displayId = this.getDisplayId(msg); let output: nb.ICellOutput; switch (msgType) { case 'execute_result': @@ -552,11 +550,6 @@ export class CellModel implements ICellModel { }); } - private getDisplayId(msg: nb.IIOPubMessage): string | undefined { - let transient = (msg.content.transient || {}); - return transient['display_id'] as string; - } - public setStdInHandler(handler: nb.MessageHandler): void { this._stdInHandler = handler; } diff --git a/src/sql/workbench/parts/notebook/browser/models/notebookModel.ts b/src/sql/workbench/parts/notebook/browser/models/notebookModel.ts index 683fd8d0b0..395d74a9c7 100644 --- a/src/sql/workbench/parts/notebook/browser/models/notebookModel.ts +++ b/src/sql/workbench/parts/notebook/browser/models/notebookModel.ts @@ -9,7 +9,7 @@ import { localize } from 'vs/nls'; import { Event, Emitter } from 'vs/base/common/event'; import { Disposable } from 'vs/base/common/lifecycle'; -import { IClientSession, INotebookModel, IDefaultConnection, INotebookModelOptions, ICellModel, NotebookContentChange, notebookConstants, INotebookContentsEditable } from 'sql/workbench/parts/notebook/browser/models/modelInterfaces'; +import { IClientSession, INotebookModel, IDefaultConnection, INotebookModelOptions, ICellModel, NotebookContentChange, notebookConstants } from 'sql/workbench/parts/notebook/browser/models/modelInterfaces'; import { NotebookChangeType, CellType, CellTypes } from 'sql/workbench/parts/notebook/common/models/contracts'; import { nbversion } from 'sql/workbench/parts/notebook/common/models/notebookConstants'; import * as notebookUtils from 'sql/workbench/parts/notebook/browser/models/notebookUtils'; diff --git a/src/sql/workbench/parts/notebook/browser/notebook.component.ts b/src/sql/workbench/parts/notebook/browser/notebook.component.ts index 9300c550a1..01331c19f7 100644 --- a/src/sql/workbench/parts/notebook/browser/notebook.component.ts +++ b/src/sql/workbench/parts/notebook/browser/notebook.component.ts @@ -23,7 +23,7 @@ import * as DOM from 'vs/base/browser/dom'; import { AngularDisposable } from 'sql/base/browser/lifecycle'; import { CellTypes, CellType } from 'sql/workbench/parts/notebook/common/models/contracts'; -import { ICellModel, IModelFactory, INotebookModel, NotebookContentChange } from 'sql/workbench/parts/notebook/browser/models/modelInterfaces'; +import { ICellModel, IModelFactory, INotebookModel } from 'sql/workbench/parts/notebook/browser/models/modelInterfaces'; import { IConnectionManagementService } from 'sql/platform/connection/common/connectionManagement'; import { INotebookService, INotebookParams, INotebookManager, INotebookEditor, DEFAULT_NOTEBOOK_PROVIDER, SQL_NOTEBOOK_PROVIDER, INotebookSection, INavigationProvider } from 'sql/workbench/services/notebook/browser/notebookService'; import { NotebookModel } from 'sql/workbench/parts/notebook/browser/models/notebookModel'; @@ -54,7 +54,6 @@ import { Button } from 'sql/base/browser/ui/button/button'; import { isUndefinedOrNull } from 'vs/base/common/types'; import { IBootstrapParams } from 'sql/workbench/services/bootstrap/common/bootstrapParams'; import { getErrorMessage } from 'vs/base/common/errors'; -import { IEnvironmentService } from 'vs/platform/environment/common/environment'; import { find, firstIndex } from 'vs/base/common/arrays'; @@ -71,8 +70,6 @@ export class NotebookComponent extends AngularDisposable implements OnInit, OnDe @ViewChild('bookNav', { read: ElementRef }) private bookNav: ElementRef; private _model: NotebookModel; - private _isInErrorState: boolean = false; - private _errorMessage: string; protected _actionBar: Taskbar; protected isLoading: boolean; private notebookManagers: INotebookManager[] = []; @@ -105,8 +102,7 @@ export class NotebookComponent extends AngularDisposable implements OnInit, OnDe @Inject(ICapabilitiesService) private capabilitiesService: ICapabilitiesService, @Inject(ITextFileService) private textFileService: ITextFileService, @Inject(ILogService) private readonly logService: ILogService, - @Inject(ITelemetryService) private telemetryService: ITelemetryService, - @Inject(IEnvironmentService) private readonly environmentService: IEnvironmentService + @Inject(ITelemetryService) private telemetryService: ITelemetryService ) { super(); this.updateProfile(); @@ -398,8 +394,6 @@ export class NotebookComponent extends AngularDisposable implements OnInit, OnDe } private setViewInErrorState(error: any): any { - this._isInErrorState = true; - this._errorMessage = getErrorMessage(error); // For now, send message as error notification #870 covers having dedicated area for this this.notificationService.error(error); } diff --git a/src/sql/workbench/parts/notebook/browser/outputs/plotlyOutput.component.ts b/src/sql/workbench/parts/notebook/browser/outputs/plotlyOutput.component.ts index 185f9c7570..c7cb32d1b5 100644 --- a/src/sql/workbench/parts/notebook/browser/outputs/plotlyOutput.component.ts +++ b/src/sql/workbench/parts/notebook/browser/outputs/plotlyOutput.component.ts @@ -4,8 +4,7 @@ *--------------------------------------------------------------------------------------------*/ -import { OnInit, Component, Input, Inject, ElementRef, ViewChild } from '@angular/core'; -import { IThemeService } from 'vs/platform/theme/common/themeService'; +import { OnInit, Component, Input, ElementRef, ViewChild } from '@angular/core'; import { localize } from 'vs/nls'; import * as types from 'vs/base/common/types'; import { AngularDisposable } from 'sql/base/browser/lifecycle'; @@ -54,9 +53,7 @@ export class PlotlyOutputComponent extends AngularDisposable implements IMimeCom private _plotDiv: PlotlyHTMLElement; public errorText: string; - constructor( - @Inject(IThemeService) private readonly themeService: IThemeService - ) { + constructor() { super(); } diff --git a/src/sql/workbench/parts/notebook/test/electron-browser/cell.test.ts b/src/sql/workbench/parts/notebook/test/electron-browser/cell.test.ts index fd39818670..e5606962bd 100644 --- a/src/sql/workbench/parts/notebook/test/electron-browser/cell.test.ts +++ b/src/sql/workbench/parts/notebook/test/electron-browser/cell.test.ts @@ -456,10 +456,8 @@ suite('Cell Model', function (): void { future.setup(f => f.setStdInHandler(TypeMoq.It.isAny())).callback((handler) => onStdIn = handler); let deferred = new Deferred(); - let stdInMessage: nb.IStdinMessage = undefined; cell.setStdInHandler({ handle: (msg: nb.IStdinMessage) => { - stdInMessage = msg; return deferred.promise; } }); diff --git a/src/sql/workbench/parts/notebook/test/electron-browser/clientSession.test.ts b/src/sql/workbench/parts/notebook/test/electron-browser/clientSession.test.ts index 53593b260b..4e456c606c 100644 --- a/src/sql/workbench/parts/notebook/test/electron-browser/clientSession.test.ts +++ b/src/sql/workbench/parts/notebook/test/electron-browser/clientSession.test.ts @@ -23,7 +23,6 @@ suite('Client Session', function (): void { let mockSessionManager: TypeMoq.Mock; let notificationService: TypeMoq.Mock; let session: ClientSession; - let remoteSession: ClientSession; setup(() => { serverManager = new ServerManagerStub(); @@ -42,12 +41,6 @@ suite('Client Session', function (): void { let serverlessNotebookManager = new NotebookManagerStub(); serverlessNotebookManager.sessionManager = mockSessionManager.object; - remoteSession = new ClientSession({ - notebookManager: serverlessNotebookManager, - notebookUri: path, - notificationService: notificationService.object, - kernelSpec: undefined - }); }); test('Should set path, isReady and ready on construction', function (): void { diff --git a/src/sql/workbench/parts/objectExplorer/browser/connectionTreeAction.ts b/src/sql/workbench/parts/objectExplorer/browser/connectionTreeAction.ts index 51f1a79c8b..8e49df5c9c 100644 --- a/src/sql/workbench/parts/objectExplorer/browser/connectionTreeAction.ts +++ b/src/sql/workbench/parts/objectExplorer/browser/connectionTreeAction.ts @@ -89,9 +89,7 @@ export class DisconnectConnectionAction extends Action { id: string, label: string, private _connectionProfile: ConnectionProfile, - @IConnectionManagementService private _connectionManagementService: IConnectionManagementService, - @IObjectExplorerService private _objectExplorerService: IObjectExplorerService, - @IErrorMessageService private _errorMessageService: IErrorMessageService + @IConnectionManagementService private _connectionManagementService: IConnectionManagementService ) { super(id, label); } @@ -269,8 +267,7 @@ export class RecentConnectionsFilterAction extends Action { constructor( id: string, label: string, - private view: ServerTreeView, - @IConnectionManagementService private _connectionManagementService: IConnectionManagementService + private view: ServerTreeView ) { super(id, label); this.class = RecentConnectionsFilterAction.enabledClass; diff --git a/src/sql/workbench/parts/objectExplorer/browser/objectExplorerActions.ts b/src/sql/workbench/parts/objectExplorer/browser/objectExplorerActions.ts index 2c3515b30f..aabe49bdfd 100644 --- a/src/sql/workbench/parts/objectExplorer/browser/objectExplorerActions.ts +++ b/src/sql/workbench/parts/objectExplorer/browser/objectExplorerActions.ts @@ -3,7 +3,6 @@ * Licensed under the Source EULA. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { ITree } from 'vs/base/parts/tree/browser/tree'; import { ExecuteCommandAction } from 'vs/platform/actions/common/actions'; import { ICommandService } from 'vs/platform/commands/common/commands'; diff --git a/src/sql/workbench/parts/objectExplorer/browser/objectExplorerViewTreeShim.ts b/src/sql/workbench/parts/objectExplorer/browser/objectExplorerViewTreeShim.ts index f308aac0bb..69ea3c4948 100644 --- a/src/sql/workbench/parts/objectExplorer/browser/objectExplorerViewTreeShim.ts +++ b/src/sql/workbench/parts/objectExplorer/browser/objectExplorerViewTreeShim.ts @@ -9,7 +9,6 @@ import { ICapabilitiesService } from 'sql/platform/capabilities/common/capabilit import { IConnectionManagementService } from 'sql/platform/connection/common/connectionManagement'; import { ConnectionProfile } from 'sql/platform/connection/common/connectionProfile'; import { ITreeItem } from 'sql/workbench/common/views'; -import { IConnectionDialogService } from 'sql/workbench/services/connection/common/connectionDialogService'; import { IObjectExplorerService } from 'sql/workbench/services/objectExplorer/browser/objectExplorerService'; import { hash } from 'vs/base/common/hash'; import { Disposable } from 'vs/base/common/lifecycle'; @@ -43,7 +42,6 @@ export class OEShimService extends Disposable implements IOEShimService { constructor( @IObjectExplorerService private oe: IObjectExplorerService, @IConnectionManagementService private cm: IConnectionManagementService, - @IConnectionDialogService private cd: IConnectionDialogService, @ICapabilitiesService private capabilities: ICapabilitiesService ) { super(); diff --git a/src/sql/workbench/parts/objectExplorer/browser/serverTreeActionProvider.ts b/src/sql/workbench/parts/objectExplorer/browser/serverTreeActionProvider.ts index fd98b040b1..058fc2595e 100644 --- a/src/sql/workbench/parts/objectExplorer/browser/serverTreeActionProvider.ts +++ b/src/sql/workbench/parts/objectExplorer/browser/serverTreeActionProvider.ts @@ -19,7 +19,7 @@ import { ConnectionProfileGroup } from 'sql/platform/connection/common/connectio import { ConnectionProfile } from 'sql/platform/connection/common/connectionProfile'; import { TreeUpdateUtils } from 'sql/workbench/parts/objectExplorer/browser/treeUpdateUtils'; import { IConnectionManagementService } from 'sql/platform/connection/common/connectionManagement'; -import { MenuId, IMenuService, MenuItemAction } from 'vs/platform/actions/common/actions'; +import { MenuId, IMenuService } from 'vs/platform/actions/common/actions'; import { ConnectionContextKey } from 'sql/workbench/parts/connection/common/connectionContextKey'; import { TreeNodeContextKey } from 'sql/workbench/parts/objectExplorer/common/treeNodeContextKey'; import { IQueryManagementService } from 'sql/platform/query/common/queryManagement'; diff --git a/src/sql/workbench/parts/objectExplorer/browser/serverTreeRenderer.ts b/src/sql/workbench/parts/objectExplorer/browser/serverTreeRenderer.ts index a71d481e36..16cca6b3f5 100644 --- a/src/sql/workbench/parts/objectExplorer/browser/serverTreeRenderer.ts +++ b/src/sql/workbench/parts/objectExplorer/browser/serverTreeRenderer.ts @@ -15,7 +15,6 @@ import { IConnectionManagementService } from 'sql/platform/connection/common/con import { TreeNode } from 'sql/workbench/parts/objectExplorer/common/treeNode'; import { InputBox } from 'vs/base/browser/ui/inputbox/inputBox'; import { badgeRenderer, iconRenderer } from 'sql/workbench/parts/objectExplorer/browser/iconRenderer'; -import { ContextKeyExpr, IContextKeyService } from 'vs/platform/contextkey/common/contextkey'; import { URI } from 'vs/base/common/uri'; export interface IConnectionTemplateData { @@ -59,8 +58,7 @@ export class ServerTreeRenderer implements IRenderer { constructor( isCompact: boolean, - @IConnectionManagementService private _connectionManagementService: IConnectionManagementService, - @IContextKeyService private _contextKeyService: IContextKeyService + @IConnectionManagementService private _connectionManagementService: IConnectionManagementService ) { // isCompact defaults to false unless explicitly set by instantiation call. if (isCompact) { diff --git a/src/sql/workbench/parts/objectExplorer/browser/serverTreeView.ts b/src/sql/workbench/parts/objectExplorer/browser/serverTreeView.ts index b67a7938b0..cfbcbe68b2 100644 --- a/src/sql/workbench/parts/objectExplorer/browser/serverTreeView.ts +++ b/src/sql/workbench/parts/objectExplorer/browser/serverTreeView.ts @@ -10,7 +10,7 @@ import Severity from 'vs/base/common/severity'; import { IThemeService } from 'vs/platform/theme/common/themeService'; import { attachListStyler } from 'vs/platform/theme/common/styler'; import { ITree } from 'vs/base/parts/tree/browser/tree'; -import { IDisposable, dispose, Disposable } from 'vs/base/common/lifecycle'; +import { Disposable } from 'vs/base/common/lifecycle'; import { localize } from 'vs/nls'; import { IConfigurationService } from 'vs/platform/configuration/common/configuration'; import { Event, Emitter } from 'vs/base/common/event'; diff --git a/src/sql/workbench/parts/objectExplorer/test/browser/connectionTreeActions.test.ts b/src/sql/workbench/parts/objectExplorer/test/browser/connectionTreeActions.test.ts index 1833833f67..cfa0ab788a 100644 --- a/src/sql/workbench/parts/objectExplorer/test/browser/connectionTreeActions.test.ts +++ b/src/sql/workbench/parts/objectExplorer/test/browser/connectionTreeActions.test.ts @@ -189,9 +189,8 @@ suite('SQL Connection Tree Action tests', () => { id: 'testId' }); let connectionManagementService = createConnectionManagementService(isConnectedReturnValue, connection); - let objectExplorerService = createObjectExplorerService(connectionManagementService.object, undefined); - let changeConnectionAction: DisconnectConnectionAction = new DisconnectConnectionAction(DisconnectConnectionAction.ID, DisconnectConnectionAction.LABEL, connection, connectionManagementService.object, objectExplorerService.object, errorMessageService.object); + let changeConnectionAction: DisconnectConnectionAction = new DisconnectConnectionAction(DisconnectConnectionAction.ID, DisconnectConnectionAction.LABEL, connection, connectionManagementService.object); let actionContext = new ObjectExplorerActionsContext(); actionContext.connectionProfile = connection.toIConnectionProfile(); @@ -212,8 +211,6 @@ suite('SQL Connection Tree Action tests', () => { }); test('ActiveConnectionsFilterAction - test if view is called to display filtered results', (done) => { - let connectionManagementService = createConnectionManagementService(true, undefined); - let instantiationService = TypeMoq.Mock.ofType(InstantiationService, TypeMoq.MockBehavior.Loose); instantiationService.setup(x => x.createInstance(TypeMoq.It.isAny())).returns((input) => { return new Promise((resolve) => resolve({})); @@ -229,8 +226,6 @@ suite('SQL Connection Tree Action tests', () => { }); test('ActiveConnectionsFilterAction - test if view is called refresh results if action is toggled', (done) => { - let connectionManagementService = createConnectionManagementService(true, undefined); - let instantiationService = TypeMoq.Mock.ofType(InstantiationService, TypeMoq.MockBehavior.Loose); instantiationService.setup(x => x.createInstance(TypeMoq.It.isAny())).returns((input) => { return new Promise((resolve) => resolve({})); @@ -247,8 +242,6 @@ suite('SQL Connection Tree Action tests', () => { }); test('RecentConnectionsFilterAction - test if view is called to display filtered results', (done) => { - let connectionManagementService = createConnectionManagementService(true, undefined); - let instantiationService = TypeMoq.Mock.ofType(InstantiationService, TypeMoq.MockBehavior.Loose); instantiationService.setup(x => x.createInstance(TypeMoq.It.isAny())).returns((input) => { return new Promise((resolve) => resolve({})); @@ -257,15 +250,13 @@ suite('SQL Connection Tree Action tests', () => { let serverTreeView = TypeMoq.Mock.ofType(ServerTreeView, TypeMoq.MockBehavior.Strict, undefined, instantiationService.object, undefined, undefined, undefined, undefined, capabilitiesService); serverTreeView.setup(x => x.showFilteredTree(TypeMoq.It.isAnyString())); serverTreeView.setup(x => x.refreshTree()); - let connectionTreeAction: RecentConnectionsFilterAction = new RecentConnectionsFilterAction(RecentConnectionsFilterAction.ID, RecentConnectionsFilterAction.LABEL, serverTreeView.object, connectionManagementService.object); + let connectionTreeAction: RecentConnectionsFilterAction = new RecentConnectionsFilterAction(RecentConnectionsFilterAction.ID, RecentConnectionsFilterAction.LABEL, serverTreeView.object); connectionTreeAction.run().then((value) => { serverTreeView.verify(x => x.showFilteredTree('recent'), TypeMoq.Times.once()); }).then(() => done(), (err) => done(err)); }); test('RecentConnectionsFilterAction - test if view is called refresh results if action is toggled', (done) => { - let connectionManagementService = createConnectionManagementService(true, undefined); - let instantiationService = TypeMoq.Mock.ofType(InstantiationService, TypeMoq.MockBehavior.Loose); instantiationService.setup(x => x.createInstance(TypeMoq.It.isAny())).returns((input) => { return new Promise((resolve) => resolve({})); @@ -274,7 +265,7 @@ suite('SQL Connection Tree Action tests', () => { let serverTreeView = TypeMoq.Mock.ofType(ServerTreeView, TypeMoq.MockBehavior.Strict, undefined, instantiationService.object, undefined, undefined, undefined, undefined, capabilitiesService); serverTreeView.setup(x => x.showFilteredTree(TypeMoq.It.isAnyString())); serverTreeView.setup(x => x.refreshTree()); - let connectionTreeAction: RecentConnectionsFilterAction = new RecentConnectionsFilterAction(RecentConnectionsFilterAction.ID, RecentConnectionsFilterAction.LABEL, serverTreeView.object, connectionManagementService.object); + let connectionTreeAction: RecentConnectionsFilterAction = new RecentConnectionsFilterAction(RecentConnectionsFilterAction.ID, RecentConnectionsFilterAction.LABEL, serverTreeView.object); connectionTreeAction.isSet = true; connectionTreeAction.run().then((value) => { serverTreeView.verify(x => x.refreshTree(), TypeMoq.Times.once()); diff --git a/src/sql/workbench/parts/profiler/browser/profilerActions.ts b/src/sql/workbench/parts/profiler/browser/profilerActions.ts index 36a5613e56..adb0d894d9 100644 --- a/src/sql/workbench/parts/profiler/browser/profilerActions.ts +++ b/src/sql/workbench/parts/profiler/browser/profilerActions.ts @@ -15,9 +15,7 @@ import { Action } from 'vs/base/common/actions'; import * as nls from 'vs/nls'; import { IEditorAction } from 'vs/editor/common/editorCommon'; import { IEditorService, ACTIVE_GROUP } from 'vs/workbench/services/editor/common/editorService'; -import { ICommandService } from 'vs/platform/commands/common/commands'; import { IInstantiationService, ServicesAccessor } from 'vs/platform/instantiation/common/instantiation'; -import { INotificationService } from 'vs/platform/notification/common/notification'; export class ProfilerConnect extends Action { private static readonly ConnectText = nls.localize('profilerAction.connect', "Connect"); @@ -88,9 +86,7 @@ export class ProfilerCreate extends Action { constructor( id: string, label: string, - @ICommandService private _commandService: ICommandService, - @IProfilerService private _profilerService: IProfilerService, - @INotificationService private _notificationService: INotificationService + @IProfilerService private _profilerService: IProfilerService ) { super(id, label, 'add'); } diff --git a/src/sql/workbench/parts/profiler/browser/profilerFindWidget.ts b/src/sql/workbench/parts/profiler/browser/profilerFindWidget.ts index 0d7fd6bd1f..764892b122 100644 --- a/src/sql/workbench/parts/profiler/browser/profilerFindWidget.ts +++ b/src/sql/workbench/parts/profiler/browser/profilerFindWidget.ts @@ -505,87 +505,6 @@ export class FindWidget extends Widget implements IOverlayWidget, IHorizontalSas } } -interface ISimpleCheckboxOpts { - parent: HTMLElement; - title: string; - onChange: () => void; -} - -class SimpleCheckbox extends Widget { - - private static _COUNTER = 0; - - private _opts: ISimpleCheckboxOpts; - private _domNode: HTMLElement; - private _checkbox: HTMLInputElement; - private _label: HTMLLabelElement; - - constructor(opts: ISimpleCheckboxOpts) { - super(); - this._opts = opts; - - this._domNode = document.createElement('div'); - this._domNode.className = 'monaco-checkbox'; - this._domNode.title = this._opts.title; - this._domNode.tabIndex = 0; - - this._checkbox = document.createElement('input'); - this._checkbox.type = 'checkbox'; - this._checkbox.className = 'checkbox'; - this._checkbox.id = 'checkbox-' + SimpleCheckbox._COUNTER++; - this._checkbox.tabIndex = -1; - - this._label = document.createElement('label'); - this._label.className = 'label'; - // Connect the label and the checkbox. Checkbox will get checked when the label recieves a click. - this._label.htmlFor = this._checkbox.id; - this._label.tabIndex = -1; - - this._domNode.appendChild(this._checkbox); - this._domNode.appendChild(this._label); - - this._opts.parent.appendChild(this._domNode); - - this.onchange(this._checkbox, (e) => { - this._opts.onChange(); - }); - } - - public get domNode(): HTMLElement { - return this._domNode; - } - - public get checked(): boolean { - return this._checkbox.checked; - } - - public set checked(newValue: boolean) { - this._checkbox.checked = newValue; - } - - public focus(): void { - this._checkbox.focus(); - } - - private enable(): void { - this._checkbox.removeAttribute('disabled'); - } - - private disable(): void { - this._checkbox.disabled = true; - } - - public setEnabled(enabled: boolean): void { - if (enabled) { - this.enable(); - this.domNode.tabIndex = 0; - } else { - this.disable(); - this.domNode.tabIndex = -1; - } - } -} - interface ISimpleButtonOpts { label: string; className: string; diff --git a/src/sql/workbench/parts/profiler/browser/profilerInput.ts b/src/sql/workbench/parts/profiler/browser/profilerInput.ts index 111d3b7359..6e5a2174c3 100644 --- a/src/sql/workbench/parts/profiler/browser/profilerInput.ts +++ b/src/sql/workbench/parts/profiler/browser/profilerInput.ts @@ -13,7 +13,6 @@ import * as nls from 'vs/nls'; import { EditorInput, ConfirmResult } from 'vs/workbench/common/editor'; import { IEditorModel } from 'vs/platform/editor/common/editor'; -import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation'; import { INotificationService } from 'vs/platform/notification/common/notification'; import { Event, Emitter } from 'vs/base/common/event'; import { generateUuid } from 'vs/base/common/uuid'; @@ -46,7 +45,6 @@ export class ProfilerInput extends EditorInput implements IProfilerSession { constructor( public connection: IConnectionProfile, - @IInstantiationService private _instantiationService: IInstantiationService, @IProfilerService private _profilerService: IProfilerService, @INotificationService private _notificationService: INotificationService, @IDialogService private _dialogService: IDialogService diff --git a/src/sql/workbench/parts/query/browser/actions.ts b/src/sql/workbench/parts/query/browser/actions.ts index 73db1c29ee..e7e643bae8 100644 --- a/src/sql/workbench/parts/query/browser/actions.ts +++ b/src/sql/workbench/parts/query/browser/actions.ts @@ -22,7 +22,6 @@ import { GridTableState } from 'sql/workbench/parts/query/common/gridPanelState' import * as Constants from 'sql/workbench/contrib/extensions/common/constants'; import { IAdsTelemetryService } from 'sql/platform/telemetry/common/telemetry'; import * as TelemetryKeys from 'sql/platform/telemetry/common/telemetryKeys'; -import { IEnvironmentService } from 'vs/platform/environment/common/environment'; import { getErrorMessage } from 'vs/base/common/errors'; export interface IGridActionContext { @@ -212,8 +211,7 @@ export class ChartDataAction extends Action { constructor( @IEditorService private editorService: IEditorService, - @IExtensionTipsService private readonly extensionTipsService: IExtensionTipsService, - @IEnvironmentService private readonly environmentService: IEnvironmentService + @IExtensionTipsService private readonly extensionTipsService: IExtensionTipsService ) { super(ChartDataAction.ID, ChartDataAction.LABEL, ChartDataAction.ICON); } diff --git a/src/sql/workbench/parts/query/browser/query.contribution.ts b/src/sql/workbench/parts/query/browser/query.contribution.ts index f60d40af47..dd8c042533 100644 --- a/src/sql/workbench/parts/query/browser/query.contribution.ts +++ b/src/sql/workbench/parts/query/browser/query.contribution.ts @@ -40,8 +40,6 @@ import { CommandsRegistry, ICommandService } from 'vs/platform/commands/common/c import { ManageActionContext } from 'sql/workbench/browser/actions'; import { ItemContextKey } from 'sql/workbench/parts/dashboard/browser/widgets/explorer/explorerTreeContext'; -const gridCommandsWeightBonus = 100; // give our commands a little bit more weight over other default list/tree commands - export const QueryEditorVisibleCondition = ContextKeyExpr.has(queryContext.queryEditorVisibleId); export const ResultsGridFocusCondition = ContextKeyExpr.and(ContextKeyExpr.has(queryContext.resultsVisibleId), ContextKeyExpr.has(queryContext.resultsGridFocussedId)); export const ResultsMessagesFocusCondition = ContextKeyExpr.and(ContextKeyExpr.has(queryContext.resultsVisibleId), ContextKeyExpr.has(queryContext.resultsMessagesFocussedId)); diff --git a/src/sql/workbench/parts/query/browser/queryActions.ts b/src/sql/workbench/parts/query/browser/queryActions.ts index 6465f1e1a0..e37af13aff 100644 --- a/src/sql/workbench/parts/query/browser/queryActions.ts +++ b/src/sql/workbench/parts/query/browser/queryActions.ts @@ -6,7 +6,7 @@ import 'vs/css!./media/queryActions'; import * as nls from 'vs/nls'; import { Action, IActionViewItem, IActionRunner } from 'vs/base/common/actions'; -import { IDisposable, dispose, Disposable } from 'vs/base/common/lifecycle'; +import { IDisposable, Disposable } from 'vs/base/common/lifecycle'; import { IContextViewService } from 'vs/platform/contextview/browser/contextView'; import { IConfigurationService } from 'vs/platform/configuration/common/configuration'; import { IThemeService } from 'vs/platform/theme/common/themeService'; @@ -546,10 +546,6 @@ export class ToggleSqlCmdModeAction extends QueryTaskbarAction { this.isSqlCmdMode ? this.updateCssClass(ToggleSqlCmdModeAction.DisableSqlcmdClass) : this.updateCssClass(ToggleSqlCmdModeAction.EnableSqlcmdClass); } - private setSqlCmdModeFalse() { - - } - public async run(): Promise { const toSqlCmdState = !this.isSqlCmdMode; // input.state change triggers event that changes this.isSqlCmdMode, so store it before using this.editor.input.state.isSqlCmdMode = toSqlCmdState; diff --git a/src/sql/workbench/parts/query/browser/queryEditor.ts b/src/sql/workbench/parts/query/browser/queryEditor.ts index 27b9e6489f..4326efd354 100644 --- a/src/sql/workbench/parts/query/browser/queryEditor.ts +++ b/src/sql/workbench/parts/query/browser/queryEditor.ts @@ -6,7 +6,7 @@ import 'vs/css!./media/queryEditor'; import * as DOM from 'vs/base/browser/dom'; -import { EditorOptions, IEditorControl, IEditorMemento, IEditorCloseEvent } from 'vs/workbench/common/editor'; +import { EditorOptions, IEditorControl, IEditorMemento } from 'vs/workbench/common/editor'; import { BaseEditor, EditorMemento } from 'vs/workbench/browser/parts/editor/baseEditor'; import { Orientation } from 'vs/base/browser/ui/sash/sash'; import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry'; diff --git a/src/sql/workbench/parts/query/browser/queryResultsView.ts b/src/sql/workbench/parts/query/browser/queryResultsView.ts index 3ee919b0e3..3a14e2d2ff 100644 --- a/src/sql/workbench/parts/query/browser/queryResultsView.ts +++ b/src/sql/workbench/parts/query/browser/queryResultsView.ts @@ -23,7 +23,6 @@ import { dispose, Disposable, DisposableStore } from 'vs/base/common/lifecycle'; import { attachTabbedPanelStyler } from 'sql/platform/theme/common/styler'; import { IThemeService } from 'vs/platform/theme/common/themeService'; import { Event } from 'vs/base/common/event'; -import { find } from 'vs/base/common/arrays'; import { startsWith } from 'vs/base/common/strings'; class MessagesView extends Disposable implements IPanelView { diff --git a/src/sql/workbench/parts/query/test/browser/queryActions.test.ts b/src/sql/workbench/parts/query/test/browser/queryActions.test.ts index 00214cafbe..ad5f78da6b 100644 --- a/src/sql/workbench/parts/query/test/browser/queryActions.test.ts +++ b/src/sql/workbench/parts/query/test/browser/queryActions.test.ts @@ -112,7 +112,6 @@ suite('SQL QueryAction Tests', () => { // ... Create assert variables let isConnected: boolean = undefined; let connectionParams: INewConnectionParams = undefined; - let calledRunQuery: boolean = false; let countCalledShowDialog: number = 0; // ... Mock "showDialog" ConnectionDialogService @@ -131,9 +130,7 @@ suite('SQL QueryAction Tests', () => { // ... Mock QueryModelService let queryModelService = TypeMoq.Mock.ofType(QueryModelService, TypeMoq.MockBehavior.Loose); - queryModelService.setup(x => x.runQuery(TypeMoq.It.isAny(), undefined, TypeMoq.It.isAny(), TypeMoq.It.isAny())).callback(() => { - calledRunQuery = true; - }); + queryModelService.setup(x => x.runQuery(TypeMoq.It.isAny(), undefined, TypeMoq.It.isAny(), TypeMoq.It.isAny())); // If I call run on RunQueryAction when I am not connected let queryAction: RunQueryAction = new RunQueryAction(editor.object, queryModelService.object, connectionManagementService.object); diff --git a/src/sql/workbench/parts/queryPlan/browser/queryPlan.component.ts b/src/sql/workbench/parts/queryPlan/browser/queryPlan.component.ts index 8d6ed8ae9c..ac6efff6f7 100644 --- a/src/sql/workbench/parts/queryPlan/browser/queryPlan.component.ts +++ b/src/sql/workbench/parts/queryPlan/browser/queryPlan.component.ts @@ -5,7 +5,7 @@ import 'vs/css!./media/qp'; -import { ElementRef, Component, Inject, forwardRef, OnDestroy, OnInit, ViewChild } from '@angular/core'; +import { ElementRef, Component, Inject, OnDestroy, OnInit, ViewChild } from '@angular/core'; import * as QP from 'html-query-plan'; import { IQueryPlanParams, IBootstrapParams } from 'sql/workbench/services/bootstrap/common/bootstrapParams'; @@ -30,7 +30,6 @@ export class QueryPlanComponent implements OnDestroy, OnInit { @ViewChild('container', { read: ElementRef }) _container: ElementRef; constructor( - @Inject(forwardRef(() => ElementRef)) private _el: ElementRef, @Inject(IBootstrapParams) private _params: IQueryPlanParams ) { } diff --git a/src/sql/workbench/parts/tasks/browser/tasksRenderer.ts b/src/sql/workbench/parts/tasks/browser/tasksRenderer.ts index be330baead..54674a98f2 100644 --- a/src/sql/workbench/parts/tasks/browser/tasksRenderer.ts +++ b/src/sql/workbench/parts/tasks/browser/tasksRenderer.ts @@ -29,7 +29,6 @@ export interface ITaskHistoryTemplateData { export class TaskHistoryRenderer implements IRenderer { public static readonly TASKOBJECT_HEIGHT = 22; - private static readonly TASKOBJECT_TEMPLATE_ID = 'carbonTask'; private static readonly FAIL_CLASS = 'error'; private static readonly SUCCESS_CLASS = 'success'; private static readonly INPROGRESS_CLASS = 'in-progress'; diff --git a/src/sql/workbench/parts/tasks/browser/tasksView.ts b/src/sql/workbench/parts/tasks/browser/tasksView.ts index 46d839b37a..f75f524a1b 100644 --- a/src/sql/workbench/parts/tasks/browser/tasksView.ts +++ b/src/sql/workbench/parts/tasks/browser/tasksView.ts @@ -10,7 +10,7 @@ import { Tree } from 'vs/base/parts/tree/browser/treeImpl'; import { IThemeService } from 'vs/platform/theme/common/themeService'; import { attachListStyler } from 'vs/platform/theme/common/styler'; import { ITree } from 'vs/base/parts/tree/browser/tree'; -import { dispose, Disposable } from 'vs/base/common/lifecycle'; +import { Disposable } from 'vs/base/common/lifecycle'; import { DefaultFilter, DefaultDragAndDrop, DefaultAccessibilityProvider } from 'vs/base/parts/tree/browser/treeDefaults'; import { localize } from 'vs/nls'; import { hide, $, append } from 'vs/base/browser/dom'; diff --git a/src/sql/workbench/parts/tasks/common/tasksAction.ts b/src/sql/workbench/parts/tasks/common/tasksAction.ts index a2fe4d38ee..2a3898ceb6 100644 --- a/src/sql/workbench/parts/tasks/common/tasksAction.ts +++ b/src/sql/workbench/parts/tasks/common/tasksAction.ts @@ -6,7 +6,7 @@ import { localize } from 'vs/nls'; import { Action } from 'vs/base/common/actions'; import { ITaskService } from 'sql/platform/tasks/common/tasksService'; -import { TaskNode, TaskExecutionMode, TaskStatus } from 'sql/platform/tasks/common/tasksNode'; +import { TaskNode } from 'sql/platform/tasks/common/tasksNode'; import { IQueryEditorService } from 'sql/workbench/services/queryEditor/common/queryEditorService'; import Severity from 'vs/base/common/severity'; import { IErrorMessageService } from 'sql/platform/errorMessage/common/errorMessageService'; diff --git a/src/sql/workbench/services/connection/browser/connectionDialogService.ts b/src/sql/workbench/services/connection/browser/connectionDialogService.ts index 178b9b2c92..7971c14acc 100644 --- a/src/sql/workbench/services/connection/browser/connectionDialogService.ts +++ b/src/sql/workbench/services/connection/browser/connectionDialogService.ts @@ -27,7 +27,6 @@ import * as types from 'vs/base/common/types'; import { trim } from 'vs/base/common/strings'; import { localize } from 'vs/nls'; import { IConfigurationService } from 'vs/platform/configuration/common/configuration'; -import { IWorkbenchLayoutService } from 'vs/workbench/services/layout/browser/layoutService'; import { CmsConnectionController } from 'sql/workbench/services/connection/browser/cmsConnectionController'; import { entries } from 'sql/base/common/collections'; import { find } from 'vs/base/common/arrays'; @@ -81,7 +80,6 @@ export class ConnectionDialogService implements IConnectionDialogService { private _connectionManagementService: IConnectionManagementService; constructor( - @IWorkbenchLayoutService private layoutService: IWorkbenchLayoutService, @IInstantiationService private _instantiationService: IInstantiationService, @ICapabilitiesService private _capabilitiesService: ICapabilitiesService, @IErrorMessageService private _errorMessageService: IErrorMessageService, diff --git a/src/sql/workbench/services/connection/test/browser/connectionDialogService.test.ts b/src/sql/workbench/services/connection/test/browser/connectionDialogService.test.ts index bea6f38db0..dd60ed0316 100644 --- a/src/sql/workbench/services/connection/test/browser/connectionDialogService.test.ts +++ b/src/sql/workbench/services/connection/test/browser/connectionDialogService.test.ts @@ -21,7 +21,7 @@ suite('ConnectionDialogService tests', () => { setup(() => { let errorMessageService = getMockErrorMessageService(); - connectionDialogService = new ConnectionDialogService(undefined, undefined, undefined, errorMessageService.object, + connectionDialogService = new ConnectionDialogService(undefined, undefined, errorMessageService.object, undefined, undefined, undefined); mockConnectionManagementService = TypeMoq.Mock.ofType(ConnectionManagementService, TypeMoq.MockBehavior.Strict, {}, {}, new TestStorageService()); (connectionDialogService as any)._connectionManagementService = mockConnectionManagementService.object; diff --git a/src/sql/workbench/services/dialog/browser/dialogContainer.component.ts b/src/sql/workbench/services/dialog/browser/dialogContainer.component.ts index 5dce670fc2..ccbcfe9aa6 100644 --- a/src/sql/workbench/services/dialog/browser/dialogContainer.component.ts +++ b/src/sql/workbench/services/dialog/browser/dialogContainer.component.ts @@ -44,7 +44,7 @@ export interface DialogComponentParams extends IBootstrapParams { export class DialogContainer implements AfterViewInit { private _onResize = new Emitter(); public readonly onResize: Event = this._onResize.event; - private _dialogPane: DialogPane; + public _dialogPane: DialogPane; public modelViewId: string; @ViewChild(ModelViewContent) private _modelViewContent: ModelViewContent; diff --git a/src/sql/workbench/services/dialog/browser/dialogModal.ts b/src/sql/workbench/services/dialog/browser/dialogModal.ts index b0ac5d9d58..e2c3598c8f 100644 --- a/src/sql/workbench/services/dialog/browser/dialogModal.ts +++ b/src/sql/workbench/services/dialog/browser/dialogModal.ts @@ -31,7 +31,6 @@ export class DialogModal extends Modal { private _onCancel = new Emitter(); // Buttons - private _cancelButton: Button; private _doneButton: Button; constructor( @@ -75,7 +74,7 @@ export class DialogModal extends Modal { this._dialog.onValidityChanged(valid => { this._doneButton.enabled = valid && this._dialog.okButton.enabled; }); - this._cancelButton = this.addDialogButton(this._dialog.cancelButton, () => this.cancel(), false); + this.addDialogButton(this._dialog.cancelButton, () => this.cancel(), false); this._dialog.cancelButton.registerClickEvent(this._onCancel.event); let messageChangeHandler = (message: DialogMessage) => { diff --git a/src/sql/workbench/services/dialog/browser/wizardModal.ts b/src/sql/workbench/services/dialog/browser/wizardModal.ts index 52e58f9a6b..4115553011 100644 --- a/src/sql/workbench/services/dialog/browser/wizardModal.ts +++ b/src/sql/workbench/services/dialog/browser/wizardModal.ts @@ -34,15 +34,12 @@ export class WizardModal extends Modal { // Wizard HTML elements private _body: HTMLElement; - private _messageAndPageContainer: HTMLElement; private _pageContainer: HTMLElement; // Buttons private _previousButton: Button; private _nextButton: Button; - private _generateScriptButton: Button; private _doneButton: Button; - private _cancelButton: Button; constructor( private _wizard: Wizard, @@ -83,10 +80,10 @@ export class WizardModal extends Modal { this._previousButton = this.addDialogButton(this._wizard.backButton, () => this.showPage(this._wizard.currentPage - 1)); this._nextButton = this.addDialogButton(this._wizard.nextButton, () => this.showPage(this._wizard.currentPage + 1, true, true), true, true); - this._generateScriptButton = this.addDialogButton(this._wizard.generateScriptButton, () => undefined); + this.addDialogButton(this._wizard.generateScriptButton, () => undefined); this._doneButton = this.addDialogButton(this._wizard.doneButton, () => this.done(), false, true); this._wizard.doneButton.registerClickEvent(this._onDone.event); - this._cancelButton = this.addDialogButton(this._wizard.cancelButton, () => this.cancel(), false); + this.addDialogButton(this._wizard.cancelButton, () => this.cancel(), false); this._wizard.cancelButton.registerClickEvent(this._onCancel.event); let messageChangeHandler = (message: DialogMessage) => { @@ -133,7 +130,6 @@ export class WizardModal extends Modal { this.initializeNavigation(this._body); const mpContainer = append(this._body, $('div.dialog-message-and-page-container')); - this._messageAndPageContainer = mpContainer; mpContainer.append(this._messageElement); this._pageContainer = append(mpContainer, $('div.dialogModal-page-container')); diff --git a/src/sql/workbench/services/dialog/browser/wizardNavigation.component.ts b/src/sql/workbench/services/dialog/browser/wizardNavigation.component.ts index 84533d0c0c..27014fd947 100644 --- a/src/sql/workbench/services/dialog/browser/wizardNavigation.component.ts +++ b/src/sql/workbench/services/dialog/browser/wizardNavigation.component.ts @@ -41,7 +41,6 @@ export class WizardNavigation implements AfterViewInit { @ViewChild('container', { read: ElementRef }) private _container: ElementRef; constructor( - @Inject(forwardRef(() => ElementRef)) private _el: ElementRef, @Inject(forwardRef(() => ChangeDetectorRef)) private _changeRef: ChangeDetectorRef, @Inject(IBootstrapParams) private _params: WizardNavigationParams, @Inject(IWorkbenchThemeService) private _themeService: IWorkbenchThemeService) { diff --git a/src/sql/workbench/services/fileBrowser/browser/fileBrowserTreeView.ts b/src/sql/workbench/services/fileBrowser/browser/fileBrowserTreeView.ts index 413e7be7d8..0102e3268b 100644 --- a/src/sql/workbench/services/fileBrowser/browser/fileBrowserTreeView.ts +++ b/src/sql/workbench/services/fileBrowser/browser/fileBrowserTreeView.ts @@ -9,7 +9,7 @@ import { FileBrowserRenderer } from 'sql/workbench/services/fileBrowser/browser/ import { IFileBrowserService } from 'sql/platform/fileBrowser/common/interfaces'; import { FileNode } from 'sql/workbench/services/fileBrowser/common/fileNode'; import errors = require('vs/base/common/errors'); -import { IDisposable, dispose, Disposable } from 'vs/base/common/lifecycle'; +import { IDisposable, Disposable } from 'vs/base/common/lifecycle'; import * as DOM from 'vs/base/browser/dom'; import nls = require('vs/nls'); import { DefaultFilter, DefaultAccessibilityProvider, DefaultDragAndDrop } from 'vs/base/parts/tree/browser/treeDefaults'; diff --git a/src/sql/workbench/services/notebook/browser/notebookServiceImpl.ts b/src/sql/workbench/services/notebook/browser/notebookServiceImpl.ts index 66de972ad8..df48f34848 100644 --- a/src/sql/workbench/services/notebook/browser/notebookServiceImpl.ts +++ b/src/sql/workbench/services/notebook/browser/notebookServiceImpl.ts @@ -73,7 +73,7 @@ const notebookRegistry = Registry.as(Extensions.Noteb class ProviderDescriptor { private _instanceReady = new Deferred(); - constructor(private providerId: string, private _instance?: INotebookProvider) { + constructor(private _instance?: INotebookProvider) { if (_instance) { this._instanceReady.resolve(_instance); } @@ -243,7 +243,7 @@ export class NotebookService extends Disposable implements INotebookService { let registration = p.registration; if (!this._providers.has(p.id)) { - this._providers.set(p.id, new ProviderDescriptor(p.id)); + this._providers.set(p.id, new ProviderDescriptor()); } if (registration.fileExtensions) { if (Array.isArray(registration.fileExtensions)) { @@ -266,7 +266,7 @@ export class NotebookService extends Disposable implements INotebookService { // Update, which will resolve the promise for anyone waiting on the instance to be registered providerDescriptor.instance = instance; } else { - this._providers.set(providerId, new ProviderDescriptor(providerId, instance)); + this._providers.set(providerId, new ProviderDescriptor(instance)); } } diff --git a/src/sql/workbench/services/notebook/browser/sql/sqlSessionManager.ts b/src/sql/workbench/services/notebook/browser/sql/sqlSessionManager.ts index 6de3d0b718..b8fe1e59e2 100644 --- a/src/sql/workbench/services/notebook/browser/sql/sqlSessionManager.ts +++ b/src/sql/workbench/services/notebook/browser/sql/sqlSessionManager.ts @@ -98,7 +98,6 @@ export class SqlSessionManager implements nb.SessionManager { export class SqlSession implements nb.ISession { private _kernel: SqlKernel; private _defaultKernelLoaded = false; - private _currentConnection: IConnectionProfile; public set defaultKernelLoaded(value) { this._defaultKernelLoaded = value; diff --git a/src/sql/workbench/services/objectExplorer/test/browser/objectExplorerService.test.ts b/src/sql/workbench/services/objectExplorer/test/browser/objectExplorerService.test.ts index 3080b24ebe..f74d15092f 100644 --- a/src/sql/workbench/services/objectExplorer/test/browser/objectExplorerService.test.ts +++ b/src/sql/workbench/services/objectExplorer/test/browser/objectExplorerService.test.ts @@ -14,7 +14,7 @@ import * as TypeMoq from 'typemoq'; import * as assert from 'assert'; import { ServerTreeView } from 'sql/workbench/parts/objectExplorer/browser/serverTreeView'; import { ConnectionOptionSpecialType, ServiceOptionType } from 'sql/workbench/api/common/sqlExtHostTypes'; -import { Event, Emitter } from 'vs/base/common/event'; +import { Event } from 'vs/base/common/event'; import { mssqlProviderName } from 'sql/platform/connection/common/constants'; import { NullLogService } from 'vs/platform/log/common/log'; import { TestObjectExplorerProvider } from 'sql/workbench/services/objectExplorer/test/common/testObjectExplorerProvider'; @@ -127,7 +127,6 @@ suite('SQL Object Explorer Service tests', () => { sqlOEProvider = TypeMoq.Mock.ofType(TestObjectExplorerProvider, TypeMoq.MockBehavior.Loose); sqlOEProvider.callBase = true; - let onCapabilitiesRegistered = new Emitter(); let sqlProvider = { providerId: mssqlProviderName, displayName: 'MSSQL', @@ -265,12 +264,6 @@ suite('SQL Object Explorer Service tests', () => { connectionManagementService.setup(x => x.getCapabilities(mssqlProviderName)).returns(() => undefined); - let extensionManagementServiceMock = { - getInstalled: () => { - return Promise.resolve([]); - } - }; - const logService = new NullLogService(); objectExplorerService = new ObjectExplorerService(connectionManagementService.object, undefined, capabilitiesService, logService); objectExplorerService.registerProvider(mssqlProviderName, sqlOEProvider.object); diff --git a/src/sql/workbench/services/queryEditor/browser/queryEditorService.ts b/src/sql/workbench/services/queryEditor/browser/queryEditorService.ts index 854de76fd7..5e4be23997 100644 --- a/src/sql/workbench/services/queryEditor/browser/queryEditorService.ts +++ b/src/sql/workbench/services/queryEditor/browser/queryEditorService.ts @@ -8,7 +8,6 @@ import { QueryInput } from 'sql/workbench/parts/query/common/queryInput'; import { EditDataInput } from 'sql/workbench/parts/editData/browser/editDataInput'; import { IConnectableInput, IConnectionManagementService } from 'sql/platform/connection/common/connectionManagement'; import { IQueryEditorService, IQueryEditorOptions } from 'sql/workbench/services/queryEditor/common/queryEditorService'; -import { QueryPlanInput } from 'sql/workbench/parts/queryPlan/common/queryPlanInput'; import { sqlModeId, untitledFilePrefix, getSupportedInputResource } from 'sql/workbench/browser/customInputConverter'; import * as TaskUtilities from 'sql/workbench/browser/taskUtilities'; diff --git a/src/sql/workbench/test/browser/taskUtilities.test.ts b/src/sql/workbench/test/browser/taskUtilities.test.ts index b56a6ff119..c979059fff 100644 --- a/src/sql/workbench/test/browser/taskUtilities.test.ts +++ b/src/sql/workbench/test/browser/taskUtilities.test.ts @@ -10,9 +10,6 @@ import { IObjectExplorerService } from 'sql/workbench/services/objectExplorer/br import { TestConnectionManagementService } from 'sql/platform/connection/test/common/testConnectionManagementService'; import { IConnectionProfile } from 'sql/platform/connection/common/interfaces'; import { ConnectionProfile } from 'sql/platform/connection/common/connectionProfile'; -import { URI } from 'vs/base/common/uri'; -import { UntitledEditorInput } from 'vs/workbench/common/editor/untitledEditorInput'; -import { QueryInput } from 'sql/workbench/parts/query/common/queryInput'; import { TestEditorService } from 'vs/workbench/test/workbenchTestServices'; import { assign } from 'vs/base/common/objects'; @@ -76,8 +73,6 @@ suite('TaskUtilities', function () { // Mock the workbench service to return the active tab connection let tabConnectionUri = 'file://test_uri'; - let editorInput = new UntitledEditorInput(URI.parse(tabConnectionUri), false, undefined, undefined, undefined, undefined, undefined, undefined); - let queryInput = new QueryInput(undefined, editorInput, undefined, undefined, undefined, undefined, undefined, undefined); mockConnectionManagementService.setup(x => x.getConnectionProfile(tabConnectionUri)).returns(() => tabProfile); // If I call getCurrentGlobalConnection, it should return the expected profile from the active tab diff --git a/src/sql/workbench/test/electron-browser/api/extHostModelView.test.ts b/src/sql/workbench/test/electron-browser/api/extHostModelView.test.ts index e498168152..00153d6c50 100644 --- a/src/sql/workbench/test/electron-browser/api/extHostModelView.test.ts +++ b/src/sql/workbench/test/electron-browser/api/extHostModelView.test.ts @@ -29,7 +29,6 @@ suite('ExtHostModelView Validation Tests', () => { let widgetId = 'widget_id'; let handle = 1; // let viewInitialized: Deferred; - let initializedModels: IComponentShape[]; setup(done => { // Set up the MainThreadModelViewShape proxy @@ -222,8 +221,7 @@ suite('ExtHostModelView Validation Tests', () => { test('Inserting and removing components from a container should work correctly', () => { // Set up the mock proxy to save the component that gets initialized so that it can be verified - let rootComponent: IComponentShape; - mockProxy.setup(x => x.$initializeModel(It.isAny(), It.isAny())).callback((handle, componentShape) => rootComponent = componentShape); + mockProxy.setup(x => x.$initializeModel(It.isAny(), It.isAny())); mockProxy.setup(x => x.$addToContainer(It.isAny(), It.isAny(), It.isAny(), undefined)).returns(() => Promise.resolve()); mockProxy.setup(x => x.$addToContainer(It.isAny(), It.isAny(), It.isAny(), It.isAny())).returns(() => Promise.resolve()); mockProxy.setup(x => x.$removeFromContainer(It.isAny(), It.isAny(), It.isAny())).returns(() => Promise.resolve()); @@ -306,8 +304,7 @@ suite('ExtHostModelView Validation Tests', () => { test('Removing a component that does not exist does not fail', () => { // Set up the mock proxy to save the component that gets initialized so that it can be verified - let rootComponent: IComponentShape; - mockProxy.setup(x => x.$initializeModel(It.isAny(), It.isAny())).callback((handle, componentShape) => rootComponent = componentShape); + mockProxy.setup(x => x.$initializeModel(It.isAny(), It.isAny())); mockProxy.setup(x => x.$addToContainer(It.isAny(), It.isAny(), It.isAny(), undefined)).returns(() => Promise.resolve()); mockProxy.setup(x => x.$addToContainer(It.isAny(), It.isAny(), It.isAny(), It.isAny())).returns(() => Promise.resolve()); diff --git a/src/sql/workbench/test/electron-browser/api/mainThreadModelViewDialog.test.ts b/src/sql/workbench/test/electron-browser/api/mainThreadModelViewDialog.test.ts index 8a7be0acaf..cd66d67f1e 100644 --- a/src/sql/workbench/test/electron-browser/api/mainThreadModelViewDialog.test.ts +++ b/src/sql/workbench/test/electron-browser/api/mainThreadModelViewDialog.test.ts @@ -65,7 +65,7 @@ suite('MainThreadModelViewDialog Tests', () => { let extHostContext = { getProxy: proxyType => mockExtHostModelViewDialog.object }; - mainThreadModelViewDialog = new MainThreadModelViewDialog(extHostContext, undefined, undefined, undefined); + mainThreadModelViewDialog = new MainThreadModelViewDialog(extHostContext, undefined, undefined); // Set up the mock dialog service mockDialogService = Mock.ofType(CustomDialogService, undefined); diff --git a/src/sql/workbench/test/electron-browser/api/mainThreadNotebook.test.ts b/src/sql/workbench/test/electron-browser/api/mainThreadNotebook.test.ts index 707c321537..b0518062a7 100644 --- a/src/sql/workbench/test/electron-browser/api/mainThreadNotebook.test.ts +++ b/src/sql/workbench/test/electron-browser/api/mainThreadNotebook.test.ts @@ -42,10 +42,8 @@ suite('MainThreadNotebook Tests', () => { suite('On registering a provider', () => { let provider: INotebookProvider; - let registeredProviderId: string; setup(() => { mockNotebookService.setup(s => s.registerProvider(TypeMoq.It.isAnyString(), TypeMoq.It.isAny())).returns((id, providerImpl) => { - registeredProviderId = id; provider = providerImpl; }); }); diff --git a/src/tsconfig.base.json b/src/tsconfig.base.json index ac827b6c21..e67b902c3c 100644 --- a/src/tsconfig.base.json +++ b/src/tsconfig.base.json @@ -5,7 +5,7 @@ "noImplicitAny": false, "experimentalDecorators": true, "noImplicitReturns": true, - "noUnusedLocals": false, + "noUnusedLocals": true, "noImplicitThis": true, "alwaysStrict": true, "strictBindCallApply": true, diff --git a/src/vs/code/electron-browser/issue/issueReporterModel.ts b/src/vs/code/electron-browser/issue/issueReporterModel.ts index 05d964e148..6408274726 100644 --- a/src/vs/code/electron-browser/issue/issueReporterModel.ts +++ b/src/vs/code/electron-browser/issue/issueReporterModel.ts @@ -66,7 +66,7 @@ export class IssueReporterModel { Issue Type: ${this.getIssueTypeTitle()} ${this._data.issueDescription} - +${this.getExtensionVersion()} Azure Data Studio version: ${this._data.versionInfo && this._data.versionInfo.vscodeVersion} OS version: ${this._data.versionInfo && this._data.versionInfo.os} ${this.getRemoteOSes()} @@ -269,4 +269,4 @@ ${table} `; } -} \ No newline at end of file +} diff --git a/src/vs/editor/contrib/comment/comment.ts b/src/vs/editor/contrib/comment/comment.ts index 56eda9fe34..f8129f86cc 100644 --- a/src/vs/editor/contrib/comment/comment.ts +++ b/src/vs/editor/contrib/comment/comment.ts @@ -11,7 +11,7 @@ import { ICommand } from 'vs/editor/common/editorCommon'; import { EditorContextKeys } from 'vs/editor/common/editorContextKeys'; import { BlockCommentCommand } from 'vs/editor/contrib/comment/blockCommentCommand'; import { LineCommentCommand, Type } from 'vs/editor/contrib/comment/lineCommentCommand'; -import { MenuId } from 'vs/platform/actions/common/actions'; +// import { MenuId } from 'vs/platform/actions/common/actions'; import { KeybindingWeight } from 'vs/platform/keybinding/common/keybindingsRegistry'; abstract class CommentLineAction extends EditorAction { diff --git a/src/vs/editor/contrib/goToDefinition/goToDefinitionCommands.ts b/src/vs/editor/contrib/goToDefinition/goToDefinitionCommands.ts index 653f47f74b..6d1af21d7f 100644 --- a/src/vs/editor/contrib/goToDefinition/goToDefinitionCommands.ts +++ b/src/vs/editor/contrib/goToDefinition/goToDefinitionCommands.ts @@ -21,7 +21,7 @@ import { PeekContext } from 'vs/editor/contrib/referenceSearch/peekViewWidget'; import { ReferencesController } from 'vs/editor/contrib/referenceSearch/referencesController'; import { ReferencesModel } from 'vs/editor/contrib/referenceSearch/referencesModel'; import * as nls from 'vs/nls'; -import { MenuId, MenuRegistry } from 'vs/platform/actions/common/actions'; +// import { MenuId, MenuRegistry } from 'vs/platform/actions/common/actions'; import { ContextKeyExpr } from 'vs/platform/contextkey/common/contextkey'; import { KeybindingWeight } from 'vs/platform/keybinding/common/keybindingsRegistry'; import { INotificationService } from 'vs/platform/notification/common/notification'; diff --git a/src/vs/platform/extensionManagement/common/extensionGalleryService.ts b/src/vs/platform/extensionManagement/common/extensionGalleryService.ts index a596889726..3dc618b9d6 100644 --- a/src/vs/platform/extensionManagement/common/extensionGalleryService.ts +++ b/src/vs/platform/extensionManagement/common/extensionGalleryService.ts @@ -673,8 +673,8 @@ export class ExtensionGalleryService implements IExtensionGalleryService { if (result) { const r = result.results[0]; const galleryExtensions = r.extensions; - const resultCount = r.resultMetadata && r.resultMetadata.filter(m => m.metadataType === 'ResultCount')[0]; - const total = resultCount && resultCount.metadataItems.filter(i => i.name === 'TotalCount')[0].count || 0; + // const resultCount = r.resultMetadata && r.resultMetadata.filter(m => m.metadataType === 'ResultCount')[0]; {{SQL CARBON EDIT}} comment out for no unused + // const total = resultCount && resultCount.metadataItems.filter(i => i.name === 'TotalCount')[0].count || 0; {{SQL CARBON EDIT}} comment out for no unused // {{SQL CARBON EDIT}} let filteredExtensionsResult = this.createQueryResult(query, galleryExtensions); diff --git a/src/vs/platform/extensionManagement/node/extensionManagementService.ts b/src/vs/platform/extensionManagement/node/extensionManagementService.ts index 26fd2e7e01..95bf99c477 100644 --- a/src/vs/platform/extensionManagement/node/extensionManagementService.ts +++ b/src/vs/platform/extensionManagement/node/extensionManagementService.ts @@ -8,7 +8,7 @@ import * as path from 'vs/base/common/path'; import * as pfs from 'vs/base/node/pfs'; import { assign } from 'vs/base/common/objects'; import { toDisposable, Disposable } from 'vs/base/common/lifecycle'; -import { flatten, isNonEmptyArray } from 'vs/base/common/arrays'; +import { flatten/*, isNonEmptyArray*/ } from 'vs/base/common/arrays'; import { extract, ExtractError, zip, IFile } from 'vs/base/node/zip'; import { IExtensionManagementService, IExtensionGalleryService, ILocalExtension, @@ -205,7 +205,7 @@ export class ExtensionManagementService extends Disposable implements IExtension return getManifest(zipPath) .then(manifest => { const identifier = { id: getGalleryExtensionId(manifest.publisher, manifest.name) }; - let operation: InstallOperation = InstallOperation.Install; + // let operation: InstallOperation = InstallOperation.Install; {{SQL CARBON EDIT}} comment out for no unused // {{SQL CARBON EDIT - Check VSCode and ADS version}} if (manifest.engines && ((manifest.engines.vscode && !isEngineValid(manifest.engines.vscode, product.vscodeVersion)) || (manifest.engines.azdata && !isEngineValid(manifest.engines.azdata, product.version)))) { return Promise.reject(new Error(nls.localize('incompatible', "Unable to install extension '{0}' as it is not compatible with Azure Data Studio '{1}'.", identifier.id, product.version))); @@ -215,7 +215,7 @@ export class ExtensionManagementService extends Disposable implements IExtension .then(installedExtensions => { const existing = installedExtensions.filter(i => areSameExtensions(identifier, i.identifier))[0]; if (existing) { - operation = InstallOperation.Update; + // operation = InstallOperation.Update; {{SQL CARBON EDIT}} comment out for no unused if (identifierWithVersion.equals(new ExtensionIdentifierWithVersion(existing.identifier, existing.manifest.version))) { // {{SQL CARBON EDIT}} - Update VS Code product name return this.removeExtension(existing, 'existing').then(null, e => Promise.reject(new Error(nls.localize('restartCode', "Please restart Azure Data Studio before reinstalling {0}.", manifest.displayName || manifest.name)))); @@ -267,7 +267,7 @@ export class ExtensionManagementService extends Disposable implements IExtension return this.downloadService.download(vsix, URI.file(downloadedLocation)).then(() => URI.file(downloadedLocation)); } - private installFromZipPath(identifierWithVersion: ExtensionIdentifierWithVersion, zipPath: string, metadata: IGalleryMetadata | null, type: ExtensionType, operation: InstallOperation, token: CancellationToken): Promise { + /*private installFromZipPath(identifierWithVersion: ExtensionIdentifierWithVersion, zipPath: string, metadata: IGalleryMetadata | null, type: ExtensionType, operation: InstallOperation, token: CancellationToken): Promise { {{SQL CARBON EDIT}} comment out for no unused return this.toNonCancellablePromise(this.installExtension({ zipPath, identifierWithVersion, metadata }, type, token) .then(local => this.installDependenciesAndPackExtensions(local, null) .then( @@ -285,7 +285,7 @@ export class ExtensionManagementService extends Disposable implements IExtension local => { this._onDidInstallExtension.fire({ identifier: identifierWithVersion.identifier, zipPath, local, operation }); return local; }, error => { this._onDidInstallExtension.fire({ identifier: identifierWithVersion.identifier, zipPath, operation, error }); return Promise.reject(error); } )); - } + }*/ async installFromGallery(extension: IGalleryExtension): Promise { if (!this.galleryService.isEnabled()) { @@ -594,10 +594,10 @@ export class ExtensionManagementService extends Disposable implements IExtension .then(() => local); } - private getMetadata(extensionName: string): Promise { + /*private getMetadata(extensionName: string): Promise { {{SQL CARBON EDIT}} comment out function for no unused return this.findGalleryExtensionByName(extensionName) .then(galleryExtension => galleryExtension ? { id: galleryExtension.identifier.uuid, publisherDisplayName: galleryExtension.publisherDisplayName, publisherId: galleryExtension.publisherId } : null); - } + }*/ private findGalleryExtension(local: ILocalExtension): Promise { if (local.identifier.uuid) { diff --git a/src/vs/platform/telemetry/common/errorTelemetry.ts b/src/vs/platform/telemetry/common/errorTelemetry.ts index 8404c258e5..a3d4803780 100644 --- a/src/vs/platform/telemetry/common/errorTelemetry.ts +++ b/src/vs/platform/telemetry/common/errorTelemetry.ts @@ -9,7 +9,7 @@ import { toDisposable, DisposableStore } from 'vs/base/common/lifecycle'; import { safeStringify } from 'vs/base/common/objects'; import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry'; -type ErrorEventFragment = { +/*type ErrorEventFragment = { {{SQL CARBON EDIT}} comment out for no unused callstack: { classification: 'CallstackOrException', purpose: 'PerformanceAndHealth' }; msg?: { classification: 'CallstackOrException', purpose: 'PerformanceAndHealth' }; file?: { classification: 'CallstackOrException', purpose: 'PerformanceAndHealth' }; @@ -18,7 +18,7 @@ type ErrorEventFragment = { uncaught_error_name?: { classification: 'CallstackOrException', purpose: 'PerformanceAndHealth' }; uncaught_error_msg?: { classification: 'CallstackOrException', purpose: 'PerformanceAndHealth' }; count?: { classification: 'CallstackOrException', purpose: 'PerformanceAndHealth', isMeasurement: true }; -}; +};*/ export interface ErrorEvent { callstack: string; msg?: string; @@ -45,14 +45,14 @@ export default abstract class BaseErrorTelemetry { public static ERROR_FLUSH_TIMEOUT: number = 5 * 1000; - private _telemetryService: ITelemetryService; + // private _telemetryService: ITelemetryService; {{SQL CARBON EDIT}} comment out for no unused private _flushDelay: number; private _flushHandle: any = -1; private _buffer: ErrorEvent[] = []; protected readonly _disposables = new DisposableStore(); constructor(telemetryService: ITelemetryService, flushDelay = BaseErrorTelemetry.ERROR_FLUSH_TIMEOUT) { - this._telemetryService = telemetryService; + // this._telemetryService = telemetryService; {{SQL CARBON EDIT}} comment out for no unused this._flushDelay = flushDelay; // (1) check for unexpected but handled errors @@ -118,10 +118,10 @@ export default abstract class BaseErrorTelemetry { } private _flushBuffer(): void { - for (let error of this._buffer) { + /*for (let error of this._buffer) { {{SQL CARBON EDIT}} don't log errors type UnhandledErrorClassification = {} & ErrorEventFragment; - // this._telemetryService.publicLog2('UnhandledError', error, true); {{SQL CARBON EDIT}} comment out log - } + this._telemetryService.publicLog2('UnhandledError', error, true); + }*/ this._buffer.length = 0; } } diff --git a/src/vs/platform/telemetry/node/commonProperties.ts b/src/vs/platform/telemetry/node/commonProperties.ts index 858a132001..0aab67d1c1 100644 --- a/src/vs/platform/telemetry/node/commonProperties.ts +++ b/src/vs/platform/telemetry/node/commonProperties.ts @@ -96,11 +96,11 @@ export async function resolveCommonProperties( return result; } -function verifyMicrosoftInternalDomain(domainList: readonly string[]): boolean { +/*function verifyMicrosoftInternalDomain(domainList: readonly string[]): boolean { {{SQL CARBON EDIT}} comment out for no unused if (!process || !process.env || !process.env['USERDNSDOMAIN']) { return false; } const domain = process.env['USERDNSDOMAIN']!.toLowerCase(); return domainList.some(msftDomain => domain === msftDomain); -} +}*/ diff --git a/src/vs/workbench/api/common/extHost.api.impl.ts b/src/vs/workbench/api/common/extHost.api.impl.ts index 2a5e4686e9..5168fdecd9 100644 --- a/src/vs/workbench/api/common/extHost.api.impl.ts +++ b/src/vs/workbench/api/common/extHost.api.impl.ts @@ -60,8 +60,8 @@ import { ExtHostLabelService } from 'vs/workbench/api/common/extHostLabelService import { getRemoteName } from 'vs/platform/remote/common/remoteHosts'; import { ServicesAccessor } from 'vs/platform/instantiation/common/instantiation'; import { IExtHostDecorations } from 'vs/workbench/api/common/extHostDecorations'; -import { IExtHostTask } from 'vs/workbench/api/common/extHostTask'; -import { IExtHostDebugService } from 'vs/workbench/api/common/extHostDebugService'; +// import { IExtHostTask } from 'vs/workbench/api/common/extHostTask'; +// import { IExtHostDebugService } from 'vs/workbench/api/common/extHostDebugService'; import { IExtHostSearch } from 'vs/workbench/api/common/extHostSearch'; import { ILogService } from 'vs/platform/log/common/log'; import { IURITransformerService } from 'vs/workbench/api/common/extHostUriTransformerService'; diff --git a/src/vs/workbench/api/common/extHostTreeViews.ts b/src/vs/workbench/api/common/extHostTreeViews.ts index e01e7baa37..d1147a7ec7 100644 --- a/src/vs/workbench/api/common/extHostTreeViews.ts +++ b/src/vs/workbench/api/common/extHostTreeViews.ts @@ -22,7 +22,6 @@ import { IExtensionDescription } from 'vs/platform/extensions/common/extensions' // {{SQL CARBON EDIT}} import * as azdata from 'azdata'; -import { ITreeItem as sqlITreeItem } from 'sql/workbench/common/views'; export type TreeItemHandle = string; function toTreeItemLabel(label: any, extension: IExtensionDescription): ITreeItemLabel | undefined { diff --git a/src/vs/workbench/api/node/extHost.services.ts b/src/vs/workbench/api/node/extHost.services.ts index 4a7febd793..e864993b01 100644 --- a/src/vs/workbench/api/node/extHost.services.ts +++ b/src/vs/workbench/api/node/extHost.services.ts @@ -13,10 +13,10 @@ import { IExtHostCommands, ExtHostCommands } from 'vs/workbench/api/common/extHo import { IExtHostDocumentsAndEditors, ExtHostDocumentsAndEditors } from 'vs/workbench/api/common/extHostDocumentsAndEditors'; import { ExtHostTerminalService } from 'vs/workbench/api/node/extHostTerminalService'; import { IExtHostTerminalService } from 'vs/workbench/api/common/extHostTerminalService'; -import { IExtHostTask } from 'vs/workbench/api/common/extHostTask'; -import { ExtHostTask } from 'vs/workbench/api/node/extHostTask'; -import { ExtHostDebugService } from 'vs/workbench/api/node/extHostDebugService'; -import { IExtHostDebugService } from 'vs/workbench/api/common/extHostDebugService'; +// import { IExtHostTask } from 'vs/workbench/api/common/extHostTask'; +// import { ExtHostTask } from 'vs/workbench/api/node/extHostTask'; +// import { ExtHostDebugService } from 'vs/workbench/api/node/extHostDebugService'; +// import { IExtHostDebugService } from 'vs/workbench/api/common/extHostDebugService'; import { IExtHostSearch } from 'vs/workbench/api/common/extHostSearch'; import { ExtHostSearch } from 'vs/workbench/api/node/extHostSearch'; import { ExtensionStoragePaths } from 'vs/workbench/api/node/extHostStoragePaths'; diff --git a/src/vs/workbench/api/node/extHostTask.ts b/src/vs/workbench/api/node/extHostTask.ts index 74f73a419a..e1f3430781 100644 --- a/src/vs/workbench/api/node/extHostTask.ts +++ b/src/vs/workbench/api/node/extHostTask.ts @@ -3,18 +3,18 @@ * Licensed under the Source EULA. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import * as path from 'vs/base/common/path'; +// import * as path from 'vs/base/common/path'; -import { URI, UriComponents } from 'vs/base/common/uri'; -import { win32 } from 'vs/base/node/processes'; +import { /*URI,*/ UriComponents } from 'vs/base/common/uri'; +// import { win32 } from 'vs/base/node/processes'; import * as types from 'vs/workbench/api/common/extHostTypes'; import { IExtHostWorkspace } from 'vs/workbench/api/common/extHostWorkspace'; import * as vscode from 'vscode'; import * as tasks from '../common/shared/tasks'; -import { ExtHostVariableResolverService } from 'vs/workbench/api/node/extHostDebugService'; +// import { ExtHostVariableResolverService } from 'vs/workbench/api/node/extHostDebugService'; import { IExtHostDocumentsAndEditors } from 'vs/workbench/api/common/extHostDocumentsAndEditors'; import { IExtHostConfiguration } from 'vs/workbench/api/common/extHostConfiguration'; -import { IWorkspaceFolder } from 'vs/platform/workspace/common/workspace'; +// import { IWorkspaceFolder } from 'vs/platform/workspace/common/workspace'; import { IExtensionDescription } from 'vs/platform/extensions/common/extensions'; import { IExtHostTerminalService } from 'vs/workbench/api/common/extHostTerminalService'; import { IExtHostRpcService } from 'vs/workbench/api/common/extHostRpcService'; diff --git a/src/vs/workbench/browser/parts/editor/editorGroupView.ts b/src/vs/workbench/browser/parts/editor/editorGroupView.ts index b807a17e50..6717e17d86 100644 --- a/src/vs/workbench/browser/parts/editor/editorGroupView.ts +++ b/src/vs/workbench/browser/parts/editor/editorGroupView.ts @@ -32,7 +32,7 @@ import { RunOnceWorker } from 'vs/base/common/async'; import { EventType as TouchEventType, GestureEvent } from 'vs/base/browser/touch'; import { TitleControl } from 'vs/workbench/browser/parts/editor/titleControl'; import { IEditorGroupsAccessor, IEditorGroupView, IEditorPartOptionsChangeEvent, getActiveTextEditorOptions, IEditorOpeningEvent } from 'vs/workbench/browser/parts/editor/editor'; -import { IUntitledEditorService } from 'vs/workbench/services/untitled/common/untitledEditorService'; +// import { IUntitledEditorService } from 'vs/workbench/services/untitled/common/untitledEditorService'; import { ActionBar } from 'vs/base/browser/ui/actionbar/actionbar'; import { IKeybindingService } from 'vs/platform/keybinding/common/keybinding'; import { ActionRunner, IAction, Action } from 'vs/base/common/actions'; @@ -132,7 +132,7 @@ export class EditorGroupView extends Themable implements IEditorGroupView { @INotificationService private readonly notificationService: INotificationService, @IDialogService private readonly dialogService: IDialogService, @ITelemetryService private readonly telemetryService: ITelemetryService, - @IUntitledEditorService private readonly untitledEditorService: IUntitledEditorService, + // @IUntitledEditorService private readonly untitledEditorService: IUntitledEditorService, {{SQL CARBON EDIT}} no unused @IKeybindingService private readonly keybindingService: IKeybindingService, @IMenuService private readonly menuService: IMenuService, @IContextMenuService private readonly contextMenuService: IContextMenuService, diff --git a/src/vs/workbench/browser/parts/editor/tabsTitleControl.ts b/src/vs/workbench/browser/parts/editor/tabsTitleControl.ts index c196e730ee..fb4a09678e 100644 --- a/src/vs/workbench/browser/parts/editor/tabsTitleControl.ts +++ b/src/vs/workbench/browser/parts/editor/tabsTitleControl.ts @@ -32,7 +32,7 @@ import { Color } from 'vs/base/common/color'; import { INotificationService } from 'vs/platform/notification/common/notification'; import { IExtensionService } from 'vs/workbench/services/extensions/common/extensions'; import { MergeGroupMode, IMergeGroupOptions } from 'vs/workbench/services/editor/common/editorGroupsService'; -import { IUntitledEditorService } from 'vs/workbench/services/untitled/common/untitledEditorService'; +// import { IUntitledEditorService } from 'vs/workbench/services/untitled/common/untitledEditorService'; import { addClass, addDisposableListener, hasClass, EventType, EventHelper, removeClass, Dimension, scheduleAtNextAnimationFrame, findParentWithClass, clearNode } from 'vs/base/browser/dom'; import { localize } from 'vs/nls'; import { IEditorGroupsAccessor, IEditorGroupView } from 'vs/workbench/browser/parts/editor/editor'; @@ -81,7 +81,7 @@ export class TabsTitleControl extends TitleControl { group: IEditorGroupView, @IContextMenuService contextMenuService: IContextMenuService, @IInstantiationService instantiationService: IInstantiationService, - @IUntitledEditorService private readonly untitledEditorService: IUntitledEditorService, + // @IUntitledEditorService private readonly untitledEditorService: IUntitledEditorService, {{SQL CARBON EDIT}} comment out inject @IContextKeyService contextKeyService: IContextKeyService, @IKeybindingService keybindingService: IKeybindingService, @ITelemetryService telemetryService: ITelemetryService, diff --git a/src/vs/workbench/contrib/codeEditor/browser/toggleMinimap.ts b/src/vs/workbench/contrib/codeEditor/browser/toggleMinimap.ts index 11ab749844..d38d36ddde 100644 --- a/src/vs/workbench/contrib/codeEditor/browser/toggleMinimap.ts +++ b/src/vs/workbench/contrib/codeEditor/browser/toggleMinimap.ts @@ -5,9 +5,9 @@ import * as nls from 'vs/nls'; import { Action } from 'vs/base/common/actions'; -import { MenuId, MenuRegistry, SyncActionDescriptor } from 'vs/platform/actions/common/actions'; +import { /*MenuId, MenuRegistry,*/ SyncActionDescriptor } from 'vs/platform/actions/common/actions'; import { ConfigurationTarget, IConfigurationService } from 'vs/platform/configuration/common/configuration'; -import { ContextKeyExpr } from 'vs/platform/contextkey/common/contextkey'; +// import { ContextKeyExpr } from 'vs/platform/contextkey/common/contextkey'; import { Registry } from 'vs/platform/registry/common/platform'; import { Extensions as ActionExtensions, IWorkbenchActionRegistry } from 'vs/workbench/common/actions'; diff --git a/src/vs/workbench/contrib/codeEditor/browser/toggleRenderControlCharacter.ts b/src/vs/workbench/contrib/codeEditor/browser/toggleRenderControlCharacter.ts index 5be3deac35..161fba0dc5 100644 --- a/src/vs/workbench/contrib/codeEditor/browser/toggleRenderControlCharacter.ts +++ b/src/vs/workbench/contrib/codeEditor/browser/toggleRenderControlCharacter.ts @@ -5,9 +5,9 @@ import * as nls from 'vs/nls'; import { Action } from 'vs/base/common/actions'; -import { MenuId, MenuRegistry, SyncActionDescriptor } from 'vs/platform/actions/common/actions'; +import { /*MenuId, MenuRegistry,*/ SyncActionDescriptor } from 'vs/platform/actions/common/actions'; import { ConfigurationTarget, IConfigurationService } from 'vs/platform/configuration/common/configuration'; -import { ContextKeyExpr } from 'vs/platform/contextkey/common/contextkey'; +// import { ContextKeyExpr } from 'vs/platform/contextkey/common/contextkey'; import { Registry } from 'vs/platform/registry/common/platform'; import { Extensions as ActionExtensions, IWorkbenchActionRegistry } from 'vs/workbench/common/actions'; diff --git a/src/vs/workbench/contrib/codeEditor/browser/toggleRenderWhitespace.ts b/src/vs/workbench/contrib/codeEditor/browser/toggleRenderWhitespace.ts index 8cd771cc1c..dffc2f7c1c 100644 --- a/src/vs/workbench/contrib/codeEditor/browser/toggleRenderWhitespace.ts +++ b/src/vs/workbench/contrib/codeEditor/browser/toggleRenderWhitespace.ts @@ -5,9 +5,9 @@ import * as nls from 'vs/nls'; import { Action } from 'vs/base/common/actions'; -import { MenuId, MenuRegistry, SyncActionDescriptor } from 'vs/platform/actions/common/actions'; +import { /*MenuId, MenuRegistry,*/ SyncActionDescriptor } from 'vs/platform/actions/common/actions'; import { ConfigurationTarget, IConfigurationService } from 'vs/platform/configuration/common/configuration'; -import { ContextKeyExpr } from 'vs/platform/contextkey/common/contextkey'; +// import { ContextKeyExpr } from 'vs/platform/contextkey/common/contextkey'; import { Registry } from 'vs/platform/registry/common/platform'; import { Extensions as ActionExtensions, IWorkbenchActionRegistry } from 'vs/workbench/common/actions'; diff --git a/src/vs/workbench/contrib/debug/test/browser/debugANSIHandling.test.ts b/src/vs/workbench/contrib/debug/test/browser/debugANSIHandling.test.ts index 57359d2b14..15dfe3bcbc 100644 --- a/src/vs/workbench/contrib/debug/test/browser/debugANSIHandling.test.ts +++ b/src/vs/workbench/contrib/debug/test/browser/debugANSIHandling.test.ts @@ -18,7 +18,7 @@ import { DebugModel } from 'vs/workbench/contrib/debug/common/debugModel'; import { DebugSession } from 'vs/workbench/contrib/debug/browser/debugSession'; import { NullOpenerService } from 'vs/platform/opener/common/opener'; -suite('Debug - ANSI Handling', () => { +suite.skip('Debug - ANSI Handling', () => { let model: DebugModel; let session: DebugSession; @@ -44,6 +44,457 @@ suite('Debug - ANSI Handling', () => { }); test('appendStylizedStringToContainer', () => { - assert.equal('', ''); + const root: HTMLSpanElement = document.createElement('span'); + let child: Node; + + assert.equal(0, root.children.length); + + appendStylizedStringToContainer(root, 'content1', ['class1', 'class2'], linkDetector, session); + appendStylizedStringToContainer(root, 'content2', ['class2', 'class3'], linkDetector, session); + + assert.equal(2, root.children.length); + + child = root.firstChild!; + if (child instanceof HTMLSpanElement) { + assert.equal('content1', child.textContent); + assert(dom.hasClass(child, 'class1')); + assert(dom.hasClass(child, 'class2')); + } else { + assert.fail('Unexpected assertion error'); + } + + child = root.lastChild!; + if (child instanceof HTMLSpanElement) { + assert.equal('content2', child.textContent); + assert(dom.hasClass(child, 'class2')); + assert(dom.hasClass(child, 'class3')); + } else { + assert.fail('Unexpected assertion error'); + } }); + + /** + * Apply an ANSI sequence to {@link #getSequenceOutput}. + * + * @param sequence The ANSI sequence to stylize. + * @returns An {@link HTMLSpanElement} that contains the stylized text. + */ + function getSequenceOutput(sequence: string): HTMLSpanElement { + const root: HTMLSpanElement = handleANSIOutput(sequence, linkDetector, themeService, session); + assert.equal(1, root.children.length); + const child: Node = root.lastChild!; + if (child instanceof HTMLSpanElement) { + return child; + } else { + assert.fail('Unexpected assertion error'); + return null!; + } + } + + /** + * Assert that a given ANSI sequence maintains added content following the ANSI code, and that + * the provided {@param assertion} passes. + * + * @param sequence The ANSI sequence to verify. The provided sequence should contain ANSI codes + * only, and should not include actual text content as it is provided by this function. + * @param assertion The function used to verify the output. + */ + function assertSingleSequenceElement(sequence: string, assertion: (child: HTMLSpanElement) => void): void { + const child: HTMLSpanElement = getSequenceOutput(sequence + 'content'); + assert.equal('content', child.textContent); + assertion(child); + } + + /** + * Assert that a given DOM element has the custom inline CSS style matching + * the color value provided. + * @param element The HTML span element to look at. + * @param colorType If `foreground`, will check the element's css `color`; + * if `background`, will check the element's css `backgroundColor`. + * @param color RGBA object to compare color to. If `undefined` or not provided, + * will assert that no value is set. + * @param message Optional custom message to pass to assertion. + */ + function assertInlineColor(element: HTMLSpanElement, colorType: 'background' | 'foreground', color?: RGBA | undefined, message?: string): void { + if (color !== undefined) { + const cssColor = Color.Format.CSS.formatRGB( + new Color(color) + ); + if (colorType === 'background') { + const styleBefore = element.style.backgroundColor; + element.style.backgroundColor = cssColor; + assert(styleBefore === element.style.backgroundColor, message || `Incorrect ${colorType} color style found (found color: ${styleBefore}, expected ${cssColor}).`); + } else { + const styleBefore = element.style.color; + element.style.color = cssColor; + assert(styleBefore === element.style.color, message || `Incorrect ${colorType} color style found (found color: ${styleBefore}, expected ${cssColor}).`); + } + } else { + if (colorType === 'background') { + assert(!element.style.backgroundColor, message || `Defined ${colorType} color style found when it should not have been defined`); + } else { + assert(!element.style.color, message || `Defined ${colorType} color style found when it should not have been defined`); + } + } + + } + + test('Expected single sequence operation', () => { + + // Bold code + assertSingleSequenceElement('\x1b[1m', (child) => { + assert(dom.hasClass(child, 'code-bold'), 'Bold formatting not detected after bold ANSI code.'); + }); + + // Italic code + assertSingleSequenceElement('\x1b[3m', (child) => { + assert(dom.hasClass(child, 'code-italic'), 'Italic formatting not detected after italic ANSI code.'); + }); + + // Underline code + assertSingleSequenceElement('\x1b[4m', (child) => { + assert(dom.hasClass(child, 'code-underline'), 'Underline formatting not detected after underline ANSI code.'); + }); + + for (let i = 30; i <= 37; i++) { + const customClassName: string = 'code-foreground-colored'; + + // Foreground colour class + assertSingleSequenceElement('\x1b[' + i + 'm', (child) => { + assert(dom.hasClass(child, customClassName), `Custom foreground class not found on element after foreground ANSI code #${i}.`); + }); + + // Cancellation code removes colour class + assertSingleSequenceElement('\x1b[' + i + ';39m', (child) => { + assert(dom.hasClass(child, customClassName) === false, 'Custom foreground class still found after foreground cancellation code.'); + assertInlineColor(child, 'foreground', undefined, 'Custom color style still found after foreground cancellation code.'); + }); + } + + for (let i = 40; i <= 47; i++) { + const customClassName: string = 'code-background-colored'; + + // Foreground colour class + assertSingleSequenceElement('\x1b[' + i + 'm', (child) => { + assert(dom.hasClass(child, customClassName), `Custom background class not found on element after background ANSI code #${i}.`); + }); + + // Cancellation code removes colour class + assertSingleSequenceElement('\x1b[' + i + ';49m', (child) => { + assert(dom.hasClass(child, customClassName) === false, 'Custom background class still found after background cancellation code.'); + assertInlineColor(child, 'foreground', undefined, 'Custom color style still found after background cancellation code.'); + }); + } + + // Different codes do not cancel each other + assertSingleSequenceElement('\x1b[1;3;4;30;41m', (child) => { + assert.equal(5, child.classList.length, 'Incorrect number of classes found for different ANSI codes.'); + + assert(dom.hasClass(child, 'code-bold')); + assert(dom.hasClass(child, 'code-italic'), 'Different ANSI codes should not cancel each other.'); + assert(dom.hasClass(child, 'code-underline'), 'Different ANSI codes should not cancel each other.'); + assert(dom.hasClass(child, 'code-foreground-colored'), 'Different ANSI codes should not cancel each other.'); + assert(dom.hasClass(child, 'code-background-colored'), 'Different ANSI codes should not cancel each other.'); + }); + + // New foreground codes don't remove old background codes and vice versa + assertSingleSequenceElement('\x1b[40;31;42;33m', (child) => { + assert.equal(2, child.classList.length); + + assert(dom.hasClass(child, 'code-background-colored'), 'New foreground ANSI code should not cancel existing background formatting.'); + assert(dom.hasClass(child, 'code-foreground-colored'), 'New background ANSI code should not cancel existing foreground formatting.'); + }); + + // Duplicate codes do not change output + assertSingleSequenceElement('\x1b[1;1;4;1;4;4;1;4m', (child) => { + assert(dom.hasClass(child, 'code-bold'), 'Duplicate formatting codes should have no effect.'); + assert(dom.hasClass(child, 'code-underline'), 'Duplicate formatting codes should have no effect.'); + }); + + // Extra terminating semicolon does not change output + assertSingleSequenceElement('\x1b[1;4;m', (child) => { + assert(dom.hasClass(child, 'code-bold'), 'Extra semicolon after ANSI codes should have no effect.'); + assert(dom.hasClass(child, 'code-underline'), 'Extra semicolon after ANSI codes should have no effect.'); + }); + + // Cancellation code removes multiple codes + assertSingleSequenceElement('\x1b[1;4;30;41;32;43;34;45;36;47;0m', (child) => { + assert.equal(0, child.classList.length, 'Cancellation ANSI code should clear ALL formatting.'); + assertInlineColor(child, 'background', undefined, 'Cancellation ANSI code should clear ALL formatting.'); + assertInlineColor(child, 'foreground', undefined, 'Cancellation ANSI code should clear ALL formatting.'); + }); + + }); + + test('Expected single 8-bit color sequence operation', () => { + // Basic and bright color codes specified with 8-bit color code format + for (let i = 0; i <= 15; i++) { + // As these are controlled by theme, difficult to check actual color value + // Foreground codes should add standard classes + assertSingleSequenceElement('\x1b[38;5;' + i + 'm', (child) => { + assert(dom.hasClass(child, 'code-foreground-colored'), `Custom color class not found after foreground 8-bit color code 38;5;${i}`); + }); + + // Background codes should add standard classes + assertSingleSequenceElement('\x1b[48;5;' + i + 'm', (child) => { + assert(dom.hasClass(child, 'code-background-colored'), `Custom color class not found after background 8-bit color code 48;5;${i}`); + }); + } + + // 8-bit advanced colors + for (let i = 16; i <= 255; i++) { + // Foreground codes should add custom class and inline style + assertSingleSequenceElement('\x1b[38;5;' + i + 'm', (child) => { + assert(dom.hasClass(child, 'code-foreground-colored'), `Custom color class not found after foreground 8-bit color code 38;5;${i}`); + assertInlineColor(child, 'foreground', (calcANSI8bitColor(i) as RGBA), `Incorrect or no color styling found after foreground 8-bit color code 38;5;${i}`); + }); + + // Background codes should add custom class and inline style + assertSingleSequenceElement('\x1b[48;5;' + i + 'm', (child) => { + assert(dom.hasClass(child, 'code-background-colored'), `Custom color class not found after background 8-bit color code 48;5;${i}`); + assertInlineColor(child, 'background', (calcANSI8bitColor(i) as RGBA), `Incorrect or no color styling found after background 8-bit color code 48;5;${i}`); + }); + } + + // Bad (nonexistent) color should not render + assertSingleSequenceElement('\x1b[48;5;300m', (child) => { + assert.equal(0, child.classList.length, 'Bad ANSI color codes should have no effect.'); + }); + + // Should ignore any codes after the ones needed to determine color + assertSingleSequenceElement('\x1b[48;5;100;42;77;99;4;24m', (child) => { + assert(dom.hasClass(child, 'code-background-colored')); + assert.equal(1, child.classList.length); + assertInlineColor(child, 'background', (calcANSI8bitColor(100) as RGBA)); + }); + }); + + test('Expected single 24-bit color sequence operation', () => { + // 24-bit advanced colors + for (let r = 0; r <= 255; r += 64) { + for (let g = 0; g <= 255; g += 64) { + for (let b = 0; b <= 255; b += 64) { + let color = new RGBA(r, g, b); + // Foreground codes should add class and inline style + assertSingleSequenceElement(`\x1b[38;2;${r};${g};${b}m`, (child) => { + assert(dom.hasClass(child, 'code-foreground-colored'), 'DOM should have "code-foreground-colored" class for advanced ANSI colors.'); + assertInlineColor(child, 'foreground', color); + }); + + // Background codes should add class and inline style + assertSingleSequenceElement(`\x1b[48;2;${r};${g};${b}m`, (child) => { + assert(dom.hasClass(child, 'code-background-colored'), 'DOM should have "code-foreground-colored" class for advanced ANSI colors.'); + assertInlineColor(child, 'background', color); + }); + } + } + } + + // Invalid color should not render + assertSingleSequenceElement('\x1b[38;2;4;4m', (child) => { + assert.equal(0, child.classList.length, `Invalid color code "38;2;4;4" should not add a class (classes found: ${child.classList}).`); + assert(!child.style.color, `Invalid color code "38;2;4;4" should not add a custom color CSS (found color: ${child.style.color}).`); + }); + + // Bad (nonexistent) color should not render + assertSingleSequenceElement('\x1b[48;2;150;300;5m', (child) => { + assert.equal(0, child.classList.length, `Nonexistent color code "48;2;150;300;5" should not add a class (classes found: ${child.classList}).`); + }); + + // Should ignore any codes after the ones needed to determine color + assertSingleSequenceElement('\x1b[48;2;100;42;77;99;200;75m', (child) => { + assert(dom.hasClass(child, 'code-background-colored'), `Color code with extra (valid) items "48;2;100;42;77;99;200;75" should still treat initial part as valid code and add class "code-background-custom".`); + assert.equal(1, child.classList.length, `Color code with extra items "48;2;100;42;77;99;200;75" should add one and only one class. (classes found: ${child.classList}).`); + assertInlineColor(child, 'background', new RGBA(100, 42, 77), `Color code "48;2;100;42;77;99;200;75" should style background-color as rgb(100,42,77).`); + }); + }); + + + /** + * Assert that a given ANSI sequence produces the expected number of {@link HTMLSpanElement} children. For + * each child, run the provided assertion. + * + * @param sequence The ANSI sequence to verify. + * @param assertions A set of assertions to run on the resulting children. + */ + function assertMultipleSequenceElements(sequence: string, assertions: Array<(child: HTMLSpanElement) => void>, elementsExpected?: number): void { + if (elementsExpected === undefined) { + elementsExpected = assertions.length; + } + const root: HTMLSpanElement = handleANSIOutput(sequence, linkDetector, themeService, session); + assert.equal(elementsExpected, root.children.length); + for (let i = 0; i < elementsExpected; i++) { + const child: Node = root.children[i]; + if (child instanceof HTMLSpanElement) { + assertions[i](child); + } else { + assert.fail('Unexpected assertion error'); + } + } + } + + test('Expected multiple sequence operation', () => { + + // Multiple codes affect the same text + assertSingleSequenceElement('\x1b[1m\x1b[3m\x1b[4m\x1b[32m', (child) => { + assert(dom.hasClass(child, 'code-bold'), 'Bold class not found after multiple different ANSI codes.'); + assert(dom.hasClass(child, 'code-italic'), 'Italic class not found after multiple different ANSI codes.'); + assert(dom.hasClass(child, 'code-underline'), 'Underline class not found after multiple different ANSI codes.'); + assert(dom.hasClass(child, 'code-foreground-colored'), 'Foreground color class not found after multiple different ANSI codes.'); + }); + + // Consecutive codes do not affect previous ones + assertMultipleSequenceElements('\x1b[1mbold\x1b[32mgreen\x1b[4munderline\x1b[3mitalic\x1b[0mnothing', [ + (bold) => { + assert.equal(1, bold.classList.length); + assert(dom.hasClass(bold, 'code-bold'), 'Bold class not found after bold ANSI code.'); + }, + (green) => { + assert.equal(2, green.classList.length); + assert(dom.hasClass(green, 'code-bold'), 'Bold class not found after both bold and color ANSI codes.'); + assert(dom.hasClass(green, 'code-foreground-colored'), 'Color class not found after color ANSI code.'); + }, + (underline) => { + assert.equal(3, underline.classList.length); + assert(dom.hasClass(underline, 'code-bold'), 'Bold class not found after bold, color, and underline ANSI codes.'); + assert(dom.hasClass(underline, 'code-foreground-colored'), 'Color class not found after color and underline ANSI codes.'); + assert(dom.hasClass(underline, 'code-underline'), 'Underline class not found after underline ANSI code.'); + }, + (italic) => { + assert.equal(4, italic.classList.length); + assert(dom.hasClass(italic, 'code-bold'), 'Bold class not found after bold, color, underline, and italic ANSI codes.'); + assert(dom.hasClass(italic, 'code-foreground-colored'), 'Color class not found after color, underline, and italic ANSI codes.'); + assert(dom.hasClass(italic, 'code-underline'), 'Underline class not found after underline and italic ANSI codes.'); + assert(dom.hasClass(italic, 'code-italic'), 'Italic class not found after italic ANSI code.'); + }, + (nothing) => { + assert.equal(0, nothing.classList.length, 'One or more style classes still found after reset ANSI code.'); + }, + ], 5); + + // Different types of color codes still cancel each other + assertMultipleSequenceElements('\x1b[34msimple\x1b[38;2;100;100;100m24bit\x1b[38;5;3m8bitsimple\x1b[38;5;101m8bitadvanced', [ + (simple) => { + assert.equal(1, simple.classList.length, 'Foreground ANSI color code should add one class.'); + assert(dom.hasClass(simple, 'code-foreground-colored'), 'Foreground ANSI color codes should add custom foreground color class.'); + }, + (adv24Bit) => { + assert.equal(1, adv24Bit.classList.length, 'Multiple foreground ANSI color codes should only add a single class.'); + assert(dom.hasClass(adv24Bit, 'code-foreground-colored'), 'Foreground ANSI color codes should add custom foreground color class.'); + assertInlineColor(adv24Bit, 'foreground', new RGBA(100, 100, 100), '24-bit RGBA ANSI color code (100,100,100) should add matching color inline style.'); + }, + (adv8BitSimple) => { + assert.equal(1, adv8BitSimple.classList.length, 'Multiple foreground ANSI color codes should only add a single class.'); + assert(dom.hasClass(adv8BitSimple, 'code-foreground-colored'), 'Foreground ANSI color codes should add custom foreground color class.'); + // Won't assert color because it's theme based + }, + (adv8BitAdvanced) => { + assert.equal(1, adv8BitAdvanced.classList.length, 'Multiple foreground ANSI color codes should only add a single class.'); + assert(dom.hasClass(adv8BitAdvanced, 'code-foreground-colored'), 'Foreground ANSI color codes should add custom foreground color class.'); + } + ], 4); + + }); + + /** + * Assert that the provided ANSI sequence exactly matches the text content of the resulting + * {@link HTMLSpanElement}. + * + * @param sequence The ANSI sequence to verify. + */ + function assertSequenceEqualToContent(sequence: string): void { + const child: HTMLSpanElement = getSequenceOutput(sequence); + assert(child.textContent === sequence); + } + + test('Invalid codes treated as regular text', () => { + + // Individual components of ANSI code start are printed + assertSequenceEqualToContent('\x1b'); + assertSequenceEqualToContent('['); + + // Unsupported sequence prints both characters + assertSequenceEqualToContent('\x1b['); + + // Random strings are displayed properly + for (let i = 0; i < 50; i++) { + const uuid: string = generateUuid(); + assertSequenceEqualToContent(uuid); + } + + }); + + /** + * Assert that a given ANSI sequence maintains added content following the ANSI code, and that + * the expression itself is thrown away. + * + * @param sequence The ANSI sequence to verify. The provided sequence should contain ANSI codes + * only, and should not include actual text content as it is provided by this function. + */ + function assertEmptyOutput(sequence: string) { + const child: HTMLSpanElement = getSequenceOutput(sequence + 'content'); + assert.equal('content', child.textContent); + assert.equal(0, child.classList.length); + } + + test('Empty sequence output', () => { + + const sequences: string[] = [ + // No colour codes + '', + '\x1b[;m', + '\x1b[1;;m', + '\x1b[m', + '\x1b[99m' + ]; + + sequences.forEach(sequence => { + assertEmptyOutput(sequence); + }); + + // Check other possible ANSI terminators + const terminators: string[] = 'ABCDHIJKfhmpsu'.split(''); + + terminators.forEach(terminator => { + assertEmptyOutput('\x1b[content' + terminator); + }); + + }); + + test('calcANSI8bitColor', () => { + // Invalid values + // Negative (below range), simple range, decimals + for (let i = -10; i <= 15; i += 0.5) { + assert(calcANSI8bitColor(i) === undefined, 'Values less than 16 passed to calcANSI8bitColor should return undefined.'); + } + // In-range range decimals + for (let i = 16.5; i < 254; i += 1) { + assert(calcANSI8bitColor(i) === undefined, 'Floats passed to calcANSI8bitColor should return undefined.'); + } + // Above range + for (let i = 256; i < 300; i += 0.5) { + assert(calcANSI8bitColor(i) === undefined, 'Values grather than 255 passed to calcANSI8bitColor should return undefined.'); + } + + // All valid colors + for (let red = 0; red <= 5; red++) { + for (let green = 0; green <= 5; green++) { + for (let blue = 0; blue <= 5; blue++) { + let colorOut: any = calcANSI8bitColor(16 + red * 36 + green * 6 + blue); + assert(colorOut.r === Math.round(red * (255 / 5)), 'Incorrect red value encountered for color'); + assert(colorOut.g === Math.round(green * (255 / 5)), 'Incorrect green value encountered for color'); + assert(colorOut.b === Math.round(blue * (255 / 5)), 'Incorrect balue value encountered for color'); + } + } + } + + // All grays + for (let i = 232; i <= 255; i++) { + let grayOut: any = calcANSI8bitColor(i); + assert(grayOut.r === grayOut.g); + assert(grayOut.r === grayOut.b); + assert(grayOut.r === Math.round((i - 232) / 23 * 255)); + } + }); + }); diff --git a/src/vs/workbench/contrib/emmet/browser/actions/expandAbbreviation.ts b/src/vs/workbench/contrib/emmet/browser/actions/expandAbbreviation.ts index 72a6d0888a..4a502c0d08 100644 --- a/src/vs/workbench/contrib/emmet/browser/actions/expandAbbreviation.ts +++ b/src/vs/workbench/contrib/emmet/browser/actions/expandAbbreviation.ts @@ -9,7 +9,7 @@ import { EditorContextKeys } from 'vs/editor/common/editorContextKeys'; import { KeyCode } from 'vs/base/common/keyCodes'; import { ContextKeyExpr } from 'vs/platform/contextkey/common/contextkey'; import { KeybindingWeight } from 'vs/platform/keybinding/common/keybindingsRegistry'; -import { MenuId } from 'vs/platform/actions/common/actions'; +// import { MenuId } from 'vs/platform/actions/common/actions'; class ExpandAbbreviationAction extends EmmetEditorAction { diff --git a/src/vs/workbench/contrib/emmet/browser/actions/showEmmetCommands.ts b/src/vs/workbench/contrib/emmet/browser/actions/showEmmetCommands.ts index 5da1f951c4..7e66a58198 100644 --- a/src/vs/workbench/contrib/emmet/browser/actions/showEmmetCommands.ts +++ b/src/vs/workbench/contrib/emmet/browser/actions/showEmmetCommands.ts @@ -9,7 +9,7 @@ import { registerEditorAction, EditorAction, ServicesAccessor } from 'vs/editor/ import { IQuickOpenService } from 'vs/platform/quickOpen/common/quickOpen'; import { EditorContextKeys } from 'vs/editor/common/editorContextKeys'; import { ICodeEditor } from 'vs/editor/browser/editorBrowser'; -import { MenuId } from 'vs/platform/actions/common/actions'; +// import { MenuId } from 'vs/platform/actions/common/actions'; const EMMET_COMMANDS_PREFIX = '>Emmet: '; diff --git a/src/vs/workbench/contrib/extensions/browser/extensionEditor.ts b/src/vs/workbench/contrib/extensions/browser/extensionEditor.ts index 717c3658e2..065c1f75e9 100644 --- a/src/vs/workbench/contrib/extensions/browser/extensionEditor.ts +++ b/src/vs/workbench/contrib/extensions/browser/extensionEditor.ts @@ -24,7 +24,7 @@ import { IExtensionManifest, IKeyBinding, IView, IViewContainer, ExtensionType } import { ResolvedKeybinding, KeyMod, KeyCode } from 'vs/base/common/keyCodes'; import { ExtensionsInput } from 'vs/workbench/contrib/extensions/common/extensionsInput'; import { IExtensionsWorkbenchService, IExtensionsViewlet, VIEWLET_ID, IExtension, ExtensionContainers } from 'vs/workbench/contrib/extensions/common/extensions'; -import { RatingsWidget, InstallCountWidget, RemoteBadgeWidget } from 'vs/workbench/contrib/extensions/browser/extensionsWidgets'; +import { /*RatingsWidget, InstallCountWidget,*/ RemoteBadgeWidget } from 'vs/workbench/contrib/extensions/browser/extensionsWidgets'; import { EditorOptions } from 'vs/workbench/common/editor'; import { ActionBar } from 'vs/base/browser/ui/actionbar/actionbar'; import { CombinedInstallAction, UpdateAction, ExtensionEditorDropDownAction, ReloadAction, MaliciousStatusLabelAction, IgnoreExtensionRecommendationAction, UndoIgnoreExtensionRecommendationAction, EnableDropDownAction, DisableDropDownAction, StatusLabelAction, SetFileIconThemeAction, SetColorThemeAction, RemoteInstallAction, ExtensionToolTipAction, SystemDisabledWarningAction, LocalInstallAction } from 'vs/workbench/contrib/extensions/browser/extensionsActions'; diff --git a/src/vs/workbench/contrib/extensions/browser/extensionTipsService.ts b/src/vs/workbench/contrib/extensions/browser/extensionTipsService.ts index 998ec1e3f8..b0f6945bf1 100644 --- a/src/vs/workbench/contrib/extensions/browser/extensionTipsService.ts +++ b/src/vs/workbench/contrib/extensions/browser/extensionTipsService.ts @@ -7,12 +7,12 @@ import { localize } from 'vs/nls'; import { join, basename } from 'vs/base/common/path'; import { forEach } from 'vs/base/common/collections'; import { Disposable } from 'vs/base/common/lifecycle'; -import { match } from 'vs/base/common/glob'; +// import { match } from 'vs/base/common/glob'; import * as json from 'vs/base/common/json'; import { IExtensionManagementService, IExtensionGalleryService, EXTENSION_IDENTIFIER_PATTERN, InstallOperation, ILocalExtension } from 'vs/platform/extensionManagement/common/extensionManagement'; import { IExtensionTipsService, ExtensionRecommendationReason, IExtensionsConfigContent, RecommendationChangeNotification, IExtensionRecommendation, ExtensionRecommendationSource, IExtensionEnablementService, EnablementState } from 'vs/workbench/services/extensionManagement/common/extensionManagement'; -import { IModelService } from 'vs/editor/common/services/modelService'; -import { ITextModel } from 'vs/editor/common/model'; +// import { IModelService } from 'vs/editor/common/services/modelService'; +// import { ITextModel } from 'vs/editor/common/model'; import { IStorageService, StorageScope } from 'vs/platform/storage/common/storage'; import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation'; // {{SQL CARBON EDIT}} @@ -23,37 +23,37 @@ import * as Constants from 'sql/workbench/contrib/extensions/common/constants'; import Severity from 'vs/base/common/severity'; import { IWorkspaceContextService, IWorkspaceFolder, IWorkspace, IWorkspaceFoldersChangeEvent, WorkbenchState } from 'vs/platform/workspace/common/workspace'; import { IFileService } from 'vs/platform/files/common/files'; -import { IExtensionsConfiguration, ConfigurationKey, ShowRecommendationsOnlyOnDemandKey, IExtensionsViewlet, IExtensionsWorkbenchService, EXTENSIONS_CONFIG } from 'vs/workbench/contrib/extensions/common/extensions'; +import { IExtensionsConfiguration, ConfigurationKey, ShowRecommendationsOnlyOnDemandKey, /*IExtensionsViewlet, IExtensionsWorkbenchService,*/ EXTENSIONS_CONFIG } from 'vs/workbench/contrib/extensions/common/extensions'; import { IConfigurationService, ConfigurationTarget } from 'vs/platform/configuration/common/configuration'; import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry'; import { flatten, distinct, shuffle, coalesce, firstIndex } from 'vs/base/common/arrays'; -import { guessMimeTypes, MIME_UNKNOWN } from 'vs/base/common/mime'; -import { IExtensionService } from 'vs/workbench/services/extensions/common/extensions'; +// import { guessMimeTypes, MIME_UNKNOWN } from 'vs/base/common/mime'; +// import { IExtensionService } from 'vs/workbench/services/extensions/common/extensions'; import { IRequestService, asJson } from 'vs/platform/request/common/request'; import { isNumber } from 'vs/base/common/types'; -import { IViewletService } from 'vs/workbench/services/viewlet/browser/viewlet'; +// import { IViewletService } from 'vs/workbench/services/viewlet/browser/viewlet'; import { INotificationService } from 'vs/platform/notification/common/notification'; import { Emitter, Event } from 'vs/base/common/event'; import { assign } from 'vs/base/common/objects'; import { URI } from 'vs/base/common/uri'; import { areSameExtensions } from 'vs/platform/extensionManagement/common/extensionManagementUtil'; -import { IExperimentService, ExperimentActionType, ExperimentState } from 'vs/workbench/contrib/experiments/common/experimentService'; +// import { IExperimentService, ExperimentActionType, ExperimentState } from 'vs/workbench/contrib/experiments/common/experimentService'; import { CancellationToken } from 'vs/base/common/cancellation'; import { ExtensionType, ExtensionsPolicy, ExtensionsPolicyKey } from 'vs/platform/extensions/common/extensions'; // {{SQL CARBON EDIT}} -import { extname } from 'vs/base/common/resources'; +// import { extname } from 'vs/base/common/resources'; import { IExeBasedExtensionTip, IProductService } from 'vs/platform/product/common/productService'; import { timeout } from 'vs/base/common/async'; import { IAdsTelemetryService } from 'sql/platform/telemetry/common/telemetry'; // {{SQL CARBON EDIT}} import * as TelemetryKeys from 'sql/platform/telemetry/common/telemetryKeys'; // {{SQL CARBON EDIT}} import { IWorkspaceStatsService } from 'vs/workbench/contrib/stats/common/workspaceStats'; -import { setImmediate, isWeb } from 'vs/base/common/platform'; +import { /*setImmediate,*/ isWeb } from 'vs/base/common/platform'; import { platform, env as processEnv } from 'vs/base/common/process'; import { IWorkbenchEnvironmentService } from 'vs/workbench/services/environment/common/environmentService'; const milliSecondsInADay = 1000 * 60 * 60 * 24; const choiceNever = localize('neverShowAgain', "Don't Show Again"); -const searchMarketplace = localize('searchMarketplace', "Search Marketplace"); -const processedFileExtensions: string[] = []; +// const searchMarketplace = localize('searchMarketplace', "Search Marketplace"); {{SQL CARBON EDIT}} comment out for no unused +// const processedFileExtensions: string[] = []; {{SQL CARBON EDIT}} comment out for no unused interface IDynamicWorkspaceRecommendations { remoteSet: string[]; @@ -97,7 +97,7 @@ export class ExtensionTipsService extends Disposable implements IExtensionTipsSe constructor( @IExtensionGalleryService private readonly _galleryService: IExtensionGalleryService, - @IModelService private readonly _modelService: IModelService, + // @IModelService private readonly _modelService: IModelService, {{SQL CARBON EDIT}} comment out for no unused @IStorageService private readonly storageService: IStorageService, @IExtensionManagementService private readonly extensionsService: IExtensionManagementService, @IExtensionEnablementService private readonly extensionEnablementService: IExtensionEnablementService, @@ -107,13 +107,13 @@ export class ExtensionTipsService extends Disposable implements IExtensionTipsSe @IConfigurationService private readonly configurationService: IConfigurationService, @ITelemetryService private readonly telemetryService: ITelemetryService, @IWorkbenchEnvironmentService private readonly environmentService: IWorkbenchEnvironmentService, - @IExtensionService private readonly extensionService: IExtensionService, + // @IExtensionService private readonly extensionService: IExtensionService, {{SQL CARBON EDIT}} comment out for no unused @IRequestService private readonly requestService: IRequestService, - @IViewletService private readonly viewletService: IViewletService, + // @IViewletService private readonly viewletService: IViewletService, {{SQL CARBON EDIT}} comment out for no unused @INotificationService private readonly notificationService: INotificationService, @IExtensionManagementService private readonly extensionManagementService: IExtensionManagementService, - @IExtensionsWorkbenchService private readonly extensionWorkbenchService: IExtensionsWorkbenchService, - @IExperimentService private readonly experimentService: IExperimentService, + // @IExtensionsWorkbenchService private readonly extensionWorkbenchService: IExtensionsWorkbenchService, {{SQL CARBON EDIT}} comment out for no unused + // @IExperimentService private readonly experimentService: IExperimentService, {{SQL CARBON EDIT}} comment out for no unused @IAdsTelemetryService private readonly adsTelemetryService: IAdsTelemetryService, // {{SQL CARBON EDIT}} @IWorkspaceStatsService private readonly workspaceStatsService: IWorkspaceStatsService, @IProductService private readonly productService: IProductService @@ -709,7 +709,7 @@ export class ExtensionTipsService extends Disposable implements IExtensionTipsSe * Prompt the user to either install the recommended extension for the file type in the current editor model * or prompt to search the marketplace if it has extensions that can support the file type */ - private promptFiletypeBasedRecommendations(model: ITextModel): void { + /*private promptFiletypeBasedRecommendations(model: ITextModel): void { {{SQL CARBON EDIT}} comment out for no unused const uri = model.uri; if (!uri || !this.fileService.canHandleResource(uri)) { return; @@ -776,9 +776,9 @@ export class ExtensionTipsService extends Disposable implements IExtensionTipsSe this.promptRecommendedExtensionForFileExtension(fileExtension, installed); }); - } + }*/ - private async promptRecommendedExtensionForFileType(recommendationsToSuggest: string[], installed: ILocalExtension[]): Promise { + /*private async promptRecommendedExtensionForFileType(recommendationsToSuggest: string[], installed: ILocalExtension[]): Promise { {{SQL CARBON EDIT}} comment out for no unused recommendationsToSuggest = this.filterIgnoredOrNotAllowed(recommendationsToSuggest); if (recommendationsToSuggest.length === 0) { @@ -805,24 +805,24 @@ export class ExtensionTipsService extends Disposable implements IExtensionTipsSe [{ label: localize('install', 'Install'), run: () => { - /* __GDPR__ + *//* __GDPR__ "extensionRecommendations:popup" : { "userReaction" : { "classification": "SystemMetaData", "purpose": "FeatureInsight" }, "extensionId": { "classification": "PublicNonPersonalData", "purpose": "FeatureInsight" } } - */ + *//* this.telemetryService.publicLog('extensionRecommendations:popup', { userReaction: 'install', extensionId: name }); this.instantiationService.createInstance(InstallRecommendedExtensionAction, id).run(); } }, { label: localize('showRecommendations', "Show Recommendations"), run: () => { - /* __GDPR__ + *//* __GDPR__ "extensionRecommendations:popup" : { "userReaction" : { "classification": "SystemMetaData", "purpose": "FeatureInsight" }, "extensionId": { "classification": "PublicNonPersonalData", "purpose": "FeatureInsight" } } - */ + *//* this.telemetryService.publicLog('extensionRecommendations:popup', { userReaction: 'show', extensionId: name }); const recommendationsAction = this.instantiationService.createInstance(ShowRecommendedExtensionsAction, ShowRecommendedExtensionsAction.ID, localize('showRecommendations', "Show Recommendations")); @@ -834,12 +834,12 @@ export class ExtensionTipsService extends Disposable implements IExtensionTipsSe isSecondary: true, run: () => { this.addToImportantRecommendationsIgnore(id); - /* __GDPR__ + *//* __GDPR__ "extensionRecommendations:popup" : { "userReaction" : { "classification": "SystemMetaData", "purpose": "FeatureInsight" }, "extensionId": { "classification": "PublicNonPersonalData", "purpose": "FeatureInsight" } } - */ + *//* this.telemetryService.publicLog('extensionRecommendations:popup', { userReaction: 'neverShowAgain', extensionId: name }); this.notificationService.prompt( Severity.Info, @@ -857,21 +857,21 @@ export class ExtensionTipsService extends Disposable implements IExtensionTipsSe { sticky: true, onCancel: () => { - /* __GDPR__ + *//* __GDPR__ "extensionRecommendations:popup" : { "userReaction" : { "classification": "SystemMetaData", "purpose": "FeatureInsight" }, "extensionId": { "classification": "PublicNonPersonalData", "purpose": "FeatureInsight" } } - */ + *//* this.telemetryService.publicLog('extensionRecommendations:popup', { userReaction: 'cancelled', extensionId: name }); } } ); return true; - } + }*/ - private async promptRecommendedExtensionForFileExtension(fileExtension: string, installed: ILocalExtension[]): Promise { + /*private async promptRecommendedExtensionForFileExtension(fileExtension: string, installed: ILocalExtension[]): Promise { {{SQL CARBON EDIT}} no unused const fileExtensionSuggestionIgnoreList = JSON.parse(this.storageService.get('extensionsAssistant/fileExtensionsSuggestionIgnore', StorageScope.GLOBAL, '[]')); if (fileExtensionSuggestionIgnoreList.indexOf(fileExtension) > -1) { return; @@ -894,12 +894,12 @@ export class ExtensionTipsService extends Disposable implements IExtensionTipsSe [{ label: searchMarketplace, run: () => { - /* __GDPR__ + *//* __GDPR__ "fileExtensionSuggestion:popup" : { "userReaction" : { "classification": "SystemMetaData", "purpose": "FeatureInsight" }, "fileExtension": { "classification": "PublicNonPersonalData", "purpose": "FeatureInsight" } } - */ + *//* this.telemetryService.publicLog('fileExtensionSuggestion:popup', { userReaction: 'ok', fileExtension: fileExtension }); this.viewletService.openViewlet('workbench.view.extensions', true) .then(viewlet => viewlet as IExtensionsViewlet) @@ -917,29 +917,29 @@ export class ExtensionTipsService extends Disposable implements IExtensionTipsSe JSON.stringify(fileExtensionSuggestionIgnoreList), StorageScope.GLOBAL ); - /* __GDPR__ + *//* __GDPR__ "fileExtensionSuggestion:popup" : { "userReaction" : { "classification": "SystemMetaData", "purpose": "FeatureInsight" }, "fileExtension": { "classification": "PublicNonPersonalData", "purpose": "FeatureInsight" } } - */ + *//* this.telemetryService.publicLog('fileExtensionSuggestion:popup', { userReaction: 'neverShowAgain', fileExtension: fileExtension }); } }], { sticky: true, onCancel: () => { - /* __GDPR__ + *//* __GDPR__ "fileExtensionSuggestion:popup" : { "userReaction" : { "classification": "SystemMetaData", "purpose": "FeatureInsight" }, "fileExtension": { "classification": "PublicNonPersonalData", "purpose": "FeatureInsight" } } - */ + *//* this.telemetryService.publicLog('fileExtensionSuggestion:popup', { userReaction: 'cancelled', fileExtension: fileExtension }); } } ); - } + }*/ private filterIgnoredOrNotAllowed(recommendationsToSuggest: string[]): string[] { const importantRecommendationsIgnoreList = JSON.parse(this.storageService.get('extensionsAssistant/importantRecommendationsIgnore', StorageScope.GLOBAL, '[]')); diff --git a/src/vs/workbench/contrib/extensions/browser/extensionsList.ts b/src/vs/workbench/contrib/extensions/browser/extensionsList.ts index 292ca665ee..7561cd29fa 100644 --- a/src/vs/workbench/contrib/extensions/browser/extensionsList.ts +++ b/src/vs/workbench/contrib/extensions/browser/extensionsList.ts @@ -15,7 +15,7 @@ import { domEvent } from 'vs/base/browser/event'; import { IExtension, ExtensionContainers, ExtensionState, IExtensionsWorkbenchService } from 'vs/workbench/contrib/extensions/common/extensions'; import { InstallAction, UpdateAction, ManageExtensionAction, ReloadAction, MaliciousStatusLabelAction, ExtensionActionViewItem, StatusLabelAction, RemoteInstallAction, SystemDisabledWarningAction, ExtensionToolTipAction, LocalInstallAction } from 'vs/workbench/contrib/extensions/browser/extensionsActions'; import { areSameExtensions } from 'vs/platform/extensionManagement/common/extensionManagementUtil'; -import { Label, RatingsWidget, InstallCountWidget, RecommendationWidget, RemoteBadgeWidget, TooltipWidget } from 'vs/workbench/contrib/extensions/browser/extensionsWidgets'; +import { Label, RatingsWidget, /*InstallCountWidget,*/ RecommendationWidget, RemoteBadgeWidget, TooltipWidget } from 'vs/workbench/contrib/extensions/browser/extensionsWidgets'; import { IExtensionService } from 'vs/workbench/services/extensions/common/extensions'; import { IExtensionManagementServerService } from 'vs/workbench/services/extensionManagement/common/extensionManagement'; import { INotificationService } from 'vs/platform/notification/common/notification'; @@ -73,7 +73,7 @@ export class Renderer implements IPagedRenderer { const header = append(headerContainer, $('.header')); const name = append(header, $('span.name')); const version = append(header, $('span.version')); - const installCount = append(header, $('span.install-count')); + // const installCount = append(header, $('span.install-count')); {{SQL CARBON EDIT}} no unused const ratings = append(header, $('span.ratings')); const headerRemoteBadgeWidget = this.instantiationService.createInstance(RemoteBadgeWidget, header, false); const description = append(details, $('.description.ellipsis')); diff --git a/src/vs/workbench/contrib/extensions/browser/extensionsViewlet.ts b/src/vs/workbench/contrib/extensions/browser/extensionsViewlet.ts index c55d65c6da..ab1263cf7a 100644 --- a/src/vs/workbench/contrib/extensions/browser/extensionsViewlet.ts +++ b/src/vs/workbench/contrib/extensions/browser/extensionsViewlet.ts @@ -20,7 +20,7 @@ import { IInstantiationService } from 'vs/platform/instantiation/common/instanti import { IExtensionService } from 'vs/workbench/services/extensions/common/extensions'; import { IExtensionsWorkbenchService, IExtensionsViewlet, VIEWLET_ID, AutoUpdateConfigurationKey, ShowRecommendationsOnlyOnDemandKey, CloseExtensionDetailsOnViewChangeKey, VIEW_CONTAINER } from '../common/extensions'; import { - ShowEnabledExtensionsAction, ShowInstalledExtensionsAction, ShowRecommendedExtensionsAction, ShowPopularExtensionsAction, ShowDisabledExtensionsAction, + ShowEnabledExtensionsAction, ShowInstalledExtensionsAction, ShowRecommendedExtensionsAction, /*ShowPopularExtensionsAction,*/ ShowDisabledExtensionsAction, ShowOutdatedExtensionsAction, ClearExtensionsInputAction, ChangeSortAction, UpdateAllAction, CheckForUpdatesAction, DisableAllAction, EnableAllAction, EnableAutoUpdateAction, DisableAutoUpdateAction, ShowBuiltInExtensionsAction, InstallVSIXAction } from 'vs/workbench/contrib/extensions/browser/extensionsActions'; diff --git a/src/vs/workbench/contrib/extensions/browser/extensionsViews.ts b/src/vs/workbench/contrib/extensions/browser/extensionsViews.ts index e0c49bb0b4..2103ed95a9 100644 --- a/src/vs/workbench/contrib/extensions/browser/extensionsViews.ts +++ b/src/vs/workbench/contrib/extensions/browser/extensionsViews.ts @@ -1029,7 +1029,7 @@ export class DefaultRecommendedExtensionsView extends ExtensionsListView { } export class RecommendedExtensionsView extends ExtensionsListView { - private readonly recommendedExtensionsQuery = '@recommended'; + // private readonly recommendedExtensionsQuery = '@recommended'; {{SQL CARBON EDIT}} no unused renderBody(container: HTMLElement): void { super.renderBody(container); diff --git a/src/vs/workbench/contrib/themes/browser/themes.contribution.ts b/src/vs/workbench/contrib/themes/browser/themes.contribution.ts index 2b10c0a23a..5c1835fa95 100644 --- a/src/vs/workbench/contrib/themes/browser/themes.contribution.ts +++ b/src/vs/workbench/contrib/themes/browser/themes.contribution.ts @@ -12,7 +12,7 @@ import { Registry } from 'vs/platform/registry/common/platform'; import { IWorkbenchActionRegistry, Extensions } from 'vs/workbench/common/actions'; import { IWorkbenchThemeService, COLOR_THEME_SETTING, ICON_THEME_SETTING, IColorTheme, IFileIconTheme } from 'vs/workbench/services/themes/common/workbenchThemeService'; import { VIEWLET_ID, IExtensionsViewlet } from 'vs/workbench/contrib/extensions/common/extensions'; -import { IExtensionGalleryService } from 'vs/platform/extensionManagement/common/extensionManagement'; +// import { IExtensionGalleryService } from 'vs/platform/extensionManagement/common/extensionManagement'; import { IViewletService } from 'vs/workbench/services/viewlet/browser/viewlet'; import { IColorRegistry, Extensions as ColorRegistryExtensions } from 'vs/platform/theme/common/colorRegistry'; import { IEditorService } from 'vs/workbench/services/editor/common/editorService'; @@ -33,7 +33,7 @@ export class SelectColorThemeAction extends Action { label: string, @IQuickInputService private readonly quickInputService: IQuickInputService, @IWorkbenchThemeService private readonly themeService: IWorkbenchThemeService, - @IExtensionGalleryService private readonly extensionGalleryService: IExtensionGalleryService, + // @IExtensionGalleryService private readonly extensionGalleryService: IExtensionGalleryService, {{SQL CARBON EDIT}} no unused @IViewletService private readonly viewletService: IViewletService, @IConfigurationService private readonly configurationService: IConfigurationService ) { @@ -106,7 +106,7 @@ class SelectIconThemeAction extends Action { label: string, @IQuickInputService private readonly quickInputService: IQuickInputService, @IWorkbenchThemeService private readonly themeService: IWorkbenchThemeService, - @IExtensionGalleryService private readonly extensionGalleryService: IExtensionGalleryService, + // @IExtensionGalleryService private readonly extensionGalleryService: IExtensionGalleryService, {{SQL CARBON EDIT}} no unused @IViewletService private readonly viewletService: IViewletService, @IConfigurationService private readonly configurationService: IConfigurationService @@ -166,7 +166,7 @@ class SelectIconThemeAction extends Action { } } -function configurationEntries(extensionGalleryService: IExtensionGalleryService, label: string): QuickPickInput[] { +/*function configurationEntries(extensionGalleryService: IExtensionGalleryService, label: string): QuickPickInput[] { {{SQL CARBON EDIT}} comment out function for no unused if (extensionGalleryService.isEnabled()) { return [ { @@ -180,7 +180,7 @@ function configurationEntries(extensionGalleryService: IExtensionGalleryService, ]; } return []; -} +}*/ function openExtensionViewlet(viewletService: IViewletService, query: string) { return viewletService.openViewlet(VIEWLET_ID, true).then(viewlet => { diff --git a/src/vs/workbench/contrib/update/browser/update.ts b/src/vs/workbench/contrib/update/browser/update.ts index 9a1ac92a44..7b364f3999 100644 --- a/src/vs/workbench/contrib/update/browser/update.ts +++ b/src/vs/workbench/contrib/update/browser/update.ts @@ -19,7 +19,7 @@ import * as semver from 'semver-umd'; import { INotificationService, Severity } from 'vs/platform/notification/common/notification'; import { IDialogService } from 'vs/platform/dialogs/common/dialogs'; import { IWorkbenchEnvironmentService } from 'vs/workbench/services/environment/common/environmentService'; -import { ReleaseNotesManager } from './releaseNotesEditor'; +// import { ReleaseNotesManager } from './releaseNotesEditor'; import { isWindows } from 'vs/base/common/platform'; import { IConfigurationService } from 'vs/platform/configuration/common/configuration'; import { RawContextKey, IContextKey, IContextKeyService } from 'vs/platform/contextkey/common/contextkey'; @@ -36,24 +36,15 @@ import { IElectronEnvironmentService } from 'vs/workbench/services/electron/elec const CONTEXT_UPDATE_STATE = new RawContextKey('updateState', StateType.Uninitialized); -let releaseNotesManager: ReleaseNotesManager | undefined = undefined; +/*let releaseNotesManager: ReleaseNotesManager | undefined = undefined; {{SQL CARBON EDIT}} comment out for no unused function showReleaseNotes(instantiationService: IInstantiationService, version: string) { - /* // {{SQL CARBON EDIT}} just open release notes in browser until we can get ADS release notes from the web if (!releaseNotesManager) { releaseNotesManager = instantiationService.createInstance(ReleaseNotesManager); } return instantiationService.invokeFunction(accessor => releaseNotesManager!.show(accessor, version)); - */ - - // {{SQL CARBON EDIT}} Open release notes in browser until we can get ADS notes from web - return instantiationService.invokeFunction(async accessor => { - const action = accessor.get(IInstantiationService).createInstance(OpenLatestReleaseNotesInBrowserAction); - await action.run(); - }); - -} +}*/ export class OpenLatestReleaseNotesInBrowserAction extends Action { @@ -78,7 +69,7 @@ export abstract class AbstractShowReleaseNotesAction extends Action { constructor( id: string, label: string, - private version: string, + /*private */version: string, // {{SQL CARBON EDIT}} no unused @IInstantiationService private readonly instantiationService: IInstantiationService ) { super(id, label, undefined, true); diff --git a/src/vs/workbench/contrib/watermark/browser/watermark.ts b/src/vs/workbench/contrib/watermark/browser/watermark.ts index a8880c6547..651a877614 100644 --- a/src/vs/workbench/contrib/watermark/browser/watermark.ts +++ b/src/vs/workbench/contrib/watermark/browser/watermark.ts @@ -5,7 +5,7 @@ import 'vs/css!./watermark'; import { Disposable, DisposableStore } from 'vs/base/common/lifecycle'; -import { assign } from 'vs/base/common/objects'; +// import { assign } from 'vs/base/common/objects'; import { isMacintosh, OS } from 'vs/base/common/platform'; import { IKeybindingService } from 'vs/platform/keybinding/common/keybinding'; import * as nls from 'vs/nls'; @@ -16,18 +16,18 @@ import { IWorkbenchContribution, IWorkbenchContributionsRegistry, Extensions as import { ILifecycleService, LifecyclePhase } from 'vs/platform/lifecycle/common/lifecycle'; import { IConfigurationService } from 'vs/platform/configuration/common/configuration'; import { GlobalNewUntitledFileAction } from 'vs/workbench/contrib/files/browser/fileActions'; -import { OpenFolderAction, OpenFileFolderAction, OpenFileAction } from 'vs/workbench/browser/actions/workspaceActions'; -import { ShowAllCommandsAction } from 'vs/workbench/contrib/quickopen/browser/commandsHandler'; +// import { OpenFolderAction, OpenFileFolderAction, OpenFileAction } from 'vs/workbench/browser/actions/workspaceActions'; +// import { ShowAllCommandsAction } from 'vs/workbench/contrib/quickopen/browser/commandsHandler'; import { Parts, IWorkbenchLayoutService } from 'vs/workbench/services/layout/browser/layoutService'; -import { StartAction } from 'vs/workbench/contrib/debug/browser/debugActions'; +// import { StartAction } from 'vs/workbench/contrib/debug/browser/debugActions'; import { FindInFilesActionId } from 'vs/workbench/contrib/search/common/constants'; -import { QUICKOPEN_ACTION_ID } from 'vs/workbench/browser/parts/quickopen/quickopen'; +// import { QUICKOPEN_ACTION_ID } from 'vs/workbench/browser/parts/quickopen/quickopen'; import * as dom from 'vs/base/browser/dom'; import { KeybindingLabel } from 'vs/base/browser/ui/keybindingLabel/keybindingLabel'; import { IEditorGroupsService } from 'vs/workbench/services/editor/common/editorGroupsService'; import { CommandsRegistry } from 'vs/platform/commands/common/commands'; import { IDimension } from 'vs/platform/layout/browser/layoutService'; -import { TERMINAL_COMMAND_ID } from 'vs/workbench/contrib/terminal/common/terminal'; +// import { TERMINAL_COMMAND_ID } from 'vs/workbench/contrib/terminal/common/terminal'; import { assertIsDefined } from 'vs/base/common/types'; // {{SQL CARBON EDIT}} @@ -47,7 +47,7 @@ const showServers: WatermarkEntry = { text: nls.localize('watermark.showServers' const newSqlFile: WatermarkEntry = { text: nls.localize('watermark.newSqlFile', "New SQL File"), id: GlobalNewUntitledFileAction.ID }; const newNotebook: WatermarkEntry = { text: nls.localize('watermark.newNotebook', "New Notebook"), id: NewNotebookAction.ID }; -const showCommands: WatermarkEntry = { text: nls.localize('watermark.showCommands', "Show All Commands"), id: ShowAllCommandsAction.ID }; +/*const showCommands: WatermarkEntry = { text: nls.localize('watermark.showCommands', "Show All Commands"), id: ShowAllCommandsAction.ID }; {{SQL CARBON EDIT}} no unused const quickOpen: WatermarkEntry = { text: nls.localize('watermark.quickOpen', "Go to File"), id: QUICKOPEN_ACTION_ID }; const openFileNonMacOnly: WatermarkEntry = { text: nls.localize('watermark.openFile', "Open File"), id: OpenFileAction.ID, mac: false }; const openFolderNonMacOnly: WatermarkEntry = { text: nls.localize('watermark.openFolder', "Open Folder"), id: OpenFolderAction.ID, mac: false }; @@ -55,9 +55,9 @@ const openFileOrFolderMacOnly: WatermarkEntry = { text: nls.localize('watermark. const openRecent: WatermarkEntry = { text: nls.localize('watermark.openRecent', "Open Recent"), id: 'workbench.action.openRecent' }; const newUntitledFile: WatermarkEntry = { text: nls.localize('watermark.newUntitledFile', "New Untitled File"), id: GlobalNewUntitledFileAction.ID }; const newUntitledFileMacOnly: WatermarkEntry = assign({ mac: true }, newUntitledFile); -const toggleTerminal: WatermarkEntry = { text: nls.localize({ key: 'watermark.toggleTerminal', comment: ['toggle is a verb here'] }, "Toggle Terminal"), id: TERMINAL_COMMAND_ID.TOGGLE }; +const toggleTerminal: WatermarkEntry = { text: nls.localize({ key: 'watermark.toggleTerminal', comment: ['toggle is a verb here'] }, "Toggle Terminal"), id: TERMINAL_COMMAND_ID.TOGGLE };*/ const findInFiles: WatermarkEntry = { text: nls.localize('watermark.findInFiles', "Find in Files"), id: FindInFilesActionId }; -const startDebugging: WatermarkEntry = { text: nls.localize('watermark.startDebugging', "Start Debugging"), id: StartAction.ID }; +// const startDebugging: WatermarkEntry = { text: nls.localize('watermark.startDebugging', "Start Debugging"), id: StartAction.ID }; {{SQL CARBON EDIT}} no unused // {{SQL CARBON EDIT}} - Replace noFolderEntries and folderEntries const noFolderEntries = [ diff --git a/src/vs/workbench/contrib/welcome/overlay/browser/welcomeOverlay.ts b/src/vs/workbench/contrib/welcome/overlay/browser/welcomeOverlay.ts index 110372fa68..16c9634e08 100644 --- a/src/vs/workbench/contrib/welcome/overlay/browser/welcomeOverlay.ts +++ b/src/vs/workbench/contrib/welcome/overlay/browser/welcomeOverlay.ts @@ -5,19 +5,19 @@ import 'vs/css!./welcomeOverlay'; import * as dom from 'vs/base/browser/dom'; -import { Registry } from 'vs/platform/registry/common/platform'; +// import { Registry } from 'vs/platform/registry/common/platform'; import { IKeybindingService } from 'vs/platform/keybinding/common/keybinding'; import { ShowAllCommandsAction } from 'vs/workbench/contrib/quickopen/browser/commandsHandler'; import { IEditorService } from 'vs/workbench/services/editor/common/editorService'; import { IWorkbenchLayoutService } from 'vs/workbench/services/layout/browser/layoutService'; import { localize } from 'vs/nls'; import { Action } from 'vs/base/common/actions'; -import { IWorkbenchActionRegistry, Extensions } from 'vs/workbench/common/actions'; -import { SyncActionDescriptor } from 'vs/platform/actions/common/actions'; +// import { IWorkbenchActionRegistry, Extensions } from 'vs/workbench/common/actions'; +// import { SyncActionDescriptor } from 'vs/platform/actions/common/actions'; import { ICommandService } from 'vs/platform/commands/common/commands'; import { Disposable } from 'vs/base/common/lifecycle'; import { RawContextKey, IContextKey, IContextKeyService } from 'vs/platform/contextkey/common/contextkey'; -import { KeyCode } from 'vs/base/common/keyCodes'; +// import { KeyCode } from 'vs/base/common/keyCodes'; import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation'; import { registerThemingParticipant } from 'vs/platform/theme/common/themeService'; import { textPreformatForeground, foreground } from 'vs/platform/theme/common/colorRegistry'; diff --git a/src/vs/workbench/contrib/welcome/walkThrough/browser/walkThrough.contribution.ts b/src/vs/workbench/contrib/welcome/walkThrough/browser/walkThrough.contribution.ts index 2330b83f78..7000c73ef2 100644 --- a/src/vs/workbench/contrib/welcome/walkThrough/browser/walkThrough.contribution.ts +++ b/src/vs/workbench/contrib/welcome/walkThrough/browser/walkThrough.contribution.ts @@ -13,7 +13,7 @@ import { Registry } from 'vs/platform/registry/common/platform'; import { Extensions as EditorInputExtensions, IEditorInputFactoryRegistry } from 'vs/workbench/common/editor'; import { SyncDescriptor } from 'vs/platform/instantiation/common/descriptors'; import { IWorkbenchActionRegistry, Extensions } from 'vs/workbench/common/actions'; -import { SyncActionDescriptor, MenuRegistry, MenuId } from 'vs/platform/actions/common/actions'; +import { SyncActionDescriptor, /*MenuRegistry, MenuId*/ } from 'vs/platform/actions/common/actions'; import { IWorkbenchContributionsRegistry, Extensions as WorkbenchExtensions } from 'vs/workbench/common/contributions'; import { IEditorRegistry, Extensions as EditorExtensions, EditorDescriptor } from 'vs/workbench/browser/editor'; import { LifecyclePhase } from 'vs/platform/lifecycle/common/lifecycle'; diff --git a/src/vs/workbench/services/extensions/worker/extHost.services.ts b/src/vs/workbench/services/extensions/worker/extHost.services.ts index 86613c8dc5..aa0f90c762 100644 --- a/src/vs/workbench/services/extensions/worker/extHost.services.ts +++ b/src/vs/workbench/services/extensions/worker/extHost.services.ts @@ -11,8 +11,8 @@ import { IExtHostConfiguration, ExtHostConfiguration } from 'vs/workbench/api/co import { IExtHostCommands, ExtHostCommands } from 'vs/workbench/api/common/extHostCommands'; import { IExtHostDocumentsAndEditors, ExtHostDocumentsAndEditors } from 'vs/workbench/api/common/extHostDocumentsAndEditors'; import { IExtHostTerminalService, WorkerExtHostTerminalService } from 'vs/workbench/api/common/extHostTerminalService'; -import { IExtHostTask, WorkerExtHostTask } from 'vs/workbench/api/common/extHostTask'; -import { IExtHostDebugService } from 'vs/workbench/api/common/extHostDebugService'; +// import { IExtHostTask, WorkerExtHostTask } from 'vs/workbench/api/common/extHostTask'; +// import { IExtHostDebugService } from 'vs/workbench/api/common/extHostDebugService'; import { IExtHostSearch } from 'vs/workbench/api/common/extHostSearch'; import { IExtensionStoragePaths } from 'vs/workbench/api/common/extHostStoragePaths'; import { IExtHostExtensionService } from 'vs/workbench/api/common/extHostExtensionService';