 (defvar ac-fsharp-completion-process nil)
 (defvar ac-fsharp-partial-data "")
 (defvar ac-fsharp-data "")
+(defvar ac-fsharp-completion-cache nil)
 
 (defun log-to-proc-buf (proc str)
   (let ((buf (process-buffer proc))



; Consider using 'text' for filtering
(defun ac-fsharp-completions (file line col text)
  (setq ac-fsharp-status 'fetch-in-progress)
  (setq ac-fsharp-data nil)
  (ac-fsharp-parse-file file)
  (ac-fsharp-send-completion-request file line col)
  (while (eq ac-fsharp-status 'fetch-in-progress)
    (accept-process-output ac-fsharp-completion-process))
  ac-fsharp-data)

(defun ac-fsharp-completion-at-point ()
  "Return a function ready to interrogate the F# compiler service for completions at point."
  (if ac-fsharp-completion-process
      (let ((end (point))
            (start

(defun ac-fsharp-load-project (file)
  "Load the specified F# file as a project"
  (interactive "f")
  (setq ac-fsharp-completion-cache nil)
  (log-psendstr ac-fsharp-completion-process
                (format "project \"%s\"\n" (expand-file-name file))))

