@@ -87,7 +87,7 @@ export class JupyterlabNotebookCodeFormatter extends JupyterlabCodeFormatter {
8787 }
8888
8989 const metadata =
90- this . notebookTracker . currentWidget . content . model ! . metadata . toJSON ( ) ;
90+ this . notebookTracker . currentWidget . content . model ! . sharedModel . metadata ; ;
9191
9292 if ( ! metadata ) {
9393 return null ;
@@ -148,7 +148,7 @@ export class JupyterlabNotebookCodeFormatter extends JupyterlabCodeFormatter {
148148 if ( formatterToUse === 'noop' || formatterToUse === 'skip' ) {
149149 continue ;
150150 }
151- const currentTexts = selectedCells . map ( cell => cell . model . value . text ) ;
151+ const currentTexts = selectedCells . map ( cell => cell . model . sharedModel . source ) ;
152152 const formattedTexts = await this . formatCode (
153153 currentTexts ,
154154 formatterToUse ,
@@ -162,7 +162,7 @@ export class JupyterlabNotebookCodeFormatter extends JupyterlabCodeFormatter {
162162 const cell = selectedCells [ i ] ;
163163 const currentText = currentTexts [ i ] ;
164164 const formattedText = formattedTexts . code [ i ] ;
165- const cellValueHasNotChanged = cell . model . value . text === currentText ;
165+ const cellValueHasNotChanged = cell . model . sharedModel . source === currentText ;
166166 if ( cellValueHasNotChanged ) {
167167 if ( formattedText . error ) {
168168 if ( showErrors ) {
@@ -172,7 +172,7 @@ export class JupyterlabNotebookCodeFormatter extends JupyterlabCodeFormatter {
172172 ) ;
173173 }
174174 } else {
175- cell . model . value . text = formattedText . code ;
175+ cell . model . sharedModel . source = formattedText . code ;
176176 }
177177 } else {
178178 if ( showErrors ) {
@@ -236,7 +236,7 @@ export class JupyterlabFileEditorCodeFormatter extends JupyterlabCodeFormatter {
236236 const editorWidget = this . editorTracker . currentWidget ;
237237 this . working = true ;
238238 const editor = editorWidget ! . content . editor ;
239- const code = editor . model . value . text ;
239+ const code = editor . model . sharedModel . source ;
240240 this . formatCode (
241241 [ code ] ,
242242 formatter ,
@@ -253,7 +253,7 @@ export class JupyterlabFileEditorCodeFormatter extends JupyterlabCodeFormatter {
253253 this . working = false ;
254254 return ;
255255 }
256- this . editorTracker . currentWidget ! . content . editor . model . value . text =
256+ this . editorTracker . currentWidget ! . content . editor . model . sharedModel . source =
257257 data . code [ 0 ] . code ;
258258 this . working = false ;
259259 } )
0 commit comments