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

WIP

0f51003
Select commit
Loading
Failed to load commit list.
Open

[WIP] Lazy load projects #1957

WIP
0f51003
Select commit
Loading
Failed to load commit list.
Deleted GitHub App / Copilot for PRs succeeded Nov 3, 2023 in 1m 13s

Analysis complete

Summary

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.

Walkthrough

  • 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)

Poem

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

Emoji

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

Include these descriptions in your pull request description by including the following marker tags:

  • copilot:all: all the content, in one go
  • copilot:summary: a one paragraph summary of the code changes
  • copilot:walkthrough: a step by step walkthrough of the code changes
  • copilot:poem: a poem about the code changes!
  • copilot:emoji: three emoji that capture the changes

Feedback is welcome. Simply add a comment to this PR of the form /copilot feedback [your comments here].

Details

Copilot for PRs is a limited technical preview from GitHub Next.

It's aim is to make it easier to write pull request descriptions by providing automatically generated suggestions based on the code changes.

To find out more go to https://githubnext.com/projects/copilot-for-pull-requests or come and chat with us on Discord

Progress:

File Status Duration
Summary & Walkthrough βœ… Finished 69.2 seconds
release/package.json βœ… Finished 50.2 seconds
src/Components/MSBuild.fs βœ… Finished 48.5 seconds
src/Components/SolutionExplorer.fs βœ… Finished 50.3 seconds
src/Core/DTO.fs βœ… Finished 50.3 seconds
src/Core/Project.fs βœ… Finished 54 seconds
src/fsharp.fs βœ… Finished 48.5 seconds