@@ -34,7 +34,7 @@ namespace CommandIDs {
3434type Tree = Map < string , Tree > ;
3535
3636/**
37- * Convert the list of snippets a tree.
37+ * Convert the list of snippets to a tree.
3838 * @param snippets The list of snippets.
3939 */
4040function toTree ( snippets : Snippet [ ] ) {
@@ -45,7 +45,7 @@ function toTree(snippets: Snippet[]) {
4545 if ( ! node . has ( part ) ) {
4646 node . set ( part , new Map < string , Tree > ( ) ) ;
4747 }
48- node = node . get ( part ) ;
48+ node = node . get ( part ) ! ;
4949 } ) ;
5050 } ) ;
5151 return tree ;
@@ -92,6 +92,8 @@ const extension: JupyterFrontEndPlugin<void> = {
9292 menu : IMainMenu | null ,
9393 notebookTracker : INotebookTracker | null
9494 ) => {
95+ console . log ( 'JupyterLab extension jupyterlab-snippets is activated!' ) ;
96+
9597 const { commands } = app ;
9698
9799 const isEnabled = ( ) => {
@@ -122,11 +124,11 @@ const extension: JupyterFrontEndPlugin<void> = {
122124 return ;
123125 }
124126
125- const current = notebookTracker . currentWidget ;
126- const notebook = current . content ;
127+ const current = notebookTracker ! . currentWidget ;
128+ const notebook = current ! . content ;
127129 NotebookActions . insertBelow ( notebook ) ;
128130 const activeCell = notebook . activeCell ;
129- activeCell . model . value . text = content ;
131+ activeCell ! . model . sharedModel . setSource ( content ) ;
130132 } ,
131133 isEnabled
132134 } ) ;
0 commit comments