Skip to content

Commit 198493c

Browse files
Merge pull request #168 from juergenhoetzel/flycheck-predicate
Flycheck: Add predicate function (WIP)
2 parents 1309c29 + 4820cf5 commit 198493c

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

flycheck-fsharp.el

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,9 @@
3434

3535
(defvar flycheck-fsharp--lint-callback-info nil)
3636

37+
(defun flycheck-fsharp--can-make-request-p ()
38+
(fsharp-ac-can-make-request t))
39+
3740
(defun flycheck-fsharp-fsautocomplete-lint-start (checker callback)
3841
"Start a F# syntax check with CHECKER.
3942
CALLBACK is the status callback passed by Flycheck."
@@ -48,6 +51,7 @@ CALLBACK is the status callback passed by Flycheck."
4851
"A syntax checker for F# using FSharp.AutoComplete.
4952
See URL `https://github.com/fsharp/FsAutoComplete'."
5053
:start #'flycheck-fsharp-fsautocomplete-lint-start
54+
:predicate #'flycheck-fsharp--can-make-request-p
5155
:modes '(fsharp-mode))
5256

5357
(defvar flycheck-fsharp--error-callback-info nil)
@@ -63,6 +67,7 @@ CALLBACK is the status callback passed by Flycheck."
6367
See URL `https://github.com/fsharp/FsAutoComplete'."
6468
:start #'flycheck-fsharp-fsautocomplete-start
6569
:modes '(fsharp-mode)
70+
:predicate #'flycheck-fsharp--can-make-request-p
6671
:next-checkers '((info . fsharp-fsautocomplete-lint)))
6772

6873
(defun flycheck-fsharp-handle-lint (data)

test/test-common.el

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
(defmacro stubbing-process-functions (&rest body)
3030
`(noflet ((process-live-p (p) t)
3131
(fsharp-ac--process-live-p (host) t)
32+
(flycheck-fsharp--can-make-request-p () t)
3233
(start-process (&rest args))
3334
(set-process-filter (&rest args))
3435
(set-process-query-on-exit-flag (&rest args))

0 commit comments

Comments
 (0)