label service: more tests

This commit is contained in:
isidor
2019-01-18 13:46:49 +01:00
parent b1eb540216
commit 39bb8bb17d
2 changed files with 9 additions and 1 deletions

View File

@@ -77,7 +77,6 @@ function hasDriveLetter(path: string): boolean {
return !!(isWindows && path && path[2] === ':');
}
class ResourceLabelFormattersHandler implements IWorkbenchContribution {
constructor(@ILabelService labelService: ILabelService) {
resourceLabelFormattersExtPoint.setHandler(extensions => {

View File

@@ -84,7 +84,16 @@ suite('URI Label', () => {
separator: '/'
}
});
labelService.registerFormatter({
scheme: 'vscode',
authority: 'mi*',
formatting: {
label: 'third',
separator: '/'
}
});
// Make sure the most specific authority is picked
const uri1 = URI.parse('vscode://microsoft.com/1/2/3/4/5');
assert.equal(labelService.getUriLabel(uri1, { relative: false }), 'second');
});