@@ -22,12 +22,6 @@ import {
2222 CodeSnippetEditor ,
2323 ICodeSnippetEditorMetadata
2424} from './CodeSnippetEditor' ;
25- import {
26- /*NotebookPanel,*/
27- /*NotebookActions,*/
28- NotebookTracker
29- } from '@jupyterlab/notebook' ;
30- //import { ReadonlyPartialJSONObject } from '@lumino/coreutils';
3125
3226const CODE_SNIPPET_EXTENSION_ID = 'code-snippet-extension' ;
3327
@@ -62,23 +56,9 @@ function activateCodeSnippet(
6256 app : JupyterFrontEnd ,
6357 palette : ICommandPalette ,
6458 restorer : ILayoutRestorer ,
65- editorServices : IEditorServices ,
66- trackerNotebook : NotebookTracker
59+ editorServices : IEditorServices
6760) : void {
6861 console . log ( 'JupyterLab extension code-snippets is activated!' ) ;
69- // const { shell } = app;
70-
71- // Get the current widget and activate unless the args specify otherwise.
72- // function getCurrent(args: ReadonlyPartialJSONObject): NotebookPanel | null {
73- // const widget = trackerNotebook.currentWidget;
74- // const activate = args['activate'] !== false;
75-
76- // if (activate && widget) {
77- // shell.activateById(widget.id);
78- // }
79-
80- // return widget;
81- // }
8262
8363 const getCurrentWidget = ( ) : Widget => {
8464 return app . shell . currentWidget ;
@@ -184,7 +164,7 @@ function activateCodeSnippet(
184164 execute : ( ) => {
185165 const highlightedCode = getSelectedText ( ) ;
186166 if ( highlightedCode === '' ) {
187- //let current = getCurrent(args);
167+ //if user just right-clicks the whole cell to save
188168 const curr = document . getElementsByClassName (
189169 'jp-Cell jp-mod-selected'
190170 ) [ 1 ] ;
0 commit comments