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 { ...@@ -14,8 +14,15 @@ class SourceHighlighters {
try { try {
if (!this.highlighters[from]) this.highlighters[from] = [] if (!this.highlighters[from]) this.highlighters[from] = []
const sourceHighlight = new SourceHighlighter() const sourceHighlight = new SourceHighlighter()
sourceHighlight.currentSourceLocationFromfileName(position, filePath, hexColor) if (
this.highlighters[from].push(sourceHighlight) !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) { } catch (e) {
throw e throw e
} }
......
...@@ -108,9 +108,9 @@ staticAnalysisView.prototype.run = function () { ...@@ -108,9 +108,9 @@ staticAnalysisView.prototype.run = function () {
if (!this.view) { if (!this.view) {
return return
} }
const highlightLocation = (location, fileName) => { const highlightLocation = async (location, fileName) => {
// await this.analysisModule.call('editor', 'highlight', location, fileName) @todo(#2834) use this after fixing the issue await this.analysisModule.call('editor', 'discardHighlight')
this.sourceHighlighter.currentSourceLocationFromfileName(location, fileName) await this.analysisModule.call('editor', 'highlight', location, fileName)
} }
const selected = this.selectedModules() const selected = this.selectedModules()
const warningContainer = $('#staticanalysisresult') 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