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