Repository navigation
feat(ui): offer field names in arrays and in keys that take a field in the Script pane - #856
Conversation
…n the Script pane
|
No actionable comments were generated in the recent review.
|
| Layer / File(s) | Summary |
|---|---|
Track array values crates/ui-egui/src/scriptcomplete.rs |
The scanner tracks array membership for values. Top-level value lookup and tool-parameter completion exclude array entries. |
Offer field-valued completions crates/ui-egui/src/scriptcomplete.rs |
Parameter descriptions determine which keys accept fields. Suggestions support numeric filtering, exclude fields already in the array, and use either the line’s layer or the named table. Table fields also provide field help and icons. |
Validate and document completion crates/ui-egui/src/scriptcomplete.rs, docs/user-guide/analysis.md |
Tests cover field suggestions, filtering, field sources, help, icons, and type parsing. The user guide adds examples for supported parameters. |
Priority:
Estimated code review effort: 3 (Moderate) | ~20 minutes
Change: Feature
Sequence Diagram(s)
sequenceDiagram
participant ScriptPane
participant Scan as scriptcomplete::scan
participant Offer as scriptcomplete::offer_at
participant Fields as Line layer or named table fields
ScriptPane->>Scan: Parse cursor context and array membership
Scan->>Offer: Provide key, value, and listed state
Offer->>Fields: Resolve candidate fields
Fields-->>Offer: Return field metadata
Offer-->>ScriptPane: Return filtered suggestions
Possibly related issues
- opengeos/RustGIS#662 — This PR extends Script pane field autocomplete, which is part of the parent issue’s autocomplete work.
Possibly related PRs
- opengeos/RustGIS#827 — Adds Script pane field completion for
gp.runparameters and shared table input functionality used by this change. - opengeos/RustGIS#771 — Adds the initial field completion from a line’s layer, which this change generalizes to more command parameters.
- opengeos/RustGIS#743 — Provides the
Quotescontract used when scanning quoted values in field arrays.
Suggested reviewers: giswqs
Merge Risk: 
Minimal · up to ee97b
-
The documented completion behavior matches the supported cases, and no actionable issue remains before merge.
Pre-merge checks: 
5
-
Full details: Title check
-
Explanation
The title names the main change: field-name suggestions in the Script pane for keys that take a field type, including arrays. It matches the changeset in scriptcomplete.rs and the analysis.md docs. It is long (86 characters) but still specific and accurate.
Full details: Description check
-
Explanation
The description follows the template. It has a Summary that explains what changed and why, a Testing section listing cargo xtask ci, a new test, and manual checks, and a Related issue section that closes
#846. The summary is detailed and matches the objectives and the raw summary.
Full details: Linked Issues check
-
Explanation
Issue
#846requires field suggestions for field-typed values and strings in field-list arrays, using the line layer or thelayer.geocodetable, applying numeric filtering, preserving matching/display/insertion behavior, and excluding unrelated contexts. The PR summary reports implementation incrates/ui-egui/src/scriptcomplete.rs, includingOf::TableFields, array tracking, duplicate suppression, numeric filtering, layer and table resolution, and the listed exclusions. The reported test covers these cases. The user guide documents the feature.
Full details: Out of Scope Changes check
-
Explanation
The reported changes are limited to Script pane completion logic, its focused automated test coverage, and user-guide documentation for issue
#846. TheOf::TableFieldsandValueAt.listedchanges support the completion behavior. No unrelated change is identified.
Full details: Docstring Coverage
-
Explanation
Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 15 functions across 1 files. (1 skipped: 1 unsupported.)
-
Finishing Touches
-
🧪 Generate unit tests (beta)
-
- Create a new PR
-
- Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
A rabbit types a field name bright,
Suggestions hop into the light.
Arrays skip names already there,
Numeric fields get careful care.
Table fields join the list with flair.
Comment @coderabbitai help to get the list of available commands.
Code reviewThe change is small and well tested. I found one medium-confidence concern and a few lower-confidence notes. I did not run the code or the tests. Bugs
Security
Performance
Quality
AGENTS.md
Change sizeCompared: the whole PR against main (merge base c281e2a to PR head 3fedaf5)
|
📖 Docs preview
GitHub Pages takes a minute or two to publish a new commit. Newer commits from the fork aren't published until a maintainer adds the |
Code reviewI read the whole diff ( Bugs
Security
Performance
Quality
AGENTS.md
Change sizeCompared: the whole PR against main (merge base c281e2a to PR head ee97b78).
|
Code reviewThis PR extends the script-completion offers in Bugs
Security / Never-crash
Performance
Quality
AGENTS.md
Change sizeCompared: the whole PR against main (merge base c281e2a to PR head ee97b78).
|
Summary
The Script pane now offers field names wherever a command's description gives a field as a key's type, not only for
"field", and inside the key's array when the type is a list (#846):field,[fieldor[numeric field(field,field|null,[fields],[field, …],field | [fields],[numeric fields]), in a command that takes a"layer", e.g.data.explore/data.similar"fields",share.locator"fields",report.new"groups"/"sort",data.convert"nameField",share.export3d"heightField",layer.geocode"address". Commands with no"layer"are left out, since their fields belong to another layer (data.relate'soriginKey/destinationKey, a report chart'scategory/value), as are[related fields]and[names]."field"offers them; only numeric ones where the type saysnumeric; forlayer.geocodewith a"table", that table's fields (Of::TableFields, with type and alias beside each).scan), but only list-typed field keys offer there: Run turns down an array for a layer, a tool, a tool's parameter or a singlefield, so nothing is offered for those, andvalue_ofignores array strings. Fields the array already lists, before or after the cursor, aren't offered again: the same field twice would do the same work twice.Behaviour change: a
"field"described asnumeric field(layer.extrusion,analysis.interpolate,analysis.simulate) now offers only the numeric fields, as its description says. The user guide (Analysis › Script) describes the new values.Testing
cargo xtask cipasses.keys_that_take_fields_offer_them_in_arrays_too: numeric and plain lists, fields given before and after the cursor left out (the one being typed kept),nameFieldandaddress,data.relateand[related fields]left out, nested arrays, arrays for a single field, a layer, a tool or a tool's parameter, a layer given in an array, andlayer.geocode's table (case aside, help and icon, a missing table, a table given as a number).data.explorenumeric fields, a chosen field not offered again (after and before the cursor),share.locator,report.new"sort",layer.extrusionnumeric only,layer.geocodewith a CSV table, nothing fordata.relate'soriginKey, for"layer": ["or for"field": [";labels.fieldunchanged.Related issue
Closes #846
Summary by CodeRabbit