     @reset @editor
     done = (err, messages) =>
       @dispatch.resetAndDisplayMessages @editor, messages
-    @gotoDefinitionForWord  @wordAtCursor(), done
+    {word, range} = @wordAtCursor()
+    @gotoDefinitionForWord word, done
 
   gotoDefinitionForWord: (word, callback = ->) ->
     message = {}

        targetFilePath = outputs[0]
        if targetFilePath == @editor.getPath()
          @editor.setCursorBufferPosition [col, line]
          # @editor.markBufferRange([[1,1], ])
          @emit @didCompleteNotification, @editor, false
        else
          atom.workspace.open(targetFilePath, {initialLine:line, initialColumn:col}).then (e) =>
            @emit @didCompleteNotification, @editor, false
      else # godef can't find def
        message =


    @dispatch.executor.exec(cmd, cwd, env, done, args)

  wordAtCursor: (editor = @editor) ->
    options =
      wordRegex: /[\w+\.]*/
    cursor = editor.getCursor()
    # TODO this is probably a furphy. It's the range of godef's output that's needed
    range = cursor.getCurrentWordBufferRange(options)
    word = @editor.getTextInBufferRange(range)
    return {word: word, range: range}

  highlightWordAtCursor: (editor = @editor) ->
    {word, range} = @wordAtCursor(editor)
    highlightMarker = editor.markBufferRange(range, {invalidate:'inside'})
    highlightDecoration = editor.decorateMarker(highlightMarker, {type:'highlight', class:'goplus-godef-highlight'})
    cursor = editor.getCursor()
    # TODO how
    subscription = cursor.onDidChangePosition ->
      highlightMarker.destroy()
