Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit17d153e

Browse files
Vasily KirichenkoVasily Kirichenko
Vasily Kirichenko
authored and
Vasily Kirichenko
committed
remove CancellationToken from repeatedlyProgressUntilDoneOrTimeShareOver(OrCanceled)
remove explicit CancellationToken from forceAsync
1 parentfd99c76 commit17d153e

File tree

3 files changed

+7
-19
lines changed

3 files changed

+7
-19
lines changed

‎src/absil/illib.fs‎

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -521,7 +521,7 @@ module Eventually =
521521

522522
/// Keep running the computation bit by bit until a time limit is reached.
523523
/// The runner gets called each time the computation is restarted
524-
letrepeatedlyProgressUntilDoneOrTimeShareOverOrCanceled timeShareInMilliseconds(cancellationToken:CancellationToken)runner e=
524+
letrepeatedlyProgressUntilDoneOrTimeShareOver timeShareInMilliseconds runner e=
525525
letsw=new System.Diagnostics.Stopwatch()
526526
let recrunTimeShare e=
527527
runner(fun()->
@@ -531,24 +531,22 @@ module Eventually =
531531
match ewith
532532
| Done_-> e
533533
| NotYetDone work->
534-
ifcancellationToken.IsCancellationRequested||sw.ElapsedMilliseconds> timeShareInMillisecondsthen
534+
if sw.ElapsedMilliseconds> timeShareInMillisecondsthen
535535
sw.Stop();
536536
NotYetDone(fun()-> runTimeShare e)
537537
else
538538
loop(work())
539539
loop(e))
540540
runTimeShare e
541541

542-
letforceAsync(cancellationToken:CancellationToken)(executor:(unit-> Eventually<'T>)->Async<Eventually<'T>>)(e:Eventually<'T>):Async<'Toption>=
542+
letforceAsync(runner:(unit-> Eventually<'T>)->Async<Eventually<'T>>)(e:Eventually<'T>):Async<'Toption>=
543543
let recloop(e:Eventually<'T>)=
544544
async{
545545
match ewith
546546
| Done x->return Some x
547547
| NotYetDone work->
548-
if cancellationToken.IsCancellationRequestedthenreturn None
549-
else
550-
let!r= executor work
551-
return! loop r
548+
let!r= runner work
549+
return! loop r
552550
}
553551
loop e
554552

‎src/fsharp/vs/IncrementalBuild.fs‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1497,9 +1497,8 @@ type IncrementalBuilder(frameworkTcImportsCache: FrameworkImportsCache, tcConfig
14971497
if ensureReactivethen
14981498
lettimeSlicedComputation=
14991499
fullComputation|>
1500-
Eventually.repeatedlyProgressUntilDoneOrTimeShareOverOrCanceled
1500+
Eventually.repeatedlyProgressUntilDoneOrTimeShareOver
15011501
maxTimeShareMilliseconds
1502-
CancellationToken.None
15031502
(fun f->
15041503
// Reinstall the compilation globals each time we start or restart
15051504
use unwind=new CompilationGlobalsScope(errorLogger, BuildPhase.TypeCheck, projectDirectory)

‎src/fsharp/vs/service.fs‎

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1643,7 +1643,6 @@ module internal Parser =
16431643

16441644
// Run the type checker...
16451645
| Some parsedMainInput->
1646-
let!cancellationToken= Async.CancellationToken
16471646
// Initialize the error handler
16481647
leterrHandler=new ErrorHandler(true, mainInputFileName, tcConfig, source)
16491648

@@ -1730,22 +1729,14 @@ module internal Parser =
17301729
letcheckForErrors()=(parseResults.ParseHadErrors|| errHandler.ErrorCount>0)
17311730
// Typecheck is potentially a long running operation. We chop it up here with an Eventually continuation and, at each slice, give a chance
17321731
// for the client to claim the result as obsolete and have the typecheck abort.
1733-
//let computation = TypeCheckOneInputAndFinishEventually(checkForErrors,tcConfig, tcImports, tcGlobals, None, TcResultsSink.WithSink sink, tcState, parsedMainInput)
1734-
//match computation |> Eventually.forceWhile (fun () -> not cancellationToken.IsCancellationRequested) with
1735-
//| Some((tcEnvAtEnd,_,typedImplFiles),tcState) -> Some (tcEnvAtEnd, typedImplFiles, tcState)
1736-
//| None -> None // Means 'aborted'
17371732
letprojectDir= Path.GetDirectoryName(projectFileName)
17381733
letcapturingErrorLogger= CompilationErrorLogger("TypeCheckOneFile", tcConfig)
17391734
leterrorLogger= GetErrorLoggerFilteringByScopedPragmas(false,GetScopedPragmasForInput(parsedMainInput), capturingErrorLogger)
17401735

17411736
let!result=
17421737
TypeCheckOneInputAndFinishEventually(checkForErrors,tcConfig, tcImports, tcGlobals, None, TcResultsSink.WithSink sink, tcState, parsedMainInput)
1743-
|> Eventually.repeatedlyProgressUntilDoneOrTimeShareOverOrCanceled
1744-
50L
1745-
cancellationToken
1746-
(fun f-> f())
1738+
|> Eventually.repeatedlyProgressUntilDoneOrTimeShareOver50L(fun f-> f())
17471739
|> Eventually.forceAsync
1748-
cancellationToken
17491740
(fun(work: unit-> Eventually<_>)->
17501741
reactorOps.EnqueueAndAwaitOpAsync("TypeCheckOneFile",
17511742
fun _->

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp