Merge remote-tracking branch 'smcenlly/issue-130882' into main

This commit is contained in:
Connor Peet
2022-01-24 11:10:41 -08:00
6 changed files with 19 additions and 2 deletions

View File

@@ -95,7 +95,7 @@ const testItemPropAccessor = <K extends keyof vscode.TestItem>(
};
};
type WritableProps = Pick<vscode.TestItem, 'range' | 'label' | 'description' | 'canResolveChildren' | 'busy' | 'error' | 'tags'>;
type WritableProps = Pick<vscode.TestItem, 'range' | 'label' | 'description' | 'sortText' | 'canResolveChildren' | 'busy' | 'error' | 'tags'>;
const strictEqualComparator = <T>(a: T, b: T) => a === b;
@@ -107,6 +107,7 @@ const propComparators: { [K in keyof Required<WritableProps>]: (a: vscode.TestIt
},
label: strictEqualComparator,
description: strictEqualComparator,
sortText: strictEqualComparator,
busy: strictEqualComparator,
error: strictEqualComparator,
canResolveChildren: strictEqualComparator,
@@ -129,6 +130,7 @@ const makePropDescriptors = (api: IExtHostTestItemApi, label: string): { [K in k
range: testItemPropAccessor(api, 'range', undefined, propComparators.range),
label: testItemPropAccessor(api, 'label', label, propComparators.label),
description: testItemPropAccessor(api, 'description', undefined, propComparators.description),
sortText: testItemPropAccessor(api, 'sortText', undefined, propComparators.sortText),
canResolveChildren: testItemPropAccessor(api, 'canResolveChildren', false, propComparators.canResolveChildren),
busy: testItemPropAccessor(api, 'busy', false, propComparators.busy),
error: testItemPropAccessor(api, 'error', undefined, propComparators.error),
@@ -268,6 +270,7 @@ export class TestItemImpl implements vscode.TestItem {
public range!: vscode.Range | undefined;
public description!: string | undefined;
public sortText!: string | undefined;
public label!: string;
public error!: string | vscode.MarkdownString;
public busy!: boolean;

View File

@@ -1725,6 +1725,7 @@ export namespace TestItem {
tags: item.tags.map(t => TestTag.namespace(ctrlId, t.id)),
range: Range.from(item.range) || null,
description: item.description || null,
sortText: item.sortText || null,
error: item.error ? (MarkdownString.fromStrict(item.error) || null) : null,
};
}
@@ -1745,6 +1746,7 @@ export namespace TestItem {
canResolveChildren: false,
busy: false,
description: item.description || undefined,
sortText: item.sortText || undefined,
};
}
@@ -1753,6 +1755,7 @@ export namespace TestItem {
const testItem = new TestItemImpl(testId.controllerId, testId.localId, item.label, URI.revive(item.uri));
testItem.range = Range.to(item.range || undefined);
testItem.description = item.description || undefined;
testItem.sortText = item.sortText || undefined;
return testItem;
}