Commit b000cab7 authored by yann300's avatar yann300

add api function

parent 1ea31f8b
'use strict' 'use strict'
var remix = require('ethereum-remix').util.AstWalker var remix = require('ethereum-remix')
var SourceMappingDecoder = remix.util.SourceMappingDecoder var SourceMappingDecoder = remix.util.SourceMappingDecoder
var AstWalker = remix.util.AstWalker var AstWalker = remix.util.AstWalker
var EventManager = remix.lib.EventManager var EventManager = remix.lib.EventManager
...@@ -38,12 +38,16 @@ class ContextualListener { ...@@ -38,12 +38,16 @@ class ContextualListener {
} }
declarationOf (node) { declarationOf (node) {
if (node.attributes.referencedDeclaration) { if (node.attributes && node.attributes.referencedDeclaration) {
return this._index['Declarations'][node.attributes.referencedDeclaration] return this._index['FlatReferences'][node.attributes.referencedDeclaration]
} }
return null return null
} }
referencesOf (node) {
return this._index['Declarations'][node.id]
}
_highlightItems (cursorPosition, compilationResult, file) { _highlightItems (cursorPosition, compilationResult, file) {
if (this.currentPosition === cursorPosition) return if (this.currentPosition === cursorPosition) return
if (this.currentFile !== file) { if (this.currentFile !== file) {
......
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