Skip to content

Commit 86b1dd7

Browse files
changes
1 parent 6f53789 commit 86b1dd7

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@codebolt/codeboltjs",
3-
"version": "1.1.36",
3+
"version": "1.1.37",
44
"description": "",
55
"keywords": [],
66
"author": "",

src/modules/codeutils.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ const cbcodeutils = {
3333
parser.setLanguage(JavaScript);
3434
const trees = [];
3535
const functionNodes = [];
36+
3637
const processDirectory = (directory:any) => {
3738
console.log("isdir")
3839
// Read all files in the directory
@@ -46,7 +47,8 @@ const cbcodeutils = {
4647
} else if (path.extname(file.name) === '.js') {
4748
const code = fs.readFileSync(path.join(directory, file.name), 'utf-8');
4849
console.log(code);
49-
const tree = parser.parse(code);
50+
let tree:any = parser.parse(code);
51+
tree.rootNode.path = path.join(directory, file.name); // Set file path for t
5052
trees.push(tree);
5153
}
5254
});
@@ -57,7 +59,8 @@ const cbcodeutils = {
5759
} else if (path.extname(pathInput) === '.js') {
5860
// Read a single JavaScript file
5961
const code = fs.readFileSync(pathInput, 'utf-8');
60-
let tree = parser.parse(code);
62+
let tree:any = parser.parse(code);
63+
tree.rootNode.path = pathInput; // Set file path for t
6164

6265
trees.push(tree);
6366
}

0 commit comments

Comments
 (0)