File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -19,11 +19,7 @@ var completePredictModuleSource = complete.PredictAnything
1919type completePredictSequence []complete.Predictor
2020
2121func (s completePredictSequence ) Predict (a complete.Args ) []string {
22- // Only one level of command is stripped off the prefix of a.Completed
23- // here, so nested subcommands like "workspace new" will need to provide
24- // dummy entries (e.g. complete.PredictNothing) as placeholders for
25- // all but the first subcommand. For example, "workspace new" needs
26- // one placeholder for the argument "new".
22+ // Nested subcommands do not require any placeholder entry for their subcommand name.
2723 idx := len (a .Completed )
2824 if idx >= len (s ) {
2925 return nil
Original file line number Diff line number Diff line change @@ -190,7 +190,6 @@ func (c *WorkspaceDeleteCommand) Run(args []string) int {
190190
191191func (c * WorkspaceDeleteCommand ) AutocompleteArgs () complete.Predictor {
192192 return completePredictSequence {
193- complete .PredictNothing , // the "select" subcommand itself (already matched)
194193 c .completePredictWorkspaceName (),
195194 complete .PredictDirs ("" ),
196195 }
Original file line number Diff line number Diff line change @@ -167,7 +167,6 @@ func (c *WorkspaceNewCommand) Run(args []string) int {
167167
168168func (c * WorkspaceNewCommand ) AutocompleteArgs () complete.Predictor {
169169 return completePredictSequence {
170- complete .PredictNothing , // the "new" subcommand itself (already matched)
171170 complete .PredictAnything ,
172171 complete .PredictDirs ("" ),
173172 }
Original file line number Diff line number Diff line change @@ -117,7 +117,6 @@ func (c *WorkspaceSelectCommand) Run(args []string) int {
117117
118118func (c * WorkspaceSelectCommand ) AutocompleteArgs () complete.Predictor {
119119 return completePredictSequence {
120- complete .PredictNothing , // the "select" subcommand itself (already matched)
121120 c .completePredictWorkspaceName (),
122121 complete .PredictDirs ("" ),
123122 }
You can’t perform that action at this time.
0 commit comments