File tree Expand file tree Collapse file tree 2 files changed +22
-1
lines changed Expand file tree Collapse file tree 2 files changed +22
-1
lines changed Original file line number Diff line number Diff line change @@ -48,6 +48,19 @@ app.commands.execute('jupyterlab-cell-diff:show-codemirror', {
4848});
4949``` 
5050
51+ #### Command Arguments  
52+ 
53+ The ` jupyterlab-cell-diff:show-codemirror `  command accepts the following arguments:
54+ 
55+ |  Argument            |  Type      |  Required |  Description                                                                          | 
56+ |  ------------------- |  --------- |  -------- |  ------------------------------------------------------------------------------------ | 
57+ |  ` cellId `             |  ` string `   |  No       |  ID of the cell to show diff for. If not provided, uses the active cell               | 
58+ |  ` originalSource `     |  ` string `   |  Yes      |  Original source code to compare against                                              | 
59+ |  ` newSource `          |  ` string `   |  Yes      |  New source code to compare with                                                      | 
60+ |  ` showActionButtons `  |  ` boolean `  |  No       |  Whether to show action buttons in the diff widget (default: ` true ` )                  | 
61+ |  ` notebookPath `       |  ` string `   |  No       |  Path to the notebook containing the cell. If not provided, uses the current notebook | 
62+ |  ` openDiff `           |  ` boolean `  |  No       |  Whether to open the diff widget automatically (default: ` true ` )                      | 
63+ 
5164## Uninstall  
5265
5366To remove the extension, execute:
Original file line number Diff line number Diff line change @@ -105,7 +105,8 @@ const codeMirrorPlugin: JupyterFrontEndPlugin<void> = {
105105                'Whether to open the diff widget automatically' 
106106              ) 
107107            } 
108-           } 
108+           } , 
109+           required : [ 'originalSource' ,  'newSource' ] 
109110        } 
110111      } , 
111112      execute : async  ( args : any  =  { } )  =>  { 
@@ -118,6 +119,13 @@ const codeMirrorPlugin: JupyterFrontEndPlugin<void> = {
118119          openDiff =  true 
119120        }  =  args ; 
120121
122+         if  ( ! originalSource  ||  ! newSource )  { 
123+           console . error ( 
124+             trans . __ ( 'Missing required arguments: originalSource and newSource' ) 
125+           ) ; 
126+           return ; 
127+         } 
128+ 
121129        const  currentNotebook  =  findNotebook ( notebookTracker ,  notebookPath ) ; 
122130        if  ( ! currentNotebook )  { 
123131          return ; 
 
 
   
 
     
   
   
          
    
    
     
    
      
     
     
    You can’t perform that action at this time.
  
 
    
  
    
      
        
     
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments