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

Add basic F# support #1078

Closed
wants to merge 1 commit into from

Conversation

realvictorprm
Copy link

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.
ionide/proj-info#100
ionide/ionide-vscode-fsharp#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
  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist

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

@ykafia
Copy link
Contributor

ykafia commented Jun 13, 2021

Absolutely cool! Does the editor loads referenced projects too?

@realvictorprm
Copy link
Author

@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
Copy link
Author

realvictorprm commented Jun 14, 2021

Hey folks, this is ready for a review.

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

@xen2
Copy link
Member

xen2 commented Jun 16, 2021

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).

@realvictorprm
Copy link
Author

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?

@ykafia
Copy link
Contributor

ykafia commented Jun 30, 2021

Do you have a test project for it ?

@xen2 xen2 marked this pull request as draft July 7, 2021 04:28
@tebjan
Copy link
Member

tebjan commented Jul 26, 2022

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

@VaclavElias
Copy link
Contributor

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.

ZZAAAKK added a commit to ZZAAAKK/stride that referenced this pull request Jul 26, 2022
Added SupportedLanguage class to centralise supported language information.
Implemented SupportedLanguage.SupportedLanguages list to perform file extension checks in place of hard-coded extensions.
NuGet v4.1.1.0-fix1078 tested by creating new F# app, adding dependencies, some boilerplate for a new scene, and building. The same steps have been carried out with a new C# app - all successful.
@VaclavElias
Copy link
Contributor

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

image

@Jklawreszuk
Copy link
Collaborator

Should this be closed?

@VaclavElias
Copy link
Contributor

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

@VaclavElias
Copy link
Contributor

Closing, as it needs to be redone.

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

Successfully merging this pull request may close these issues.

6 participants