mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-06 09:35:41 -05:00
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:
@@ -3,7 +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';
|
||||
|
||||
@@ -116,7 +115,7 @@ export class ApiWrapper {
|
||||
|
||||
public openTextDocument(uri: vscode.Uri): Thenable<vscode.TextDocument>;
|
||||
public openTextDocument(options: { language?: string; content?: string; }): Thenable<vscode.TextDocument>;
|
||||
public openTextDocument(uriOrOptions): Thenable<vscode.TextDocument> {
|
||||
public openTextDocument(uriOrOptions: any): Thenable<vscode.TextDocument> {
|
||||
return vscode.workspace.openTextDocument(uriOrOptions);
|
||||
}
|
||||
|
||||
|
||||
@@ -3,7 +3,6 @@
|
||||
* Licensed under the Source EULA. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
'use strict';
|
||||
import * as nls from 'vscode-nls';
|
||||
import * as azdata from 'azdata';
|
||||
import { AppContext } from '../appContext';
|
||||
@@ -180,4 +179,3 @@ export function refreshCommand(appContext: AppContext, tree: CmsResourceTreeProv
|
||||
tree.notifyNodeChanged(node);
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -3,7 +3,6 @@
|
||||
* Licensed under the Source EULA. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
'use strict';
|
||||
import { AppContext } from '../appContext';
|
||||
import { CmsResourceTreeProvider } from './tree/treeProvider';
|
||||
import {
|
||||
|
||||
@@ -3,12 +3,10 @@
|
||||
* Licensed under the Source EULA. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
'use strict';
|
||||
|
||||
export enum CmsResourceItemType {
|
||||
cmsMessageNodeContainer = 'cms.resource.itemType.cmsMessageNodeContainer',
|
||||
cmsEmptyNodeContainer = 'cms.resource.itemType.cmsEmptyNodeContainer',
|
||||
cmsNodeContainer = 'cms.resource.itemType.databaseServerContainer',
|
||||
registeredServer = 'cms.resource.itemType.databaseServer',
|
||||
serverGroup = 'cms.resource.itemType.serverGroup'
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,8 +3,6 @@
|
||||
* Licensed under the Source EULA. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
'use strict';
|
||||
|
||||
import { TreeItem, TreeItemCollapsibleState } from 'vscode';
|
||||
import { NodeInfo } from 'azdata';
|
||||
|
||||
|
||||
@@ -3,7 +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 { AppContext } from '../../appContext';
|
||||
import { TreeNode } from '../treeNode';
|
||||
@@ -45,4 +44,4 @@ export interface ICmsResourceNodeInfo {
|
||||
description: string;
|
||||
ownerUri: string;
|
||||
connection: azdata.connection.Connection;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,8 +3,6 @@
|
||||
* Licensed under the Source EULA. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
'use strict';
|
||||
|
||||
import { TreeItem, TreeItemCollapsibleState } from 'vscode';
|
||||
import { NodeInfo } from 'azdata';
|
||||
import * as nls from 'vscode-nls';
|
||||
|
||||
@@ -3,10 +3,9 @@
|
||||
* Licensed under the Source EULA. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
'use strict';
|
||||
import * as azdata from 'azdata';
|
||||
import * as nls from 'vscode-nls';
|
||||
import { TreeItemCollapsibleState, TreeItem } from 'vscode';
|
||||
import { TreeItemCollapsibleState } from 'vscode';
|
||||
import { AppContext } from '../../appContext';
|
||||
import { TreeNode } from '../treeNode';
|
||||
import { CmsResourceTreeNodeBase } from './baseTreeNodes';
|
||||
|
||||
@@ -3,7 +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 { TreeItemCollapsibleState } from 'vscode';
|
||||
import { TreeNode } from '../treeNode';
|
||||
@@ -27,8 +26,8 @@ export class RegisteredServerTreeNode extends CmsResourceTreeNodeBase {
|
||||
super(name, description, ownerUri, appContext, treeChangeHandler, parent);
|
||||
}
|
||||
|
||||
public async getChildren(): Promise<TreeNode[]> {
|
||||
return;
|
||||
public async getChildren(): Promise<TreeNode[] | undefined> {
|
||||
return undefined;
|
||||
}
|
||||
|
||||
public getTreeItem(): azdata.TreeItem | Promise<azdata.TreeItem> {
|
||||
@@ -37,8 +36,8 @@ export class RegisteredServerTreeNode extends CmsResourceTreeNodeBase {
|
||||
connectionName: this.name ? this.name : this.serverName,
|
||||
serverName: this.serverName,
|
||||
databaseName: '',
|
||||
userName: undefined,
|
||||
password: undefined,
|
||||
userName: undefined as string,
|
||||
password: undefined as string,
|
||||
authenticationType: 'Integrated',
|
||||
savePassword: false,
|
||||
groupFullName: '',
|
||||
|
||||
@@ -3,8 +3,6 @@
|
||||
* Licensed under the Source EULA. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
'use strict';
|
||||
|
||||
import { TreeItem, TreeItemCollapsibleState } from 'vscode';
|
||||
import * as azdata from 'azdata';
|
||||
import { TreeNode } from '../treeNode';
|
||||
@@ -33,7 +31,7 @@ export class ServerGroupTreeNode extends CmsResourceTreeNodeBase {
|
||||
}
|
||||
public getChildren(): TreeNode[] | Promise<TreeNode[]> {
|
||||
try {
|
||||
let nodes = [];
|
||||
let nodes: TreeNode[] = [];
|
||||
return this.appContext.cmsUtils.getRegisteredServers(this.ownerUri, this.relativePath).then((result) => {
|
||||
if (result) {
|
||||
if (result.registeredServersList) {
|
||||
|
||||
@@ -3,8 +3,6 @@
|
||||
* Licensed under the Source EULA. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
'use strict';
|
||||
|
||||
import { TreeNode } from '../treeNode';
|
||||
|
||||
export interface ICmsResourceTreeChangeHandler {
|
||||
|
||||
@@ -3,7 +3,6 @@
|
||||
* Licensed under the Source EULA. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
'use strict';
|
||||
import { TreeDataProvider, EventEmitter, Event, TreeItem } from 'vscode';
|
||||
import { AppContext } from '../../appContext';
|
||||
import * as nls from 'vscode-nls';
|
||||
@@ -14,7 +13,6 @@ import { CmsResourceEmptyTreeNode } from './cmsResourceEmptyTreeNode';
|
||||
import { ICmsResourceTreeChangeHandler } from './treeChangeHandler';
|
||||
import { CmsResourceMessageTreeNode } from '../messageTreeNode';
|
||||
import { CmsResourceTreeNode } from './cmsResourceTreeNode';
|
||||
import { ICmsResourceNodeInfo } from './baseTreeNodes';
|
||||
|
||||
export class CmsResourceTreeProvider implements TreeDataProvider<TreeNode>, ICmsResourceTreeChangeHandler {
|
||||
|
||||
@@ -38,7 +36,7 @@ export class CmsResourceTreeProvider implements TreeDataProvider<TreeNode>, ICms
|
||||
// to determine whether the system has been initialized.
|
||||
const cachedServers = this._appContext.cmsUtils.getSavedServers();
|
||||
if (cachedServers && cachedServers.length > 0) {
|
||||
const servers = [];
|
||||
const servers: CmsResourceTreeNode[] = [];
|
||||
cachedServers.forEach(async (server) => {
|
||||
servers.push(new CmsResourceTreeNode(
|
||||
server.name,
|
||||
|
||||
@@ -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 * as vscode from 'vscode';
|
||||
|
||||
|
||||
@@ -3,7 +3,6 @@
|
||||
* Licensed under the Source EULA. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
'use strict';
|
||||
import * as nls from 'vscode-nls';
|
||||
import * as vscode from 'vscode';
|
||||
import * as azdata from 'azdata';
|
||||
@@ -89,12 +88,13 @@ export class CmsUtils {
|
||||
return this._cmsService;
|
||||
}
|
||||
|
||||
public async getRegisteredServers(ownerUri: string, relativePath: string): Promise<mssql.ListRegisteredServersResult> {
|
||||
public async getRegisteredServers(ownerUri: string, relativePath: string): Promise<mssql.ListRegisteredServersResult | undefined> {
|
||||
const cmsService = await this.getCmsService();
|
||||
const result = await cmsService.getRegisteredServers(ownerUri, relativePath);
|
||||
if (result && result.registeredServersList && result.registeredServersList) {
|
||||
return result;
|
||||
}
|
||||
return undefined;
|
||||
}
|
||||
|
||||
public async createCmsServer(connection: azdata.connection.Connection,
|
||||
@@ -166,7 +166,7 @@ export class CmsUtils {
|
||||
}
|
||||
|
||||
public async addRegisteredServer(relativePath: string, ownerUri: string,
|
||||
parentServerName?: string): Promise<boolean> {
|
||||
parentServerName?: string): Promise<boolean | undefined> {
|
||||
let provider = await this.getCmsService();
|
||||
// Initial profile to disallow SQL Login without
|
||||
// changing provider.
|
||||
@@ -200,6 +200,7 @@ export class CmsUtils {
|
||||
return result;
|
||||
}
|
||||
}
|
||||
return undefined;
|
||||
}
|
||||
|
||||
public async removeRegisteredServer(registeredServerName: string, relativePath: string, ownerUri: string): Promise<boolean> {
|
||||
@@ -232,7 +233,7 @@ export class CmsUtils {
|
||||
return this._credentialProvider;
|
||||
}
|
||||
|
||||
public async makeConnection(initialConnectionProfile?: azdata.IConnectionProfile): Promise<azdata.connection.Connection> {
|
||||
public async makeConnection(initialConnectionProfile?: azdata.IConnectionProfile): Promise<azdata.connection.Connection | undefined> {
|
||||
if (!initialConnectionProfile) {
|
||||
initialConnectionProfile = {
|
||||
connectionName: undefined,
|
||||
@@ -261,6 +262,7 @@ export class CmsUtils {
|
||||
}
|
||||
return connection;
|
||||
}
|
||||
return undefined;
|
||||
}
|
||||
|
||||
// Static Functions
|
||||
|
||||
@@ -3,8 +3,6 @@
|
||||
* Licensed under the Source EULA. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
'use strict';
|
||||
|
||||
import ControllerBase from './controllerBase';
|
||||
import { CmsResourceTreeProvider } from '../cmsResource/tree/treeProvider';
|
||||
import { registerCmsResourceCommands } from '../cmsResource/commands';
|
||||
|
||||
@@ -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 { AppContext } from '../appContext';
|
||||
@@ -31,4 +29,3 @@ export default abstract class ControllerBase implements vscode.Disposable {
|
||||
this.deactivate();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -3,7 +3,6 @@
|
||||
* Licensed under the Source EULA. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
'use strict';
|
||||
import 'mocha';
|
||||
import * as vscode from 'vscode';
|
||||
import * as should from 'should';
|
||||
@@ -13,7 +12,6 @@ import { ApiWrapper } from '../../../apiWrapper';
|
||||
import { CmsResourceTreeProvider } from '../../../cmsResource/tree/treeProvider';
|
||||
import { CmsResourceMessageTreeNode } from '../../../cmsResource/messageTreeNode';
|
||||
import { CmsResourceEmptyTreeNode } from '../../../cmsResource/tree/cmsResourceEmptyTreeNode';
|
||||
import { CmsResourceTreeNode } from '../../../cmsResource/tree/cmsResourceTreeNode';
|
||||
import { CmsUtils } from '../../../cmsUtils';
|
||||
|
||||
// Mock services
|
||||
|
||||
Reference in New Issue
Block a user