Closed arialdomartini closed 1 month ago
I just found out that the problem arises only if fsautocomplete
has being installed via dotnet tool
.
The ambiguity could be because dotnet tool
and eglot-fsharp
install fsautocomplete
in 2 different paths:
Tool | Install path |
---|---|
dotnet tool | ~/.dotnet/tools |
eglot-fsharp | ~/.dotnet/tools/netcore |
I think I found the problem. I had this configuration in place:
(use-package eglot-fsharp
:ensure t
:after fsharp-mode
:config
(setq eglot-fsharp-server-install-dir "~/.dotnet/tools/"))
because I wanted to make sure that fsautocomplete
was not downloaded twice. I learnt that by default eglot-fsharp
does not downlod fsautocomplete
in ~/.dotnet
, but in the startard XDG directory.
My suggestion would be to include the hardcoded netcore
path in eglot-fsharp-server-install-dir
so in case a user configures it, as above, netcore
is not added, with something like:
(defcustom eglot-fsharp-server-install-dir
(concat (locate-user-emacs-file "FsAutoComplete") "/" "netcore")
"Install directory for FsAutoComplete."
:group 'eglot-fsharp
:risky t
:type 'directory)
With this,
Fixed in #342
(use-package eglot-fsharp
:ensure t
:after fsharp-mode
:custom (eglot-fsharp-server-install-dir nil))
will use the global user tool path.
Works like a breeze! Thank you.
Description
eglot-fsharp--path-to-server
expectsfsautocomplete
to be innetcore
subdir.dotnet tool install
does not install it in that subdir.Repro steps
Install fsautocomplete with
as recommended in https://www.nuget.org/packages/fsautocomplete.
fsautocomplete
is being installed in~/.dotnet/tools
, not in~/.dotnet/tools/netcore
.Actual behavior
I get the error:
Known workarounds
I think the problem is with the function:
which uses the hardcoded value
netcore/fsautocomplete
.With the help of @protesilaos I modified it to:
which fixed the problem.
I work on Arch Linux with SDK 8. I am not sure if this path is also valid for other configurations. It would probably a good idea to have that value parametric.
Related information
Operating system Linux version 6.8.9-arch1-1
Emacs version GNU Emacs 30.0.50 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.24.38, cairo version 1.18.0) of 2023-10-23
.NET Runtime, CoreCLR or Mono Version 8.0.104