ek9_query_enumerations
Answers first: enumerationNames[], then enumerations[] (name, module, file, line, values in declaration order, valueCount) and summary counts.
When to use it
Is there already an enumeration for this value set - one call with nameFilter:'Status' or valueFilter:'PENDING'; no arguments lists every enumeration. Both filters are case-insensitive substrings.
When not to use it
- Looking for a constrained primitive (PostCode as String, DrivingAge constrain ...) — those are not enums, use
ek9_query_constrained_types. - Looking for a data shape with named fields — use
ek9_query_records. - Hunting a specific enum VALUE literal across raw source — use
ek9_search_text. - You already know the enum name and want its full source — use
ek9_read_construct.
Details
status ∈ ok (one or more matched) / empty (walk succeeded, filters matched nothing — not an error; adds meta.unmatchedFilters[] when a moduleFilter value names no module) / error (no compiled program — compile first). Each entry carries name, module, file, line, values[] and valueCount, with values[] in declaration order (never alphabetised — ordinal order is semantically meaningful) and casing preserved verbatim. nameFilter and valueFilter are case-insensitive substrings; moduleFilter is an exact module-name allow-list.
Arguments
| Argument | Type | Required | What it is |
|---|---|---|---|
moduleFilter | array of string | Restrict to these exact module names. Default: workspace-wide. | |
nameFilter | string | Case-insensitive substring match on enumeration names. | |
valueFilter | string | Filter to enumerations declaring a value whose name matches (case-insensitive substring). Example: "PENDING" finds every enum with a PENDING-like value — useful for catching duplicate value sets. |
Recorded calls
Real calls, recorded against small projects and checked on every build - a changed answer fails it.
List all
Request
{ }
Response
{
"enumerationNames" : [ "OrderStatus", "Priority" ],
"enumerations" : [ {
"file" : "types.ek9",
"line" : 6,
"module" : "com.example.types",
"name" : "OrderStatus",
"valueCount" : 3,
"values" : [ "PENDING", "CONFIRMED", "SHIPPED" ]
}, {
"file" : "types.ek9",
"line" : 11,
"module" : "com.example.types",
"name" : "Priority",
"valueCount" : 2,
"values" : [ "LOW", "HIGH" ]
} ],
"meta" : {
"serverMs" : "<timing>"
},
"status" : "ok",
"summary" : {
"enumerationCount" : 2,
"moduleCount" : 1,
...
Cut short here: 3 more lines. The whole recorded call.