Unverified Commit 42fafe85 authored by yann300's avatar yann300 Committed by GitHub

Merge pull request #2858 from ethereum/SHdouble

use SourceHighlighters in StaticAnalisys and remove multiple highlight
parents b6c4a4e6 026443f6
......@@ -14,8 +14,15 @@ class SourceHighlighters {
try {
if (!this.highlighters[from]) this.highlighters[from] = []
const sourceHighlight = new SourceHighlighter()
sourceHighlight.currentSourceLocationFromfileName(position, filePath, hexColor)
this.highlighters[from].push(sourceHighlight)
if (
!this.highlighters[from].length ||
(this.highlighters[from].length && !this.highlighters[from].find((el) => {
return el.source === filePath && el.position === position
}))
) {
sourceHighlight.currentSourceLocationFromfileName(position, filePath, hexColor)
this.highlighters[from].push(sourceHighlight)
}
} catch (e) {
throw e
}
......
......@@ -108,9 +108,9 @@ staticAnalysisView.prototype.run = function () {
if (!this.view) {
return
}
const highlightLocation = (location, fileName) => {
// await this.analysisModule.call('editor', 'highlight', location, fileName) @todo(#2834) use this after fixing the issue
this.sourceHighlighter.currentSourceLocationFromfileName(location, fileName)
const highlightLocation = async (location, fileName) => {
await this.analysisModule.call('editor', 'discardHighlight')
await this.analysisModule.call('editor', 'highlight', location, fileName)
}
const selected = this.selectedModules()
const warningContainer = $('#staticanalysisresult')
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment