fixed overwriteing of location for warnings

pull/3/head
LianaHus 5 years ago committed by Liana Husikyan
parent 6296675abb
commit 6a9632e840
  1. 8
      src/app/tabs/staticanalysis/staticAnalysisView.js
  2. 4
      src/app/ui/renderer.js

@ -152,9 +152,9 @@ staticAnalysisView.prototype.run = function () {
self.lastCompilationSource.sources, self.lastCompilationSource.sources,
self.lastCompilationResult.sources self.lastCompilationResult.sources
) )
row = location.start.line + 1 row = location.start.line
column = location.start.column + 1 column = location.start.column
locationString = row + ':' + column + ':' locationString = (row + 1) + ':' + column + ':'
fileName = Object.keys(self.lastCompilationResult.contracts)[file] fileName = Object.keys(self.lastCompilationResult.contracts)[file]
} }
warningCount++ warningCount++
@ -169,7 +169,7 @@ staticAnalysisView.prototype.run = function () {
msg, msg,
this.view.querySelector(`[id="staticAnalysisModule${moduleName}"]`), this.view.querySelector(`[id="staticAnalysisModule${moduleName}"]`),
{ {
type: 'staticAnalysisWarning mx-2 alert alert-warning', type: 'warning',
useSpan: true, useSpan: true,
errFile: fileName, errFile: fileName,
errLine: row, errLine: row,

@ -71,7 +71,7 @@ Renderer.prototype.error = function (message, container, opt) {
} }
var errLocation = text.match(/^([^:]*):([0-9]*):(([0-9]*):)? /) var errLocation = text.match(/^([^:]*):([0-9]*):(([0-9]*):)? /)
if (errLocation) { if ((!opt.errFile || !opt.errCol || !opt.errLine) && errLocation) {
errLocation = parseRegExError(errLocation) errLocation = parseRegExError(errLocation)
opt.errFile = errLocation.errFile opt.errFile = errLocation.errFile
opt.errLine = errLocation.errLine opt.errLine = errLocation.errLine
@ -94,7 +94,7 @@ Renderer.prototype.error = function (message, container, opt) {
$(container).append($error) $(container).append($error)
$error.click((ev) => { $error.click((ev) => {
if (opt.errFile && opt.errLine) { if (opt.errFile && opt.errLine && opt.errCol) {
this._errorClick(opt.errFile, opt.errLine, opt.errCol) this._errorClick(opt.errFile, opt.errLine, opt.errCol)
} else if (opt.click) { } else if (opt.click) {
opt.click(message) opt.click(message)

Loading…
Cancel
Save