All files / PARSE/1-Discover/types IRunAnchor.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                                                                     
import type PathResolver from "../PathResolver";
import type Preprocessor from "../preprocessor/Preprocessor";
import type IAnchorFacts from "./IAnchorFacts";
 
/**
 * Where a run is anchored (#1719): every fact that follows from the location of
 * the run's own root, rather than from anything one file says.
 *
 * A files run is anchored at its `input`; a source run where its text lives.
 * These were derived once, from `config.input`, when the class was built -- and
 * the editor builds it with an empty `input`, so its preview was anchored at
 * the parent of the process's cwd: its `#include`s and guards changed with the
 * cwd, and it never read the project's `compile_commands.json`.
 *
 * Its facts are `IAnchorFacts`, which the `SourceGraph` carries. What this adds
 * is what only 1.1 and the orchestrator use: the anchor's own path and include
 * directories, and the services the compile database picks.
 */
interface IRunAnchor extends IAnchorFacts {
  /** The anchor, resolved: the input, or where the source run's text lives. */
  readonly path: string;
 
  /** The caller's include directories, then the compile database's. */
  readonly includeDirs: readonly string[];
 
  /** The compiler the compile database names, which picks the toolchain. */
  readonly compiler: string | null;
 
  readonly preprocessor: Preprocessor;
 
  readonly pathResolver: PathResolver;
}
 
export default IRunAnchor;