         @emitter.on 'did-generate-tags', fn
 
       getCachedTags: ->
-        getFileView().cachedTags
+        cachedTags
 
       generateTags: (fn) ->
         filePath = @editor.getPath()
         scopeName = @editor.getGrammar().scopeName
         cache = @getCachedTags()
         new TagGenerator(filePath, scopeName).generate().done (tags) ->
+          # console.log "generate for #{filePath}"
           cache[filePath] = tags
           fn(tags)
 

{Emitter, CompositeDisposable} = require 'atom'
getEditorState = null
_ = require 'underscore-plus'

requireFrom = (pack, path) ->
  packPath = atom.packages.resolvePackagePath(pack)
  require "#{packPath}/lib/#{path}"

getActivePackage = (pack) ->
  atom.packages.getActivePackage(pack)

module.exports =
  activate: ->
    cachedTags = {}
    @subscriptions = new CompositeDisposable
    @subscribe atom.workspace.observeTextEditors (editor) =>
      @subscribe editor.onDidSave ->
        delete cachedTags[editor.getPath()]

  deactivate: ->
    @subscriptions.dispose()
    @subscriptions = {}
    cachedTags = null

  subscribe: (args...) ->
    @subscriptions.add args...
