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

Function aliasedTypeText

src/resolution/pascal-scope.ts:1223–1232  ·  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

1221 * line: `procedure(...) of object` for `TOnHelper =` above it.
1222 */
1223function aliasedTypeText(alias: Node, context: ResolutionContext): string {
1224 const lines = fileLines(alias.filePath, context);
1225 let text = '';
1226 for (let i = alias.startLine - 1; i < alias.startLine + 2 && i < lines.length; i++) {
1227 text += ' ' + lines[i]!.replace(/\/\/.*$|\{[^}]*\}|\(\*.*?\*\)/g, ' ');
1228 const eq = text.indexOf('=');
1229 if (eq >= 0 && text.slice(eq + 1).trim()) return text.slice(eq + 1).trim();
1230 }
1231 return '';
1232}
1233
1234/** A routine type written out: `procedure(...) of object`, `function: T`, `reference to procedure`. */
1235const PROCEDURAL_TYPE = /^(?:reference\s+to\s+)?(?:procedure|function)\b/i;

Callers 1

routineTypeVerdictFunction · 0.85

Calls 1

fileLinesFunction · 0.85

Tested by

no test coverage detected