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 = {
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 :( ) => {
Original file line number Diff line number Diff 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
You can’t perform that action at this time.
0 commit comments