mirror of
https://github.com/microsoft/vscode.git
synced 2026-04-27 12:04:04 +01:00
Merge branch 'main' into correct-response-for-apply-edit
This commit is contained in:
@@ -751,7 +751,8 @@ class MirroredChangeCollector extends IncrementalChangeCollector<MirroredCollect
|
||||
|
||||
this.updated.delete(node);
|
||||
|
||||
if (node.parent && this.alreadyRemoved.has(node.parent)) {
|
||||
const parentId = TestId.parentId(node.item.extId);
|
||||
if (parentId && this.alreadyRemoved.has(parentId.toString())) {
|
||||
this.alreadyRemoved.add(node.item.extId);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -1846,7 +1846,8 @@ export namespace TestResults {
|
||||
const byInternalId = new Map<string, TestResultItem.Serialized>();
|
||||
for (const item of serialized.items) {
|
||||
byInternalId.set(item.item.extId, item);
|
||||
if (serialized.request.targets.some(t => t.controllerId === item.controllerId && t.testIds.includes(item.item.extId))) {
|
||||
const controllerId = TestId.root(item.item.extId);
|
||||
if (serialized.request.targets.some(t => t.controllerId === controllerId && t.testIds.includes(item.item.extId))) {
|
||||
roots.push(item);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -28,12 +28,21 @@ import type * as vscode from 'vscode';
|
||||
* but new ones must not be added
|
||||
* */
|
||||
function es5ClassCompat(target: Function): any {
|
||||
///@ts-expect-error
|
||||
function _() { return Reflect.construct(target, arguments, this.constructor); }
|
||||
Object.defineProperty(_, 'name', Object.getOwnPropertyDescriptor(target, 'name')!);
|
||||
Object.setPrototypeOf(_, target);
|
||||
Object.setPrototypeOf(_.prototype, target.prototype);
|
||||
return _;
|
||||
const interceptFunctions = {
|
||||
apply: function () {
|
||||
const args = arguments.length === 1 ? [] : arguments[1];
|
||||
return Reflect.construct(target, args, arguments[0].constructor);
|
||||
},
|
||||
call: function () {
|
||||
if (arguments.length === 0) {
|
||||
return Reflect.construct(target, []);
|
||||
} else {
|
||||
const [thisArg, ...restArgs] = arguments;
|
||||
return Reflect.construct(target, restArgs, thisArg.constructor);
|
||||
}
|
||||
}
|
||||
};
|
||||
return Object.assign(target, interceptFunctions);
|
||||
}
|
||||
|
||||
@es5ClassCompat
|
||||
|
||||
@@ -102,19 +102,19 @@ suite('ExtHost Testing', () => {
|
||||
assert.deepStrictEqual(single.collectDiff(), [
|
||||
{
|
||||
op: TestDiffOpType.Add,
|
||||
item: { controllerId: 'ctrlId', parent: null, expand: TestItemExpandState.BusyExpanding, item: { ...convert.TestItem.from(single.root) } }
|
||||
item: { controllerId: 'ctrlId', expand: TestItemExpandState.BusyExpanding, item: { ...convert.TestItem.from(single.root) } }
|
||||
},
|
||||
{
|
||||
op: TestDiffOpType.Add,
|
||||
item: { controllerId: 'ctrlId', parent: single.root.id, expand: TestItemExpandState.BusyExpanding, item: { ...convert.TestItem.from(a) } }
|
||||
item: { controllerId: 'ctrlId', expand: TestItemExpandState.BusyExpanding, item: { ...convert.TestItem.from(a) } }
|
||||
},
|
||||
{
|
||||
op: TestDiffOpType.Add,
|
||||
item: { controllerId: 'ctrlId', parent: new TestId(['ctrlId', 'id-a']).toString(), expand: TestItemExpandState.NotExpandable, item: convert.TestItem.from(a.children.get('id-aa') as TestItemImpl) }
|
||||
item: { controllerId: 'ctrlId', expand: TestItemExpandState.NotExpandable, item: convert.TestItem.from(a.children.get('id-aa') as TestItemImpl) }
|
||||
},
|
||||
{
|
||||
op: TestDiffOpType.Add,
|
||||
item: { controllerId: 'ctrlId', parent: new TestId(['ctrlId', 'id-a']).toString(), expand: TestItemExpandState.NotExpandable, item: convert.TestItem.from(a.children.get('id-ab') as TestItemImpl) }
|
||||
item: { controllerId: 'ctrlId', expand: TestItemExpandState.NotExpandable, item: convert.TestItem.from(a.children.get('id-ab') as TestItemImpl) }
|
||||
},
|
||||
{
|
||||
op: TestDiffOpType.Update,
|
||||
@@ -122,7 +122,7 @@ suite('ExtHost Testing', () => {
|
||||
},
|
||||
{
|
||||
op: TestDiffOpType.Add,
|
||||
item: { controllerId: 'ctrlId', parent: single.root.id, expand: TestItemExpandState.NotExpandable, item: convert.TestItem.from(b) }
|
||||
item: { controllerId: 'ctrlId', expand: TestItemExpandState.NotExpandable, item: convert.TestItem.from(b) }
|
||||
},
|
||||
{
|
||||
op: TestDiffOpType.Update,
|
||||
@@ -184,7 +184,6 @@ suite('ExtHost Testing', () => {
|
||||
{
|
||||
op: TestDiffOpType.Add, item: {
|
||||
controllerId: 'ctrlId',
|
||||
parent: new TestId(['ctrlId', 'id-a']).toString(),
|
||||
expand: TestItemExpandState.NotExpandable,
|
||||
item: convert.TestItem.from(child),
|
||||
}
|
||||
@@ -213,7 +212,6 @@ suite('ExtHost Testing', () => {
|
||||
{
|
||||
op: TestDiffOpType.Add, item: {
|
||||
controllerId: 'ctrlId',
|
||||
parent: new TestId(['ctrlId', 'id-a']).toString(),
|
||||
expand: TestItemExpandState.NotExpandable,
|
||||
item: convert.TestItem.from(child),
|
||||
}
|
||||
@@ -326,7 +324,7 @@ suite('ExtHost Testing', () => {
|
||||
},
|
||||
{
|
||||
op: TestDiffOpType.Add,
|
||||
item: { controllerId: 'ctrlId', parent: new TestId(['ctrlId', 'id-a']).toString(), expand: TestItemExpandState.NotExpandable, item: convert.TestItem.from(b) }
|
||||
item: { controllerId: 'ctrlId', expand: TestItemExpandState.NotExpandable, item: convert.TestItem.from(b) }
|
||||
},
|
||||
]);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user