 
   registerCommands: ->
     atom.commands.add 'atom-text-editor', 'tern:definition': (event) =>
-        @findDefinition(atom.workspace.getActiveTextEditor())
+        @findDefinition()
     atom.commands.add 'atom-text-editor', 'tern:startCompletion': (event) =>
       @providers[@currentProviderIdx].callPreBuildSuggestions(true)
     atom.commands.add 'atom-text-editor', 'tern:stop': (event) =>

    @disposables = []

  startServer: ->
    return unless !@server?.process
    return unless atom.project.getDirectories()[0]
    @server = new TernServer()
    @server.start (port) =>
      if !@client

  client: null
  documentationView: null
  currentProviderIdx: 0
  activeTextEditor: null

  # autocomplete
  autocompletePlus = null
