Add compile options to a few extensions (#8252)

* add compile options to a few extensions

* move dep to dev dep

* fix return types
This commit is contained in:
Anthony Dresser
2019-11-07 11:41:31 -08:00
committed by GitHub
parent b364e32beb
commit ef0a92d83f
68 changed files with 121 additions and 211 deletions

View File

@@ -3,8 +3,6 @@
* Licensed under the Source EULA. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
'use strict';
import * as vscode from 'vscode';
import * as azdata from 'azdata';
import { IControllerTreeChangeHandler } from './controllerTreeChangeHandler';
@@ -129,20 +127,20 @@ export class ControllerRootNode extends ControllerTreeNode {
}
}
public deleteControllerNode(url: string, auth: AuthType, username: string): ControllerNode {
public deleteControllerNode(url: string, auth: AuthType, username: string): ControllerNode[] | undefined {
if (!url || (auth === 'basic' && !username)) {
return undefined;
}
let nodes = this.children as ControllerNode[];
let index = nodes.findIndex(e => isControllerMatch(e, url, auth, username));
let deleted = undefined;
let deleted: ControllerNode[] | undefined;
if (index >= 0) {
deleted = nodes.splice(index, 1);
}
return deleted;
}
private getExistingControllerNode(url: string, auth: AuthType, username: string): ControllerNode {
private getExistingControllerNode(url: string, auth: AuthType, username: string): ControllerNode | undefined {
if (!url || !username) {
return undefined;
}
@@ -169,7 +167,7 @@ export class ControllerNode extends ControllerTreeNode {
this.description = description;
}
public async getChildren(): Promise<ControllerTreeNode[]> {
public async getChildren(): Promise<ControllerTreeNode[] | undefined> {
if (this.children && this.children.length > 0) {
this.clearChildren();
}
@@ -178,11 +176,12 @@ export class ControllerNode extends ControllerTreeNode {
vscode.commands.executeCommand('bigDataClusters.command.addController', this);
return this.children as ControllerTreeNode[];
}
return undefined;
}
public static toIpAndPort(url: string): string {
public static toIpAndPort(url: string): string | undefined {
if (!url) {
return;
return undefined;
}
return url.trim().replace(/ /g, '').replace(/^.+\:\/\//, '');
}
@@ -245,4 +244,3 @@ export class ControllerNode extends ControllerTreeNode {
function isControllerMatch(node: ControllerNode, url: string, auth: string, username: string): unknown {
return node.url === url && node.auth === auth && node.username === username;
}