@@ -2,7 +2,6 @@ import React from 'react';
22import styled from '@emotion/styled' ;
33import { keyframes } from '@emotion/core' ;
44import * as monaco from 'monaco-editor/esm/vs/editor/editor.api' ;
5- const { MonacoServices } = require ( 'monaco-languageclient/lib/monaco-services' ) ;
65import { extractSigners } from "util/parser" ;
76
87
@@ -173,24 +172,24 @@ class CadenceEditor extends React.Component<
173172 }
174173 }
175174
176- async initEditor ( ) {
175+ async initEditor ( ) {
177176 this . editor = monaco . editor . create (
178- document . getElementById ( this . props . mount ) ,
179- {
180- theme : 'vs-light' ,
181- language : CADENCE_LANGUAGE_ID ,
182- minimap : {
183- enabled : false ,
184- } ,
177+ document . getElementById ( this . props . mount ) ,
178+ {
179+ theme : 'vs-light' ,
180+ language : CADENCE_LANGUAGE_ID ,
181+ minimap : {
182+ enabled : false ,
185183 } ,
184+ } ,
186185 ) ;
187186 this . _subscription = this . editor . onDidChangeModelContent ( ( event : any ) => {
188187 this . props . onChange ( this . editor . getValue ( ) , event ) ;
189188 } ) ;
190189
191190 const state = this . getOrCreateEditorState (
192- this . props . activeId ,
193- this . props . code ,
191+ this . props . activeId ,
192+ this . props . code ,
194193 ) ;
195194 this . editor . setModel ( state . model ) ;
196195 this . editor . focus ( ) ;
@@ -318,20 +317,20 @@ class CadenceEditor extends React.Component<
318317 const serverStatusChanged = this . props . serverReady !== prevProps . serverReady
319318 const activeIdChanged = this . props . activeId !== prevProps . activeId
320319 const typeChanged = this . props . type !== prevProps . type
321- if ( serverStatusChanged || activeIdChanged || typeChanged ) {
322- if ( this . props . callbacks . toServer !== null ) {
320+ if ( serverStatusChanged || activeIdChanged || typeChanged ) {
321+ if ( this . props . callbacks . toServer !== null ) {
323322 await this . loadLanguageClient ( )
324323 }
325324 }
326325 }
327326
328- async swapMonacoEditor ( prev : any , current : any ) {
327+ async swapMonacoEditor ( prev : any , current : any ) {
329328 await this . destroyMonaco ( ) ;
330329 await this . initEditor ( ) ;
331330 this . switchEditor ( prev , current ) ;
332331 }
333332
334- destroyMonaco ( ) {
333+ destroyMonaco ( ) {
335334 if ( this . editor ) {
336335 this . editor . dispose ( ) ;
337336 const model = this . editor . getModel ( ) ;
0 commit comments