mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-03 09:35:40 -05:00
Merge VS Code 1.31.1 (#4283)
This commit is contained in:
@@ -10,7 +10,7 @@ import { Diagnostic, DiagnosticSeverity, Range, DiagnosticRelatedInformation, Lo
|
||||
import { MainThreadDiagnosticsShape, IMainContext } from 'vs/workbench/api/node/extHost.protocol';
|
||||
import { IMarkerData, MarkerSeverity } from 'vs/platform/markers/common/markers';
|
||||
import { mock } from 'vs/workbench/test/electron-browser/api/mock';
|
||||
import { Emitter, toPromise } from 'vs/base/common/event';
|
||||
import { Emitter, Event } from 'vs/base/common/event';
|
||||
|
||||
suite('ExtHostDiagnostics', () => {
|
||||
|
||||
@@ -37,7 +37,7 @@ suite('ExtHostDiagnostics', () => {
|
||||
assert.throws(() => collection.get(URI.parse('aa:bb')));
|
||||
assert.throws(() => collection.has(URI.parse('aa:bb')));
|
||||
assert.throws(() => collection.set(URI.parse('aa:bb'), []));
|
||||
assert.throws(() => collection.set(URI.parse('aa:bb'), undefined));
|
||||
assert.throws(() => collection.set(URI.parse('aa:bb'), undefined!));
|
||||
});
|
||||
|
||||
|
||||
@@ -132,7 +132,7 @@ suite('ExtHostDiagnostics', () => {
|
||||
collection.set([
|
||||
[uri, [new Diagnostic(new Range(0, 0, 0, 1), 'message-1')]],
|
||||
[URI.parse('some:thing'), [new Diagnostic(new Range(0, 0, 1, 1), 'something')]],
|
||||
[uri, undefined]
|
||||
[uri, undefined!]
|
||||
]);
|
||||
assert.ok(!collection.has(uri));
|
||||
|
||||
@@ -144,7 +144,7 @@ suite('ExtHostDiagnostics', () => {
|
||||
collection.set([
|
||||
[uri, [new Diagnostic(new Range(0, 0, 0, 1), 'message-1')]],
|
||||
[URI.parse('some:thing'), [new Diagnostic(new Range(0, 0, 1, 1), 'something')]],
|
||||
[uri, undefined],
|
||||
[uri, undefined!],
|
||||
[uri, [new Diagnostic(new Range(0, 0, 0, 1), 'message-2')]],
|
||||
[uri, [new Diagnostic(new Range(0, 0, 0, 1), 'message-3')]],
|
||||
]);
|
||||
@@ -160,7 +160,7 @@ suite('ExtHostDiagnostics', () => {
|
||||
|
||||
test('diagnostics collection, set tuple overrides, #11547', function () {
|
||||
|
||||
let lastEntries: [UriComponents, IMarkerData[]][];
|
||||
let lastEntries!: [UriComponents, IMarkerData[]][];
|
||||
let collection = new DiagnosticCollection('test', 'test', 100, new class extends DiagnosticsShape {
|
||||
$changeMany(owner: string, entries: [UriComponents, IMarkerData[]][]): void {
|
||||
lastEntries = entries;
|
||||
@@ -176,7 +176,7 @@ suite('ExtHostDiagnostics', () => {
|
||||
let [[, data1]] = lastEntries;
|
||||
assert.equal(data1.length, 1);
|
||||
assert.equal(data1[0].message, 'error');
|
||||
lastEntries = undefined;
|
||||
lastEntries = undefined!;
|
||||
|
||||
collection.set([[uri, [new Diagnostic(new Range(0, 0, 1, 1), 'warning')]]]);
|
||||
assert.equal(collection.get(uri).length, 1);
|
||||
@@ -185,7 +185,7 @@ suite('ExtHostDiagnostics', () => {
|
||||
let [[, data2]] = lastEntries;
|
||||
assert.equal(data2.length, 1);
|
||||
assert.equal(data2[0].message, 'warning');
|
||||
lastEntries = undefined;
|
||||
lastEntries = undefined!;
|
||||
});
|
||||
|
||||
test('don\'t send message when not making a change', function () {
|
||||
@@ -222,11 +222,11 @@ suite('ExtHostDiagnostics', () => {
|
||||
|
||||
collection.set([
|
||||
[uri, [diag, diag, diag]],
|
||||
[uri, undefined],
|
||||
[uri, undefined!],
|
||||
[uri, [diag]],
|
||||
|
||||
[uri2, [diag, diag]],
|
||||
[uri2, undefined],
|
||||
[uri2, undefined!],
|
||||
[uri2, [diag]],
|
||||
]);
|
||||
|
||||
@@ -244,7 +244,7 @@ suite('ExtHostDiagnostics', () => {
|
||||
let diag = new Diagnostic(new Range(0, 0, 0, 1), i.toString());
|
||||
|
||||
tuples.push([uri, [diag, diag, diag]]);
|
||||
tuples.push([uri, undefined]);
|
||||
tuples.push([uri, undefined!]);
|
||||
tuples.push([uri, [diag]]);
|
||||
}
|
||||
|
||||
@@ -259,7 +259,7 @@ suite('ExtHostDiagnostics', () => {
|
||||
|
||||
test('diagnostic capping', function () {
|
||||
|
||||
let lastEntries: [UriComponents, IMarkerData[]][];
|
||||
let lastEntries!: [UriComponents, IMarkerData[]][];
|
||||
let collection = new DiagnosticCollection('test', 'test', 250, new class extends DiagnosticsShape {
|
||||
$changeMany(owner: string, entries: [UriComponents, IMarkerData[]][]): void {
|
||||
lastEntries = entries;
|
||||
@@ -285,14 +285,14 @@ suite('ExtHostDiagnostics', () => {
|
||||
});
|
||||
|
||||
test('diagnostic eventing', async function () {
|
||||
let emitter = new Emitter<(string | URI)[]>();
|
||||
let emitter = new Emitter<Array<string | URI>>();
|
||||
let collection = new DiagnosticCollection('ddd', 'test', 100, new DiagnosticsShape(), emitter);
|
||||
|
||||
let diag1 = new Diagnostic(new Range(1, 1, 2, 3), 'diag1');
|
||||
let diag2 = new Diagnostic(new Range(1, 1, 2, 3), 'diag2');
|
||||
let diag3 = new Diagnostic(new Range(1, 1, 2, 3), 'diag3');
|
||||
|
||||
let p = toPromise(emitter.event).then(a => {
|
||||
let p = Event.toPromise(emitter.event).then(a => {
|
||||
assert.equal(a.length, 1);
|
||||
assert.equal(a[0].toString(), 'aa:bb');
|
||||
assert.ok(URI.isUri(a[0]));
|
||||
@@ -300,7 +300,7 @@ suite('ExtHostDiagnostics', () => {
|
||||
collection.set(URI.parse('aa:bb'), []);
|
||||
await p;
|
||||
|
||||
p = toPromise(emitter.event).then(e => {
|
||||
p = Event.toPromise(emitter.event).then(e => {
|
||||
assert.equal(e.length, 2);
|
||||
assert.ok(URI.isUri(e[0]));
|
||||
assert.ok(URI.isUri(e[1]));
|
||||
@@ -313,7 +313,7 @@ suite('ExtHostDiagnostics', () => {
|
||||
]);
|
||||
await p;
|
||||
|
||||
p = toPromise(emitter.event).then(e => {
|
||||
p = Event.toPromise(emitter.event).then(e => {
|
||||
assert.equal(e.length, 2);
|
||||
assert.ok(typeof e[0] === 'string');
|
||||
assert.ok(typeof e[1] === 'string');
|
||||
@@ -323,14 +323,14 @@ suite('ExtHostDiagnostics', () => {
|
||||
});
|
||||
|
||||
test('vscode.languages.onDidChangeDiagnostics Does Not Provide Document URI #49582', async function () {
|
||||
let emitter = new Emitter<(string | URI)[]>();
|
||||
let emitter = new Emitter<Array<string | URI>>();
|
||||
let collection = new DiagnosticCollection('ddd', 'test', 100, new DiagnosticsShape(), emitter);
|
||||
|
||||
let diag1 = new Diagnostic(new Range(1, 1, 2, 3), 'diag1');
|
||||
|
||||
// delete
|
||||
collection.set(URI.parse('aa:bb'), [diag1]);
|
||||
let p = toPromise(emitter.event).then(e => {
|
||||
let p = Event.toPromise(emitter.event).then(e => {
|
||||
assert.equal(e[0].toString(), 'aa:bb');
|
||||
});
|
||||
collection.delete(URI.parse('aa:bb'));
|
||||
@@ -338,10 +338,10 @@ suite('ExtHostDiagnostics', () => {
|
||||
|
||||
// set->undefined (as delete)
|
||||
collection.set(URI.parse('aa:bb'), [diag1]);
|
||||
p = toPromise(emitter.event).then(e => {
|
||||
p = Event.toPromise(emitter.event).then(e => {
|
||||
assert.equal(e[0].toString(), 'aa:bb');
|
||||
});
|
||||
collection.set(URI.parse('aa:bb'), undefined);
|
||||
collection.set(URI.parse('aa:bb'), undefined!);
|
||||
await p;
|
||||
});
|
||||
|
||||
@@ -355,9 +355,9 @@ suite('ExtHostDiagnostics', () => {
|
||||
assert.equal(data.length, 1);
|
||||
|
||||
let [diag] = data;
|
||||
assert.equal(diag.relatedInformation.length, 2);
|
||||
assert.equal(diag.relatedInformation[0].message, 'more1');
|
||||
assert.equal(diag.relatedInformation[1].message, 'more2');
|
||||
assert.equal(diag.relatedInformation!.length, 2);
|
||||
assert.equal(diag.relatedInformation![0].message, 'more1');
|
||||
assert.equal(diag.relatedInformation![1].message, 'more2');
|
||||
done();
|
||||
}
|
||||
}, new Emitter<any>());
|
||||
|
||||
Reference in New Issue
Block a user