mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-01-17 09:35:37 -05:00
Renable Strict TSLint (#5018)
* removes more builder references * remove builder from profiler * formatting * fix profiler dailog * remove builder from oatuhdialog * remove the rest of builder references * formatting * add more strict null checks to base * enable strict tslint rules * fix formatting * fix compile error * fix the rest of the hygeny issues and add pipeline step * fix pipeline files
This commit is contained in:
@@ -3,8 +3,6 @@
|
||||
* Licensed under the Source EULA. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
'use strict';
|
||||
|
||||
import * as azdata from 'azdata';
|
||||
import { Disposable } from 'vs/workbench/api/common/extHostTypes';
|
||||
import {
|
||||
@@ -143,7 +141,7 @@ export class ExtHostAccountManagement extends ExtHostAccountManagementShape {
|
||||
|
||||
/**
|
||||
* This method is for testing only, it is not exposed via the shape.
|
||||
* @return {number} Number of providers that are currently registered
|
||||
* @return Number of providers that are currently registered
|
||||
*/
|
||||
public getProviderCount(): number {
|
||||
return Object.keys(this._providers).length;
|
||||
|
||||
@@ -2,7 +2,6 @@
|
||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
* Licensed under the Source EULA. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
'use strict';
|
||||
|
||||
import { IMainContext } from 'vs/workbench/api/common/extHost.protocol';
|
||||
import { SqlMainContext, MainThreadCredentialManagementShape, ExtHostCredentialManagementShape } from 'sql/workbench/api/node/sqlExtHost.protocol';
|
||||
@@ -93,7 +92,7 @@ export class ExtHostCredentialManagement extends ExtHostCredentialManagementShap
|
||||
|
||||
/**
|
||||
* Helper method for tests. Not exposed via shape.
|
||||
* @return {number} Number of providers registered
|
||||
* @return Number of providers registered
|
||||
*/
|
||||
public getProviderCount(): number {
|
||||
return Object.keys(this._adapter).length;
|
||||
|
||||
@@ -358,11 +358,11 @@ export class ExtHostDataProtocol extends ExtHostDataProtocolShape {
|
||||
}
|
||||
|
||||
public $expandObjectExplorerNode(handle: number, nodeInfo: azdata.ExpandNodeInfo): Thenable<boolean> {
|
||||
return this._resolveProvider<azdata.ObjectExplorerProviderBase> (handle).expandNode(nodeInfo);
|
||||
return this._resolveProvider<azdata.ObjectExplorerProviderBase>(handle).expandNode(nodeInfo);
|
||||
}
|
||||
|
||||
public $refreshObjectExplorerNode(handle: number, nodeInfo: azdata.ExpandNodeInfo): Thenable<boolean> {
|
||||
return this._resolveProvider<azdata.ObjectExplorerProviderBase> (handle).refreshNode(nodeInfo);
|
||||
return this._resolveProvider<azdata.ObjectExplorerProviderBase>(handle).refreshNode(nodeInfo);
|
||||
}
|
||||
|
||||
public $closeObjectExplorerSession(handle: number, closeSessionInfo: azdata.ObjectExplorerCloseSessionInfo): Thenable<azdata.ObjectExplorerCloseSessionResponse> {
|
||||
|
||||
@@ -99,15 +99,15 @@ export class ExtHostTreeView<T> extends vsTreeExt.ExtHostTreeView<T> {
|
||||
console.error(`No tree item with id \'${parentHandle}\' found.`);
|
||||
}
|
||||
|
||||
this._onNodeCheckedChanged.fire({element: parentElement, checked: checked});
|
||||
this._onNodeCheckedChanged.fire({ element: parentElement, checked: checked });
|
||||
}
|
||||
|
||||
onNodeSelectedChanged(parentHandles?: vsTreeExt.TreeItemHandle[]): void {
|
||||
if (parentHandles) {
|
||||
let nodes = parentHandles.map(parentHandle => {
|
||||
return parentHandle ? this.getExtensionElement(parentHandle) : void 0;
|
||||
return parentHandle ? this.getExtensionElement(parentHandle) : void 0;
|
||||
});
|
||||
this._onChangeSelection.fire({ selection: nodes});
|
||||
this._onChangeSelection.fire({ selection: nodes });
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -2,7 +2,6 @@
|
||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
* Licensed under the Source EULA. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
'use strict';
|
||||
|
||||
import * as azdata from 'azdata';
|
||||
import * as vscode from 'vscode';
|
||||
@@ -99,7 +98,7 @@ export class ExtHostNotebook implements ExtHostNotebookShape {
|
||||
};
|
||||
return details;
|
||||
} catch (error) {
|
||||
throw typeof(error) === 'string' ? new Error(error) : error;
|
||||
throw typeof (error) === 'string' ? new Error(error) : error;
|
||||
}
|
||||
});
|
||||
}
|
||||
@@ -231,7 +230,7 @@ export class ExtHostNotebook implements ExtHostNotebookShape {
|
||||
}
|
||||
|
||||
private findManagerForUri(uriString: string): NotebookManagerAdapter {
|
||||
for(let manager of this.getAdapters(NotebookManagerAdapter)) {
|
||||
for (let manager of this.getAdapters(NotebookManagerAdapter)) {
|
||||
if (manager.uriString === uriString) {
|
||||
return manager;
|
||||
}
|
||||
@@ -279,7 +278,7 @@ export class ExtHostNotebook implements ExtHostNotebookShape {
|
||||
let value = await callback(manager);
|
||||
return value;
|
||||
} catch (error) {
|
||||
throw typeof(error) === 'string' ? new Error(error) : error;
|
||||
throw typeof (error) === 'string' ? new Error(error) : error;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -2,7 +2,6 @@
|
||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
* Licensed under the Source EULA. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
'use strict';
|
||||
|
||||
import * as azdata from 'azdata';
|
||||
|
||||
@@ -91,7 +90,7 @@ export class ExtHostNotebookDocumentData implements IDisposable {
|
||||
}
|
||||
|
||||
private _validateIndex(index: number): number {
|
||||
if (typeof(index) !== 'number') {
|
||||
if (typeof (index) !== 'number') {
|
||||
throw new Error('Invalid argument');
|
||||
}
|
||||
|
||||
|
||||
@@ -2,7 +2,6 @@
|
||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
* Licensed under the Source EULA. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
'use strict';
|
||||
|
||||
import * as azdata from 'azdata';
|
||||
import * as vscode from 'vscode';
|
||||
@@ -70,7 +69,7 @@ export class NotebookEditorEdit {
|
||||
private getAsRange(location: number | CellRange): CellRange {
|
||||
let range: CellRange = null;
|
||||
if (typeof (location) === 'number') {
|
||||
range = new CellRange(location, location+1);
|
||||
range = new CellRange(location, location + 1);
|
||||
}
|
||||
else if (location instanceof CellRange) {
|
||||
range = location;
|
||||
@@ -81,7 +80,7 @@ export class NotebookEditorEdit {
|
||||
return range;
|
||||
}
|
||||
|
||||
insertCell(value: Partial<azdata.nb.ICellContents>, location?: number): void {
|
||||
insertCell(value: Partial<azdata.nb.ICellContents>, location?: number): void {
|
||||
if (location === null || location === undefined) {
|
||||
// If not specified, assume adding to end of list
|
||||
location = this._document.cells.length;
|
||||
@@ -92,11 +91,11 @@ export class NotebookEditorEdit {
|
||||
deleteCell(index: number): void {
|
||||
let range: CellRange = null;
|
||||
|
||||
if (typeof(index) === 'number') {
|
||||
if (typeof (index) === 'number') {
|
||||
// Currently only allowing single-cell deletion.
|
||||
// Do this by saying the range extends over 1 cell so on the main thread
|
||||
// we can delete that cell, then handle insertions
|
||||
range = new CellRange(index, index+1);
|
||||
range = new CellRange(index, index + 1);
|
||||
} else {
|
||||
throw new Error('Unrecognized index');
|
||||
}
|
||||
@@ -104,7 +103,7 @@ export class NotebookEditorEdit {
|
||||
this._pushEdit(range, null, true);
|
||||
}
|
||||
|
||||
private _pushEdit(range: azdata.nb.CellRange, cell: Partial<azdata.nb.ICellContents>, forceMoveMarkers: boolean): void {
|
||||
private _pushEdit(range: azdata.nb.CellRange, cell: Partial<azdata.nb.ICellContents>, forceMoveMarkers: boolean): void {
|
||||
let validRange = this._document.validateCellRange(range);
|
||||
this._collectedEdits.push({
|
||||
range: validRange,
|
||||
|
||||
@@ -2,7 +2,6 @@
|
||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
* Licensed under the Source EULA. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
'use strict';
|
||||
|
||||
import { IMainContext } from 'vs/workbench/api/common/extHost.protocol';
|
||||
import { ExtHostQueryEditorShape, SqlMainContext, MainThreadQueryEditorShape } from 'sql/workbench/api/node/sqlExtHost.protocol';
|
||||
@@ -31,7 +30,7 @@ class ExtHostQueryDocument implements azdata.queryeditor.QueryDocument {
|
||||
}
|
||||
}
|
||||
|
||||
export class ExtHostQueryEditor implements ExtHostQueryEditorShape {
|
||||
export class ExtHostQueryEditor implements ExtHostQueryEditorShape {
|
||||
|
||||
private _proxy: MainThreadQueryEditorShape;
|
||||
private _nextListenerHandle: number = 0;
|
||||
@@ -57,7 +56,7 @@ export class ExtHostQueryEditor implements ExtHostQueryEditorShape {
|
||||
this._nextListenerHandle++;
|
||||
}
|
||||
|
||||
public $onQueryEvent(handle: number, fileUri:string, event: IQueryEvent): void {
|
||||
public $onQueryEvent(handle: number, fileUri: string, event: IQueryEvent): void {
|
||||
let listener: azdata.queryeditor.QueryEventListener = this._queryListeners[handle];
|
||||
if (listener) {
|
||||
let planXml = event.params ? event.params.planXml : undefined;
|
||||
|
||||
@@ -3,8 +3,6 @@
|
||||
* Licensed under the Source EULA. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
'use strict';
|
||||
|
||||
import * as azdata from 'azdata';
|
||||
import { IMainContext } from 'vs/workbench/api/common/extHost.protocol';
|
||||
import { Disposable } from 'vs/workbench/api/common/extHostTypes';
|
||||
@@ -64,7 +62,7 @@ export class ExtHostResourceProvider extends ExtHostResourceProviderShape {
|
||||
|
||||
/**
|
||||
* This method is for testing only, it is not exposed via the shape.
|
||||
* @return {number} Number of providers that are currently registered
|
||||
* @return Number of providers that are currently registered
|
||||
*/
|
||||
public getProviderCount(): number {
|
||||
return Object.keys(this._providers).length;
|
||||
|
||||
@@ -2,7 +2,6 @@
|
||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
* Licensed under the Source EULA. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
'use strict';
|
||||
|
||||
import { IDisposable, dispose } from 'vs/base/common/lifecycle';
|
||||
import {
|
||||
@@ -255,7 +254,7 @@ export class MainThreadDataProtocol implements MainThreadDataProtocolShape {
|
||||
|
||||
public $registerObjectExplorerNodeProvider(providerId: string, supportedProviderId: string, group: string, handle: number): Promise<any> {
|
||||
const self = this;
|
||||
this._objectExplorerService.registerNodeProvider(<azdata.ObjectExplorerNodeProvider> {
|
||||
this._objectExplorerService.registerNodeProvider(<azdata.ObjectExplorerNodeProvider>{
|
||||
supportedProviderId: supportedProviderId,
|
||||
providerId: providerId,
|
||||
group: group,
|
||||
|
||||
@@ -2,7 +2,6 @@
|
||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
* Licensed under the Source EULA. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
'use strict';
|
||||
|
||||
import {
|
||||
createMainContextProxyIdentifier as createMainId,
|
||||
@@ -18,7 +17,7 @@ import * as vscode from 'vscode';
|
||||
import { ITreeComponentItem } from 'sql/workbench/common/views';
|
||||
import { ITaskHandlerDescription } from 'sql/platform/tasks/common/tasks';
|
||||
import {
|
||||
IItemConfig, ModelComponentTypes, IComponentShape, IModelViewDialogDetails, IModelViewTabDetails, IModelViewButtonDetails,
|
||||
IItemConfig, IComponentShape, IModelViewDialogDetails, IModelViewTabDetails, IModelViewButtonDetails,
|
||||
IModelViewWizardDetails, IModelViewWizardPageDetails, INotebookManagerDetails, INotebookSessionDetails, INotebookKernelDetails, INotebookFutureDetails, FutureMessageType, INotebookFutureDone, ISingleNotebookEditOperation
|
||||
} from 'sql/workbench/api/common/sqlExtHostTypes';
|
||||
import { EditorViewColumn } from 'vs/workbench/api/common/shared/editor';
|
||||
@@ -460,7 +459,7 @@ export abstract class ExtHostDataProtocolShape {
|
||||
*/
|
||||
$schemaCompare(handle: number, sourceEndpointInfo: azdata.SchemaCompareEndpointInfo, targetEndpointInfo: azdata.SchemaCompareEndpointInfo, taskExecutionMode: azdata.TaskExecutionMode): Thenable<azdata.SchemaCompareResult> { throw ni(); }
|
||||
|
||||
/**
|
||||
/**
|
||||
* Schema compare generate script
|
||||
*/
|
||||
$schemaCompareGenerateScript(handle: number, operationId: string, targetDatabaseName: string, scriptFilePath: string, taskExecutionMode: azdata.TaskExecutionMode): Thenable<azdata.ResultStatus> { throw ni(); }
|
||||
@@ -768,7 +767,7 @@ export interface MainThreadModelViewDialogShape extends IDisposable {
|
||||
$setDirty(handle: number, isDirty: boolean): void;
|
||||
}
|
||||
export interface ExtHostQueryEditorShape {
|
||||
$onQueryEvent(handle: number, fileUri:string, event: IQueryEvent): void;
|
||||
$onQueryEvent(handle: number, fileUri: string, event: IQueryEvent): void;
|
||||
}
|
||||
|
||||
export interface MainThreadQueryEditorShape extends IDisposable {
|
||||
@@ -782,9 +781,7 @@ export interface ExtHostNotebookShape {
|
||||
|
||||
/**
|
||||
* Looks up a notebook manager for a given notebook URI
|
||||
* @param {number} providerHandle
|
||||
* @param {vscode.Uri} notebookUri
|
||||
* @returns {Thenable<string>} handle of the manager to be used when sending
|
||||
* @returns handle of the manager to be used when sending
|
||||
*/
|
||||
$getNotebookManager(providerHandle: number, notebookUri: UriComponents): Thenable<INotebookManagerDetails>;
|
||||
$handleNotebookClosed(notebookUri: UriComponents): void;
|
||||
@@ -887,4 +884,4 @@ export interface ExtHostExtensionManagementShape {
|
||||
|
||||
export interface MainThreadExtensionManagementShape extends IDisposable {
|
||||
$install(vsixPath: string): Thenable<string>;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user