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

Use Fantomas.Client #320

Closed
nojaf opened this issue Oct 25, 2021 · 3 comments
Closed

Use Fantomas.Client #320

nojaf opened this issue Oct 25, 2021 · 3 comments

Comments

@nojaf
Copy link
Contributor

nojaf commented Oct 25, 2021

Hello,

I've released a first version of Fantomas.Client, this is the proposed solution for fsprojects/fantomas#1844.

A first editor implementation was recently merged in FsAutocomplete.

The main idea is that you reference Fantomas.Client and create a new LSPFantomasService instance and use the API in FantomasService to handle formatting requests.

Each request will give you a FantomasResponse which contains a FantomasResponseCode. Based on that code, you will know how to process the response.
The FantomasService will handle proxy each request to the right compatible version of fantomas-tool.

I've written a bit of documentation here and there is a short demo here.

Would you be interested in migrating to this?

@auduchinok
Copy link
Collaborator

auduchinok commented Oct 26, 2021

Hi @nojaf,

Thanks for writing about it! Also, very nice docs and presentation. 🙂

It's unlikely we'll migrate to this approach (at least the way it's used in FsAutoComplete), since we've been using a similar Fantomas out-of-process daemon since the previous Rider release via RD-generated Fantomas model (see #252). This is the default way of how things communicate in Rider, and adding LSP dependency here doesn't seem right for now. We also need some settings integration between Fantomas and ReSharper backend, so we prefer to work with settings directly instead of delegating it to Fantomas. The only piece we currently miss is launching a dotnet tool version of Fantomas, and we're aiming for the next iteration to support it too.

We'll see if there's anything we could better align with other Fantomas clients and reuse or contribute to new service, but chances are we'll stick with what we currently have. I also expect @DedSec256 (who did our out-of-process implementation) to look through the service PRs and code, when he's back from a vacation, and to leave some comment here too.

@nojaf
Copy link
Contributor Author

nojaf commented Oct 26, 2021

Hey @auduchinok and @DedSec256. This was more or less the answer I was expecting given indeed these previous commits.
Can't blame a guy for trying right 😅. If there is anything we can do on Fantomas side, please let us know.
Feel free to close this issue.

@auduchinok
Copy link
Collaborator

@nojaf Thanks again for proposing this! We now support using different Fantomas versions via dotnet tool in our Fantomas host process, so I consider this request feature-complete, although we use a different implementation.

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

2 participants