Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
c858314
Initial analysis fix
TIHan Mar 12, 2021
38822d2
Minor cleanup
TIHan Mar 12, 2021
641c086
Minor cleanup
TIHan Mar 12, 2021
7399456
Added re-analysis back in just for scripts
TIHan Mar 17, 2021
c7d1b4f
Added cacheStamp parameter to check file FCS APIs. Refactored FSharp.…
TIHan Mar 17, 2021
6d65484
Merge remote-tracking branch 'remote/main' into analysis-fix
TIHan Mar 17, 2021
adab61d
Fixing build
TIHan Mar 17, 2021
e1e4434
Fixing tests
TIHan Mar 18, 2021
d729592
Fixing tests
TIHan Mar 18, 2021
edf0cb1
Fixing build
TIHan Mar 18, 2021
3af59e6
Fixing tests
TIHan Mar 18, 2021
a70be9c
Fixing tests
TIHan Mar 19, 2021
0183a26
Trying to fix tests
TIHan Mar 19, 2021
c53322f
Force remove cache
TIHan Mar 19, 2021
163fbcb
Trying to fix test
TIHan Mar 19, 2021
d45e796
Trying to fix
TIHan Mar 19, 2021
9f92c0b
Updating test again
TIHan Mar 19, 2021
6eb5e1c
Still trying to fix tests
TIHan Mar 19, 2021
9df8808
Merge remote-tracking branch 'remote/main' into analysis-fix
TIHan Mar 19, 2021
3364dc2
Fixing build
TIHan Mar 19, 2021
895cf2d
Trying to fix tests
TIHan Mar 20, 2021
9064891
Passing filepath to creating a test document
TIHan Mar 20, 2021
c7d1561
fixing build
TIHan Mar 20, 2021
20c1313
Still trying to fix tests
TIHan Mar 20, 2021
57b34e3
Use SourceCodeKind.Regular
TIHan Mar 22, 2021
8cc0ca3
Fixing tests
TIHan Mar 22, 2021
4f886e0
Minor update to verify no errors
TIHan Mar 22, 2021
f902148
Creating version stamps with date times for tests
TIHan Mar 22, 2021
a4a0a11
still trying to fix tests
TIHan Mar 22, 2021
c9e7a47
Make projects unique in testing diagnostics
TIHan Mar 22, 2021
b9a1780
Trying to pass tests
TIHan Mar 22, 2021
a584404
This should fix the rest
TIHan Mar 22, 2021
657ea0e
Adding back original logic for GetCachedCheckFileResult when cacheSta…
TIHan Mar 23, 2021
f8ae29d
fixing tests
TIHan Mar 23, 2021
4e45d47
fixing tests
TIHan Mar 23, 2021
4672cd1
Got a CancellationTokenSource has been disposed in a VS test. Adding …
TIHan Mar 23, 2021
48cfe41
Fixing lock
TIHan Mar 23, 2021
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
25 changes: 12 additions & 13 deletions src/fsharp/service/IncrementalBuild.fs
Original file line number Diff line number Diff line change
Expand Up @@ -1079,6 +1079,14 @@ type IncrementalBuilder(tcGlobals,
return { state with finalizedBoundModel = Some result }, result
}

let tryGetSlot (state: IncrementalBuilderState) slot =
match state.boundModels.[slot] with
| Some boundModel ->
(boundModel, state.stampedFileNames.[slot])
|> Some
| _ ->
None

let tryGetBeforeSlot (state: IncrementalBuilderState) slot =
match slot with
| 0 (* first file *) ->
Expand All @@ -1089,12 +1097,7 @@ type IncrementalBuilder(tcGlobals,
| _ ->
None
| _ ->
match state.boundModels.[slot - 1] with
| Some boundModel ->
(boundModel, state.stampedFileNames.[slot - 1])
|> Some
| _ ->
None
tryGetSlot state (slot - 1)

let evalUpToTargetSlot state (cache: TimeStampCache) ctok targetSlot =
cancellable {
Expand Down Expand Up @@ -1192,13 +1195,6 @@ type IncrementalBuilder(tcGlobals,
match result with
| Some (boundModel, timestamp) -> Some (PartialCheckResults (boundModel, timestamp))
| _ -> None


member builder.AreCheckResultsBeforeFileInProjectReady filename =
let slotOfFile = builder.GetSlotOfFileName filename
match tryGetBeforeSlot currentState slotOfFile with
| Some _ -> true
| _ -> false

member builder.TryGetCheckResultsBeforeFileInProject (filename) =
let cache = TimeStampCache defaultTimeStamp
Expand All @@ -1211,6 +1207,9 @@ type IncrementalBuilder(tcGlobals,
| Some(boundModel, timestamp) -> PartialCheckResults(boundModel, timestamp) |> Some
| _ -> None

member builder.AreCheckResultsBeforeFileInProjectReady filename =
(builder.TryGetCheckResultsBeforeFileInProject filename).IsSome

member private _.GetCheckResultsBeforeSlotInProject (ctok: CompilationThreadToken, slotOfFile, enablePartialTypeChecking) =
cancellable {
let cache = TimeStampCache defaultTimeStamp
Expand Down
21 changes: 13 additions & 8 deletions src/fsharp/service/Reactor.fs
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ type Reactor() =
// so that when the reactor picks up a thread from the thread pool we can set the culture
let mutable culture = CultureInfo(CultureInfo.CurrentUICulture.Name)

let gate = obj()
let mutable bgOpCts = new CancellationTokenSource()

let sw = new System.Diagnostics.Stopwatch()
Expand Down Expand Up @@ -86,9 +87,11 @@ type Reactor() =
match bgOpOpt with
| None -> None
| Some (bgUserOpName, bgOpName, bgOpArg, bgOp) ->
let oldBgOpCts = bgOpCts
bgOpCts <- new CancellationTokenSource()
oldBgOpCts.Dispose()
lock gate (fun () ->
let oldBgOpCts = bgOpCts
bgOpCts <- new CancellationTokenSource()
oldBgOpCts.Dispose()
)
Some (bgUserOpName, bgOpName, bgOpArg, bgOp ctok)

//Trace.TraceInformation("Reactor: --> set background op, remaining {0}", inbox.CurrentQueueLength)
Expand All @@ -113,9 +116,11 @@ type Reactor() =
| None -> ()
| Some (bgUserOpName, bgOpName, bgOpArg, bgOp) ->
Trace.TraceInformation("Reactor: {0:n3} --> wait for background {1}.{2} ({3}), remaining {4}", DateTime.Now.TimeOfDay.TotalSeconds, bgUserOpName, bgOpName, bgOpArg, inbox.CurrentQueueLength)
let oldBgOpCts = bgOpCts
bgOpCts <- new CancellationTokenSource()
oldBgOpCts.Dispose()
lock gate (fun () ->
let oldBgOpCts = bgOpCts
bgOpCts <- new CancellationTokenSource()
oldBgOpCts.Dispose()
)

try
Eventually.force bgOpCts.Token bgOp |> ignore
Expand Down Expand Up @@ -179,12 +184,12 @@ type Reactor() =
// [Foreground Mailbox Accessors] -----------------------------------------------------------
member _.SetBackgroundOp(bgOpOpt) =
Trace.TraceInformation("Reactor: {0:n3} enqueue start background, length {1}", DateTime.Now.TimeOfDay.TotalSeconds, builder.CurrentQueueLength)
bgOpCts.Cancel()
lock gate (fun () -> bgOpCts.Cancel())
builder.Post(SetBackgroundOp bgOpOpt)

member _.CancelBackgroundOp() =
Trace.TraceInformation("FCS: trying to cancel any active background work")
bgOpCts.Cancel()
lock gate (fun () -> bgOpCts.Cancel())

member _.EnqueueOp(userOpName, opName, opArg, op) =
Trace.TraceInformation("Reactor: {0:n3} enqueue {1}.{2} ({3}), length {4}", DateTime.Now.TimeOfDay.TotalSeconds, userOpName, opName, opArg, builder.CurrentQueueLength)
Expand Down
Loading