Skip to content

Commit

Permalink
restore use of CheckFileInProjectAllowingStaleCachedResults
Browse files Browse the repository at this point in the history
  • Loading branch information
dsyme authored and dsyme committed Oct 2, 2017
1 parent 2f3298c commit e0b2a13
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 6 deletions.
10 changes: 7 additions & 3 deletions vsintegration/src/FSharp.LanguageService/BackgroundRequests.fs
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@ open Microsoft.VisualStudio.Shell.Interop
open Microsoft.FSharp.Compiler
open Microsoft.FSharp.Compiler.SourceCodeServices


#nowarn "44" // use of obsolete CheckFileInProjectAllowingStaleCachedResults

//
// Note: DEPRECATED CODE ONLY ACTIVE IN UNIT TESTING VIA "UNROSLYNIZED" UNIT TESTS.
//
Expand Down Expand Up @@ -191,11 +194,12 @@ type internal FSharpLanguageServiceBackgroundRequests_DEPRECATED

// Type-checking
let typedResults,aborted =
match interactiveChecker.CheckFileInProject(parseResults,req.FileName,req.Timestamp,req.Text,checkOptions,req.Snapshot) |> Async.RunSynchronously with
| FSharpCheckFileAnswer.Aborted ->
match interactiveChecker.CheckFileInProjectAllowingStaleCachedResults(parseResults,req.FileName,req.Timestamp,req.Text,checkOptions,req.Snapshot) |> Async.RunSynchronously with
| None -> None,false
| Some FSharpCheckFileAnswer.Aborted ->
// isResultObsolete returned true during the type check.
None,true
| FSharpCheckFileAnswer.Succeeded results -> Some results, false
| Some (FSharpCheckFileAnswer.Succeeded results) -> Some results, false

sr := None
parseResults,typedResults,true,aborted,req.Timestamp
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4349,9 +4349,9 @@ let x = query { for bbbb in abbbbc(*D0*) do
"()"])
let file = OpenFile(project, "file1.fs")
MoveCursorToEndOfMarker(file,"System.Deployment.Application.")
//let completions = AutoCompleteAtCursor(file)
// // printf "Completions=%A\n" completions
//Assert.AreEqual(0, completions.Length) // Expect none here because reference hasn't been added.
let completions = AutoCompleteAtCursor(file)
// printf "Completions=%A\n" completions
Assert.AreEqual(0, completions.Length) // Expect none here because reference hasn't been added.

// Now, add a reference to the given assembly.
this.AddAssemblyReference(project,"System.Deployment")
Expand Down

0 comments on commit e0b2a13

Please sign in to comment.