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
1 change: 1 addition & 0 deletions docs/release-notes/.FSharp.Compiler.Service/9.0.300.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,6 @@

* FSharpCheckFileResults.ProjectContext.ProjectOptions will not be available when using the experimental Transparent Compiler feature. ([PR #18205](https://github.com/dotnet/fsharp/pull/18205))
* Update `Obsolete` attribute checking to account for `DiagnosticId` and `UrlFormat` properties. ([PR #18224](https://github.com/dotnet/fsharp/pull/18224))
* Remove `Cancellable.UsingToken` from tests ([PR #18276](https://github.com/dotnet/fsharp/pull/18276))

### Breaking Changes
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ let mutable private wasCancelled = false
let runCancelFirstTime f =
let mutable requestCount = 0
fun () ->
use _ = Cancellable.UsingToken cts.Token
if requestCount = 0 then
cts.Cancel()

Expand Down Expand Up @@ -150,12 +149,17 @@ let referenceReaderProject getPreTypeDefs (cancelOnModuleAccess: bool) (options:
let parseAndCheck path source options =
cts <- new CancellationTokenSource()
wasCancelled <- false
use _ = Cancellable.UsingToken cts.Token

try
match Async.RunSynchronously(checker.ParseAndCheckFileInProject(path, 0, SourceText.ofString source, options), cancellationToken = cts.Token) with
| fileResults, FSharpCheckFileAnswer.Aborted -> None
| fileResults, FSharpCheckFileAnswer.Succeeded results -> Some results
let checkFileAsync = checker.ParseAndCheckFileInProject(path, 0, SourceText.ofString source, options)
let result =
match Async.RunSynchronously(checkFileAsync, cancellationToken = cts.Token) with
| _, FSharpCheckFileAnswer.Aborted -> None
| _, FSharpCheckFileAnswer.Succeeded results -> Some results

Cancellable.HasCancellationToken |> shouldEqual false
result

with :? OperationCanceledException ->
wasCancelled <- true
None
Expand Down