update
This commit is contained in:
Родитель
11bd4df63c
Коммит
78d2ad5a7f
|
@ -9823,13 +9823,18 @@
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"rxjs": {
|
"rxjs": {
|
||||||
"version": "5.5.6",
|
"version": "6.4.0",
|
||||||
"resolved": "https://registry.npmjs.org/rxjs/-/rxjs-5.5.6.tgz",
|
"resolved": "https://registry.npmjs.org/rxjs/-/rxjs-6.4.0.tgz",
|
||||||
"integrity": "sha512-v4Q5HDC0FHAQ7zcBX7T2IL6O5ltl1a2GX4ENjPXg6SjDY69Cmx9v4113C99a4wGF16ClPv5Z8mghuYorVkg/kg==",
|
"integrity": "sha512-Z9Yfa11F6B9Sg/BK9MnqnQ+aQYicPLtilXBp2yUtDt2JRCE0h26d33EnfO3ZxoNxG0T92OUucP3Ct7cpfkdFfw==",
|
||||||
"requires": {
|
"requires": {
|
||||||
"symbol-observable": "1.0.1"
|
"tslib": "^1.9.0"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"rxjs-compat": {
|
||||||
|
"version": "6.4.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/rxjs-compat/-/rxjs-compat-6.4.0.tgz",
|
||||||
|
"integrity": "sha512-eo/O8RS83hJdJukCtA+IF6qnqa8FPOuVo+OPCzgVi+dbTle9KCdNv97IcQO0WwNVik7DJLKmf0F8uwzc0q40vw=="
|
||||||
|
},
|
||||||
"safe-buffer": {
|
"safe-buffer": {
|
||||||
"version": "5.1.1",
|
"version": "5.1.1",
|
||||||
"resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.1.tgz",
|
"resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.1.tgz",
|
||||||
|
@ -10414,11 +10419,6 @@
|
||||||
"es6-symbol": "^3.1.1"
|
"es6-symbol": "^3.1.1"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"symbol-observable": {
|
|
||||||
"version": "1.0.1",
|
|
||||||
"resolved": "https://registry.npmjs.org/symbol-observable/-/symbol-observable-1.0.1.tgz",
|
|
||||||
"integrity": "sha1-g0D8RwLDEi310iKI+IKD9RPT/dQ="
|
|
||||||
},
|
|
||||||
"tar": {
|
"tar": {
|
||||||
"version": "2.2.1",
|
"version": "2.2.1",
|
||||||
"resolved": "https://registry.npmjs.org/tar/-/tar-2.2.1.tgz",
|
"resolved": "https://registry.npmjs.org/tar/-/tar-2.2.1.tgz",
|
||||||
|
@ -10711,8 +10711,7 @@
|
||||||
"tslib": {
|
"tslib": {
|
||||||
"version": "1.9.0",
|
"version": "1.9.0",
|
||||||
"resolved": "https://registry.npmjs.org/tslib/-/tslib-1.9.0.tgz",
|
"resolved": "https://registry.npmjs.org/tslib/-/tslib-1.9.0.tgz",
|
||||||
"integrity": "sha512-f/qGG2tUkrISBlQZEjEqoZ3B2+npJjIf04H1wuAv9iA8i04Icp+61KRXxFdha22670NJopsZCIjhC3SnjPRKrQ==",
|
"integrity": "sha512-f/qGG2tUkrISBlQZEjEqoZ3B2+npJjIf04H1wuAv9iA8i04Icp+61KRXxFdha22670NJopsZCIjhC3SnjPRKrQ=="
|
||||||
"dev": true
|
|
||||||
},
|
},
|
||||||
"tslint": {
|
"tslint": {
|
||||||
"version": "5.10.0",
|
"version": "5.10.0",
|
||||||
|
|
|
@ -79,7 +79,7 @@
|
||||||
"open": "*",
|
"open": "*",
|
||||||
"remove-bom-buffer": "3.0.0",
|
"remove-bom-buffer": "3.0.0",
|
||||||
"request-light": "0.2.4",
|
"request-light": "0.2.4",
|
||||||
"rxjs": "5.5.6",
|
"rxjs": "6.4.0",
|
||||||
"semver": "*",
|
"semver": "*",
|
||||||
"stream": "0.0.2",
|
"stream": "0.0.2",
|
||||||
"strip-bom": "3.0.0",
|
"strip-bom": "3.0.0",
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
* Licensed under the MIT License. See License.txt in the project root for license information.
|
* Licensed under the MIT License. See License.txt in the project root for license information.
|
||||||
*--------------------------------------------------------------------------------------------*/
|
*--------------------------------------------------------------------------------------------*/
|
||||||
|
|
||||||
import { Subscription } from "rxjs/Subscription";
|
import { Subscription } from "rxjs";
|
||||||
import Disposable, { IDisposable } from "./Disposable";
|
import Disposable, { IDisposable } from "./Disposable";
|
||||||
|
|
||||||
export default class CompositeDisposable extends Disposable {
|
export default class CompositeDisposable extends Disposable {
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||||
* Licensed under the MIT License. See License.txt in the project root for license information.
|
* Licensed under the MIT License. See License.txt in the project root for license information.
|
||||||
*--------------------------------------------------------------------------------------------*/
|
*--------------------------------------------------------------------------------------------*/
|
||||||
import { Subscription } from "rxjs/Subscription";
|
import { Subscription } from "rxjs";
|
||||||
|
|
||||||
export default class Disposable implements IDisposable {
|
export default class Disposable implements IDisposable {
|
||||||
private onDispose: { (): void };
|
private onDispose: { (): void };
|
||||||
|
|
|
@ -2,9 +2,8 @@
|
||||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||||
* Licensed under the MIT License. See License.txt in the project root for license information.
|
* Licensed under the MIT License. See License.txt in the project root for license information.
|
||||||
*--------------------------------------------------------------------------------------------*/
|
*--------------------------------------------------------------------------------------------*/
|
||||||
import { Subject } from "rxjs/Subject";
|
import { Subject , Subscription } from "rxjs";
|
||||||
import { BaseEvent } from "./omnisharp/loggingEvents";
|
import { BaseEvent } from "./omnisharp/loggingEvents";
|
||||||
import { Subscription } from "rxjs/Subscription";
|
|
||||||
|
|
||||||
export class EventStream {
|
export class EventStream {
|
||||||
private sink: Subject<BaseEvent>;
|
private sink: Subject<BaseEvent>;
|
||||||
|
|
|
@ -5,10 +5,8 @@
|
||||||
|
|
||||||
import { Options } from "../omnisharp/options";
|
import { Options } from "../omnisharp/options";
|
||||||
import { vscode } from "../vscodeAdapter";
|
import { vscode } from "../vscodeAdapter";
|
||||||
import 'rxjs/add/operator/take';
|
import { Observable, Observer } from "rxjs";
|
||||||
import 'rxjs/add/operator/publishBehavior';
|
import { publishBehavior } from "rxjs/operators";
|
||||||
import { Observable } from "rxjs/Observable";
|
|
||||||
import { Observer } from "rxjs/Observer";
|
|
||||||
|
|
||||||
export default function createOptionStream(vscode: vscode): Observable<Options> {
|
export default function createOptionStream(vscode: vscode): Observable<Options> {
|
||||||
return Observable.create((observer: Observer<Options>) => {
|
return Observable.create((observer: Observer<Options>) => {
|
||||||
|
@ -20,5 +18,5 @@ export default function createOptionStream(vscode: vscode): Observable<Options>
|
||||||
});
|
});
|
||||||
|
|
||||||
return () => disposable.dispose();
|
return () => disposable.dispose();
|
||||||
}).publishBehavior(Options.Read(vscode)).refCount();
|
}).pipe(publishBehavior(Options.Read(vscode))).refCount();
|
||||||
}
|
}
|
|
@ -1,23 +1,22 @@
|
||||||
/*---------------------------------------------------------------------------------------------
|
/*---------------------------------------------------------------------------------------------
|
||||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||||
* Licensed under the MIT License. See License.txt in the project root for license information.
|
* Licensed under the MIT License. See License.txt in the project root for license information.
|
||||||
*--------------------------------------------------------------------------------------------*/
|
*--------------------------------------------------------------------------------------------*/
|
||||||
|
|
||||||
import { vscode } from "../vscodeAdapter";
|
import { vscode } from "../vscodeAdapter";
|
||||||
import { Options } from "../omnisharp/options";
|
import { Options } from "../omnisharp/options";
|
||||||
import ShowInformationMessage from "./utils/ShowInformationMessage";
|
import ShowInformationMessage from "./utils/ShowInformationMessage";
|
||||||
import { Observable } from "rxjs/Observable";
|
import { Observable } from "rxjs";
|
||||||
import Disposable from "../Disposable";
|
import Disposable from "../Disposable";
|
||||||
import 'rxjs/add/operator/filter';
|
import { filter} from 'rxjs/operators';
|
||||||
import 'rxjs/add/operator/distinctUntilChanged';
|
|
||||||
|
|
||||||
function ConfigChangeObservable(optionObservable: Observable<Options>): Observable<Options> {
|
function ConfigChangeObservable(optionObservable: Observable<Options>): Observable<Options> {
|
||||||
let options: Options;
|
let options: Options;
|
||||||
return optionObservable. filter(newOptions => {
|
return optionObservable.pipe( filter(newOptions => {
|
||||||
let changed = (options && hasChanged(options, newOptions));
|
let changed = (options && hasChanged(options, newOptions));
|
||||||
options = newOptions;
|
options = newOptions;
|
||||||
return changed;
|
return changed;
|
||||||
});
|
}));
|
||||||
}
|
}
|
||||||
|
|
||||||
export function ShowOmniSharpConfigChangePrompt(optionObservable: Observable<Options>, vscode: vscode): Disposable {
|
export function ShowOmniSharpConfigChangePrompt(optionObservable: Observable<Options>, vscode: vscode): Disposable {
|
||||||
|
|
|
@ -4,9 +4,7 @@
|
||||||
*--------------------------------------------------------------------------------------------*/
|
*--------------------------------------------------------------------------------------------*/
|
||||||
|
|
||||||
import { Options } from "../omnisharp/options";
|
import { Options } from "../omnisharp/options";
|
||||||
import { Subscription } from "rxjs/Subscription";
|
import { Subscription , Observable } from "rxjs";
|
||||||
import { Observable } from "rxjs/Observable";
|
|
||||||
|
|
||||||
export default class OptionProvider {
|
export default class OptionProvider {
|
||||||
private options: Options;
|
private options: Options;
|
||||||
private subscription: Subscription;
|
private subscription: Subscription;
|
||||||
|
|
|
@ -1,13 +1,13 @@
|
||||||
/*---------------------------------------------------------------------------------------------
|
/*---------------------------------------------------------------------------------------------
|
||||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||||
* Licensed under the MIT License. See License.txt in the project root for license information.
|
* Licensed under the MIT License. See License.txt in the project root for license information.
|
||||||
*--------------------------------------------------------------------------------------------*/
|
*--------------------------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
import {debounceTime} from 'rxjs/operators';
|
||||||
import { vscode } from '../vscodeAdapter';
|
import { vscode } from '../vscodeAdapter';
|
||||||
import { BaseEvent, OmnisharpServerOnError, OmnisharpServerMsBuildProjectDiagnostics } from "../omnisharp/loggingEvents";
|
import { BaseEvent, OmnisharpServerOnError, OmnisharpServerMsBuildProjectDiagnostics } from "../omnisharp/loggingEvents";
|
||||||
import { Scheduler } from 'rxjs/Scheduler';
|
import { Scheduler , Subject } from 'rxjs';
|
||||||
import { Subject } from 'rxjs/Subject';
|
|
||||||
import 'rxjs/add/operator/debounceTime';
|
|
||||||
import showWarningMessage from './utils/ShowWarningMessage';
|
import showWarningMessage from './utils/ShowWarningMessage';
|
||||||
|
|
||||||
export class WarningMessageObserver {
|
export class WarningMessageObserver {
|
||||||
|
@ -15,7 +15,7 @@ export class WarningMessageObserver {
|
||||||
|
|
||||||
constructor(private vscode: vscode, private disableMsBuildDiagnosticWarning: () => boolean, scheduler?: Scheduler) {
|
constructor(private vscode: vscode, private disableMsBuildDiagnosticWarning: () => boolean, scheduler?: Scheduler) {
|
||||||
this.warningMessageDebouncer = new Subject<BaseEvent>();
|
this.warningMessageDebouncer = new Subject<BaseEvent>();
|
||||||
this.warningMessageDebouncer.debounceTime(1500, scheduler).subscribe(async event => {
|
this.warningMessageDebouncer.pipe(debounceTime(1500, scheduler)).subscribe(async event => {
|
||||||
let message = "Some projects have trouble loading. Please review the output for more details.";
|
let message = "Some projects have trouble loading. Please review the output for more details.";
|
||||||
await showWarningMessage(this.vscode, message, { title: "Show Output", command: 'o.showOutput' });
|
await showWarningMessage(this.vscode, message, { title: "Show Output", command: 'o.showOutput' });
|
||||||
});
|
});
|
||||||
|
|
|
@ -1,7 +1,8 @@
|
||||||
|
|
||||||
/*---------------------------------------------------------------------------------------------
|
/*---------------------------------------------------------------------------------------------
|
||||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||||
* Licensed under the MIT License. See License.txt in the project root for license information.
|
* Licensed under the MIT License. See License.txt in the project root for license information.
|
||||||
*--------------------------------------------------------------------------------------------*/
|
*--------------------------------------------------------------------------------------------*/
|
||||||
|
|
||||||
import * as fs from 'fs';
|
import * as fs from 'fs';
|
||||||
import * as path from 'path';
|
import * as path from 'path';
|
||||||
|
@ -24,8 +25,8 @@ import { OmnisharpDownloader } from './OmnisharpDownloader';
|
||||||
import * as ObservableEvents from './loggingEvents';
|
import * as ObservableEvents from './loggingEvents';
|
||||||
import { EventStream } from '../EventStream';
|
import { EventStream } from '../EventStream';
|
||||||
import { NetworkSettingsProvider } from '../NetworkSettings';
|
import { NetworkSettingsProvider } from '../NetworkSettings';
|
||||||
import { Subject } from 'rxjs/Subject';
|
import { Subject } from 'rxjs';
|
||||||
import 'rxjs/add/operator/debounceTime';
|
import {debounceTime} from 'rxjs/operators';
|
||||||
import CompositeDisposable from '../CompositeDisposable';
|
import CompositeDisposable from '../CompositeDisposable';
|
||||||
import Disposable from '../Disposable';
|
import Disposable from '../Disposable';
|
||||||
import OptionProvider from '../observers/OptionProvider';
|
import OptionProvider from '../observers/OptionProvider';
|
||||||
|
@ -97,7 +98,7 @@ export class OmniSharpServer {
|
||||||
this._requestQueue = new RequestQueueCollection(this.eventStream, 8, request => this._makeRequest(request));
|
this._requestQueue = new RequestQueueCollection(this.eventStream, 8, request => this._makeRequest(request));
|
||||||
let downloader = new OmnisharpDownloader(networkSettingsProvider, this.eventStream, this.packageJSON, platformInfo, extensionPath);
|
let downloader = new OmnisharpDownloader(networkSettingsProvider, this.eventStream, this.packageJSON, platformInfo, extensionPath);
|
||||||
this._omnisharpManager = new OmnisharpManager(downloader, platformInfo);
|
this._omnisharpManager = new OmnisharpManager(downloader, platformInfo);
|
||||||
this.updateProjectDebouncer.debounceTime(1500).subscribe((event) => { this.updateProjectInfo(); });
|
this.updateProjectDebouncer.pipe(debounceTime(1500)).subscribe((event) => { this.updateProjectInfo(); });
|
||||||
this.firstUpdateProject = true;
|
this.firstUpdateProject = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,18 +1,15 @@
|
||||||
/*---------------------------------------------------------------------------------------------
|
/*---------------------------------------------------------------------------------------------
|
||||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||||
* Licensed under the MIT License. See License.txt in the project root for license information.
|
* Licensed under the MIT License. See License.txt in the project root for license information.
|
||||||
*--------------------------------------------------------------------------------------------*/
|
*--------------------------------------------------------------------------------------------*/
|
||||||
|
|
||||||
import { use as chaiUse, expect, should } from 'chai';
|
import { use as chaiUse, expect, should } from 'chai';
|
||||||
import { updateConfig, getVSCodeWithConfig } from '../testAssets/Fakes';
|
import { updateConfig, getVSCodeWithConfig } from '../testAssets/Fakes';
|
||||||
import { Observable } from 'rxjs/Observable';
|
import { timeout } from 'rxjs/operators';
|
||||||
import 'rxjs/add/observable/fromPromise';
|
import { from as observableFrom, Subject, BehaviorSubject } from 'rxjs';
|
||||||
import 'rxjs/add/operator/timeout';
|
|
||||||
import { vscode } from '../../../src/vscodeAdapter';
|
import { vscode } from '../../../src/vscodeAdapter';
|
||||||
import { ShowOmniSharpConfigChangePrompt } from '../../../src/observers/OptionChangeObserver';
|
import { ShowOmniSharpConfigChangePrompt } from '../../../src/observers/OptionChangeObserver';
|
||||||
import { Subject } from 'rxjs/Subject';
|
|
||||||
import { Options } from '../../../src/omnisharp/options';
|
import { Options } from '../../../src/omnisharp/options';
|
||||||
import { BehaviorSubject } from 'rxjs/BehaviorSubject';
|
|
||||||
|
|
||||||
chaiUse(require('chai-as-promised'));
|
chaiUse(require('chai-as-promised'));
|
||||||
chaiUse(require('chai-string'));
|
chaiUse(require('chai-string'));
|
||||||
|
@ -37,7 +34,7 @@ suite("OmniSharpConfigChangeObserver", () => {
|
||||||
signalCommandDone = () => { resolve(); };
|
signalCommandDone = () => { resolve(); };
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
[
|
[
|
||||||
{ config: "omnisharp", section: "path", value: "somePath" },
|
{ config: "omnisharp", section: "path", value: "somePath" },
|
||||||
{ config: "omnisharp", section: "waitForDebugger", value: true },
|
{ config: "omnisharp", section: "waitForDebugger", value: true },
|
||||||
|
@ -59,7 +56,7 @@ suite("OmniSharpConfigChangeObserver", () => {
|
||||||
|
|
||||||
test('Given an information message if the user clicks cancel, the command is not executed', async () => {
|
test('Given an information message if the user clicks cancel, the command is not executed', async () => {
|
||||||
doClickCancel();
|
doClickCancel();
|
||||||
await expect(Observable.fromPromise(commandDone).timeout(1).toPromise()).to.be.rejected;
|
await expect(observableFrom(commandDone).pipe(timeout(1)).toPromise()).to.be.rejected;
|
||||||
expect(invokedCommand).to.be.undefined;
|
expect(invokedCommand).to.be.undefined;
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -69,9 +66,9 @@ suite("OmniSharpConfigChangeObserver", () => {
|
||||||
expect(invokedCommand).to.be.equal("o.restart");
|
expect(invokedCommand).to.be.equal("o.restart");
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
suite('Information Message is not shown on change in',() => {
|
suite('Information Message is not shown on change in', () => {
|
||||||
[
|
[
|
||||||
{ config: "csharp", section: 'disableCodeActions', value: true },
|
{ config: "csharp", section: 'disableCodeActions', value: true },
|
||||||
{ config: "csharp", section: 'testsCodeLens.enabled', value: false },
|
{ config: "csharp", section: 'testsCodeLens.enabled', value: false },
|
||||||
|
|
|
@ -7,7 +7,7 @@ import { should, expect } from 'chai';
|
||||||
import { getVSCodeWithConfig, updateConfig } from "../testAssets/Fakes";
|
import { getVSCodeWithConfig, updateConfig } from "../testAssets/Fakes";
|
||||||
import { vscode } from "../../../src/vscodeAdapter";
|
import { vscode } from "../../../src/vscodeAdapter";
|
||||||
import OptionProvider from '../../../src/observers/OptionProvider';
|
import OptionProvider from '../../../src/observers/OptionProvider';
|
||||||
import { Subject } from 'rxjs/Subject';
|
import { Subject } from 'rxjs';
|
||||||
import { Options } from '../../../src/omnisharp/options';
|
import { Options } from '../../../src/omnisharp/options';
|
||||||
|
|
||||||
suite('OptionProvider', () => {
|
suite('OptionProvider', () => {
|
||||||
|
|
|
@ -6,8 +6,8 @@
|
||||||
import { use as chaiUse, expect, should } from 'chai';
|
import { use as chaiUse, expect, should } from 'chai';
|
||||||
import { vscode } from '../../../src/vscodeAdapter';
|
import { vscode } from '../../../src/vscodeAdapter';
|
||||||
import { getFakeVsCode } from '../testAssets/Fakes';
|
import { getFakeVsCode } from '../testAssets/Fakes';
|
||||||
import 'rxjs/add/observable/fromPromise';
|
|
||||||
import 'rxjs/add/operator/timeout';
|
|
||||||
import { ErrorMessageObserver } from '../../../src/observers/ErrorMessageObserver';
|
import { ErrorMessageObserver } from '../../../src/observers/ErrorMessageObserver';
|
||||||
import { ZipError, DotNetTestRunFailure, DotNetTestDebugStartFailure, EventWithMessage, IntegrityCheckFailure } from '../../../src/omnisharp/loggingEvents';
|
import { ZipError, DotNetTestRunFailure, DotNetTestDebugStartFailure, EventWithMessage, IntegrityCheckFailure } from '../../../src/omnisharp/loggingEvents';
|
||||||
|
|
||||||
|
|
|
@ -1,14 +1,13 @@
|
||||||
/*---------------------------------------------------------------------------------------------
|
/*---------------------------------------------------------------------------------------------
|
||||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||||
* Licensed under the MIT License. See License.txt in the project root for license information.
|
* Licensed under the MIT License. See License.txt in the project root for license information.
|
||||||
*--------------------------------------------------------------------------------------------*/
|
*--------------------------------------------------------------------------------------------*/
|
||||||
|
|
||||||
import { InformationMessageObserver } from '../../../src/observers/InformationMessageObserver';
|
import { InformationMessageObserver } from '../../../src/observers/InformationMessageObserver';
|
||||||
import { use as chaiUse, expect, should } from 'chai';
|
import { use as chaiUse, expect, should } from 'chai';
|
||||||
import { getUnresolvedDependenices, updateConfig, getVSCodeWithConfig } from '../testAssets/Fakes';
|
import { getUnresolvedDependenices, updateConfig, getVSCodeWithConfig } from '../testAssets/Fakes';
|
||||||
import { Observable } from 'rxjs/Observable';
|
import {from as observableFrom } from 'rxjs';
|
||||||
import 'rxjs/add/observable/fromPromise';
|
import {timeout} from 'rxjs/operators';
|
||||||
import 'rxjs/add/operator/timeout';
|
|
||||||
|
|
||||||
chaiUse(require('chai-as-promised'));
|
chaiUse(require('chai-as-promised'));
|
||||||
chaiUse(require('chai-string'));
|
chaiUse(require('chai-string'));
|
||||||
|
@ -72,7 +71,7 @@ suite("InformationMessageObserver", () => {
|
||||||
test('Given an information message if the user clicks cancel, the command is not executed', async () => {
|
test('Given an information message if the user clicks cancel, the command is not executed', async () => {
|
||||||
observer.post(elem.event);
|
observer.post(elem.event);
|
||||||
doClickCancel();
|
doClickCancel();
|
||||||
await expect(Observable.fromPromise(commandDone).timeout(1).toPromise()).to.be.rejected;
|
await expect(observableFrom(commandDone).pipe(timeout(1)).toPromise()).to.be.rejected;
|
||||||
expect(invokedCommand).to.be.undefined;
|
expect(invokedCommand).to.be.undefined;
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
|
@ -1,20 +1,15 @@
|
||||||
/*---------------------------------------------------------------------------------------------
|
/*---------------------------------------------------------------------------------------------
|
||||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||||
* Licensed under the MIT License. See License.txt in the project root for license information.
|
* Licensed under the MIT License. See License.txt in the project root for license information.
|
||||||
*--------------------------------------------------------------------------------------------*/
|
*--------------------------------------------------------------------------------------------*/
|
||||||
|
|
||||||
import { WarningMessageObserver } from '../../../src/observers/WarningMessageObserver';
|
import { WarningMessageObserver } from '../../../src/observers/WarningMessageObserver';
|
||||||
import { assert, use as chaiUse, expect, should } from 'chai';
|
import { assert, use as chaiUse, expect, should } from 'chai';
|
||||||
import { getFakeVsCode, getMSBuildDiagnosticsMessage, getOmnisharpMSBuildProjectDiagnosticsEvent, getOmnisharpServerOnErrorEvent } from '../testAssets/Fakes';
|
import { getFakeVsCode, getMSBuildDiagnosticsMessage, getOmnisharpMSBuildProjectDiagnosticsEvent, getOmnisharpServerOnErrorEvent } from '../testAssets/Fakes';
|
||||||
import { vscode } from '../../../src/vscodeAdapter';
|
import { vscode } from '../../../src/vscodeAdapter';
|
||||||
import { TestScheduler } from 'rxjs/testing/TestScheduler';
|
import { TestScheduler } from 'rxjs/testing';
|
||||||
import { Observable } from 'rxjs/Observable';
|
import { from as observableFrom, Subject } from 'rxjs';
|
||||||
import "rxjs/add/operator/map";
|
import { timeout, map } from 'rxjs/operators';
|
||||||
import "rxjs/add/operator/debounceTime";
|
|
||||||
import 'rxjs/add/operator/timeout';
|
|
||||||
import 'rxjs/add/observable/fromPromise';
|
|
||||||
import 'rxjs/add/observable/timer';
|
|
||||||
import { Subject } from 'rxjs/Subject';
|
|
||||||
|
|
||||||
chaiUse(require('chai-as-promised'));
|
chaiUse(require('chai-as-promised'));
|
||||||
chaiUse(require('chai-string'));
|
chaiUse(require('chai-string'));
|
||||||
|
@ -165,7 +160,7 @@ suite('WarningMessageObserver', () => {
|
||||||
test(`Given a warning message, when the user clicks ok the command is executed`, async () => {
|
test(`Given a warning message, when the user clicks ok the command is executed`, async () => {
|
||||||
let marble = `${timeToMarble(1500)}a`;
|
let marble = `${timeToMarble(1500)}a`;
|
||||||
let eventList = scheduler.createHotObservable(marble, { a: elem.eventA });
|
let eventList = scheduler.createHotObservable(marble, { a: elem.eventA });
|
||||||
scheduler.expectObservable(eventList.map(e => observer.post(e)));
|
scheduler.expectObservable(eventList.pipe(map(e => observer.post(e))));
|
||||||
scheduler.flush();
|
scheduler.flush();
|
||||||
doClickOk();
|
doClickOk();
|
||||||
await commandDone;
|
await commandDone;
|
||||||
|
@ -175,10 +170,10 @@ suite('WarningMessageObserver', () => {
|
||||||
test(`Given a warning message, when the user clicks cancel the command is not executed`, async () => {
|
test(`Given a warning message, when the user clicks cancel the command is not executed`, async () => {
|
||||||
let marble = `${timeToMarble(1500)}a--|`;
|
let marble = `${timeToMarble(1500)}a--|`;
|
||||||
let eventList = scheduler.createHotObservable(marble, { a: elem.eventA });
|
let eventList = scheduler.createHotObservable(marble, { a: elem.eventA });
|
||||||
scheduler.expectObservable(eventList.map(e => observer.post(e)));
|
scheduler.expectObservable(eventList.pipe(map(e => observer.post(e))));
|
||||||
scheduler.flush();
|
scheduler.flush();
|
||||||
doClickCancel();
|
doClickCancel();
|
||||||
await expect(Observable.fromPromise(commandDone).timeout(1).toPromise()).to.be.rejected;
|
await expect(observableFrom(commandDone).pipe(timeout(1)).toPromise()).to.be.rejected;
|
||||||
expect(invokedCommand).to.be.undefined;
|
expect(invokedCommand).to.be.undefined;
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
|
@ -7,10 +7,9 @@ import { should, expect } from 'chai';
|
||||||
import { ConfigurationChangeEvent, vscode } from "../../src/vscodeAdapter";
|
import { ConfigurationChangeEvent, vscode } from "../../src/vscodeAdapter";
|
||||||
import { getVSCodeWithConfig, updateConfig } from "./testAssets/Fakes";
|
import { getVSCodeWithConfig, updateConfig } from "./testAssets/Fakes";
|
||||||
import Disposable from "../../src/Disposable";
|
import Disposable from "../../src/Disposable";
|
||||||
import { Observable } from "rxjs/Observable";
|
import { Observable, Subscription } from "rxjs";
|
||||||
import { Options } from "../../src/omnisharp/options";
|
import { Options } from "../../src/omnisharp/options";
|
||||||
import { GetConfigChangeEvent } from './testAssets/GetConfigChangeEvent';
|
import { GetConfigChangeEvent } from './testAssets/GetConfigChangeEvent';
|
||||||
import { Subscription } from 'rxjs/Subscription';
|
|
||||||
import createOptionStream from '../../src/observables/CreateOptionStream';
|
import createOptionStream from '../../src/observables/CreateOptionStream';
|
||||||
|
|
||||||
suite('OptionStream', () => {
|
suite('OptionStream', () => {
|
||||||
|
|
Загрузка…
Ссылка в новой задаче