Skip to content

Commit 9d3fb3c

Browse files
committed
update: add the position of function entrance
1 parent 9eab8d1 commit 9d3fb3c

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

src/impact.ts

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { TEXT_NODE_TYPES } from './const.js';
1+
import { TEXT_NODE_TYPES, UN_KNOWN } from './const.js';
22
import {
33
FileInfoTree,
44
FuncCallSearchResult,
@@ -13,11 +13,18 @@ import { handleCircularPath } from './utils/handle_circular_path.js';
1313
function getImpacts (treeData: FileInfoTree, funcInfo: ImpactReason) {
1414
let templateImpact = [] as TemplateImpactResult[];
1515

16+
let mainFuncPosition = UN_KNOWN;
17+
try {
18+
mainFuncPosition = treeData[funcInfo.filePath]['allFuncsInfo'][funcInfo.name].position;
19+
} catch (error) {}
20+
1621
// function entrance
1722
const main = {
1823
name: funcInfo.name,
1924
file: funcInfo.filePath,
25+
position: mainFuncPosition,
2026
};
27+
funcInfo.paths[0].push(mainFuncPosition);
2128

2229
let callList = [funcInfo] as ImpactReason[];
2330
const impactReport = [];

0 commit comments

Comments
 (0)