ek9_query_programs

Answers first: status, programCount, programNames - complete for the workspace or the filters given - then programs[] {name, module, file, line, signature, parameters}.

Category: Enquiry · Compare: Constructs navigator (by-genus) — Programs group

When to use it

'What programs (entry points) does this app expose, with what arguments' is one call with no arguments, or nameFilter / argTypeFilter / moduleFilter to narrow.

When not to use it

Details

status is ok (>=1 program) / empty (filtered set empty — NOT an error; carries meta.unmatchedFilters[] when a moduleFilter names no module) / not-compiled (nothing compiled yet — compile first). Each program projects name, module, file, line, a ready-to-read signature string, and parameters[] as {name,type} pairs read off the program's single entry method. argTypeFilter is a leading-prefix, in-order, case-insensitive exact-type match; unresolved arg types render as <unresolved> without degrading status.

Arguments

ArgumentTypeRequiredWhat it is
argTypeFilterarray of stringFilter to programs whose argument list STARTS WITH these types, in order (case-insensitive, exact type-name match). Example: ["Date"] matches programs whose first argument is a Date.
moduleFilterarray of stringRestrict to specific modules (exact names). Default: workspace-wide.
nameFilterstringCase-insensitive substring match on program names.

Recorded calls

Real calls, recorded against small projects and checked on every build - a changed answer fails it.

List all

Request

{ }

Response

{
  "meta" : {
    "serverMs" : "<timing>"
  },
  "programCount" : 2,
  "programNames" : [ "Main", "DailyBatch" ],
  "programs" : [ {
    "file" : "app.ek9",
    "line" : 6,
    "module" : "com.example.app",
    "name" : "Main",
    "parameters" : [ ],
    "signature" : "Main()"
  }, {
    "file" : "app.ek9",
    "line" : 10,
    "module" : "com.example.app",
    "name" : "DailyBatch",
    "parameters" : [ {
      "name" : "runDate",
      "type" : "Date"
    } ],
    "signature" : "DailyBatch()\n  -> runDate as Date"
  } ],
...

Cut short here: 6 more lines. The whole recorded call.