From b000cab75046980f625cb7190f06af41fff97ba5 Mon Sep 17 00:00:00 2001 From: yann300 Date: Thu, 28 Sep 2017 17:39:50 +0200 Subject: [PATCH] add api function --- src/app/editor/contextualListener.js | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/app/editor/contextualListener.js b/src/app/editor/contextualListener.js index 42a5d7064b..454a6fb1d6 100644 --- a/src/app/editor/contextualListener.js +++ b/src/app/editor/contextualListener.js @@ -1,5 +1,5 @@ 'use strict' -var remix = require('ethereum-remix').util.AstWalker +var remix = require('ethereum-remix') var SourceMappingDecoder = remix.util.SourceMappingDecoder var AstWalker = remix.util.AstWalker var EventManager = remix.lib.EventManager @@ -38,12 +38,16 @@ class ContextualListener { } declarationOf (node) { - if (node.attributes.referencedDeclaration) { - return this._index['Declarations'][node.attributes.referencedDeclaration] + if (node.attributes && node.attributes.referencedDeclaration) { + return this._index['FlatReferences'][node.attributes.referencedDeclaration] } return null } + referencesOf (node) { + return this._index['Declarations'][node.id] + } + _highlightItems (cursorPosition, compilationResult, file) { if (this.currentPosition === cursorPosition) return if (this.currentFile !== file) {