From f8fccaae5cd0faefc6e3dd139561440e2d59e6b1 Mon Sep 17 00:00:00 2001 From: August Feng Date: Sun, 26 Mar 2023 11:51:14 -0400 Subject: [PATCH 1/2] remove obsolete variable in fsharp client this variable does not seem used since we install fsautocomplete in dotnet's tool directory: 2d98a9565328a480f98813a7f0f4669d7cad3639. --- clients/lsp-fsharp.el | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/clients/lsp-fsharp.el b/clients/lsp-fsharp.el index afd87206020..9372692ff69 100644 --- a/clients/lsp-fsharp.el +++ b/clients/lsp-fsharp.el @@ -32,9 +32,6 @@ :group 'lsp-mode :package-version '(lsp-mode . "6.1")) -(defcustom lsp-fsharp-server-install-dir (f-join lsp-server-install-dir "fsautocomplete/") - "Install directory for fsautocomplete server. -The slash is expected at the end." :group 'lsp-fsharp :risky t :type 'directory @@ -178,10 +175,7 @@ available, else the globally installed tool." (defun lsp-fsharp--fsac-cmd () "The location of fsautocomplete executable." - (or (-let [maybe-local-executable (expand-file-name "fsautocomplete" lsp-fsharp-server-install-dir)] - (when (f-exists-p maybe-local-executable) - maybe-local-executable)) - (executable-find "fsautocomplete") + (or (executable-find "fsautocomplete") (f-join (or (getenv "USERPROFILE") (getenv "HOME")) ".dotnet" "tools" "fsautocomplete"))) From feced9d7b6bb5b5409e70cd5a83fefaf1bbcdcfa Mon Sep 17 00:00:00 2001 From: August Feng Date: Sun, 26 Mar 2023 11:53:58 -0400 Subject: [PATCH 2/2] support local fsautocomplete for server debugging --- clients/lsp-fsharp.el | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/clients/lsp-fsharp.el b/clients/lsp-fsharp.el index 9372692ff69..363e7e76bce 100644 --- a/clients/lsp-fsharp.el +++ b/clients/lsp-fsharp.el @@ -32,10 +32,11 @@ :group 'lsp-mode :package-version '(lsp-mode . "6.1")) +(defcustom lsp-fsharp-server-dll-path nil + "Path to a self-built fsautocomplete dll. Useful for debugging." :group 'lsp-fsharp - :risky t - :type 'directory - :package-version '(lsp-mode . "6.1")) + :type 'file + :package-version '(lsp-mode . "8.0.1")) (defcustom lsp-fsharp-server-args nil "Extra arguments for the F# language server." @@ -201,9 +202,11 @@ available, else the globally installed tool." (list "/bin/ksh" "-c")) (t nil))) - (fsautocomplete-exec (lsp-fsharp--fsac-cmd))) + (fsautocomplete-cmd (if lsp-fsharp-server-dll-path + (list "dotnet" (expand-file-name lsp-fsharp-server-dll-path)) + (list (lsp-fsharp--fsac-cmd))))) (append startup-wrapper - (list fsautocomplete-exec) + fsautocomplete-cmd lsp-fsharp-server-args))) (defun lsp-fsharp--test-fsautocomplete-present ()