File tree Expand file tree Collapse file tree 1 file changed +1
-16
lines changed
Expand file tree Collapse file tree 1 file changed +1
-16
lines changed Original file line number Diff line number Diff line change @@ -337,28 +337,13 @@ export class Completion {
337337 previousArgs : string [ ] ,
338338 toComplete : string
339339 ) {
340- const commandParts = [ ...previousArgs ] . filter ( arg => arg !== '' ) ;
341-
342- // When we have no real command parts (just empty or showing root commands)
343- const isRootCompletion = commandParts . length === 0 ;
340+ const commandParts = [ ...previousArgs ] . filter ( Boolean ) ;
344341
345342 for ( const [ k , command ] of this . commands ) {
346343 if ( k === '' ) continue ;
347344
348345 const parts = k . split ( ' ' ) ;
349346
350- // For root completion, just match the first part of each command
351- if ( isRootCompletion ) {
352- if ( parts [ 0 ] . startsWith ( toComplete ) ) {
353- this . completions . push ( {
354- value : parts [ 0 ] ,
355- description : command . description ,
356- } ) ;
357- }
358- continue ;
359- }
360-
361- // For subcommand completion, match the parts against commandParts
362347 let match = true ;
363348 let i = 0 ;
364349
You can’t perform that action at this time.
0 commit comments