Skip to content
Merged
Changes from 1 commit
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
Prev Previous commit
Next Next commit
Address merge issues
  • Loading branch information
Kevin Ransom committed Jun 21, 2018
commit 1225c3e7cc4d8e73b39462c7d07e2d8c671ba2f4
Original file line number Diff line number Diff line change
Expand Up @@ -20,16 +20,17 @@ type FSharpChecker with
checker.ParseDocument(document, parsingOptions, sourceText=sourceText.ToString(), userOpName=userOpName)

member checker.ParseAndCheckDocument(filePath: string, textVersionHash: int, sourceText: string, options: FSharpProjectOptions, allowStaleResults: bool, userOpName: string) =
let parseAndCheckFile =
async {
let! parseResults, checkFileAnswer = checker.ParseAndCheckFileInProject(filePath, textVersionHash, sourceText, options, userOpName=userOpName)
return
match checkFileAnswer with
| FSharpCheckFileAnswer.Aborted ->
None
| FSharpCheckFileAnswer.Succeeded(checkFileResults) ->
Some (parseResults, checkFileResults)
}
async {
let parseAndCheckFile =
async {
let! parseResults, checkFileAnswer = checker.ParseAndCheckFileInProject(filePath, textVersionHash, sourceText, options, userOpName=userOpName)
return
match checkFileAnswer with
| FSharpCheckFileAnswer.Aborted ->
None
| FSharpCheckFileAnswer.Succeeded(checkFileResults) ->
Some (parseResults, checkFileResults)
}

let tryGetFreshResultsWithTimeout() =
async {
Expand All @@ -40,16 +41,15 @@ type FSharpChecker with
return None // worker is cancelled at this point, we cannot return it and wait its completion anymore
}

let bindParsedInput(results: (FSharpParseFileResults * FSharpCheckFileResults) option) =
match results with
| Some(parseResults, checkResults) ->
match parseResults.ParseTree with
| Some parsedInput -> Some (parseResults, parsedInput, checkResults)
let bindParsedInput(results: (FSharpParseFileResults * FSharpCheckFileResults) option) =
match results with
| Some(parseResults, checkResults) ->
match parseResults.ParseTree with
| Some parsedInput -> Some (parseResults, parsedInput, checkResults)
| None -> None
| None -> None
| None -> None

if allowStaleResults then
async {
if allowStaleResults then
let! freshResults = tryGetFreshResultsWithTimeout()

let! results =
Expand All @@ -69,7 +69,6 @@ type FSharpChecker with
return bindParsedInput results
}


member checker.ParseAndCheckDocument(document: Document, options: FSharpProjectOptions, allowStaleResults: bool, userOpName: string, ?sourceText: SourceText) =
async {
let! cancellationToken = Async.CancellationToken
Expand Down