Open purkhusid opened 8 months ago
@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: https://github.com/fsharp/FsAutoComplete/pull/1191 https://github.com/ionide/proj-info/pull/198
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.
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
, andfsharp
, and a new option inpackage.json
.🤖 Generated by Copilot at 0f51003
🚀🌲🛠️
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
FSharp.lazyLoadWorkspace
to enable lazy loading of F# projects in the workspace (link)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)Project
module to take anExtensionContext
parameter in theinitWorkspace
andinitWorkspaceHelper
functions, which is needed to register the event handler for opening F# files (link, link, link)DTO
module to add a new record typeWorkspacePeekFsproj
, which represents an F# project file with its compile items, and change theWorkspacePeekFound.Directory
type to contain an array ofWorkspacePeekFsproj
records instead of strings (link, link)Project
module to map theWorkspacePeekFsproj
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)SolutionExplorer
andfsharp
modules to pass theExtensionContext
parameter to theProject.initWorkspace
function, which now requires it as part of the lazy loading feature (link, link, link)SolutionExplorer
module to take a string parameter instead of aWorkspacePeekFsproj
record in thegetProjItem
function, which is used to create the solution explorer tree (link)release/package.json
file (link)