stride icon indicating copy to clipboard operation
stride copied to clipboard

Add basic F# support

Open realvictorprm opened this issue 3 years ago • 8 comments

PR Details

With these changes F# projects are compiled and included in the solution tree. This allows to have F# projects which are the startup project and automatic recompilation as soon as the source files changed.

Besides, original changes were from @Zeroto, however I had to edit the fork from him to get the F# support up and running again with the latest .NET version. There have been some changes since .NET 5.0.2xx, which required to declare the env var DOTNET_HOST_PATH. Without that the F# compilation fails, because the F# targets build on that this env var is existent.

I applied that "fix" based on these insights here. https://github.com/ionide/proj-info/pull/100 https://github.com/ionide/ionide-vscode-fsharp/issues/1509

Related Issue

#781

Motivation and Context

I like to be able to code my game in F# too, with this I have at least minimal engine support for F#.

Types of changes

  • [ ] Docs change / refactoring / dependency upgrade
  • [x] Bug fix (non-breaking change which fixes an issue)
  • [x] New feature (non-breaking change which adds functionality)
  • [ ] Breaking change (fix or feature that would cause existing functionality to change)

Checklist

  • [x] My change requires a change to the documentation.
  • [ ] I have added tests to cover my changes.
  • [ ] All new and existing tests passed.

realvictorprm avatar Jun 13 '21 20:06 realvictorprm

Absolutely cool! Does the editor loads referenced projects too?

ykafia avatar Jun 13 '21 20:06 ykafia

@ykafia Glad to see you like it 😃

Dependencies of the F# project are displayed. However I'm just getting into enhancing all changes, because I spend most of my time fixing that annoying DOTNET_HOST_PATH bug 😅

realvictorprm avatar Jun 13 '21 20:06 realvictorprm

Hey folks, this is ready for a review.

I would be very happy to get input what is necessary to get this merged.

realvictorprm avatar Jun 14 '21 12:06 realvictorprm

Thanks, this improvement is very welcome! I was thinking that it would be good to create a file in Stride.Core.Assets that contains the list of languages with all required attributes (file extension, etc.). You could create a custom structure/class so that it's easier to declare, i.e.

SupportedLanguages = new SupportedLanguage[]
{
    {
        Name = "C#",
        Extension = ".csproj",
    }
}

The idea would be then to only have to maintain this specific file and stop hardcoding ".csproj" all over the places. Of course, the Visual Studio extension changes can be dealt with separately (it's optional and require more specific changes).

xen2 avatar Jun 16 '21 04:06 xen2

Thank you, I'm very happy to hear you're open for this improvement! :)

Unfortunately I have some bad news. I spend the last days trying to get a template running with F# and always run into the problem that the resulting window is black. Even worse, I ran out of ideas what the problem could be. Do you folks have some idea why and how that could happen?

realvictorprm avatar Jun 16 '21 05:06 realvictorprm

Do you have a test project for it ?

ykafia avatar Jun 30 '21 13:06 ykafia

@VaclavElias and @ZZAAAKK are currently looking into reviving this.

tebjan avatar Jul 26 '22 13:07 tebjan

Yeah, I suggested to do a separate PR where we will take only some bits from this PR, including the advise about the SupportedLanguage class.

VaclavElias avatar Jul 26 '22 13:07 VaclavElias

@realvictorprm are you still around to finalise this? The box in F# arrived :)

image

VaclavElias avatar Sep 17 '23 22:09 VaclavElias

Should this be closed?

Jklawreszuk avatar Oct 27 '23 02:10 Jklawreszuk

Let's close. A new PR should be done to make further adjustments so F# can work also outside of code-only approach.

VaclavElias avatar Oct 27 '23 11:10 VaclavElias

Closing, as it needs to be redone.

VaclavElias avatar Nov 18 '23 20:11 VaclavElias