All files / types/symbols/cpp ICppBaseSymbol.ts

0% Statements 0/0
0% Branches 0/0
0% Functions 0/0
0% Lines 0/0

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47                                                                                             
import type TSymbolKindCpp from "../../symbol-kinds/TSymbolKindCpp";
import type ESourceLanguage from "../../../utils/types/ESourceLanguage";
import type TVisibility from "../../TVisibility";
import type ISourceSpan from "../../ISourceSpan";
 
/**
 * Base interface for all C++ language symbol types.
 * C++ symbols use simple strings for types since they pass through to codegen unchanged.
 */
interface ICppBaseSymbol {
  /** Symbol kind - discriminator for type narrowing */
  readonly kind: TSymbolKindCpp;
 
  /** Symbol name */
  readonly name: string;
 
  /** Source file where the symbol is defined */
  readonly sourceFile: string;
 
  /**
   * Where this symbol is declared, as a span rather than a bare line.
   *
   * Replaced `sourceLine` rather than joining it (#1318). Carrying both would
   * put one fact in two places -- `span.line` and `sourceLine` -- which is the
   * shape recorded in `visibility` below: two places held one fact, they
   * disagreed, and the header believed the wrong one (#1300).
   *
   * A column is what a symbol-level diagnostic was missing: 136 of 302
   * `.expected.error` fixtures began at `1:0` because a diagnostic about a
   * symbol had no position and fell back to the start of the file (#1316).
   */
  readonly span: ISourceSpan;
 
  /** Source language - always Cpp for C++ symbols */
  readonly sourceLanguage: ESourceLanguage.Cpp;
 
  /** Recorded "public" for every symbol, including class members declared under
   * `private:` or `protected:` — the resolver walks `memberdeclaration` only and never
   * reads an `accessSpecifier`, so this is not yet the declared visibility (#1475). */
  readonly visibility: TVisibility;
 
  /** Parent namespace or class name */
  readonly parent?: string;
}
 
export default ICppBaseSymbol;