       else
         grammarA.name.localeCompare(grammarB.name)
     grammars.unshift(@autoDetect)
-    @setItems(grammars)
-
-  confirmed: (grammar) ->
-    @cancel()
-    if grammar is @autoDetect
-      atom.syntax.clearGrammarOverrideForPath(@editor.getPath())
-    else
-      atom.syntax.setGrammarOverrideForPath(@editor.getPath(), grammar.scopeName)
-    @editor.reloadGrammar()
-
-  attach: ->
-    super
-
-    atom.workspaceView.append(this)
-    @focusEditor()
+    grammars

      @cancel()
      false

    @populate()
    @attach()

  getFilterKey: ->

    element.textContent = grammar.name
    element

  confirmed: (grammar) ->
    @cancel()
    if grammar is @autoDetect
      atom.syntax.clearGrammarOverrideForPath(@editor.getPath())
    else
      atom.syntax.setGrammarOverrideForPath(@editor.getPath(), grammar.scopeName)
    @editor.reloadGrammar()

  attach: ->
    @storeFocusedElement()
    atom.workspaceView.append(this)
    @focusEditor()

  getGrammars: ->
    grammars = atom.syntax.getGrammars().filter (grammar) ->
      grammar isnt atom.syntax.nullGrammar

