@@ -3,14 +3,14 @@ import { ZoomIn, ZoomOut } from '@mui/icons-material';
33import { FileName } from 'components/file-name/file-name' ;
44import React , { useContext , useEffect , useRef , useState , MouseEvent } from 'react' ;
55import {
6- getCppAstNodeInfo ,
7- getCppDiagram ,
8- getCppDiagramLegend ,
9- getCppFileDiagram ,
10- getCppFileDiagramLegend ,
11- getCppReferenceTypes ,
12- getCppReferences ,
13- } from 'service/cpp -service' ;
6+ getAstNodeInfo ,
7+ getDiagram ,
8+ getDiagramLegend ,
9+ getFileDiagram ,
10+ getFileDiagramLegend ,
11+ getReferenceTypes ,
12+ getReferences ,
13+ } from 'service/language -service' ;
1414import { TransformWrapper , TransformComponent , ReactZoomPanPinchRef } from 'react-zoom-pan-pinch' ;
1515import { FileInfo , AstNodeInfo } from '@thrift-generated' ;
1616import { AppContext } from 'global-context/app-context' ;
@@ -44,17 +44,17 @@ export const Diagrams = (): JSX.Element => {
4444 appCtx . diagramType === 'file'
4545 ? await getFileInfo ( appCtx . diagramGenId )
4646 : appCtx . diagramType === 'ast'
47- ? await getCppAstNodeInfo ( appCtx . diagramGenId )
47+ ? await getAstNodeInfo ( appCtx . diagramGenId )
4848 : undefined ;
4949
5050 if ( ! initDiagramInfo ) return ;
5151
5252 if ( parseInt ( appCtx . diagramTypeId ) === 999 ) {
53- const refTypes = await getCppReferenceTypes ( initDiagramInfo . id as string ) ;
53+ const refTypes = await getReferenceTypes ( initDiagramInfo . id as string ) ;
5454 if ( refTypes . get ( 'Definition' ) === undefined ) return ;
5555
5656 const astNodeDef = (
57- await getCppReferences ( initDiagramInfo . id as string , refTypes . get ( 'Definition' ) as number , [ ] )
57+ await getReferences ( initDiagramInfo . id as string , refTypes . get ( 'Definition' ) as number , [ ] )
5858 ) [ 0 ] ;
5959
6060 setDiagramInfo ( astNodeDef ) ;
@@ -64,9 +64,9 @@ export const Diagrams = (): JSX.Element => {
6464
6565 const diagram =
6666 initDiagramInfo instanceof FileInfo
67- ? await getCppFileDiagram ( appCtx . diagramGenId , parseInt ( appCtx . diagramTypeId ) )
67+ ? await getFileDiagram ( appCtx . diagramGenId , parseInt ( appCtx . diagramTypeId ) )
6868 : initDiagramInfo instanceof AstNodeInfo
69- ? await getCppDiagram ( appCtx . diagramGenId , parseInt ( appCtx . diagramTypeId ) )
69+ ? await getDiagram ( appCtx . diagramGenId , parseInt ( appCtx . diagramTypeId ) )
7070 : '' ;
7171
7272 sendGAEvent ( {
@@ -105,7 +105,7 @@ export const Diagrams = (): JSX.Element => {
105105 appCtx . diagramType === 'file'
106106 ? await getFileInfo ( appCtx . diagramGenId )
107107 : appCtx . diagramType === 'ast'
108- ? await getCppAstNodeInfo ( appCtx . diagramGenId )
108+ ? await getAstNodeInfo ( appCtx . diagramGenId )
109109 : undefined ;
110110
111111 if ( ! initDiagramInfo ) return ;
@@ -119,7 +119,7 @@ export const Diagrams = (): JSX.Element => {
119119 } as RouterQueryType ,
120120 } ) ;
121121 } else if ( initDiagramInfo instanceof AstNodeInfo ) {
122- const astNodeInfo = await getCppAstNodeInfo ( diagramGenId ) ;
122+ const astNodeInfo = await getAstNodeInfo ( diagramGenId ) ;
123123
124124 router . push ( {
125125 pathname : '/project' ,
@@ -146,9 +146,9 @@ export const Diagrams = (): JSX.Element => {
146146
147147 const diagramLegend =
148148 diagramInfo instanceof FileInfo
149- ? await getCppFileDiagramLegend ( parseInt ( appCtx . diagramTypeId ) )
149+ ? await getFileDiagramLegend ( parseInt ( appCtx . diagramTypeId ) )
150150 : diagramInfo instanceof AstNodeInfo
151- ? await getCppDiagramLegend ( parseInt ( appCtx . diagramTypeId ) )
151+ ? await getDiagramLegend ( parseInt ( appCtx . diagramTypeId ) )
152152 : '' ;
153153
154154 const parser = new DOMParser ( ) ;
0 commit comments