Closed alexandrehtrb closed 3 weeks ago
Hey, @alexandrehtrb.
Currently, this is the design of the compiler and language, requirement even.
There are no current plans to change that, as it will require a major compiler and typechecker architecture change (and will likely be major performance hit).
We might reevaluate it in future.
Welcome @alexandrehtrb, you may be interested by this article:
https://fsharpforfunandprofit.com/posts/recipe-part3/
and other things that mandate it remains the same, or at least, make it less practical, to envision a world where F# does not have mandatory file ordering; for the time being.
I don't think it is a blocker for people doing C# to learn F#; with this rhetoric, we can create infinity of good reasons not to learn/use F# (goes same for C#, etc.).
Everyone goes over the hump, I also was irked a bit, but it was due to pre conditionning of 1 class per file for so many years.
I live happier with less files, shorter lines, more expressive and correct code, and code having topological and semantical ordering.
You may read on https://github.com/fsharp/fslang-suggestions/issues/309#issuecomment-1290626807 and discuss suggestions to extend F# in relation to what you are bringing.
@alexandrehtrb Please do not forget that in C# order of files does not matter while in F# it does. So by specifying files in fsproj you're not only including those into compilation, you're also indicating compiler which file ordering is proper/expected.
If you are using Visual Studio, when you add a new .fs file, it is automatically added to the project's .fsproj. However, if you are using other editors like VS Code, it isn't, and without adding to fsproj, it won't get compiled.
In VS Code / Ionide, you have a context menu in the solution explorer where you can "Add file above" / "Add file below". These commands automatically update the fsproj file.
Is your feature request related to a problem? Please describe.
If you are using Visual Studio, when you add a new .fs file, it is automatically added to the project's .fsproj. However, if you are using other editors like VS Code, it isn't, and without adding to fsproj, it won't get compiled.
This shouldn't exist:
This is a major source of confusion for C# developers that want to learn F#; this isn't required for csproj, why should it be for fsproj? Even if there was an historical reason for this, I believe it should be removed and the compiler should be smart enough to just compile everything under its directory.
Describe the solution you'd like
No need for explicit mentioning .fs files to compile in .fsproj.
Describe alternatives you've considered
Additional context