-
-
Notifications
You must be signed in to change notification settings - Fork 193
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
Fantomas V #2160
Comments
Could you please clarify what "grab the F# compiler from the source files instead" means? I don't think I follow; surely you don't mean compiling the F# compiler from source as part of Fantomas? |
Hi there,
Actually, I do mean that, but it is less bad than it sounds. Any recent improvements that are made in the compiler can be picked up immediately by moving the git commit pointer in the paket.dependencies file. The footprint of our own compiler service is significantly less compared with the full FCS on NuGet. There is some more prose in the documentation folder where I elaborate a bit more. Though some parts are already outdated. Let me know if you have any further questions. |
For reference Fable has a similar situation, we use a custom build of the FCS compiler based on a fork maintained by @ncave to improve the performance of incremental compilation with Fable. It's probably not the best way to do things but this is how we do it:
Again, this is just for reference in case it helps, probably Fantomas' needs require a different process. Also, please note that this is different from building the Fable Repl which uses yet another fork 😸 in a totally different way (it does remove files, sources are kept in Fable repo and CI builds it every time)> |
Introduction
Over the years Fantomas has been improving, making it usable in more and more codebases. Under the hood, we still do a lot of questionable processing to reconstruct the correct code. It is well known that we use the FSharp Compiler Services to collect our information via the Untyped Abstract Syntax Tree (AST). Alas, we don't always have enough information in the tree and so we resort to finding answers in the F# tokens.
Going forward, we wish to improve the syntax tree so that we can have a more streamlined codebase and have better performance.
Pull requests for this over
dotnet/fsharp
have been submitted in the past and eventually make it intoFCS
.This process works but is time-consuming. The releases of FCS are scarce and unpredictable. There are no hard feelings here, but we wish to explore an alternative way of integrating the compiler in Fantomas.
This issue serves as a meta issue to collect the various aspects of the next major version.
Not everything is known at this point, and what is known can be subjected to change.
Core goals
In essence, the theme of the next major version is having a better syntax tree. And we need to make some fundamental (and potentially breaking) changes to get there. We want to improve the syntax tree on
dotnet/fsharp
side and eat our cake on Fantomas side shortly afterwards.Community goals
Next to our core goals, we also wish to provide a stage where the community can address #1408. This setting still has open questions and we wish to engage the community to pick this up as part of version five.
Breaking changes
A major version allows for breaking changes. We will address certain topics, that we otherwise couldn't due to semantic versioning.
Of course, with a focus on keeping the impact for end-users to a minimum.
Proposed scope
Change
Fantomas
toFantomas.Core
andfantomas-tool
tofantomas
, Rename Fantomas to Fantomas.Core and fantomas-tool to fantomas #2174net6
, Update .NET tool to net6 #2172Deprecate
fsharp_semicolon_at_end_of_line
, Removefsharp_semicolon_at_end_of_line
#2247fsharp_keep_if_then_in_same_line
, Removefsharp_keep_if_then_in_same_line
#2248fsharp_indent_on_try_with
, Removefsharp_indent_on_try_with
#2249--stdin
,--stdout
, Update command line tool for v5 #2346Fantomas.Extras
(we might introduce a separate package that exposes the.editorconfig
toFormatConfig
parsing), Remove Fantomas.Extras #2269Add
fsharp_stroustrup_style
(name to be discussed in Option for Stroustrup bracket style #1408)Technical process
All development is now happening on the master branch.
The text was updated successfully, but these errors were encountered: