@@ -338,9 +338,10 @@ class HerokuRepl {
338
338
*
339
339
* @param {Record<string, unknown> } commandMeta the metadata for the command
340
340
* @param {string[] } flagsOrArgs the flags or args for the command
341
+ * @param {string } line the current line
341
342
* @returns {Promise<[string[], string]> } the completions and the current input
342
343
*/
343
- async #buildCompletions( commandMeta , flagsOrArgs = [ ] , line ) {
344
+ async #buildCompletions( commandMeta , flagsOrArgs = [ ] , line = '' ) {
344
345
const { args, flags} = commandMeta
345
346
const { requiredInputs : requiredFlags , optionalInputs : optionalFlags } = this . #collectInputsFromManifest( flags )
346
347
const { requiredInputs : requiredArgs , optionalInputs : optionalArgs } = this . #collectInputsFromManifest( args )
@@ -362,9 +363,9 @@ class HerokuRepl {
362
363
// Flags *must* occur first since they may influence
363
364
// the completions for args.
364
365
return await this . #getCompletionsForFlag( line , current , requiredFlags , userFlags , commandMeta ) ||
365
- await this . #getCompletionsForArg( line , current , requiredArgs , userArgs , commandMeta ) ||
366
+ await this . #getCompletionsForArg( current , requiredArgs , userArgs ) ||
366
367
await this . #getCompletionsForFlag( line , current , optionalFlags , userFlags , commandMeta ) ||
367
- await this . #getCompletionsForArg( line , current , optionalArgs , userArgs , commandMeta ) ||
368
+ await this . #getCompletionsForArg( current , optionalArgs , userArgs ) ||
368
369
this . #getCompletionsForEndOfLine( line , flags , userFlags )
369
370
}
370
371
@@ -585,14 +586,12 @@ class HerokuRepl {
585
586
/**
586
587
* Get completions for an arg.
587
588
*
588
- * @param {string } line the current line
589
589
* @param {string } current the current input
590
590
* @param {({long: string}[]) } args the args for the command
591
591
* @param {string[] } userArgs the args that have already been used
592
- * @param {Record<string, unknown> } commandMeta the metadata for the command
593
592
* @returns {Promise<[string[], string] | null> } the completions and the current input
594
593
*/
595
- async #getCompletionsForArg( line , current , args = [ ] , userArgs = [ ] , commandMeta ) {
594
+ async #getCompletionsForArg( current , args = [ ] , userArgs = [ ] ) {
596
595
if ( userArgs . length <= args . length ) {
597
596
const arg = args [ userArgs . length ]
598
597
if ( arg ) {
0 commit comments