mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-01-27 01:25:36 -05:00
No unused locals (#8231)
* add no unused local * fix strict null * fix compile errors * update vscode comments
This commit is contained in:
@@ -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,
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -44,7 +44,7 @@ export interface DialogComponentParams extends IBootstrapParams {
|
||||
export class DialogContainer implements AfterViewInit {
|
||||
private _onResize = new Emitter<void>();
|
||||
public readonly onResize: Event<void> = this._onResize.event;
|
||||
private _dialogPane: DialogPane;
|
||||
public _dialogPane: DialogPane;
|
||||
|
||||
public modelViewId: string;
|
||||
@ViewChild(ModelViewContent) private _modelViewContent: ModelViewContent;
|
||||
|
||||
@@ -31,7 +31,6 @@ export class DialogModal extends Modal {
|
||||
private _onCancel = new Emitter<void>();
|
||||
|
||||
// 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) => {
|
||||
|
||||
@@ -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'));
|
||||
|
||||
|
||||
@@ -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) {
|
||||
|
||||
@@ -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';
|
||||
|
||||
@@ -73,7 +73,7 @@ const notebookRegistry = Registry.as<INotebookProviderRegistry>(Extensions.Noteb
|
||||
|
||||
class ProviderDescriptor {
|
||||
private _instanceReady = new Deferred<INotebookProvider>();
|
||||
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<string>(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));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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<string>();
|
||||
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);
|
||||
|
||||
@@ -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';
|
||||
|
||||
|
||||
Reference in New Issue
Block a user