ek9_query_effective_api
Answers first: declaredMethodNames, inheritedMethodNames, overrides as 'method:Trait', operatorNames, traitNames - then every member in full with its source and file/line.
When to use it
What can be called on a type - declared, inherited, which methods override a trait, its operators - one call with symbol:'X', no file needed.
When not to use it
- ONLY the type's declared structure (own bodies/fields, no merged inherited/trait/defaulted members) - use
ek9_query_constructinstead. - You want the supertype/subtype graph ('what extends X?') not the member list - use
ek9_query_type_hierarchyinstead. - You want ONE member at a cursor - use
ek9_inspect_symbol_at_cursor; everything in scope at a position - useek9_list_visible_symbols. - You want the API of a BUILT-IN type (String, List) - use
ek9_helpinstead.
Details
Genus-dependent shape: a fields[] array appears only for records (record fields are public; class/component/service/application fields are private and excluded, traits have no fields), and only inherited record fields carry inheritedFrom. Per-member source is declared / inherited / trait / defaulted (compiler-synthesised operator), with the declaring site in each member's file/line; re-declared members add override:true plus overrides:{from,at:{file,line}} — follow recursively to trace override chains. Reliable merge needs FULL_RESOLUTION (Phase 7+); earlier phases mis-attribute inherited/trait/defaulted members with no PARTIAL_DATA warning to flag it.
Arguments
| Argument | Type | Required | What it is |
|---|---|---|---|
column | integer | 0-based char offset of the target identifier on 'line' (an IDE cursor). OMIT it and pass symbol:'<name>' instead, or omit both and the first identifier on the line is taken (right for a declaration line). Reuse a column from ek9_inspect_symbol_at_cursor verbatim. | |
file | string | The EK9 source file - OPTIONAL when symbol is a construct name; required to anchor on a member or a use site. | |
line | integer | 1-based line of the declaration or a reference - OMIT it and pass symbol:'<name>' to let the tool find the line (a model counting lines in a file miscounts); if you do count, use ek9_read_file(lineNumbers:true). | |
symbol | string | A 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. |
It also takes the arguments every tool takes.
Recorded calls
Real calls, recorded against small projects and checked on every build - a changed answer fails it.
Every overload summarised
Request
{
"symbol" : "Processor.process",
"verbosity" : "summary"
}
Response
{
"meta" : {
"serverMs" : "<timing>"
},
"note" : "'Processor.process' names 2 overloads - each is answered in overloads[], tagged with its signature; resend one signature (e.g. 'Processor.process(Integer)') for that overload alone.",
"overloadCount" : 2,
"overloads" : [ {
"constructorCount" : 1,
"constructors" : [ {
"name" : "Processor"
} ],
"declaredAt" : "overloads.ek9:11",
"declaredMethodNames" : [ "process" ],
"genus" : "CLASS",
"inheritedMethodNames" : [ ],
"methodCount" : 2,
"methods" : [ {
"name" : "process"
}, {
"name" : "process"
} ],
"operatorCount" : 1,
"operatorNames" : [ "?" ],
"operators" : [ {
...
Cut short here: 38 more lines. The whole recorded call.
Effective api shape
Request
{
"file" : "MyRecord.ek9",
"line" : 5
}
Response
{
"constructorCount" : 1,
"constructors" : [ {
"file" : "MyRecord.ek9",
"line" : 5,
"name" : "MyRecord",
"parameters" : [ ],
"pure" : false,
"source" : "declared"
} ],
"declaredMethodNames" : [ ],
"fieldCount" : 1,
"fields" : [ {
"file" : "MyRecord.ek9",
"kind" : "FIELD",
"line" : 6,
"name" : "name",
"source" : "declared",
"type" : "String"
} ],
"genus" : "RECORD",
"inheritedMethodNames" : [ ],
"meta" : {
"serverMs" : "<timing>"
...
Cut short here: 134 more lines. The whole recorded call.
Overloaded operators named once
Request
{
"symbol" : "Priority"
}
Response
{
"constructorCount" : 3,
"constructors" : [ {
"file" : "overloads.ek9",
"line" : 5,
"name" : "Priority",
"parameters" : [ ],
"pure" : true,
"source" : "declared"
}, {
"file" : "overloads.ek9",
"line" : 5,
"name" : "Priority",
"parameters" : [ {
"name" : "other",
"type" : "Priority"
} ],
"pure" : true,
"source" : "declared"
}, {
"file" : "overloads.ek9",
"line" : 5,
"name" : "Priority",
"parameters" : [ {
...
Cut short here: 258 more lines. The whole recorded call.
See also
- Show me in the IDE: Chapter 11: Optional and Result, built
- Show me in the IDE: Chapter 7: asking about a type
- Show me in the IDE: Chapter 9: collections, asked about
- Show me in the IDE: Chapter 20: a generic type, read