Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 11 additions & 5 deletions src/Compiler/Service/IncrementalBuild.fs
Original file line number Diff line number Diff line change
Expand Up @@ -1058,11 +1058,17 @@ module IncrementalBuilderStateHelpers =
let rec createFinalizeBoundModelGraphNode (initialState: IncrementalBuilderInitialState) (boundModels: ImmutableArray<GraphNode<BoundModel>>.Builder) =
GraphNode(node {
use _ = Activity.start "GetCheckResultsAndImplementationsForProject" [|Activity.Tags.project, initialState.outfile|]
// Compute last bound model then get all the evaluated models.

// Compute last bound model then get all the evaluated models*.
let! _ = boundModels[boundModels.Count - 1].GetOrComputeValue()
let boundModels =
boundModels.ToImmutable()
|> ImmutableArray.map (fun x -> x.TryPeekValue().Value)
let! boundModels =
boundModels
|> Seq.map (fun x ->
match x.TryPeekValue() with
| ValueSome v -> node.Return v
// *Evaluating the last bound model doesn't always guarantee that all the other bound models are evaluated.
| _ -> node.ReturnFrom(x.GetOrComputeValue()))
|> NodeCode.Sequential

let! result =
FinalizeTypeCheckTask
Expand All @@ -1071,7 +1077,7 @@ module IncrementalBuilderStateHelpers =
initialState.enablePartialTypeChecking
initialState.assemblyName
initialState.outfile
boundModels
(boundModels.ToImmutableArray())
let result = (result, DateTime.UtcNow)
return result
})
Expand Down
2 changes: 1 addition & 1 deletion vsintegration/src/FSharp.Editor/Common/RoslynHelpers.fs
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ module internal RoslynHelpers =
| :? OperationCanceledException ->
tcs.TrySetCanceled(cancellationToken) |> ignore
| exn ->
System.Diagnostics.Trace.WriteLine("Visual F# Tools: exception swallowed and not passed to Roslyn: {0}", exn.Message)
System.Diagnostics.Trace.TraceError("Visual F# Tools: exception swallowed and not passed to Roslyn: {0}", exn)
let res = Unchecked.defaultof<_>
tcs.TrySetResult(res) |> ignore
),
Expand Down