mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-16 10:58:30 -05:00
Enable stricter compile options on extensions (#5044)
* enable stricter compile settings in extensions * more strict compile * formatting * formatting * revert some changes * formtting * formatting
This commit is contained in:
@@ -2,10 +2,8 @@
|
||||
* 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 { SqlOpsDataClient, ClientOptions, SqlOpsFeature } from 'dataprotocol-client';
|
||||
import * as path from 'path';
|
||||
import { IConfig, ServerProvider } from 'service-downloader';
|
||||
import { ServerOptions, RPCMessageType, ClientCapabilities, ServerCapabilities, TransportKind } from 'vscode-languageclient';
|
||||
import { Disposable } from 'vscode';
|
||||
|
||||
@@ -51,7 +51,6 @@ export class DacFxServicesFeature extends SqlOpsFeature<undefined> {
|
||||
|
||||
protected registerProvider(options: undefined): Disposable {
|
||||
const client = this._client;
|
||||
let self = this;
|
||||
|
||||
let exportBacpac = (databaseName: string, packageFilePath: string, ownerUri: string, taskExecutionMode: azdata.TaskExecutionMode): Thenable<azdata.DacFxResult> => {
|
||||
let params: contracts.ExportParams = { databaseName: databaseName, packageFilePath: packageFilePath, ownerUri: ownerUri, taskExecutionMode: taskExecutionMode };
|
||||
@@ -165,7 +164,6 @@ export class SchemaCompareServicesFeature extends SqlOpsFeature<undefined> {
|
||||
|
||||
protected registerProvider(options: undefined): Disposable {
|
||||
const client = this._client;
|
||||
let self = this;
|
||||
|
||||
let schemaCompare = (sourceEndpointInfo: azdata.SchemaCompareEndpointInfo, targetEndpointInfo: azdata.SchemaCompareEndpointInfo, taskExecutionMode: azdata.TaskExecutionMode): Thenable<azdata.SchemaCompareResult> => {
|
||||
let params: contracts.SchemaCompareParams = { sourceEndpointInfo: sourceEndpointInfo, targetEndpointInfo: targetEndpointInfo, taskExecutionMode: taskExecutionMode };
|
||||
@@ -729,4 +727,4 @@ export class AgentServicesFeature extends SqlOpsFeature<undefined> {
|
||||
registerOnUpdated
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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 vscode from 'vscode';
|
||||
import * as azdata from 'azdata';
|
||||
@@ -13,7 +12,7 @@ const localize = nls.loadMessageBundle();
|
||||
|
||||
import { SqlOpsDataClient, ClientOptions } from 'dataprotocol-client';
|
||||
import { IConfig, ServerProvider, Events } from 'service-downloader';
|
||||
import { ServerOptions, TransportKind, LanguageClient } from 'vscode-languageclient';
|
||||
import { ServerOptions, TransportKind } from 'vscode-languageclient';
|
||||
|
||||
import * as Constants from './constants';
|
||||
import ContextProvider from './contextProvider';
|
||||
@@ -37,7 +36,6 @@ import { registerSearchServerCommand } from './objectExplorerNodeProvider/comman
|
||||
const baseConfig = require('./config.json');
|
||||
const outputChannel = vscode.window.createOutputChannel(Constants.serviceName);
|
||||
const statusView = vscode.window.createStatusBarItem(vscode.StatusBarAlignment.Left);
|
||||
const jupyterNotebookProviderId = 'jupyter';
|
||||
const msgSampleCodeDataFrame = localize('msgSampleCodeDataFrame', 'This sample code loads the file into a data frame and shows the first 10 results.');
|
||||
|
||||
|
||||
@@ -47,7 +45,7 @@ export async function activate(context: vscode.ExtensionContext): Promise<MssqlE
|
||||
|
||||
if (!supported) {
|
||||
vscode.window.showErrorMessage('Unsupported platform');
|
||||
return;
|
||||
return undefined;
|
||||
}
|
||||
|
||||
let config: IConfig = JSON.parse(JSON.stringify(baseConfig));
|
||||
|
||||
@@ -126,7 +126,7 @@ export abstract class Command extends vscode.Disposable {
|
||||
|
||||
export abstract class ProgressCommand extends Command {
|
||||
static progressId = 0;
|
||||
constructor(private command: string, protected prompter: IPrompter, appContext: AppContext) {
|
||||
constructor(command: string, protected prompter: IPrompter, appContext: AppContext) {
|
||||
super(command, appContext);
|
||||
}
|
||||
|
||||
|
||||
@@ -3,14 +3,12 @@
|
||||
* 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';
|
||||
const localize = nls.loadMessageBundle();
|
||||
|
||||
import * as constants from '../constants';
|
||||
import { IFileSource, IHdfsOptions, IRequestParams, FileSourceFactory } from './fileSources';
|
||||
import { IFileSource, IHdfsOptions, FileSourceFactory } from './fileSources';
|
||||
|
||||
export class SqlClusterConnection {
|
||||
private _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 * as vscode from 'vscode';
|
||||
import * as azdata from 'azdata';
|
||||
import * as fs from 'fs';
|
||||
@@ -14,13 +12,12 @@ const localize = nls.loadMessageBundle();
|
||||
|
||||
import { ApiWrapper } from '../apiWrapper';
|
||||
import { Command, ICommandViewContext, ProgressCommand, ICommandObjectExplorerContext } from './command';
|
||||
import { IHdfsOptions, HdfsFileSource, File, IFile, joinHdfsPath, FileSourceFactory } from './fileSources';
|
||||
import { HdfsProvider, FolderNode, FileNode, HdfsFileSourceNode } from './hdfsProvider';
|
||||
import { File, IFile, joinHdfsPath } from './fileSources';
|
||||
import { FolderNode, FileNode, HdfsFileSourceNode } from './hdfsProvider';
|
||||
import { IPrompter, IQuestion, QuestionTypes } from '../prompts/question';
|
||||
import * as constants from '../constants';
|
||||
import * as LocalizedConstants from '../localizedConstants';
|
||||
import * as utils from '../utils';
|
||||
import { SqlClusterConnection } from './connection';
|
||||
import { AppContext } from '../appContext';
|
||||
import { TreeNode } from './treeNodes';
|
||||
import { MssqlObjectExplorerNodeProvider } from './objectExplorerNodeProvider';
|
||||
@@ -171,7 +168,6 @@ export class MkDirCommand extends ProgressCommand {
|
||||
}
|
||||
|
||||
private async mkDir(fileName, folderNode: FolderNode, cancelToken: vscode.CancellationTokenSource): Promise<void> {
|
||||
let subFolder = await folderNode.mkdir(fileName);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -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';
|
||||
import * as fspath from 'path';
|
||||
@@ -12,9 +10,8 @@ import * as fs from 'fs';
|
||||
import * as nls from 'vscode-nls';
|
||||
const localize = nls.loadMessageBundle();
|
||||
|
||||
import { ApiWrapper } from '../apiWrapper';
|
||||
import * as Constants from '../constants';
|
||||
import { IFileSource, IHdfsOptions, HdfsFileSource, IFile, File, FileSourceFactory } from './fileSources';
|
||||
import { IFileSource, IHdfsOptions, IFile, File, FileSourceFactory } from './fileSources';
|
||||
import { CancelableStream } from './cancelableStream';
|
||||
import { TreeNode } from './treeNodes';
|
||||
import * as utils from '../utils';
|
||||
@@ -38,7 +35,7 @@ export class HdfsProvider implements vscode.TreeDataProvider<TreeNode>, ITreeCha
|
||||
private _onDidChangeTreeData = new vscode.EventEmitter<TreeNode>();
|
||||
private context: TreeDataContext;
|
||||
|
||||
constructor(extensionContext: vscode.ExtensionContext, private vscodeApi: ApiWrapper) {
|
||||
constructor(extensionContext: vscode.ExtensionContext) {
|
||||
this.connections = [];
|
||||
this.context = new TreeDataContext(extensionContext, this);
|
||||
}
|
||||
|
||||
@@ -1,10 +1,7 @@
|
||||
'use strict';
|
||||
|
||||
// This code is originally from https://github.com/DonJayamanne/bowerVSCode
|
||||
// License: https://github.com/DonJayamanne/bowerVSCode/blob/master/LICENSE
|
||||
|
||||
import {window, OutputChannel } from 'vscode';
|
||||
import * as nodeUtil from 'util';
|
||||
import { window, OutputChannel } from 'vscode';
|
||||
import PromptFactory from './factory';
|
||||
import EscapeException from '../escapeException';
|
||||
import { IQuestion, IPrompter, IPromptCallback } from './question';
|
||||
@@ -13,8 +10,6 @@ import { IQuestion, IPrompter, IPromptCallback } from './question';
|
||||
export default class CodeAdapter implements IPrompter {
|
||||
|
||||
private outChannel: OutputChannel;
|
||||
private outBuffer: string = '';
|
||||
private messageLevelFormatters = {};
|
||||
constructor() {
|
||||
// TODO Decide whether output channel logging should be saved here?
|
||||
this.outChannel = window.createOutputChannel('test');
|
||||
@@ -24,15 +19,9 @@ export default class CodeAdapter implements IPrompter {
|
||||
public logError(message: any): void {
|
||||
let line = `error: ${message.message}\n Code - ${message.code}`;
|
||||
|
||||
this.outBuffer += `${line}\n`;
|
||||
this.outChannel.appendLine(line);
|
||||
}
|
||||
|
||||
private formatMessage(message: any): string {
|
||||
const prefix = `${message.level}: (${message.id}) `;
|
||||
return `${prefix}${message.message}`;
|
||||
}
|
||||
|
||||
public clearLog(): void {
|
||||
this.outChannel.clear();
|
||||
}
|
||||
@@ -58,19 +47,20 @@ export default class CodeAdapter implements IPrompter {
|
||||
|
||||
public promptSingle<T>(question: IQuestion, ignoreFocusOut?: boolean): Promise<T> {
|
||||
let questions: IQuestion[] = [question];
|
||||
return this.prompt(questions, ignoreFocusOut).then( (answers: {[key: string]: T}) => {
|
||||
return this.prompt(questions, ignoreFocusOut).then((answers: { [key: string]: T }) => {
|
||||
if (answers) {
|
||||
let response: T = answers[question.name];
|
||||
return response || undefined;
|
||||
}
|
||||
return undefined;
|
||||
});
|
||||
}
|
||||
|
||||
public prompt<T>(questions: IQuestion[], ignoreFocusOut?: boolean): Promise<{[key: string]: T}> {
|
||||
let answers: {[key: string]: T} = {};
|
||||
public prompt<T>(questions: IQuestion[], ignoreFocusOut?: boolean): Promise<{ [key: string]: T }> {
|
||||
let answers: { [key: string]: T } = {};
|
||||
|
||||
// Collapse multiple questions into a set of prompt steps
|
||||
let promptResult: Promise<{[key: string]: T}> = questions.reduce((promise: Promise<{[key: string]: T}>, question: IQuestion) => {
|
||||
let promptResult: Promise<{ [key: string]: T }> = questions.reduce((promise: Promise<{ [key: string]: T }>, question: IQuestion) => {
|
||||
this.fixQuestion(question);
|
||||
|
||||
return promise.then(() => {
|
||||
|
||||
@@ -3,13 +3,10 @@
|
||||
* 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';
|
||||
const localize = nls.loadMessageBundle();
|
||||
|
||||
import { SparkJobSubmissionModel } from './sparkJobSubmissionModel';
|
||||
import { AppContext } from '../../../appContext';
|
||||
import { ApiWrapper } from '../../../apiWrapper';
|
||||
|
||||
|
||||
@@ -10,7 +10,6 @@ import * as path from 'path';
|
||||
import * as azdata from 'azdata';
|
||||
import * as vscode from 'vscode';
|
||||
import * as which from 'which';
|
||||
import * as Constants from '../constants';
|
||||
|
||||
const localize = nls.loadMessageBundle();
|
||||
|
||||
|
||||
@@ -34,11 +34,11 @@ export function FilterErrorPath(line: string): string {
|
||||
return values[1];
|
||||
}
|
||||
}
|
||||
return undefined;
|
||||
}
|
||||
|
||||
export class Telemetry {
|
||||
private static reporter: TelemetryReporter;
|
||||
private static userId: string;
|
||||
private static platformInformation: PlatformInformation;
|
||||
private static disabled: boolean;
|
||||
|
||||
|
||||
@@ -112,6 +112,7 @@ export function getPackageInfo(packageJson: any): IPackageInfo {
|
||||
aiKey: packageJson.aiKey
|
||||
};
|
||||
}
|
||||
return undefined;
|
||||
}
|
||||
|
||||
export function generateUserId(): Promise<string> {
|
||||
|
||||
Reference in New Issue
Block a user