add api function

pull/1/head
yann300 7 years ago
parent 1ea31f8b5f
commit b000cab750
  1. 10
      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) {

Loading…
Cancel
Save