     @pythonPath = atom.config.get('autocomplete-fortran.pythonPath')
     @parserPath = path.join(__dirname, "..", "python", "parse_fortran.py")
     @minPrefix = atom.config.get('autocomplete-fortran.minPrefix')
+    @saveWatchers = new CompositeDisposable
+    @workspaceWatcher = atom.workspace.observeTextEditors((editor) => @setupEditors(editor))
+
+  destructor: () ->
+    if @workspaceWatcher?
+      @workspaceWatcher.dispose()
+    if @saveWatchers?
+      @saveWatchers.dispose()
+
+  setupEditors: (editor) ->
+    @saveWatchers.add editor.onDidSave((event) => @fileUpdateSave(event))
+
+  fileUpdateSave: (event) ->
+    fileRef = @modFiles.indexOf(event.path)
+    if fileRef > -1
+      @fileUpdate(event.path)
 
   rebuildIndex: () ->
     # Reset index

  disableForSelector: '.source.fortran .comment, .source.fortran .string.quoted'
  inclusionPriority: 1
  suggestionPriority: 2

  pythonPath: ''
  parserPath: ''

{BufferedProcess, CompositeDisposable, File} = require 'atom'
fs = require('fs')
path = require('path')

