ek9_query_construct

Answers first: fieldNames, methodNames, operatorNames, defaultedOperatorNames, superName, traitNames, then construct{name, fullyQualifiedName, module, genus, isOpen, extends, traits, modifiers} and the full fields/methods/operators/constructors/metrics.

Category: Enquiry · Compare: Structure View (IntelliJ) / Outline (VSCode)

When to use it

Everything about one type or function in one call - fields, methods, operators, supertype, traits, metrics - with symbol:'Order', no file needed. An IDE cursor (file + line anywhere inside the construct) also works; defaulted operators are marked.

When not to use it

Details

ONE uniform shape for every genus: the name lists first, then the header under 'construct{}' (name, fullyQualifiedName, module, genus, modifiers, declaration 'line', isOpen, flat 'extends' + 'traits', generic template/parameterised-type info, 'serviceUri' for services) with sibling fields/methods/operators/constructors/metrics. A FUNCTION reuses that shape — parameters appear as 'fields', the return as a single 'methods' entry, operators/constructors empty. Metrics carry complexity/cohesion/coupling/inheritanceDepth plus member counts; 'coupling' MAY be fractional (each by-trait delegation discounts 0.5).

Arguments

ArgumentTypeRequiredWhat it is
filestringThe EK9 source file - OPTIONAL when symbol is a construct name; required to anchor on a member or a use site.
lineinteger1-based line anywhere inside the target construct - OMIT it and pass symbol:'<name>' instead.
symbolstringA construct NAME alone ('Shape', 'sample.deps.core::Validator') - no file needed, the tool finds it workspace-wide; or, with file (+ line), the identifier you mean there.

Recorded calls

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

Construct shape

Request

{
  "file" : "MyRecord.ek9",
  "line" : 5
}

Response

{
  "construct" : {
    "extends" : "Any",
    "fullyQualifiedName" : "com.example::MyRecord",
    "genus" : "RECORD",
    "isOpen" : false,
    "line" : 5,
    "modifiers" : [ ],
    "module" : "com.example",
    "name" : "MyRecord"
  },
  "constructors" : [ {
    "parameters" : [ ]
  } ],
  "defaultedOperatorNames" : [ "?", "$", "$$", ":=:", "<=>", "==", "<>", "<", "<=", ">", ">=", "#?" ],
  "fieldNames" : [ "name" ],
  "fields" : [ {
    "mutable" : true,
    "name" : "name",
    "type" : "String"
  } ],
  "meta" : {
    "serverMs" : "<timing>"
  },
...

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