From 6a9632e8400a9d0937df62cfdb903c52c898f7cf Mon Sep 17 00:00:00 2001 From: LianaHus Date: Mon, 11 May 2020 22:46:05 +0200 Subject: [PATCH] fixed overwriteing of location for warnings --- src/app/tabs/staticanalysis/staticAnalysisView.js | 8 ++++---- src/app/ui/renderer.js | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/app/tabs/staticanalysis/staticAnalysisView.js b/src/app/tabs/staticanalysis/staticAnalysisView.js index 993a330ba0..c70eef274c 100644 --- a/src/app/tabs/staticanalysis/staticAnalysisView.js +++ b/src/app/tabs/staticanalysis/staticAnalysisView.js @@ -152,9 +152,9 @@ staticAnalysisView.prototype.run = function () { self.lastCompilationSource.sources, self.lastCompilationResult.sources ) - row = location.start.line + 1 - column = location.start.column + 1 - locationString = row + ':' + column + ':' + row = location.start.line + column = location.start.column + locationString = (row + 1) + ':' + column + ':' fileName = Object.keys(self.lastCompilationResult.contracts)[file] } warningCount++ @@ -169,7 +169,7 @@ staticAnalysisView.prototype.run = function () { msg, this.view.querySelector(`[id="staticAnalysisModule${moduleName}"]`), { - type: 'staticAnalysisWarning mx-2 alert alert-warning', + type: 'warning', useSpan: true, errFile: fileName, errLine: row, diff --git a/src/app/ui/renderer.js b/src/app/ui/renderer.js index a373432172..ad09639f58 100644 --- a/src/app/ui/renderer.js +++ b/src/app/ui/renderer.js @@ -71,7 +71,7 @@ Renderer.prototype.error = function (message, container, opt) { } var errLocation = text.match(/^([^:]*):([0-9]*):(([0-9]*):)? /) - if (errLocation) { + if ((!opt.errFile || !opt.errCol || !opt.errLine) && errLocation) { errLocation = parseRegExError(errLocation) opt.errFile = errLocation.errFile opt.errLine = errLocation.errLine @@ -94,7 +94,7 @@ Renderer.prototype.error = function (message, container, opt) { $(container).append($error) $error.click((ev) => { - if (opt.errFile && opt.errLine) { + if (opt.errFile && opt.errLine && opt.errCol) { this._errorClick(opt.errFile, opt.errLine, opt.errCol) } else if (opt.click) { opt.click(message)