kythe.io@v0.0.68-0.20240422202219-7225dbc01741/kythe/typescript/testdata/refcall_id.ts (about) 1 /** 2 * @fileoverview Test to ensure that indexer produces ref/call edges and all data needed for callgraph. 3 * See https://kythe.io/docs/schema/callgraph.html. 4 */ 5 6 // clang-format off 7 //- FileInitFunc=vname("fileInit:synthetic", _, _, "testdata/refcall_id", "typescript").node/kind function 8 //- FileInitDef defines FileInitFunc 9 //- FileInitDef.node/kind anchor 10 //- FileInitDef.loc/start 0 11 //- FileInitDef.loc/end 0 12 // clang-format on 13 14 //- @Square defines/binding Square 15 //- Square.node/kind function 16 class Square { 17 //- @getWidth defines/binding GetWidth 18 getWidth(): number { 19 return 42; 20 } 21 22 //- @getArea defines/binding GetArea 23 getArea() { 24 //- GetWidthCall=@getWidth ref/call GetWidth 25 //- GetWidthCall childof GetArea 26 this.getWidth() ** 2; 27 } 28 } 29 30 //- @Square ref/call Square 31 const square = new Square(); 32 33 //- GetAreaCallOne=@getArea ref/call GetArea 34 //- GetAreaCallOne childof FileInitFunc 35 square.getArea(); 36 37 //- @doNothing defines/binding DoNothing 38 function doNothing() { 39 //- GetAreaCallTwo=@getArea ref/call GetArea 40 //- GetAreaCallTwo childof DoNothing 41 square.getArea(); 42 } 43 44 //- DoNothingCall=@doNothing ref/call DoNothing 45 //- DoNothingCall childof FileInitFunc 46 doNothing();