MCPcopy Create free account
hub / github.com/Snapchat/Valdi / getInterfaceAST

Method getInterfaceAST

compiler/companion/src/Workspace.ts:440–458  ·  view source on GitHub ↗
(fileName: string, position: number)

Source from the content-addressed store, hash-verified

438 }
439
440 async getInterfaceAST(fileName: string, position: number): Promise<DumpedInterface> {
441 const openedFile = this.getOpenedFile(fileName);
442 const node = findNode(openedFile.sourceFile, position, (node) => ts.isInterfaceDeclaration(node));
443 if (!node) {
444 throw new Error(`Could not resolve interface declaration at position ${position}`);
445 }
446
447 const references: AST.TypeReference[] = [];
448
449 const dumpedInterface = dumpInterface(node as ts.InterfaceDeclaration, {
450 typeChecker: openedFile.workspaceProject.typeChecker,
451 references,
452 });
453
454 return {
455 interface: dumpedInterface,
456 references,
457 };
458 }
459
460 async getFunctionAST(fileName: string, position: number): Promise<DumpFunctionResponseBody> {
461 const openedFile = this.getOpenedFile(fileName);

Callers

nothing calls this directly

Calls 3

getOpenedFileMethod · 0.95
findNodeFunction · 0.90
dumpInterfaceFunction · 0.90

Tested by

no test coverage detected