ionide / ionide-vscode-fsharp

VS Code plugin for F# development
http://ionide.io
MIT License
849 stars 276 forks source link

Not Recognizing F# Project Inside Workspace With Flutter #1976

Open MelbourneDeveloper opened 5 months ago

MelbourneDeveloper commented 5 months ago

Describe the bug

I have a vscode workspace with some Flutter, C# and F# projects. The C# and F# projects are sitting in a folder named dotnet under the same solution. The workspace only includes the dotnet folder. It doesn't include the solution at the root level. Ionide doesn't pick up the F# projects unless I remove the Flutter folders from the workspace.

Steps to reproduce

I cannot consistently reproduce this problem in a blank sample. I tried creating a vscode workspace with VS Solution, and a Flutter app. The first few times, the Ionide F# project didn't load, but eventually it worked ok.

See the video as evidence of what is happening. This consistently occurs with my workspace.

Expected behaviour

Ionide picks up my F# projects

Screenshots

This is what I see in my F# project. Bear in mind that I don't get this problem if I remove the Flutter folders from my workspace:

image

Notice that syntax errors don't cause problems at the vscode level:

image

When I remove these two folders from the workspace, the F# project correctly loads:

image

After removal:

image

Video - You Can Clearly See The Issue Here

Here is a video that demonstrates the issue, and the workaround. Note that I had to modify the workspace twice for the F# project to eventually load.

https://github.com/ionide/ionide-vscode-fsharp/assets/16697547/812f14cd-18d6-4ed5-b47f-40ce2d5b650b

Machine info

vzarytovskii commented 5 months ago

I remember @baronfel mentioning that Ionide doesn't fully support workspaces.

baronfel commented 5 months ago

@MelbourneDeveloper can you try setting https://ionide.io/Editors/Code/options.html#fsharpworkspacepath to point specifically at your solution/project that you'd like to load? If you set that, Ionide doesn't try to do any inference to find your setup - it just loads that solution/project explicitly.

@vzarytovskii is right that we don't support workspaces. We have a quite old issue about this that we need to solve, but to be honest I've never used them.

vzarytovskii commented 5 months ago

@MelbourneDeveloper can you try setting https://ionide.io/Editors/Code/options.html#fsharpworkspacepath to point specifically at your solution/project that you'd like to load? If you set that, Ionide doesn't try to do any inference to find your setup - it just loads that solution/project explicitly.

We do that explicitly for the FCS, works like a charm.

@vzarytovskii is right that we don't support workspaces. We have a quite old issue about this that we need to solve, but to be honest I've never used them.

Yeah, same, I tried once but found it quite distracting tbh, but we have a one language solution, so a different use-case perhaps.

MelbourneDeveloper commented 5 months ago

@MelbourneDeveloper can you try setting https://ionide.io/Editors/Code/options.html#fsharpworkspacepath to point specifically at your solution/project that you'd like to load? If you set that, Ionide doesn't try to do any inference to find your setup - it just loads that solution/project explicitly.

@vzarytovskii is right that we don't support workspaces. We have a quite old issue about this that we need to solve, but to be honest I've never used them.

I'm new to F#. I don't know what I'm doing. I just added an F# project to my solution and it didn't show up in VS Code. It adds to the frustration of onboarding into a new language. You just have to know how the tooling works to discover these issues.

MelbourneDeveloper commented 5 months ago

@MelbourneDeveloper can you try setting https://ionide.io/Editors/Code/options.html#fsharpworkspacepath to point specifically at your solution/project that you'd like to load? If you set that, Ionide doesn't try to do any inference to find your setup - it just loads that solution/project explicitly.

@vzarytovskii is right that we don't support workspaces. We have a quite old issue about this that we need to solve, but to be honest I've never used them.

I tried adding the setting here, but it didn't fix the issue:

{
    "extensions": {},
    "folders": [
        {
            "path": "client"
        },
        {
            "path": "shared"
        },
        {
            "path": "dotnet"
        }
    ],
    "settings": {
        "FSharp.workspacePath": "dotnet/PDFs.sln"
    }
}
baronfel commented 5 months ago

@MelbourneDeveloper can you try setting ionide.io/Editors/Code/options.html#fsharpworkspacepath to point specifically at your solution/project that you'd like to load? If you set that, Ionide doesn't try to do any inference to find your setup - it just loads that solution/project explicitly. @vzarytovskii is right that we don't support workspaces. We have a quite old issue about this that we need to solve, but to be honest I've never used them.

I'm new to F#. I don't know what I'm doing. I just added an F# project to my solution and it didn't show up in VS Code. It adds to the frustration of onboarding into a new language. You just have to know how the tooling works to discover these issues.

I know, and it sucks. I'm sorry. Ionide is completely OSS and community supported, however, so unless community members (or another maintainer) implement it that's what we have.