-
-
Notifications
You must be signed in to change notification settings - Fork 282
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
[WIP] Allow selecting fsproj files into workspace #1955
base: main
Are you sure you want to change the base?
Conversation
@baronfel @TheAngryByrd This is still WIP but I wanted to check if this was a feature that would be accepted. The defaults would have to be rethough a bit since Ionide always loads the available sln file instead of prompting the user. I was also thinking about adding a new command for selecting multiple fsprojs, and then an configuration option that allows the user to set their default fsprojs. |
There's a lot of overlap here between an already-existing |
I thought about going the slnf route but the downside of that is that you also need to maintain an actual solution file which contains all the projects. The main motivator for me is to make it as frictionless as possible to open a repo and loading only the projects that you need for the work you are about to be doing. How I envisioned it is that a developer would do the following:
This workflow is really nice because you can configure your workspace without having to mess with any files at. |
There is also one other way to make the dev experience even easier and that would be:
This would be my ideal workflow but I think it's also quite a bit more complex to implement and that's why I went the route that is in the PR. If you think that lazy loading the projects like this would be possible then I think I'll have a go at it if you could point me in the right direction. |
I looked a bit into the lazy loading of projects and it seems like the main blocker for doing it is that we can't tell what fsproj an .fs file belongs to without calling |
No, there's no good way. In addition, our current mechanism is incomplete because the file could belong to multiple projects. |
In case you haven't seen it, slngen is some prior art in this space. |
WHAT
🤖 Generated by Copilot at be8ee10
This pull request adds support for single F# project files (
.fsproj
) as a possible workspace configuration. It updates various modules and types to handle this scenario in the workspace peek feature, the build task generation, and the solution explorer panel. It also adds support for directories as results of the workspace peek feature.🤖 Generated by Copilot at be8ee10
🛠️🌲📁
WHY
When working in a monorepo with multiple independent projects it is not feasible to load all the projects in the repository. This change allows the user to select the projects that they are working on and only load them.
HOW
🤖 Generated by Copilot at be8ee10
WorkspacePeekFound
type to include aFsproj
case for project files (link)mapFound
andparse
functions inLanguageService.fs
to handle theFsproj
case and return an array ofWorkspacePeekFound
values (link, link)getProjectsFromWorkspacePeek
andisLoadingWorkspaceComplete
functions inProject.fs
to handle theFsproj
case and return a list or an array of project file paths (link, link)ConfiguredWorkspace
type to include aFsproj
case for project files (link)private
function inProject.fs
to convert a string value into aConfiguredWorkspace
value if it ends with ".fsproj" (link)private
function inProject.fs
to check the validity of aConfiguredWorkspace
value if it is aFsproj
case (link)private
function inProject.fs
to return the path of aConfiguredWorkspace
value if it is aFsproj
case (link)setFromPeek
function inProject.fs
to convert aWorkspacePeekFound
value into aConfiguredWorkspace
value if it is aFsproj
case (link)equalPeek
function inProject.fs
to compare aConfiguredWorkspace
value and aWorkspacePeekFound
value if they are bothFsproj
cases (link)text
function inProject.fs
to create a quick pick item for the workspace selection panel if the workspace peek contains aFsproj
case (link)private
function inProject.fs
to return the priority of aWorkspacePeekFound
value for the workspace selection panel if it is aFsproj
case (link)buildTaskListForSolution
function inMSBuild.fs
to handle theFsproj
case and return an empty sequence of tasks (link)private
function inSolutionExplorer.fs
to handle theFsproj
case and create a tree node for the project file (link)WorkspacePeekFound
values to use thepickFSACWorkspace
function instead of preferring the solution file (link)private
function inProject.fs
to set the context and the status bar for the current workspace depending on the type of theConfiguredWorkspace
value (link)Project
inProject.fs
(link)