File tree Expand file tree Collapse file tree 2 files changed +30
-2
lines changed Expand file tree Collapse file tree 2 files changed +30
-2
lines changed Original file line number Diff line number Diff line change @@ -11,9 +11,18 @@ const cbcodeutils = {
11
11
* @param {any } filePath - The file path where the source code is located.
12
12
* @returns {Promise<any> } A promise that resolves with the code tree.
13
13
*/
14
- getCodeTree : ( fileName : any , source : any , filePath : any ) : Promise < any > => {
14
+ getCodeTree : ( ) : Promise < any > => {
15
15
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
+ } ) ;
17
26
} ) ;
18
27
} ,
19
28
getAllFilesAsMarkDown :( ) => {
Original file line number Diff line number Diff line change @@ -26,6 +26,25 @@ export const debug={
26
26
} )
27
27
28
28
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
+
29
48
}
30
49
}
31
50
You can’t perform that action at this time.
0 commit comments