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.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,

@ -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)

Loading…
Cancel
Save