ionide / FsAutoComplete

F# language server using Language Server Protocol
Other
409 stars 154 forks source link

Use msbuild evaluation to drive some views (like Solution Explorer) #1066

Open TheAngryByrd opened 1 year ago

TheAngryByrd commented 1 year ago

While discussing an issue on FSharp.Formatting. @baronfel brought up

the act of loading the project file is evaluation, and after evaluation you have access to all properties that are statically-known (including those delivered by SDKs)

Currently in AdaptiveLSPServer, we do a full reload on changes to the project files, so say changing file order in ionide, This would require a reload for the view to refresh. For smaller projects this may not be noticeable but for for larger projects it feels laggy. Perhaps we could drive some of these views from an "evaluated" project file. References might disappear or maybe we can have some type of delta/merge logics so it doesn't look laggy.

TheAngryByrd commented 1 year ago

Example of slow moving file: Moving-file-slow

baronfel commented 1 year ago

Here's a model of the interactions here to discuss tomorrow:

sequenceDiagram
    actor User
    participant Ionide
    participant FSAC
    participant ProjectSystem
    participant MSBuild

    User->>Ionide: Add file to project
    Ionide->>FSAC: fsproj/addFile
    FSAC->>FSAC: modifies project file directly
    ProjectSystem->>MSBuild: evaluate project file with changes
    MSBuild->>ProjectSystem: send MSBuild evaluation results
    ProjectSystem->>FSAC: send updated project information
    FSAC->>Ionide: send 'project loaded' notification
    Ionide->>Ionide: update solution explorer with new project file list