 (require 'cl-lib)
 (require 'eldoc)
 (require 'help-at-pt)
+(require 'tramp)
 
 (require 'dash)
 (require 'company)

    (error "Can't start F* subprocess without a backing file (save this buffer first)"))
  (unless fstar-subp--process
    (let ((prog-abs (fstar-find-executable)))
      (fstar--init-compatibility-layer)
      (let* ((buf (fstar-subp-make-buffer))
             (process-connection-type nil)
             (args (fstar-subp-with-interactive-args (fstar-subp-get-prover-args)))
             (proc (fstar-subp-start-process buf prog-abs args)))
        (fstar-log "Started F* interactive: %S" (cons prog-abs args))

      (docs . "42.0")
      (match . "42.0"))))

(defun fstar--query-vernum (executable)
  "Ask F* EXECUTABLE for its version number."
  (with-temp-buffer
    (process-file executable nil t nil "--version")
    (buffer-string)))

(defun fstar--init-compatibility-layer (executable)
  "Adjust compatibility settings based on EXECUTABLE's version number."
  (let* ((version-string (fstar--query-vernum executable)))
    (if (string-match "^F\\* \\([- .[:alnum:]]+\\)" version-string)
        (setq fstar--vernum (match-string 1 version-string))
      (message "F*: Can't parse version number from %S" version-string)
      (setq fstar--vernum "unknown"))))
