@@ -22,12 +22,6 @@ import {
22
22
CodeSnippetEditor ,
23
23
ICodeSnippetEditorMetadata
24
24
} from './CodeSnippetEditor' ;
25
- import {
26
- /*NotebookPanel,*/
27
- /*NotebookActions,*/
28
- NotebookTracker
29
- } from '@jupyterlab/notebook' ;
30
- //import { ReadonlyPartialJSONObject } from '@lumino/coreutils';
31
25
32
26
const CODE_SNIPPET_EXTENSION_ID = 'code-snippet-extension' ;
33
27
@@ -62,23 +56,9 @@ function activateCodeSnippet(
62
56
app : JupyterFrontEnd ,
63
57
palette : ICommandPalette ,
64
58
restorer : ILayoutRestorer ,
65
- editorServices : IEditorServices ,
66
- trackerNotebook : NotebookTracker
59
+ editorServices : IEditorServices
67
60
) : void {
68
61
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
- // }
82
62
83
63
const getCurrentWidget = ( ) : Widget => {
84
64
return app . shell . currentWidget ;
@@ -184,7 +164,7 @@ function activateCodeSnippet(
184
164
execute : ( ) => {
185
165
const highlightedCode = getSelectedText ( ) ;
186
166
if ( highlightedCode === '' ) {
187
- //let current = getCurrent(args);
167
+ //if user just right-clicks the whole cell to save
188
168
const curr = document . getElementsByClassName (
189
169
'jp-Cell jp-mod-selected'
190
170
) [ 1 ] ;
0 commit comments