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

Commitfa5cdf0

Browse files
vasily-kirichenkoKevinRansom
authored andcommitted
fix ParseAndCheckDocument (dotnet#5175)
1 parent582b967 commitfa5cdf0

File tree

1 file changed

+9
-15
lines changed

1 file changed

+9
-15
lines changed

‎vsintegration/src/FSharp.Editor/LanguageService/FSharpCheckerExtensions.fs‎

Lines changed: 9 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,6 @@ open Microsoft.FSharp.Compiler
99
openMicrosoft.FSharp.Compiler.Ast
1010
openMicrosoft.FSharp.Compiler.SourceCodeServices
1111

12-
typeCheckResults=
13-
| Readyof(FSharpParseFileResults*FSharpCheckFileResults)option
14-
| StillRunningofAsync<(FSharpParseFileResults*FSharpCheckFileResults)option>
15-
1612
typeFSharpCheckerwith
1713
memberchecker.ParseDocument(document:Document,parsingOptions:FSharpParsingOptions,sourceText:string,userOpName:string)=
1814
asyncMaybe{
@@ -36,15 +32,13 @@ type FSharpChecker with
3632
Some(parseResults, checkFileResults)
3733
}
3834

39-
let!worker= Async.StartChild(parseAndCheckFile, millisecondsTimeout=Settings.LanguageServicePerformance.TimeUntilStaleCompletion)
40-
41-
lettryGetFreshResultsWithTimeout():Async<CheckResults>=
35+
lettryGetFreshResultsWithTimeout()=
4236
async{
37+
let!worker= Async.StartChild(parseAndCheckFile, millisecondsTimeout=Settings.LanguageServicePerformance.TimeUntilStaleCompletion)
4338
try
44-
let!result= worker
45-
return Ready result
39+
return! worker
4640
with:? TimeoutException->
47-
returnStillRunningworker
41+
returnNone//worker is cancelled at this point, we cannot return it and wait its completion anymore
4842
}
4943

5044
letbindParsedInput(results:(FSharpParseFileResults* FSharpCheckFileResults)option)=
@@ -60,19 +54,19 @@ type FSharpChecker with
6054

6155
let!results=
6256
match freshResultswith
63-
|Ready x-> async.Returnx
64-
|StillRunning worker->
57+
|Some x-> async.Return(Some x)
58+
|None->
6559
async{
6660
match checker.TryGetRecentCheckResultsForFile(filePath, options)with
6761
| Some(parseResults, checkFileResults,_)->
6862
return Some(parseResults, checkFileResults)
6963
| None->
70-
return!worker
64+
return!parseAndCheckFile
7165
}
7266
return bindParsedInput results
7367
else
74-
let!res=worker
75-
return bindParsedInputres
68+
let!results=parseAndCheckFile
69+
return bindParsedInputresults
7670
}
7771

7872

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp