ek9_query_components
Answers first: componentNames[], then components[] (name, module, file, line, extends, isOpen, isAbstract, keyMethods, methodCount) and summary counts - the DI-injectable constructs, workspace-wide or the filtered subset.
When to use it
Is there already a DI component I can reuse or extend - one call with nameFilter:'Logger'; no arguments lists every component. Narrow with extendsFilter, moduleFilter or includeAbstract:false.
When not to use it
- The construct is a plain class, not a DI component — use
ek9_query_classesinstead. - You want the actual DI wiring graph (who injects what) — use
ek9_query_dependency_injectioninstead. - You know a component's name and want its full inheritance chain — use
ek9_query_type_hierarchyinstead. - You know the component's name and want its full source — use
ek9_read_constructinstead.
Details
status ok = one or more matched; empty = filtered set empty (incl. a moduleFilter naming non-existent modules, surfaced in meta.unmatchedFilters[] as module:<value>) and is NOT an error; error = no compiled program (run ek9_compile first). nameFilter/methodNameFilter are plain case-insensitive substrings, not regex; built-in org.ek9.* components are excluded. extends is null unless a super-component is declared (implicit Any filtered out); keyMethods are EK9-syntax signatures, constructors-first, public-only, capped at 5; unresolved types render as <unresolved> without a partial status.
Arguments
| Argument | Type | Required | What it is |
|---|---|---|---|
extendsFilter | string | Filter to components whose extends-chain transitively includes this super-component name. | |
includeAbstract | boolean | Default true. When false, excludes components marked 'as abstract'. | |
includeMethodSummary | boolean | Default true. When true each entry includes keyMethods[] (up to 5 public signatures). Set false for a lighter response. | |
methodNameFilter | string | Filter to components declaring a method whose name matches (case-insensitive substring). | |
moduleFilter | array of string | Restrict to these exact module names. Default: workspace-wide. | |
nameFilter | string | Case-insensitive substring match on component names. |
Recorded calls
Real calls, recorded against small projects and checked on every build - a changed answer fails it.
Partial extends unmatched
Request
{
"extendsFilter" : "Log"
}
Response
{
"componentNames" : [ ],
"components" : [ ],
"meta" : {
"didYouMean" : {
"extends:Log" : [ "Logger", "ConsoleLogger" ]
},
"serverMs" : "<timing>",
"unmatchedFilters" : [ "extends:Log" ]
},
"status" : "empty",
"summary" : {
"abstractCount" : 0,
"componentCount" : 0,
"moduleCount" : 0,
"openCount" : 0
}
}
List all
Request
{ }
Response
{
"componentNames" : [ "Logger", "ConsoleLogger" ],
"components" : [ {
"extends" : null,
"file" : "di.ek9",
"isAbstract" : true,
"isOpen" : true,
"keyMethods" : [ "Logger()", "log()\n -> message as String\n <- output as String", "operator ?\n <- rtn as Boolean" ],
"line" : 6,
"methodCount" : 3,
"module" : "com.example.di",
"name" : "Logger"
}, {
"extends" : "Logger",
"file" : "di.ek9",
"isAbstract" : false,
"isOpen" : false,
"keyMethods" : [ "ConsoleLogger()", "log()\n -> message as String\n <- output as String", "operator ?\n <- rtn as Boolean" ],
"line" : 13,
"methodCount" : 3,
"module" : "com.example.di",
"name" : "ConsoleLogger"
} ],
"meta" : {
...
Cut short here: 10 more lines. The whole recorded call.