         }
 
     showAddProperty: ->
-        editor = Workspace.getActiveEditor()
+        editor = atom.workspace.getActiveTextEditor()
 
         unless editor.getGrammar().scopeName is 'text.html.php' or editor.getGrammar().scopeName is 'source.php'
             alert ('this is not a PHP file')

        bc.writeAtEnd(code)

    allGetters: (variables) ->
        editor = Workspace.getActiveEditor()
        unless editor.getGrammar().scopeName is 'text.html.php' or editor.getGrammar().scopeName is 'source.php'
            alert ('this is not a PHP file')
            return

        ui.show()

    showUI: ->
        editor = atom.workspace.getActiveTextEditor()

        unless editor.getGrammar().scopeName is 'text.html.php' or editor.getGrammar().scopeName is 'source.php'
            alert ('this is not a PHP file')
