Skip to content

Commit 8897f88

Browse files
TOTBWFyyoncho
authored andcommitted
LSP F# Fixes (#946)
* Fix F# autoinstall for emacs <= 25 * Fix native json mode for emacs >= 27
1 parent 80cfa24 commit 8897f88

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

lsp-fsharp.el

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -89,11 +89,12 @@ To use the mono/.Net framework version, set this to \"https://ci.appveyor.com/ap
8989
(defun lsp-fsharp--fsac-install ()
9090
"Downloads the latest version of fsautocomplete, and set `lsp-fsharp-server-path'."
9191
(let* ((temp-file (make-temp-file "fsautocomplete" nil ".zip"))
92-
(unzip-script (cond ((executable-find "unzip") "bash -c 'mkdir -p %2$s && unzip -qq %1$s -d %2$s'")
93-
((executable-find "powershell") "powershell -noprofile -noninteractive -nologo -ex bypass Expand-Archive -path '%s' -dest '%s'")
94-
(t (user-error "Unable to unzip server - file %s cannot be extracted, please extract it manually" temp-file)))))
92+
(install-dir-full (expand-file-name lsp-fsharp-server-install-dir))
93+
(unzip-script (cond ((executable-find "unzip") (format "bash -c 'mkdir -p %s && unzip -qq %s -d %s'") install-dir-full temp-file install-dir-full)
94+
((executable-find "powershell") (format "powershell -noprofile -noninteractive -nologo -ex bypass Expand-Archive -path '%s' -dest '%s'" temp-file install-dir-full))
95+
(t (user-error (format "Unable to unzip server - file %s cannot be extracted, please extract it manually") temp-file)))))
9596
(url-copy-file lsp-fsharp-server-download-url temp-file t)
96-
(shell-command (format unzip-script temp-file (expand-file-name lsp-fsharp-server-install-dir)))
97+
(shell-command unzip-script)
9798
(shell-command (format "%s %s --version" (lsp-fsharp--fsac-runtime-cmd) (lsp-fsharp--fsac-cmd)))))
9899

99100
(defun lsp-fsharp--make-launch-cmd ()
@@ -103,7 +104,7 @@ To use the mono/.Net framework version, set this to \"https://ci.appveyor.com/ap
103104

104105
(defun lsp-fsharp--make-init-options ()
105106
"Init options for F#."
106-
`(:automaticWorkspaceInit true))
107+
`(:automaticWorkspaceInit t))
107108

108109
(lsp-register-client
109110
(make-lsp-client :new-connection (lsp-stdio-connection 'lsp-fsharp--make-launch-cmd)

0 commit comments

Comments
 (0)