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

Error: "Creating the Fantomas Deamon failed" when saving a file or trying to format in VS #54

Open
abelbraaksma opened this issue Dec 19, 2023 · 4 comments

Comments

@abelbraaksma
Copy link
Member

abelbraaksma commented Dec 19, 2023

In VS 2022, 17.8.0, with Fantomas 6.2.0 installed both locally (dotnet tool restore) and globally (the command fantomas is available anywhere), I get the following:

Creating the Fantomas Daemon failed:
Fantomas.Client tried to run `dotnet fantomas --daemon` but failed with "Daemon std error: Run "dotnet tool restore" to make the "fantomas" command available.
.
JsonRpc exception:One or more errors occurred."
Attempting to find Fantomas Tool...
Found at: FantomasToolFound
  (FantomasVersion "5.0.6",
   LocalTool
     (Folder
        "D:\Projects\TaskSeq\src\FSharp.Control.TaskSeq.Test"))

Note the odd thing that it says Found at: FantomasToolFould and then FantomasVersion "5.0.6", which is NOT a version I have installed, as far as I know:

PS D:\projects\TaskSeq> dotnet tool list
Package Id      Version      Commands      Manifest
------------------------------------------------------------------------------------------------------------------
fantomas        6.2.0        fantomas      D:\projects\TaskSeq\.config\dotnet-tools.json
PS D:\projects\TaskSeq> dotnet tool list --global
Package Id      Version      Commands
-------------------------------------
fantomas        6.2.2        fantomas

I'm not sure what's happening here. If I had to guess, maybe the tool expects a non-6.x version and should be updated for 6.x?

I can help, just need to figure out how to debug this ;).

@abelbraaksma
Copy link
Member Author

abelbraaksma commented Dec 19, 2023

Hmm. Just realized the path it's showing, and that in my case the sln file is in the src dir and not in the root dir. Running dotnet tool restore from the src dir solved the issue.

Not sure why there's a 6.2 installed in the root dir, and globally, and a 5.0.6 installed in this repo. I'll fix that.

This message was really confusing to me, though:

Attempting to find Fantomas Tool...
Found at: FantomasToolFound

This didn't mean that it was found. It meant that there was a manifest file and that in the manifest file, it found a certain version. However, the tool was never installed in this particular directory on this machine for some reason.

If you feel like it, maybe change the above to "Attempting to find Fantomas Tool as specified in the manifest file"? Or something like that?

Sorry for the mess above, I was looking in the wrong direction lol...

@nojaf nojaf closed this as not planned Won't fix, can't repro, duplicate, stale Dec 19, 2023
@nojaf nojaf reopened this Dec 19, 2023
@nojaf
Copy link
Contributor

nojaf commented Dec 19, 2023

Whoops, my bad.

@abelbraaksma
Copy link
Member Author

abelbraaksma commented Dec 19, 2023

I think this might be more something to report in https://github.com/fsprojects/fantomas-for-vs.

Ehm, that's where this currently is, no? 😆

I'll have a look around and see if I can make a few changes that make reasoning about these errors easier and/or fix it such that it finds Fantomas if it's a level up or globally available.

There's also the issue with .fantomasignore, which currently only sometimes works (i.e., if it is in a parent directly, like how .gitignore works, it won't be applied). I might look at that too.

@deviousasti
Copy link
Member

Abel, I can't repro this. I'll reach out to you on Slack.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants