/** * Shared behavioral conformance spec for LanguageAdapter implementations * (ADR-03). * * Each adapter's own test file imports `runConformanceSuite` and calls * it against its fixture directory. The shared assertions are * deliberately language-agnostic — they check the shape of the * contract (return types, happy-path/error-path discipline, lifecycle * behavior) rather than language-specific details (TypeScript hover * format, Python Protocol routing, etc.). Language-specific * assertions live in each adapter's own `.test.ts`. * * Fixture requirements (must hold for both TypeScript and Python * fixtures feeding this suite): * - `sample.{ts,py}` — at least one class, one function, one * additional symbol (variable / type / anything) * - `broken.{ts,py}` — deliberate type error, produces ≥1 diagnostic * - `consumer.{ts,py}` — references to the class and function in * sample (so findReferences returns ≥1 hit each) * * Why a callable function, not a describe block: the same test * scaffolding applies to each adapter but with different fixtures * and different expected symbol names. A function parameterized on * both keeps the suite composable without `.each` pyramids. */ import { type LanguageAdapter } from "../types.js"; export interface ConformanceFixtureSpec { /** * Absolute path to the fixture root. Adapter initializes against * this. Must contain the files described in `files` below. */ fixtureRoot: string; /** * Filenames (relative to `fixtureRoot`) for the three required * fixture files. Different adapters use different extensions. */ files: { sample: string; broken: string; consumer: string; }; /** * Names of the symbols the conformance suite probes. The fixture * must declare each of these in `sample`, and the conformance * suite assumes: * - `classSymbol`: has kind === "class" OR "interface" * (Python Protocol → interface is allowed) * - `functionSymbol`: has kind === "function" OR "method" * (Ruby's kind-6-uniform callable mapping is allowed — Ruby has * no functions-vs-methods semantic split; all callables — * instance methods, top-level def, module functions — emit LSP * kind 6 and map to "method". Parallel to classSymbol * class-or-interface flexibility for languages that distinguish.) * Name match accepts exact OR name-with-open-paren prefix; the * C# adapter encodes parameter lists into method symbol names * per Roslyn-overload-disambiguation convention (e.g., * `FormatGreeting(string name)`) and the spec stays readable * with just the bare name. Parallel discipline pattern to the * kind flexibility: cross-adapter conformance harness * accommodates language-structural-property divergence. * - `referencedSymbol`: appears in `consumer` (for findReferences) */ symbols: { classSymbol: string; functionSymbol: string; referencedSymbol: string; }; } /** * Run the full conformance suite against a fresh adapter instance. * * Pass a factory (not an adapter) so the suite can own lifecycle — * initialize at beforeAll, shutdown at afterAll. This matches the * reality that adapters are stateful (open files, diagnostics cache) * and each suite run wants a clean slate. */ export declare function runConformanceSuite(name: string, makeAdapter: () => LanguageAdapter, spec: ConformanceFixtureSpec): void; //# sourceMappingURL=conformance.d.ts.map