@suss/adapter-ruby 0.20.0 → 0.21.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.ts CHANGED
@@ -4,6 +4,16 @@ import { Database } from '@suss/datalog';
4
4
  import { TypeShape, BehavioralSummary } from '@suss/behavioral-ir';
5
5
  import { RawCodeStructure } from '@suss/extractor';
6
6
 
7
+ /**
8
+ * A new `Parser` for every call, so that parses running at the same time do
9
+ * not fight over one parser's mutable `language` field. The compiled `Language`
10
+ * is loaded once per process and shared.
11
+ */
12
+ declare function parseRuby(source: string): Promise<Tree>;
13
+
14
+ /** A call whose block is the thing being configured rather than a place statements run. */
15
+ type BlockConfigures = (call: Node) => boolean;
16
+
7
17
  /**
8
18
  * Finds the file behind a constant.
9
19
  *
@@ -19,13 +29,6 @@ declare function underscoreConstantPath(qualifiedName: string): string;
19
29
  /** Null when there is no file at that path. We do not fall back to another root or another spelling. */
20
30
  declare function resolveConstantFile(root: string, qualifiedName: string, convention: ConstantPathConvention): string | null;
21
31
 
22
- /**
23
- * A new `Parser` for every call, so that parses running at the same time do
24
- * not fight over one parser's mutable `language` field. The compiled `Language`
25
- * is loaded once per process and shared.
26
- */
27
- declare function parseRuby(source: string): Promise<Tree>;
28
-
29
32
  /**
30
33
  * Resolves Ruby constant paths against lexical nesting.
31
34
  *
@@ -65,7 +68,7 @@ interface ClassInfo {
65
68
  /** `Module.nesting` in effect inside this class's own body, innermost first. */
66
69
  bodyNesting: readonly string[];
67
70
  }
68
- /** Every `class` declaration reachable from `root` through direct module/class nesting, in source order. */
71
+ /** Every `class` declaration reachable from `root` through module/class nesting, in source order. */
69
72
  declare function walkClasses(root: Node, visit: (info: ClassInfo) => void): void;
70
73
  /** The same walk including `module` declarations, for a lookup that has to reach a module's own methods. */
71
74
  declare function walkDefinitions(root: Node, visit: (info: ClassInfo) => void): void;
@@ -134,7 +137,7 @@ type MethodLookup = {
134
137
  */
135
138
  declare function methodInAncestry(ancestry: Ancestry, name: string): MethodLookup;
136
139
  /** Every statement of every body reached, most distant ancestor first, so a nearer declaration overwrites what it inherits. */
137
- declare function inheritedStatements(ancestry: Ancestry): Array<{
140
+ declare function inheritedStatements(ancestry: Ancestry, blockConfigures?: BlockConfigures): Array<{
138
141
  block: ReachedBody;
139
142
  statement: Node;
140
143
  }>;