Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

lsp-dafny: Use Dafny 4.4.0 and dafny server #41

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 16 additions & 15 deletions emacs/lsp-dafny.el
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@

;;;; Installation options

(defconst lsp-dafny-latest-known-version "3.9.0")
(defconst lsp-dafny-latest-known-version "4.4.0")

(defun lsp-dafny--version-safe-p (vernum)
"Check whether VERNUM is a safe value for `lsp-dafny-preferred-version'."
Expand All @@ -43,6 +43,7 @@
:safe #'lsp-dafny--version-safe-p
:type '(choice (const :tag "Auto-install the latest version" nil)
(choice :tag "Auto-install a specific version"
(const "4.4.0")
(const "3.9.0")
(const "3.8.1")
(const "3.8.0")
Expand Down Expand Up @@ -162,13 +163,13 @@ a directory name, or nil if VERNUM is `path'."

(defun lsp-dafny--server-installed-executable ()
"Compute the path to the installed version of DafnyLanguageServer."
(lsp-dafny--installed-executable "DafnyLanguageServer"))
(lsp-dafny--installed-executable "dafny"))

(defun lsp-dafny--zip-url (vernum)
"Compute the URL to download Dafny version VERNUM."
(let ((platform
(pcase system-type
((or `gnu `gnu/linux) "ubuntu-16.04")
((or `gnu `gnu/linux) "ubuntu-20.04")
((or `windows-nt `cygwin) "win")
((or `darwin) "osx-10.14.2")
(other "Unsupported platform %S" other))))
Expand Down Expand Up @@ -557,18 +558,18 @@ Prefix each line with INDENT."
(defun lsp-dafny--server-command ()
"Compute the command to run Dafny's LSP server."
`(,(lsp-dafny-ensure-executable (lsp-dafny--server-installed-executable))
,(pcase lsp-dafny-server-automatic-verification-policy
((and policy (or `never `onchange `onsave))
(format "--documents:verify=%S" policy))
(other (user-error "Invalid value %S in \
`lsp-dafny-server-automatic-verification-policy'" other)))
,@(pcase lsp-dafny-server-verification-time-limit
(`nil nil)
((and limit (pred integerp))
(list (format "--verifier:timelimit=%d" limit)))
(other (user-error "Invalid value %S in \
`lsp-dafny-server-verification-time-limit'" other)))
,@lsp-dafny-server-args))
"server"
; ,(pcase lsp-dafny-server-automatic-verification-policy
; ((and policy (or `never `onchange `onsave))
; (format "--documents:verify=%S" policy))
; (other (user-error "Invalid value %S in \ `lsp-dafny-server-automatic-verification-policy'" other)))
; ,@(pcase lsp-dafny-server-verification-time-limit
; (`nil nil)
; ((and limit (pred integerp))
; (list (format "--verifier:timelimit=%d" limit)))
; (other (user-error "Invalid value %S in \ `lsp-dafny-server-verification-time-limit'" other)))
; ,@lsp-dafny-server-args
))

;;;###autoload
(defun lsp-dafny-register ()
Expand Down