 
     editor = atom.workspace.getActiveEditor()
 
-    return if not editor?
+    return if not @isReactEnabledForEditor editor
 
     selections = editor.getSelections()
 


    editor = atom.workspace.getActiveEditor()

    return if not editor?

    selections = editor.getSelections()
    editor.transact =>

      return true if b[0] == 'jsx'
    false

  isReactEnabledForEditor: (editor) ->
    return editor? && editor.getGrammar().scopeName == "source.js.jsx"

  autoSetGrammar: (editor) ->
    return if @isReactEnabledForEditor editor

    path = require 'path'

