Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix error logging in brace matching code #4140

Merged
merged 2 commits into from
Jan 15, 2018
Merged
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
6 changes: 6 additions & 0 deletions src/fsharp/service/service.fs
Original file line number Diff line number Diff line change
Expand Up @@ -1521,6 +1521,12 @@ module internal Parser =

let matchBraces(source, fileName, options: FSharpParsingOptions, userOpName: string) =
Trace.TraceInformation("FCS: {0}.{1} ({2})", userOpName, "matchBraces", fileName)

// Make sure there is an ErrorLogger installed whenever we do stuff that might record errors, even if we ultimately ignore the errors
let delayedLogger = CapturingErrorLogger("matchBraces")
use _unwindEL = PushErrorLoggerPhaseUntilUnwind (fun _ -> delayedLogger)
use _unwindBP = PushThreadBuildPhaseUntilUnwind BuildPhase.Parse

let matchingBraces = new ResizeArray<_>()
Lexhelp.usingLexbufForParsing(UnicodeLexing.StringAsLexbuf(addNewLine source), fileName) (fun lexbuf ->
let errHandler = ErrorHandler(false, fileName, options.ErrorSeverityOptions, source)
Expand Down