Class CoverageDisplayName

java.lang.Object
org.ek9lang.compiler.phase7.generator.CoverageDisplayName
All Implemented Interfaces:
Function<ISymbol,String>

public final class CoverageDisplayName extends Object implements Function<ISymbol,String>
Resolves the user-facing display name for a function/method symbol used in coverage and quality reports.

Four cases are handled:

  • An application's two generated members - DemoApp (prepare) builds the registered components and DemoApp (close) closes them (Steve, 2026-10-28). Both would otherwise render as DemoApp, two identical rows. The words are "prepare" and "close"; the compiler's _prepare/_decommission are never shown. A program stays bare: its _main IS the program.

    Join key: _prepare keeps the bare application name as its CoverageIdentity: it runs the application's body, which phase 5 measured under that name, so anything gathered per construct (complexity, input variety, lock payloads) is genuinely _prepare's. _decommission has no source of its own, so it takes the (close) form as its identity too: a bare key would let it join onto the same per-construct data and double-count it.

  • Synthetic methods (_main, _call, _i_init, _c_init, etc.) — show the enclosing scope name. This makes a program's _main render as the program name, a dynamic function's _call render as the dynamic function's name, and so on.
  • Regular methods/operators on an aggregate (class, trait, component, record, service) — prefix the method name with the aggregate name. Renders as Newt.move, ASimpleClass.aCheck, Walker.?. This distinguishes methods from module-level free functions in coverage report listings.
  • Module-level free functions — show the bare function name with no prefix.

THE display name - hold an instance. Its siblings are CoverageIdentity (the join key) and CoverageSourceQualifiedName (the coverage/profiling identity); all three resolve through CoverageNameResolution. Used by every IR generator that registers function entries with CoverageProbePlacer - all of them through FunctionProbes.enter(CoverageProbePlacer, ISymbol, DebugInfo), THE registration.

  • Constructor Details

    • CoverageDisplayName

      public CoverageDisplayName()
  • Method Details

    • apply

      public String apply(ISymbol operationSymbol)
      Resolve the display name for a function/method symbol.
      Specified by:
      apply in interface Function<ISymbol,String>
      Parameters:
      operationSymbol - the symbol whose display name is needed; must not be null
      Returns:
      user-facing display name suitable for HTML coverage reports