@@ -33,9 +33,11 @@ suite('URI Label', () => {
3333 const uri1 = TestWorkspace . folders [ 0 ] . uri . with ( { path : TestWorkspace . folders [ 0 ] . uri . path . concat ( '/a/b/c/d' ) } ) ;
3434 assert . equal ( labelService . getUriLabel ( uri1 , { relative : true } ) , isWindows ? 'a\\b\\c\\d' : 'a/b/c/d' ) ;
3535 assert . equal ( labelService . getUriLabel ( uri1 , { relative : false } ) , isWindows ? 'C:\\testWorkspace\\a\\b\\c\\d' : '/testWorkspace/a/b/c/d' ) ;
36+ assert . equal ( labelService . getUriBasenameLabel ( uri1 ) , 'd' ) ;
3637
3738 const uri2 = URI . file ( 'c:\\1/2/3' ) ;
3839 assert . equal ( labelService . getUriLabel ( uri2 , { relative : false } ) , isWindows ? 'C:\\1\\2\\3' : '/c:\\1/2/3' ) ;
40+ assert . equal ( labelService . getUriBasenameLabel ( uri2 ) , '3' ) ;
3941 } ) ;
4042
4143 test ( 'custom scheme' , function ( ) {
@@ -51,6 +53,23 @@ suite('URI Label', () => {
5153
5254 const uri1 = URI . parse ( 'vscode://microsoft.com/1/2/3/4/5' ) ;
5355 assert . equal ( labelService . getUriLabel ( uri1 , { relative : false } ) , 'LABEL//1/2/3/4/5/microsoft.com/END' ) ;
56+ assert . equal ( labelService . getUriBasenameLabel ( uri1 ) , 'END' ) ;
57+ } ) ;
58+
59+ test . only ( 'separator' , function ( ) {
60+ labelService . registerFormatter ( {
61+ scheme : 'vscode' ,
62+ formatting : {
63+ label : 'LABEL\\${path}\\${authority}\\END' ,
64+ separator : '\\' ,
65+ tildify : true ,
66+ normalizeDriveLetter : true
67+ }
68+ } ) ;
69+
70+ const uri1 = URI . parse ( 'vscode://microsoft.com/1/2/3/4/5' ) ;
71+ assert . equal ( labelService . getUriLabel ( uri1 , { relative : false } ) , 'LABEL\\\\1\\2\\3\\4\\5\\microsoft.com\\END' ) ;
72+ assert . equal ( labelService . getUriBasenameLabel ( uri1 ) , 'END' ) ;
5473 } ) ;
5574
5675 test ( 'custom authority' , function ( ) {
@@ -65,6 +84,7 @@ suite('URI Label', () => {
6584
6685 const uri1 = URI . parse ( 'vscode://microsoft.com/1/2/3/4/5' ) ;
6786 assert . equal ( labelService . getUriLabel ( uri1 , { relative : false } ) , 'LABEL//1/2/3/4/5/microsoft.com/END' ) ;
87+ assert . equal ( labelService . getUriBasenameLabel ( uri1 ) , 'END' ) ;
6888 } ) ;
6989
7090 test ( 'mulitple authority' , function ( ) {
@@ -96,6 +116,7 @@ suite('URI Label', () => {
96116 // Make sure the most specific authority is picked
97117 const uri1 = URI . parse ( 'vscode://microsoft.com/1/2/3/4/5' ) ;
98118 assert . equal ( labelService . getUriLabel ( uri1 , { relative : false } ) , 'second' ) ;
119+ assert . equal ( labelService . getUriBasenameLabel ( uri1 ) , 'second' ) ;
99120 } ) ;
100121
101122 test ( 'custom query' , function ( ) {
0 commit comments