From a6eb4c3390d4d027af5aecd006bd13fbee7f853c Mon Sep 17 00:00:00 2001 From: yann300 Date: Wed, 1 Jun 2022 11:27:02 +0200 Subject: [PATCH] fixed file in error --- apps/solidity-compiler/src/app/compiler-api.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/apps/solidity-compiler/src/app/compiler-api.ts b/apps/solidity-compiler/src/app/compiler-api.ts index 25dfb09925..fb8d848039 100644 --- a/apps/solidity-compiler/src/app/compiler-api.ts +++ b/apps/solidity-compiler/src/app/compiler-api.ts @@ -304,14 +304,15 @@ export const CompilerApiMixin = (Base) => class extends Base { if (data.errors) { for (const error of data.errors) { let pos = helper.getPositionDetails(error.formattedMessage) - if (pos.errFile) { + const file = pos.errFile + if (file) { pos = { row: pos.errLine, column: pos.errCol, text: error.formattedMessage, type: error.severity } - await this.call('editor', 'addAnnotation', pos, pos.errFile) + await this.call('editor', 'addAnnotation', pos, file) } } }