@@ -301,51 +301,51 @@ suite('TerminalCompletionModel', function () {
301
301
suite ( 'git branch priority sorting' , ( ) => {
302
302
test ( 'should prioritize main and master branches for git commands' , ( ) => {
303
303
const items = [
304
- createItem ( { label : 'feature-branch' } ) ,
305
- createItem ( { label : 'master' } ) ,
306
- createItem ( { label : 'development' } ) ,
307
- createItem ( { label : 'main' } )
304
+ createItem ( { kind : TerminalCompletionItemKind . Argument , label : 'feature-branch' } ) ,
305
+ createItem ( { kind : TerminalCompletionItemKind . Argument , label : 'master' } ) ,
306
+ createItem ( { kind : TerminalCompletionItemKind . Argument , label : 'development' } ) ,
307
+ createItem ( { kind : TerminalCompletionItemKind . Argument , label : 'main' } )
308
308
] ;
309
309
const model = new TerminalCompletionModel ( items , new LineContext ( 'git checkout ' , 0 ) ) ;
310
310
assertItems ( model , [ 'main' , 'master' , 'development' , 'feature-branch' ] ) ;
311
311
} ) ;
312
312
313
313
test ( 'should prioritize main and master branches for git switch command' , ( ) => {
314
314
const items = [
315
- createItem ( { label : 'feature-branch' } ) ,
316
- createItem ( { label : 'main' } ) ,
317
- createItem ( { label : 'another-feature' } ) ,
318
- createItem ( { label : 'master' } )
315
+ createItem ( { kind : TerminalCompletionItemKind . Argument , label : 'feature-branch' } ) ,
316
+ createItem ( { kind : TerminalCompletionItemKind . Argument , label : 'main' } ) ,
317
+ createItem ( { kind : TerminalCompletionItemKind . Argument , label : 'another-feature' } ) ,
318
+ createItem ( { kind : TerminalCompletionItemKind . Argument , label : 'master' } )
319
319
] ;
320
320
const model = new TerminalCompletionModel ( items , new LineContext ( 'git switch ' , 0 ) ) ;
321
321
assertItems ( model , [ 'main' , 'master' , 'another-feature' , 'feature-branch' ] ) ;
322
322
} ) ;
323
323
324
324
test ( 'should not prioritize main and master for non-git commands' , ( ) => {
325
325
const items = [
326
- createItem ( { label : 'feature-branch' } ) ,
327
- createItem ( { label : 'master' } ) ,
328
- createItem ( { label : 'main' } )
326
+ createItem ( { kind : TerminalCompletionItemKind . Argument , label : 'feature-branch' } ) ,
327
+ createItem ( { kind : TerminalCompletionItemKind . Argument , label : 'master' } ) ,
328
+ createItem ( { kind : TerminalCompletionItemKind . Argument , label : 'main' } )
329
329
] ;
330
330
const model = new TerminalCompletionModel ( items , new LineContext ( 'ls ' , 0 ) ) ;
331
331
assertItems ( model , [ 'feature-branch' , 'main' , 'master' ] ) ;
332
332
} ) ;
333
333
334
334
test ( 'should handle git commands with leading whitespace' , ( ) => {
335
335
const items = [
336
- createItem ( { label : 'feature-branch' } ) ,
337
- createItem ( { label : 'master' } ) ,
338
- createItem ( { label : 'main' } )
336
+ createItem ( { kind : TerminalCompletionItemKind . Argument , label : 'feature-branch' } ) ,
337
+ createItem ( { kind : TerminalCompletionItemKind . Argument , label : 'master' } ) ,
338
+ createItem ( { kind : TerminalCompletionItemKind . Argument , label : 'main' } )
339
339
] ;
340
340
const model = new TerminalCompletionModel ( items , new LineContext ( ' git checkout ' , 0 ) ) ;
341
341
assertItems ( model , [ 'main' , 'master' , 'feature-branch' ] ) ;
342
342
} ) ;
343
343
344
344
test ( 'should work with complex label objects' , ( ) => {
345
345
const items = [
346
- createItem ( { label : { label : 'feature-branch' , description : 'Feature branch' } } ) ,
347
- createItem ( { label : { label : 'master' , description : 'Master branch' } } ) ,
348
- createItem ( { label : { label : 'main' , description : 'Main branch' } } )
346
+ createItem ( { kind : TerminalCompletionItemKind . Argument , label : { label : 'feature-branch' , description : 'Feature branch' } } ) ,
347
+ createItem ( { kind : TerminalCompletionItemKind . Argument , label : { label : 'master' , description : 'Master branch' } } ) ,
348
+ createItem ( { kind : TerminalCompletionItemKind . Argument , label : { label : 'main' , description : 'Main branch' } } )
349
349
] ;
350
350
const model = new TerminalCompletionModel ( items , new LineContext ( 'git checkout ' , 0 ) ) ;
351
351
assertItems ( model , [
0 commit comments