Add map argument autocomplete - #229
dheeraj12347 wants to merge 1 commit into
Conversation
|
Hi @Pearl1594 and @DaanHoogland , I’ve raised the map argument autocomplete work as a separate PR: #229. It adds autocomplete support for
Whenever you’re available, could you please have a look and let me know if the approach looks good or if anything should be changed? PR: #229 |
|
✅ Build complete for PR #229. 📦 Binary artifacts are available in the workflow run (expires on October 15, 2026).
|
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
Argument routing prevents indexed map suggestions from appearing with real cached argument names.
Review effort: Balanced
Findings: 1
Open (1)
What changed in this PR
Adds description-based autocomplete for CloudMonkey map arguments without assuming every map uses key/value fields.
Changes:
- Extracts indexed fields from argument descriptions.
- Adds generic key/value suggestions.
- Adds regression tests for field extraction and suggestion generation.
| File | Description |
|---|---|
| cli/completer.go | Adds map-field extraction and completion handling. |
| cli/completer_test.go | Tests indexed, generic, and non-key/value maps. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
| if arg.Type == "map" { | ||
| suggestions := mapFieldSuggestions(arg) |
|
the new map suggestions never show up when you press tab. typing tags gives only "=", and tags= or tags[0].k give nothing, because the new part only runs after the full tags= is typed and none of its suggestions start with tags=. copilot's comment above is right. can we add a test that goes through the normal tab completion with tags= so this gets caught? |

Summary
Add autocomplete support for
mapAPI arguments in CloudMonkey.Changes
tags[0].key=tags[0].value=mapargument follows the key/value structure.Testing
gofmt -w cli/completer_test.gogo test ./...git diff --checkAll tests are passing.