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

[WIP] Lazy load projects #1957

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

purkhusid
Copy link
Contributor

@purkhusid purkhusid commented Nov 3, 2023

WHAT

πŸ€– Generated by Copilot at 0f51003

This pull request adds a new feature for Ionide that allows users to enable or disable lazy loading of F# projects in the workspace. Lazy loading improves the performance and memory usage of Ionide when working with large or complex solutions by loading the projects on demand when opening F# files. The feature involves changes in several modules, such as Project, SolutionExplorer, DTO, MSBuild, and fsharp, and a new option in package.json.

πŸ€– Generated by Copilot at 0f51003

Oh, we're the coders of Ionide, and we work on F# all day
We load the projects lazily, to save some memory
We pass the ExtensionContext to the initWorkspace function
And we heave ho, on the count of three, to update the WorkspacePeek junction

πŸš€πŸŒ²πŸ› οΈ

WHY

This is a WIP PR to see if it's possible to lazy load projects to make Ionide a bit nicer to use in large repositories

HOW

πŸ€– Generated by Copilot at 0f51003

  • Add a new configuration option FSharp.lazyLoadWorkspace to enable lazy loading of F# projects in the workspace (link)
  • Modify the Project module to implement the lazy loading feature, which loads the corresponding project on demand when opening an F# file, instead of loading all the projects in the workspace at once (link, link)
  • Modify the Project module to take an ExtensionContext parameter in the initWorkspace and initWorkspaceHelper functions, which is needed to register the event handler for opening F# files (link, link, link)
  • Modify the DTO module to add a new record type WorkspacePeekFsproj, which represents an F# project file with its compile items, and change the WorkspacePeekFound.Directory type to contain an array of WorkspacePeekFsproj records instead of strings (link, link)
  • Modify the Project module to map the WorkspacePeekFsproj records to strings or tuples of project file paths and compile items, as needed by the existing functions that return or take lists or arrays of project file paths (link, link, link, link)
  • Modify the SolutionExplorer and fsharp modules to pass the ExtensionContext parameter to the Project.initWorkspace function, which now requires it as part of the lazy loading feature (link, link, link)
  • Modify the SolutionExplorer module to take a string parameter instead of a WorkspacePeekFsproj record in the getProjItem function, which is used to create the solution explorer tree (link)
  • Remove a trailing whitespace from the end of the release/package.json file (link)

@purkhusid
Copy link
Contributor Author

@baronfel @TheAngryByrd This is an proof of concept of lazy loading projects as the end user opens up .fs files. The FSAC and proj-info parts can be found here:
ionide/FsAutoComplete#1191
ionide/proj-info#198

@purkhusid
Copy link
Contributor Author

I tried out this solution on our internal monorepo and it worked pretty well. There is a lot of stuff missing from this proof of concept but I just wanted to get some feedback before I spend too much time on this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant