             id: cursorIds[0],
             pos: cursorPos.column - cursorIds[0].loc.start.column,
             usages: usages,
-            scope: scope
+            scope: parsedScope.scope
           }
     return null
 

  invalidateEditorCache: (editor) ->
    symNavParserCache[editor.getPath()] = null

  #get parsed buffer data - from cache, if possible, else
  #we calculate it and cache it.
  parseEditor: (editor) ->
    if symNavParserCache[editor.getPath()]?
      return symNavParserCache[editor.getPath()]

    esprima = require('esprima-fb')

  #works top down from global scope
  getIdentifierAtCursor: ->
    editor = @util.getActiveEditor()

    if editor
      cursorPos = editor.getCursorBufferPosition()
      parsedScopes = @parseEditor editor
      if !parsedScopes then return null

      #run through scopes, get identifiers in each
      #if we find one at the cursor position, look
      #for the next identifier
      for parsedScope in parsedScopes
        identifiers = parsedScope.identifiers
        cursorIds = identifiers.filter (node) =>
          @util.positionIsInsideLocation(cursorPos, node.loc)

