Commit 4383b4a2 authored by yann300's avatar yann300

renaming

parent 9b390452
...@@ -9,7 +9,7 @@ class ContextualListener { ...@@ -9,7 +9,7 @@ class ContextualListener {
Declarations: {}, Declarations: {},
FlatReferences: {} FlatReferences: {}
} }
this._events = [] this._activeHighlights = []
events.compiler.register('compilationFinished', (success, data, source) => { events.compiler.register('compilationFinished', (success, data, source) => {
this._stopHighlighting() this._stopHighlighting()
...@@ -67,7 +67,7 @@ class ContextualListener { ...@@ -67,7 +67,7 @@ class ContextualListener {
var position = this.sourceMappingDecoder.decode(src) var position = this.sourceMappingDecoder.decode(src)
var eventId = this._api.highlight(position, node) var eventId = this._api.highlight(position, node)
if (eventId) { if (eventId) {
this._events.push({ eventId, position, fileTarget: compilationResult.source.target }) this._activeHighlights.push({ eventId, position, fileTarget: compilationResult.source.target })
} }
} }
...@@ -86,16 +86,16 @@ class ContextualListener { ...@@ -86,16 +86,16 @@ class ContextualListener {
highlights(node.attributes.referencedDeclaration) highlights(node.attributes.referencedDeclaration)
var current = this._index['FlatReferences'][node.attributes.referencedDeclaration] var current = this._index['FlatReferences'][node.attributes.referencedDeclaration]
this._highlight(current, compilationResult) this._highlight(current, compilationResult)
} else if (node && node.name && node.name !== 'FunctionDefinition' && node.name !== 'ContractDefinition' && node.name !== 'Block') { } else {
highlights(node.id) highlights(node.id)
} }
} }
_stopHighlighting () { _stopHighlighting () {
for (var event in this._events) { for (var event in this._activeHighlights) {
this._api.stopHighlighting(this._events[event]) this._api.stopHighlighting(this._activeHighlights[event])
} }
this._events = [] this._activeHighlights = []
} }
} }
......
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