       @status = new Status
       @disposables.add @status
     @status.attach statusBar
+    { Disposable } = require 'atom'
     return new Disposable( => @status.detach())
 
-class AtomLaTeX extends Disposable
+class AtomLaTeX
   constructor: ->
+    { CompositeDisposable } = require 'atom'
     @disposables = new CompositeDisposable
     Builder = require './builder'
     Cleaner = require './cleaner'

      'atom-latex:tools-backquote': () => @latex.provider.syntax.backquote()
      'atom-latex:tools-doublequote': () => @latex.provider.syntax.doublequote()

    @disposables.add atom.workspace.observeTextEditors (editor) =>
      @disposables.add editor.onDidSave () =>
        if atom.config.get('atom-latex.build_after_save') and \
            editor.buffer.file?.path and \
            path.extname(editor.buffer.file?.path) == '.tex'
          @latex.builder.build()

  deactivate: ->
    return @disposables.dispose()

  provide: ->
    if !@provider?

            (grammar.scopeName.indexOf('text.tex.latex') > -1) or
            (grammar.name is 'LaTeX')
          promise = new Promise (resolve, reject) =>
            setTimeout(( => @lazyLoad()), 100)
            resolve()

  lazyLoad: ->
    return if @activated
    @activated = true

    @latex = new AtomLaTeX
