Skip to content

Commit 6556cb1

Browse files
changes
1 parent 9116408 commit 6556cb1

File tree

2 files changed

+30
-2
lines changed

2 files changed

+30
-2
lines changed

src/modules/codeutils.ts

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,18 @@ const cbcodeutils = {
1111
* @param {any} filePath - The file path where the source code is located.
1212
* @returns {Promise<any>} A promise that resolves with the code tree.
1313
*/
14-
getCodeTree: (fileName: any, source: any, filePath: any): Promise<any> => {
14+
getCodeTree: (): Promise<any> => {
1515
return new Promise((resolve, reject) => {
16-
// Implementation would go here
16+
cbws.getWebsocket.send(JSON.stringify({
17+
"type": "codeEvent",
18+
"action":"getCodeTree"
19+
}));
20+
cbws.getWebsocket.on('message', (data: string) => {
21+
const response = JSON.parse(data);
22+
if (response.type === "getCodeTreeResponse") {
23+
resolve(response.markdown); // Resolve the Promise with the response data
24+
}
25+
});
1726
});
1827
},
1928
getAllFilesAsMarkDown:()=>{

src/modules/debug.ts

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,25 @@ export const debug={
2626
})
2727

2828

29+
},
30+
openDebugBrowser(url:string,port:number){
31+
return new Promise((resolve, reject) => {
32+
cbws.getWebsocket.send(JSON.stringify({
33+
"type": "debugEvent",
34+
"action":"openDebugBrowser",
35+
message:{
36+
url,
37+
port
38+
}
39+
}));
40+
cbws.getWebsocket.on('message', (data: string) => {
41+
const response = JSON.parse(data);
42+
if (response.type === "openDebugBrowserResponse") {
43+
resolve(response); // Resolve the Promise with the response data
44+
}
45+
})
46+
})
47+
2948
}
3049
}
3150

0 commit comments

Comments
 (0)