Uh oh!
There was an error while loading. Please reload this page.
[WIP] In-Memory documents for FCS - #11588
Conversation
…t to ByteMemory when needed. Use FIleSystem shim from FSharpDocument, when opening file (both mmaped and bytearray).
@TIHan We've had some issues with VS tests trying to delete documents, I wonder if it's because we forget to release the initial viewstream or something. Edit: it's not failing locally and on CI anymore, maybe was just a temprorary CI hiccup? |
…nto in-memory-documents
…nto in-memory-documents
| /// </summary> | ||
| /// <param name="options">The options for the project or script, used to determine active --define conditionals and other options relevant to parsing.</param> | ||
| /// <param name="docs">FSharp documents</param> | ||
| member UpdateDocuments: options: FSharpProjectOptions * docs: FSharpDocument seq -> Async<unit> |
There was a problem hiding this comment.
Should rename this to: UpdateBackgroundDocuments
| FSharpChecker.Create( | ||
| projectCacheSize = settings.LanguageServicePerformance.ProjectCheckCacheSize, | ||
| keepAllBackgroundResolutions = false, | ||
| keepAllBackgroundResolutions = true, |
There was a problem hiding this comment.
This is temporarily 'true'. It will be 'false' once we figure out a way to enable background resolutions only for open documents.
| legacyReferenceResolver=LegacyMSBuildReferenceResolver.getResolver(), | ||
| tryGetMetadataSnapshot = tryGetMetadataSnapshot, | ||
| keepAllBackgroundSymbolUses = false, | ||
| keepAllBackgroundSymbolUses = true, |
There was a problem hiding this comment.
This is temporarily 'true'. It will be 'false' once we figure out a way to enable background resolutions only for open documents.
| let userOpName = defaultArg userOpName "Unknown" | ||
| backgroundCompiler.InvalidateConfiguration(options, userOpName) | ||
| member _.UpdateBackgroundDocuments(options: FSharpProjectOptions, docs) = |
There was a problem hiding this comment.
Looks like this can't be called concurrently, because underlying IncrementalBuilder setCurrentState
| member _.SourceFiles = sourceFiles |> List.map (fun (_, f, _) -> f) | ||
| member _.SourceFiles = mainState.sourceFiles |> Seq.map (fun (_, f, _) -> f) |> List.ofSeq | ||
| member this.UpdateDocuments(docs: FSharpDocument seq) = |
There was a problem hiding this comment.
If two calls are made concurrently, one setting docA, another docB, then the update to one will be lost
TIHan
commented
Oct 26, 2021
Closing as we favor this PR: #12305 |
@vzarytovskii and I started looking at this today.
Currently, FCS relies on the file system to be the source of truth for incremental builder.
This PR allows the user to update the F# document that incremental builder holds so we can effectively give incremental build the in-memory state from the IDE.
Acceptance Criteria
FSharpProjectsnapshot #11775 - a snapshot model will practically force in-memory documents to be implemented