Copilot commented on code in PR #229:
URL: 
https://github.com/apache/cloudstack-cloudmonkey/pull/229#discussion_r4181922758


##########
cli/completer.go:
##########
@@ -409,6 +457,19 @@ func (t *autoCompleter) Do(line []rune, pos int) (options 
[][]rune, offset int)
                                return
                        }
 
+                       if arg.Type == "map" {
+                               suggestions := mapFieldSuggestions(arg)

Review Comment:
   Cached API argument names end in `=` (`config/cache.go:152`), so the 
enclosing `arg.Name` prefix check prevents this branch from completing indexed 
fields. For `tags`, `Do` offers only `=`, while `tags[0].k` never reaches this 
block; `tags=` reaches it but matches none of the generated suggestions. Match 
map-field candidates before that guard, keeping ordinary argument completion 
when no fields are known. Add a regression test calling `autoCompleter.Do` with 
`Name: "tags="`; `TestMapAutocompleteOptions` currently bypasses the failing 
dispatch.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to