@@ -63,16 +63,25 @@ export function stringifyError(error): string {
6363 return errs . length ? `AggregateError:\n- ${ errs . join ( "\n- " ) } ` : "" ;
6464 }
6565 return (
66- error == undefined
67- ? ""
68- : error . errorText
69- ? < string > error . errorText
70- : typeof error == "string"
71- ? error
72- : error instanceof Error
73- ? error . toString ( )
74- : JSON . stringify ( error )
75- ) . trim ( ) ;
66+ (
67+ error == undefined
68+ ? ""
69+ : error . errorText
70+ ? < string > error . errorText
71+ : typeof error == "string"
72+ ? error
73+ : error instanceof Error
74+ ? error . toString ( )
75+ : JSON . stringify ( error )
76+ )
77+ . trim ( )
78+ // Unescape any HTML-escpaed characters
79+ . replaceAll ( "<" , "<" )
80+ . replaceAll ( ">" , ">" )
81+ . replaceAll ( """ , '"' )
82+ . replaceAll ( "'" , "'" )
83+ . replaceAll ( "&" , "&" )
84+ ) ;
7685 } catch {
7786 // Need to catch errors from JSON.stringify()
7887 return "" ;
@@ -1017,18 +1026,12 @@ export async function replaceFile(uri: vscode.Uri, content: string | string[] |
10171026}
10181027
10191028/** Show the compilation failure error message if required. */
1020- export function compileErrorMsg ( ) : void {
1021- vscode . window
1022- . showErrorMessage (
1023- "Compilation failed. Check 'ObjectScript' Output channel for details." ,
1024- ! vscode . window . visibleTextEditors . some ( ( e ) => e . document . languageId == outputLangId ) ? "Show" : undefined ,
1025- "Dismiss"
1026- )
1027- . then ( ( action ) => {
1028- if ( action == "Show" ) {
1029- outputChannel . show ( true ) ;
1030- }
1031- } ) ;
1029+ export function compileErrorMsg ( error : any ) : void {
1030+ handleError (
1031+ // Don't log the generic placeholder error if that's all we have
1032+ error instanceof Error && error . message . endsWith ( "Compile error" ) ? "" : error ,
1033+ "Compilaton failed."
1034+ ) ;
10321035}
10331036
10341037/** Return a string containing the displayable form of `uri` */
0 commit comments