Update vscode-languageclient to support preselect option (#1269)

* Update vscode-languageclient to support preselect option

* Remove noUnusedLocals compiler option
This commit is contained in:
Charles Gagnon 2019-08-20 13:15:50 -07:00 коммит произвёл GitHub
Родитель 8e820b2e81
Коммит abf50c1c63
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
18 изменённых файлов: 74 добавлений и 156 удалений

100
npm-shrinkwrap.json сгенерированный
Просмотреть файл

@ -459,23 +459,15 @@
"dev": true
},
"async-done": {
"version": "1.3.1",
"resolved": "https://registry.npmjs.org/async-done/-/async-done-1.3.1.tgz",
"integrity": "sha512-R1BaUeJ4PMoLNJuk+0tLJgjmEqVsdN118+Z8O+alhnQDQgy0kmD5Mqi0DNEmMx2LM0Ed5yekKu+ZXYvIHceicg==",
"version": "1.3.2",
"resolved": "https://registry.npmjs.org/async-done/-/async-done-1.3.2.tgz",
"integrity": "sha512-uYkTP8dw2og1tu1nmza1n1CMW0qb8gWWlwqMmLb7MhBVs4BXrFziT6HXUd+/RlRA/i4H9AkofYloUbs1fwMqlw==",
"dev": true,
"requires": {
"end-of-stream": "^1.1.0",
"once": "^1.3.2",
"process-nextick-args": "^1.0.7",
"process-nextick-args": "^2.0.0",
"stream-exhaust": "^1.0.1"
},
"dependencies": {
"process-nextick-args": {
"version": "1.0.7",
"resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-1.0.7.tgz",
"integrity": "sha1-FQ4gt1ZZCtP5EJPyWk8q2L/zC6M=",
"dev": true
}
}
},
"async-each": {
@ -1182,9 +1174,9 @@
}
},
"chokidar": {
"version": "2.1.5",
"resolved": "https://registry.npmjs.org/chokidar/-/chokidar-2.1.5.tgz",
"integrity": "sha512-i0TprVWp+Kj4WRPtInjexJ8Q+BqTE909VpH8xVhXrJkoc5QC8VO9TryGOqTr+2hljzc1sC62t22h5tZePodM/A==",
"version": "2.1.6",
"resolved": "https://registry.npmjs.org/chokidar/-/chokidar-2.1.6.tgz",
"integrity": "sha512-V2jUo67OKkc6ySiRpJrjlpJKl9kDuG+Xb8VgsGzb+aEouhgS1D0weyPU4lEzdAcsCAvrih2J2BqyXqHWvVLw5g==",
"dev": true,
"requires": {
"anymatch": "^2.0.0",
@ -1202,9 +1194,9 @@
},
"dependencies": {
"fsevents": {
"version": "1.2.8",
"resolved": "https://registry.npmjs.org/fsevents/-/fsevents-1.2.8.tgz",
"integrity": "sha512-tPvHgPGB7m40CZ68xqFGkKuzN+RnpGmSV+hgeKxhRpbxdqKXUFJGC3yonBOLzQBcJyGpdZFDfCsdOC2KFsXzeA==",
"version": "1.2.9",
"resolved": "https://registry.npmjs.org/fsevents/-/fsevents-1.2.9.tgz",
"integrity": "sha512-oeyj2H3EjjonWcFjD5NvZNE9Rqe4UW+nQBU2HNeKw0koVLEFIhtyETyAakeAM3de7Z/SW5kcA+fZUait9EApnw==",
"dev": true,
"optional": true,
"requires": {
@ -1750,9 +1742,9 @@
}
},
"nan": {
"version": "2.13.2",
"resolved": "https://registry.npmjs.org/nan/-/nan-2.13.2.tgz",
"integrity": "sha512-TghvYc72wlMGMVMluVo9WRJc0mB8KxxF/gZ4YYFy7V2ZQX9l7rgbPg7vjS9mt6U5HXODVFVI2bOduCzwOMv/lw==",
"version": "2.14.0",
"resolved": "https://registry.npmjs.org/nan/-/nan-2.14.0.tgz",
"integrity": "sha512-INOFj37C7k3AfaNTtX8RhsTw7qRy7eLET14cROi9+5HAVbbHuIWUHEauBv5qT4Av2tWasiTY1Jw6puUNqRJXQg==",
"dev": true,
"optional": true
},
@ -3065,14 +3057,14 @@
}
},
"es6-weak-map": {
"version": "2.0.2",
"resolved": "https://registry.npmjs.org/es6-weak-map/-/es6-weak-map-2.0.2.tgz",
"integrity": "sha1-XjqzIlH/0VOKH45f+hNXdy+S2W8=",
"version": "2.0.3",
"resolved": "https://registry.npmjs.org/es6-weak-map/-/es6-weak-map-2.0.3.tgz",
"integrity": "sha512-p5um32HOTO1kP+w7PRnB+5lQ43Z6muuMuIMffvDN8ZB4GcnjLBV6zGStpbASIMk4DCAvEaamhe2zhyCb/QXXsA==",
"dev": true,
"requires": {
"d": "1",
"es5-ext": "^0.10.14",
"es6-iterator": "^2.0.1",
"es5-ext": "^0.10.46",
"es6-iterator": "^2.0.3",
"es6-symbol": "^3.1.1"
}
},
@ -10043,9 +10035,9 @@
}
},
"typescript": {
"version": "2.3.4",
"resolved": "https://registry.npmjs.org/typescript/-/typescript-2.3.4.tgz",
"integrity": "sha1-PTgyGCgjHkNPKHUUlZw3qCtin0I=",
"version": "3.5.3",
"resolved": "https://registry.npmjs.org/typescript/-/typescript-3.5.3.tgz",
"integrity": "sha512-ACzBtm/PhXBDId6a6sDJfroT2pOWt/oOnk4/dElG5G33ZL776N3Y6/6bKZJBFpd+b05F3Ct9qDjMeJmRWtE2/g==",
"dev": true
},
"uc.micro": {
@ -10320,9 +10312,9 @@
"integrity": "sha512-yXJmeNaw3DnnKAOKJE51sL/ZaYfWJRl1pK9dr19YFCu0ObS231AB1/LbqTKRAQ5kw8A90rA6fr4riOUpTZvQZA=="
},
"v8flags": {
"version": "3.1.2",
"resolved": "https://registry.npmjs.org/v8flags/-/v8flags-3.1.2.tgz",
"integrity": "sha512-MtivA7GF24yMPte9Rp/BWGCYQNaUj86zeYxV/x2RRJMKagImbbv3u8iJC57lNhWLPcGLJmHcHmFWkNsplbbLWw==",
"version": "3.1.3",
"resolved": "https://registry.npmjs.org/v8flags/-/v8flags-3.1.3.tgz",
"integrity": "sha512-amh9CCg3ZxkzQ48Mhcb8iX7xpAfYJgePHxWMQCBWECpOSqJUXgY26ncA61UTV0BkPqfhcy6mzwCIoP4ygxpW8w==",
"dev": true,
"requires": {
"homedir-polyfill": "^1.0.1"
@ -10660,31 +10652,39 @@
}
},
"vscode-jsonrpc": {
"version": "3.5.0",
"resolved": "https://registry.npmjs.org/vscode-jsonrpc/-/vscode-jsonrpc-3.5.0.tgz",
"integrity": "sha1-hyOdnhZrLXNSJFuKgTWXgEwdY6o="
"version": "4.0.0",
"resolved": "https://registry.npmjs.org/vscode-jsonrpc/-/vscode-jsonrpc-4.0.0.tgz",
"integrity": "sha512-perEnXQdQOJMTDFNv+UF3h1Y0z4iSiaN9jIlb0OqIYgosPCZGYh/MCUlkFtV2668PL69lRDO32hmvL2yiidUYg=="
},
"vscode-languageclient": {
"version": "3.5.1",
"resolved": "https://registry.npmjs.org/vscode-languageclient/-/vscode-languageclient-3.5.1.tgz",
"integrity": "sha512-GTQ+hSq/o4c/y6GYmyP9XNrVoIu0NFZ67KltSkqN+tO0eUNDIlrVNX+3DJzzyLhSsrctuGzuYWm3t87mNAcBmQ==",
"version": "5.2.1",
"resolved": "https://registry.npmjs.org/vscode-languageclient/-/vscode-languageclient-5.2.1.tgz",
"integrity": "sha512-7jrS/9WnV0ruqPamN1nE7qCxn0phkH5LjSgSp9h6qoJGoeAKzwKz/PF6M+iGA/aklx4GLZg1prddhEPQtuXI1Q==",
"requires": {
"vscode-languageserver-protocol": "3.5.1"
"semver": "^5.5.0",
"vscode-languageserver-protocol": "3.14.1"
},
"dependencies": {
"semver": {
"version": "5.7.0",
"resolved": "https://registry.npmjs.org/semver/-/semver-5.7.0.tgz",
"integrity": "sha512-Ya52jSX2u7QKghxeoFGpLwCtGlt7j0oY9DYb5apt9nPlJ42ID+ulTXESnt/qAQcoSERyZ5sl3LDIOw0nAn/5DA=="
}
}
},
"vscode-languageserver-protocol": {
"version": "3.5.1",
"resolved": "https://registry.npmjs.org/vscode-languageserver-protocol/-/vscode-languageserver-protocol-3.5.1.tgz",
"integrity": "sha512-1fPDIwsAv1difCV+8daOrJEGunClNJWqnUHq/ncWrjhitKWXgGmRCjlwZ3gDUTt54yRcvXz1PXJDaRNvNH6pYA==",
"version": "3.14.1",
"resolved": "https://registry.npmjs.org/vscode-languageserver-protocol/-/vscode-languageserver-protocol-3.14.1.tgz",
"integrity": "sha512-IL66BLb2g20uIKog5Y2dQ0IiigW0XKrvmWiOvc0yXw80z3tMEzEnHjaGAb3ENuU7MnQqgnYJ1Cl2l9RvNgDi4g==",
"requires": {
"vscode-jsonrpc": "3.5.0",
"vscode-languageserver-types": "3.5.0"
"vscode-jsonrpc": "^4.0.0",
"vscode-languageserver-types": "3.14.0"
}
},
"vscode-languageserver-types": {
"version": "3.5.0",
"resolved": "https://registry.npmjs.org/vscode-languageserver-types/-/vscode-languageserver-types-3.5.0.tgz",
"integrity": "sha1-5I15li8LjgLelV4/UkkI4rGcA3Q="
"version": "3.14.0",
"resolved": "https://registry.npmjs.org/vscode-languageserver-types/-/vscode-languageserver-types-3.14.0.tgz",
"integrity": "sha512-lTmS6AlAlMHOvPQemVwo3CezxBp0sNB95KNPkqp3Nxd5VFEnuG1ByM0zlRWos0zjO3ZWtkvhal0COgiV1xIA4A=="
},
"vscode-nls": {
"version": "2.0.2",
@ -10777,6 +10777,12 @@
"through": "~2.3.4"
}
},
"typescript": {
"version": "2.9.2",
"resolved": "https://registry.npmjs.org/typescript/-/typescript-2.9.2.tgz",
"integrity": "sha512-Gr4p6nFNaoufRIY4NMdpQRNmgxVIGMs4Fcu/ujdYk3nAZqk7supzBE9idmvfZIlH/Cuj//dvi+019qEue9lV0w==",
"dev": true
},
"vinyl": {
"version": "1.2.0",
"resolved": "https://registry.npmjs.org/vinyl/-/vinyl-1.2.0.tgz",

Просмотреть файл

@ -89,7 +89,7 @@
"tslint": "^5.16.0",
"tslint-microsoft-contrib": "^5.2.0",
"typemoq": "^1.7.0",
"typescript": "2.3.4",
"typescript": "3.5.3",
"uglify-js": "mishoo/UglifyJS2#harmony-v2.8.22",
"vsce": "^1.58.0",
"vscode": "^1.1.33",
@ -119,7 +119,7 @@
"tmp": "^0.0.28",
"underscore": "^1.8.3",
"vscode-extension-telemetry": "^0.1.1",
"vscode-languageclient": "3.5.1",
"vscode-languageclient": "5.2.1",
"vscode-nls": "^2.0.2",
"ws": ">=3.3.1"
},

Просмотреть файл

@ -78,9 +78,7 @@ export class ConnectionInfo {
// ConnectionManager class is the main controller for connection management
export default class ConnectionManager {
private _context: vscode.ExtensionContext;
private _statusView: StatusView;
private _prompter: IPrompter;
private _connections: { [fileUri: string]: ConnectionInfo };
constructor(context: vscode.ExtensionContext,
@ -90,9 +88,7 @@ export default class ConnectionManager {
private _vscodeWrapper?: VscodeWrapper,
private _connectionStore?: ConnectionStore,
private _connectionUI?: ConnectionUI) {
this._context = context;
this._statusView = statusView;
this._prompter = prompter;
this._connections = {};
if (!this.client) {

Просмотреть файл

@ -37,7 +37,6 @@ export class ServerInitializationResult {
export class ServerStatusView implements IStatusView, vscode.Disposable {
private _numberOfSecondsBeforeHidingMessage = 5000;
private _statusBarItem: vscode.StatusBarItem = undefined;
private _progressTimerId: NodeJS.Timer;
private _onDidChangeActiveTextEditorEvent: vscode.Disposable;
private _onDidCloseTextDocument: vscode.Disposable;
@ -81,7 +80,7 @@ export class ServerStatusView implements IStatusView, vscode.Disposable {
let progressTicks = [ '|', '/', '-', '\\'];
this._progressTimerId = setInterval(() => {
setInterval(() => {
index++;
if (index > 3) {
index = 0;

Просмотреть файл

@ -14,7 +14,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?
@ -24,54 +23,14 @@ 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 formatInfo(message: any) {
// const prefix = `${message.level}: (${message.id}) `;
// if (message.id === "json") {
// let jsonString = JSON.stringify(message.data, undefined, 4);
// return `${prefix}${message.message}\n${jsonString}`;
// }
// else {
// return `${prefix}${message.message}`;
// }
// }
// private formatAction(message: any) {
// const prefix = `info: ${message.level}: (${message.id}) `;
// return `${prefix}${message.message}`;
// }
private formatMessage(message: any): string {
const prefix = `${message.level}: (${message.id}) `;
return `${prefix}${message.message}`;
}
// private formatConflict(message: any) {
// var msg = message.message + ':\n';
// var picks = (<any[]>message.data.picks);
// var pickCount = 1;
// picks.forEach((pick) => {
// let pickMessage = (pickCount++).toString() + "). " + pick.endpoint.name + "#" + pick.endpoint.target;
// if (pick.pkgMeta._resolution && pick.pkgMeta._resolution.tag) {
// pickMessage += " which resolved to " + pick.pkgMeta._resolution.tag
// }
// if (Array.isArray(pick.dependants) && pick.dependants.length > 0) {
// pickMessage += " and is required by ";
// pick.dependants.forEach((dep) => {
// pickMessage += " " + dep.endpoint.name + "#" + dep.endpoint.target;
// });
// }
// msg += " " + pickMessage + "\n";
// });
// var prefix = (message.id === "solved"? "info" : "warn") + `: ${message.level}: (${message.id}) `;
// return prefix + msg;
// }
public log(message: any): void {
let line: string = '';
if (message && typeof (message.level) === 'string') {
@ -84,7 +43,6 @@ export default class CodeAdapter implements IPrompter {
line = nodeUtil.format(arguments);
}
this.outBuffer += `${line}\n`;
this.outChannel.appendLine(line);
}
@ -113,10 +71,11 @@ 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 => {
return this.prompt<T>(questions, ignoreFocusOut).then(answers => {
if (answers) {
return answers[question.name] || false;
return answers[question.name] || undefined;
}
return undefined;
});
}
@ -153,7 +112,7 @@ export default class CodeAdapter implements IPrompter {
return promptResult.catch(err => {
if (err instanceof EscapeException || err instanceof TypeError) {
return;
return undefined;
}
window.showErrorMessage(err.message);

6
src/views/htmlcontent/package-lock.json сгенерированный
Просмотреть файл

@ -109,9 +109,9 @@
"integrity": "sha512-n+IyV+nGz3+0q3/Yf1ra12KpCyi001bi4XFxSjbiWWjfqb52iTTtpGXmCCAOWWIAn9KEuFZKGqBERHmrtScZ3A=="
},
"rxjs": {
"version": "5.0.0-beta.12",
"resolved": "https://registry.npmjs.org/rxjs/-/rxjs-5.0.0-beta.12.tgz",
"integrity": "sha1-zf3i2MRjnSCud5S/+P3fMtp60zc=",
"version": "5.4.2",
"resolved": "https://registry.npmjs.org/rxjs/-/rxjs-5.4.2.tgz",
"integrity": "sha1-KjI2/L8D31e64G/Wly/ZnlwI/Pc=",
"requires": {
"symbol-observable": "^1.0.1"
}

Просмотреть файл

@ -19,7 +19,7 @@
"moment": "^2.15.1",
"rangy": "^1.3.0",
"reflect-metadata": "0.1.12",
"rxjs": "5.0.0-beta.12",
"rxjs": "5.4.2",
"slickgrid": "github:anthonydresser/SlickGrid#2.3.23-2",
"systemjs": "0.19.40",
"systemjs-plugin-json": "^0.2.0",

Просмотреть файл

@ -136,22 +136,14 @@ const template = `
export class AppComponent implements OnInit, AfterViewChecked {
// CONSTANTS
// tslint:disable-next-line:no-unused-variable
private scrollTimeOutTime = 200;
private windowSize = 50;
// tslint:disable-next-line:no-unused-variable
private maxScrollGrids = 8;
// tslint:disable-next-line:no-unused-variable
private selectionModel = 'DragRowSelectionModel';
// tslint:disable-next-line:no-unused-variable
private slickgridPlugins = ['AutoColumnSize'];
// tslint:disable-next-line:no-unused-variable
private _rowHeight = 29;
// tslint:disable-next-line:no-unused-variable
private _defaultNumShowingRows = 8;
// tslint:disable-next-line:no-unused-variable
private Constants = Constants;
// tslint:disable-next-line:no-unused-variable
private Utils = Utils;
// the function implementations of keyboard available events
private shortcutfunc = {
@ -263,7 +255,7 @@ export class AppComponent implements OnInit, AfterViewChecked {
}
}
];
// tslint:disable-next-line:no-unused-variable
private startString = new Date().toLocaleTimeString();
private config;
@ -280,15 +272,10 @@ export class AppComponent implements OnInit, AfterViewChecked {
private resizing = false;
private resizeHandleTop = 0;
private scrollEnabled = true;
// tslint:disable-next-line:no-unused-variable
private resultActive = true;
// tslint:disable-next-line:no-unused-variable
private _messageActive = true;
// tslint:disable-next-line:no-unused-variable
private firstRender = true;
// tslint:disable-next-line:no-unused-variable
private resultsScrollTop = 0;
// tslint:disable-next-line:no-unused-variable
private activeGrid = 0;
private messageShortcut;
private resultShortcut;

Просмотреть файл

@ -37,9 +37,7 @@ const template = `
})
export class ContextMenu implements OnInit {
// tslint:disable-next-line:no-unused-variable
private Utils = Utils;
// tslint:disable-next-line:no-unused-variable
private Constants = Constants;
@Output() clickEvent: EventEmitter<{type: string, batchId: number, resultId: number, index: number, selection: ISlickRange[]}>

Просмотреть файл

@ -31,9 +31,7 @@ const template = `
})
export class MessagesContextMenu implements OnInit {
// tslint:disable-next-line:no-unused-variable
private Utils = Utils;
// tslint:disable-next-line:no-unused-variable
private Constants = Constants;
@Output() clickEvent: EventEmitter<{type: string, selectedRange: IRange }>

Просмотреть файл

@ -35,13 +35,11 @@ describe('context Menu', () => {
describe('initialization', () => {
let fixture: ComponentFixture<ContextMenu>;
let comp: ContextMenu;
let ele: HTMLElement;
beforeEach(() => {
fixture = TestBed.createComponent<ContextMenu>(ContextMenu);
fixture.detectChanges();
comp = fixture.componentInstance;
ele = fixture.nativeElement;
});

Просмотреть файл

@ -31,13 +31,11 @@ describe('Messages Context Menu', () => {
describe('initialization', () => {
let fixture: ComponentFixture<MessagesContextMenu>;
let comp: MessagesContextMenu;
let ele: HTMLElement;
beforeEach(() => {
fixture = TestBed.createComponent<MessagesContextMenu>(MessagesContextMenu);
fixture.detectChanges();
comp = fixture.componentInstance;
ele = fixture.nativeElement;
});

Просмотреть файл

@ -61,7 +61,6 @@
"no-switch-case-fall-through": false,
"no-trailing-whitespace": true,
"no-unused-expression": false,
"no-unused-variable": true,
"no-use-before-declare": true,
"no-var-keyword": true,
"no-var-requires": false,

Просмотреть файл

@ -1,13 +1,11 @@
'use strict';
import * as TypeMoq from 'typemoq';
import vscode = require('vscode');
import * as utils from '../src/models/utils';
import * as Constants from '../src/constants/constants';
import LocalizedConstants = require('../src/constants/localizedConstants');
import * as stubs from './stubs';
import * as interfaces from '../src/models/interfaces';
import { CredentialStore } from '../src/credentialstore/credentialstore';
import { ConnectionProfile } from '../src/models/connectionProfile';
import { ConnectionStore } from '../src/models/connectionStore';
import { ConnectionCredentials } from '../src/models/connectionCredentials';
@ -21,8 +19,6 @@ import assert = require('assert');
suite('ConnectionCredentials Tests', () => {
let defaultProfile: interfaces.IConnectionProfile;
let prompter: TypeMoq.IMock<IPrompter>;
let context: TypeMoq.IMock<vscode.ExtensionContext>;
let credentialStore: TypeMoq.IMock<CredentialStore>;
let vscodeWrapper: TypeMoq.IMock<VscodeWrapper>;
let connectionStore: TypeMoq.IMock<ConnectionStore>;
@ -37,8 +33,6 @@ suite('ConnectionCredentials Tests', () => {
prompter = TypeMoq.Mock.ofType(TestPrompter);
context = TypeMoq.Mock.ofType(stubs.TestExtensionContext);
credentialStore = TypeMoq.Mock.ofType(CredentialStore);
vscodeWrapper = TypeMoq.Mock.ofType(VscodeWrapper);
connectionStore = TypeMoq.Mock.ofType(ConnectionStore);

Просмотреть файл

@ -96,12 +96,11 @@ suite('Connection Profile tests', () => {
});
test('CreateProfile - SqlPassword should be default auth type', done => {
test('CreateProfile - SqlPassword should be default auth type', async () => {
// Given
let prompter: TypeMoq.IMock<IPrompter> = TypeMoq.Mock.ofType(TestPrompter);
let answers: {[key: string]: string} = {};
let profileQuestions: IQuestion[];
let profileReturned: IConnectionProfile;
// When createProfile is called
prompter.setup(x => x.prompt(TypeMoq.It.isAny(), TypeMoq.It.isAny()))
@ -109,39 +108,35 @@ suite('Connection Profile tests', () => {
// Capture questions for verification
profileQuestions = questions;
})
.returns(questions => {
.returns(async questions => {
//
return Promise.resolve(answers);
return answers;
});
ConnectionProfile.createProfile(prompter.object)
.then(profile => profileReturned = profile);
await ConnectionProfile.createProfile(prompter.object);
// Then expect SqlAuth to be the only default type
let authChoices = <INameValueChoice[]>profileQuestions[authTypeQuestionIndex].choices;
assert.strictEqual(authChoices[0].name, LocalizedConstants.authTypeSql);
done();
});
test('CreateProfile - Integrated auth support', done => {
test('CreateProfile - Integrated auth support', async () => {
// Given
let prompter: TypeMoq.IMock<IPrompter> = TypeMoq.Mock.ofType(TestPrompter);
let answers: {[key: string]: string} = {};
let profileQuestions: IQuestion[];
let profileReturned: IConnectionProfile;
prompter.setup(x => x.prompt(TypeMoq.It.isAny(), TypeMoq.It.isAny()))
.callback(questions => {
// Capture questions for verification
profileQuestions = questions;
})
.returns(questions => {
.returns(async questions => {
//
return Promise.resolve(answers);
return answers;
});
// When createProfile is called on an OS
ConnectionProfile.createProfile(prompter.object)
.then(profile => profileReturned = profile);
await ConnectionProfile.createProfile(prompter.object);
// Then integrated auth should/should not be supported
// TODO if possible the test should mock out the OS dependency but it's not clear
@ -155,8 +150,6 @@ suite('Connection Profile tests', () => {
// And on a platform with multiple choices, should prompt for input
assert.strictEqual(authQuestion.shouldPrompt(answers), true);
done();
});
test('Port number is applied to server name when connection credentials are transformed into details', () => {

Просмотреть файл

@ -620,11 +620,8 @@ suite('Per File Connection Tests', () => {
.returns(() => Promise.resolve(true));
let statusViewMock: TypeMoq.IMock<StatusView> = TypeMoq.Mock.ofType(StatusView);
let actualDbName = undefined;
statusViewMock.setup(x => x.connectSuccess(TypeMoq.It.isAny(), TypeMoq.It.isAny(), TypeMoq.It.isAny()))
.callback((fileUri, creds: IConnectionCredentials) => {
actualDbName = creds.database;
});
.callback((fileUri, creds: IConnectionCredentials) => { return; });
// And we store any DBs saved to recent connections
let savedConnection: IConnectionCredentials = undefined;

Просмотреть файл

@ -3,7 +3,6 @@ import assert = require('assert');
import { EventEmitter } from 'events';
import QueryRunner from './../src/controllers/queryRunner';
import { QueryNotificationHandler } from './../src/controllers/queryNotificationHandler';
import { SqlOutputContentProvider } from './../src/models/sqlOutputContentProvider';
import * as Utils from './../src/models/utils';
import SqlToolsServerClient from './../src/languageservice/serviceclient';
import {
@ -34,14 +33,12 @@ const standardSelection: ISelectionData = {startLine: 0, endLine: 0, startColumn
// TESTS //////////////////////////////////////////////////////////////////////////////////////////
suite('Query Runner tests', () => {
let testSqlOutputContentProvider: TypeMoq.IMock<SqlOutputContentProvider>;
let testSqlToolsServerClient: TypeMoq.IMock<SqlToolsServerClient>;
let testQueryNotificationHandler: TypeMoq.IMock<QueryNotificationHandler>;
let testVscodeWrapper: TypeMoq.IMock<VscodeWrapper>;
let testStatusView: TypeMoq.IMock<StatusView>;
setup(() => {
testSqlOutputContentProvider = TypeMoq.Mock.ofType(SqlOutputContentProvider, TypeMoq.MockBehavior.Loose, {extensionPath: ''});
testSqlToolsServerClient = TypeMoq.Mock.ofType(SqlToolsServerClient, TypeMoq.MockBehavior.Loose);
testQueryNotificationHandler = TypeMoq.Mock.ofType(QueryNotificationHandler, TypeMoq.MockBehavior.Loose);
testVscodeWrapper = TypeMoq.Mock.ofType(VscodeWrapper, TypeMoq.MockBehavior.Loose);

Просмотреть файл

@ -60,7 +60,6 @@
"no-switch-case-fall-through": false,
"no-trailing-whitespace": true,
"no-unused-expression": false,
"no-unused-variable": true,
"no-use-before-declare": true,
"no-var-keyword": true,
"no-var-requires": false,