@@ -31,24 +31,25 @@ const documentChangeNotification = new NotificationType<DocumentChange>('browser
3131shared . workspace . DocumentBuilder . onBuildPhase ( DocumentState . Validated , async documents => {
3232 for ( const document of documents ) {
3333 if ( document . diagnostics === undefined || document . diagnostics . filter ( ( i ) => i . severity === 1 ) . length === 0 ) {
34- runInterpreter ( document . textDocument . getText ( ) , {
35- log : ( message ) => {
36- sendMessage ( document , "output" , message ) ;
37- } ,
38- onStart : ( ) => {
39- sendMessage ( document , "notification" , "startInterpreter" )
40- }
41- } )
42- . catch ( ( e ) => {
43- if ( e === OperationCancelled ) {
34+ try {
35+ await runInterpreter ( document . textDocument . getText ( ) , {
36+ log : ( message ) => {
37+ sendMessage ( document , "output" , message ) ;
38+ } ,
39+ onStart : ( ) => {
40+ sendMessage ( document , "notification" , "startInterpreter" ) ;
41+ } ,
42+ } ) ;
43+ } catch ( e : any ) {
44+ if ( e === OperationCancelled ) {
4445 sendMessage ( document , "error" , "Interpreter timed out" ) ;
45- return ;
46+ } else {
47+ sendMessage ( document , "error" , e . message ) ;
4648 }
47- sendMessage ( document , "error" , e . message ) ;
48- } )
49- . finally ( ( ) => {
49+ } finally {
5050 sendMessage ( document , "notification" , "endInterpreter" ) ;
51- } ) ;
51+ }
52+
5253 }
5354 else {
5455 sendMessage ( document , "error" , document . diagnostics )
0 commit comments