3737(defun flycheck-fsharp--can-make-request-p ()
3838 (fsharp-ac-can-make-request t ))
3939
40+ (defun flycheck-verify-fsautocomlete (_checker )
41+ " Verify the F# syntax checker."
42+ (let* ((host (fsharp-ac--hostname (buffer-file-name )))
43+ (process (fsharp-ac-completion-process host))
44+ (status (when process (process-status process)))
45+ (project-file (when (eq status 'run ) (fsharp-ac--in-project-p (buffer-file-name ))))
46+ (projects (when (eq status 'run ) (hash-table-keys fsharp-ac--project-data)))
47+ (command (when process (combine-and-quote-strings (process-command process)))))
48+ (cons
49+ (flycheck-verification-result-new
50+ :label " FSharp.AutoComplete process"
51+ :message (cond
52+ ((eq status 'run ) command)
53+ (status (format " Invalid process status: %s (%s ) " command status))
54+ (" not running" ))
55+ :face (if (eq status 'run ) 'success '(bold error )))
56+ (when (eq status 'run )
57+ (list (flycheck-verification-result-new
58+ :label " F# Project"
59+ :message (or project-file " None" )
60+ :face (if project-file 'success '(bold warning )))
61+ (flycheck-verification-result-new
62+ :label " Loaded Projects"
63+ :message (if projects
64+ (mapconcat #'identity projects " , " )
65+ " No projects loaded" )
66+ :face (if projects 'success '(bold warning ))))))))
67+
4068(defun flycheck-fsharp-fsautocomplete-lint-start (checker callback )
4169 " Start a F# syntax check with CHECKER.
4270CALLBACK is the status callback passed by Flycheck."
@@ -52,6 +80,7 @@ CALLBACK is the status callback passed by Flycheck."
5280See URL `https://github.com/fsharp/FsAutoComplete' ."
5381 :start #'flycheck-fsharp-fsautocomplete-lint-start
5482 :predicate #'flycheck-fsharp--can-make-request-p
83+ :verify #'flycheck-verify-fsautocomlete
5584 :modes '(fsharp-mode))
5685
5786(defvar flycheck-fsharp--error-callback-info nil )
@@ -68,6 +97,7 @@ See URL `https://github.com/fsharp/FsAutoComplete'."
6897 :start #'flycheck-fsharp-fsautocomplete-start
6998 :modes '(fsharp-mode)
7099 :predicate #'flycheck-fsharp--can-make-request-p
100+ :verify #'flycheck-verify-fsautocomlete
71101 :next-checkers '((info . fsharp-fsautocomplete-lint)))
72102
73103(defun flycheck-fsharp-handle-lint (data )
0 commit comments