       @editor.decorateMarker marker, type: 'gutter', class: 'refactor-error'
       marker
 
-  destroyReferenceMarkers: ->
+  destroyReferences: ->
+    delete @references
     return unless @markers?
     for marker in @markers
       marker.destroy()
-
-  createReferenceMarkers: (ranges) ->
-    @markers = for range in ranges
+    delete @markers
+
+  createReferences: ->
+    @references = @ripper.find @editor.getSelectedBufferRange().start
+    @markers = for range in @references
       marker = @editor.markBufferRange range
       @editor.decorateMarker marker, type: 'highlight', class: 'refactor-reference'
       marker

    @cursorMovedTimeoutId = setTimeout @onCursorMovedAfter, 0

  onCursorMovedAfter: =>
    @destroyReferenceMarkers()
    @createReferenceMarkers @ripper.find @editor.getSelectedBufferRange().start


  ###


  parse: =>
    @editorView.off 'cursor:moved', @onCursorMoved
    @destroyReferences()
    @destroyErrors()
    text = @editor.buffer.getText()
    if text isnt @cachedText
      @cachedText = text
