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

A handy utility for updating fsac #1112

Merged
merged 2 commits into from
Oct 18, 2019
Merged
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
10 changes: 9 additions & 1 deletion lsp-fsharp.el
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@
;;; Code:

(require 'lsp-mode)
(require 'pcase)

(defgroup lsp-fsharp nil
"LSP support for the F# Programming Language, using the FsharpAutoComplete server."
Expand Down Expand Up @@ -200,6 +199,13 @@ disable if `--backgorund-service-enabled' is not used"
(shell-command unzip-script)
(shell-command (format "%s %s --version" (lsp-fsharp--fsac-runtime-cmd) (lsp-fsharp--fsac-cmd)))))

(defun lsp-fsharp-update-fsac ()
"Update fsautocomplete to the latest version."
(interactive)
(-let [install-dir (f-expand lsp-fsharp-server-install-dir)]
(f-delete install-dir t)
(lsp-fsharp--fsac-install)))

(defun lsp-fsharp--make-launch-cmd ()
"Build the command required to launch fsautocomplete."
(append (list (lsp-fsharp--fsac-runtime-cmd) (lsp-fsharp--fsac-locate) "--mode" "lsp" "--background-service-enabled")
Expand All @@ -216,6 +222,8 @@ disable if `--backgorund-service-enabled' is not used"
(directory (car (seq-filter (lambda (d) (equal "directory" (cdr (assq 'Type d)))) found))))
(cdr (assq 'Fsprojs (cdr (assq 'Data directory))))))


;;;###autoload
(defun lsp-fsharp--workspace-load (projects)
"Load all of the provided PROJECTS."
(lsp-request-async "fsharp/workspaceLoad"
Expand Down