fsprojects / fantomas

FSharp source code formatter
https://fsprojects.github.io/fantomas
Other
760 stars 190 forks source link

Dev container #2980

Closed nojaf closed 8 months ago

nojaf commented 8 months ago

As a response to @gubser poor experience in https://github.com/fsprojects/fantomas/issues/2972, I tried to set up a devcontainer.

While doing this, I did encounter some problems when only 8rc2 SDK was installed. I needed RollForward for the test projects and of course, had to workaround https://github.com/dotnet/sdk/issues/35989.

During my experiment, I updated fsdocs to the latest alpha. Even though we use a custom theme, I had to change some things for the search. Ionide was not starting in my dev container. @Martin521 would you have any ideas what I'm still missing?

nojaf commented 8 months ago

image

nojaf commented 8 months ago

Turns out, that I was trying to use a local FSAC inside the container. Works now.

dawedawe commented 8 months ago

Mmh, so far my success rate with the container is 2 out of 10 but if it can unblock others, sure, let's have it.

Martin521 commented 8 months ago

This is how dotnet/fsharp does it:

    "customizations": {
        "vscode": {
            // Add the IDs of extensions you want installed when the container is created.
            "extensions": [
                "ms-dotnettools.csharp",
                "Ionide.Ionide-fsharp",
                "tintoy.msbuild-project-tools"
            ]
        }
    },
nojaf commented 8 months ago

Yup, stole that part from dotnet/fsharp indeed.

Martin521 commented 8 months ago

And wouldn't it make sense to use a .net 8 image?

nojaf commented 8 months ago

And wouldn't it make sense to use a .net 8 image?

Yes, probably, I selected the F# option from the UI. Might make sense to use a Dockerfile instead.

dawedawe commented 8 months ago

Locally correctly formatted file should not be written, 1984 fails because of newline issues. @nojaf you don't see this?

nojaf commented 8 months ago

You mean in Windows or in the container?

dawedawe commented 8 months ago

In the container

nojaf commented 8 months ago

Ok, I now have it in Windows. This is a checkout-as line ending shenannigan. Forcing lf in the test now.