Skip to content
This repository has been archived by the owner on Jan 3, 2019. It is now read-only.

Commit

Permalink
Fix errors in fsharp-ac--can-make-request.
Browse files Browse the repository at this point in the history
Ensure buffer-file-name is not nil before processing it.
  • Loading branch information
Chris Barrett committed Mar 30, 2013
1 parent 6d37093 commit bf7f308
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions emacs/fsharp-mode-completion.el
Expand Up @@ -282,13 +282,15 @@ display in a help buffer instead.")
(when (eq ?\. c)
(point)))))


(defun fsharp-ac-can-make-request ()
(and (fsharp-ac--process-live-p)
(or
(member (expand-file-name (buffer-file-name)) fsharp-ac-project-files)
(string-match-p (rx (or "fsx" "fsscript"))
(file-name-extension (buffer-file-name))))))
"Test whether it is possible to make a request with the compiler binding.
The current buffer must be an F# file that exists on disk."
(let ((file (buffer-file-name)))
(and file
(fsharp-ac--process-live-p)
(or (member (expand-file-name file) fsharp-ac-project-files)
(string-match-p (rx (or "fsx" "fsscript"))
(file-name-extension file))))))

(defvar fsharp-ac-awaiting-tooltip nil)

Expand Down

0 comments on commit bf7f308

Please sign in to comment.