MCPcopy Create free account
hub / github.com/colbymchenry/codegraph / aliasedTypeText

Function aliasedTypeText

src/resolution/pascal-scope.ts:2759–2768  ·  view source on GitHub ↗

* What a type declaration says after its `=`, which may start on the next * line: `procedure(...) of object` for `TOnHelper =` above it.

(alias: Node, context: ResolutionContext)

Source from the content-addressed store, hash-verified

2757 * line: `procedure(...) of object` for `TOnHelper =` above it.
2758 */
2759function aliasedTypeText(alias: Node, context: ResolutionContext): string {
2760 const lines = fileLines(alias.filePath, context);
2761 let text = '';
2762 for (let i = alias.startLine - 1; i < alias.startLine + 2 && i < lines.length; i++) {
2763 text += ' ' + lines[i]!.replace(/\/\/.*$|\{[^}]*\}|\(\*.*?\*\)/g, ' ');
2764 const eq = text.indexOf('=');
2765 if (eq >= 0 && text.slice(eq + 1).trim()) return text.slice(eq + 1).trim();
2766 }
2767 return '';
2768}
2769
2770/** A routine type written out: `procedure(...) of object`, `function: T`, `reference to procedure`. */
2771const PROCEDURAL_TYPE = /^(?:reference\s+to\s+)?(?:procedure|function)\b/i;

Callers 2

typeOfTextFunction · 0.85
routineTypeVerdictFunction · 0.85

Calls 1

fileLinesFunction · 0.85

Tested by

no test coverage detected