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

Error number in VS and command line should match #1984

Merged
merged 1 commit into from
Dec 14, 2016
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
10 changes: 5 additions & 5 deletions src/fsharp/CompileOps.fs
Original file line number Diff line number Diff line change
Expand Up @@ -1537,17 +1537,17 @@ let CollectErrorOrWarning (implicitIncludeDir,showFullPaths,flattenErrors,errorS
| Some m -> Some(outputWhere (showFullPaths,errorStyle) m)
| None -> None

let OutputCanonicalInformation(err:PhasedError,subcategory, errorNumber) : CanonicalInformation =
let OutputCanonicalInformation(subcategory, errorNumber) : CanonicalInformation =
let text =
match errorStyle with
// Show the subcategory for --vserrors so that we can fish it out in Visual Studio and use it to determine error stickiness.
| ErrorStyle.VSErrors -> sprintf "%s %s FS%04d: " subcategory (if warn then "warning" else "error") errorNumber
| _ -> sprintf "%s FS%04d: " (if warn then "warning" else "error") (GetErrorNumber err)
| _ -> sprintf "%s FS%04d: " (if warn then "warning" else "error") errorNumber
{ ErrorNumber = errorNumber; Subcategory = subcategory; TextRepresentation = text}

let mainError,relatedErrors = SplitRelatedErrors err
let where = OutputWhere(mainError)
let canonical = OutputCanonicalInformation(mainError,err.Subcategory(),GetErrorNumber mainError)
let canonical = OutputCanonicalInformation(err.Subcategory(),GetErrorNumber mainError)
let message =
let os = System.Text.StringBuilder()
OutputPhasedError os mainError flattenErrors
Expand All @@ -1557,12 +1557,12 @@ let CollectErrorOrWarning (implicitIncludeDir,showFullPaths,flattenErrors,errorS

errors.Add ( ErrorOrWarning.Long( not warn, entry ) )

let OutputRelatedError(err) =
let OutputRelatedError(err:PhasedError) =
match errorStyle with
// Give a canonical string when --vserror.
| ErrorStyle.VSErrors ->
let relWhere = OutputWhere(mainError) // mainError?
let relCanonical = OutputCanonicalInformation(err, err.Subcategory(),GetErrorNumber mainError) // Use main error for code
let relCanonical = OutputCanonicalInformation(err.Subcategory(),GetErrorNumber mainError) // Use main error for code
let relMessage =
let os = System.Text.StringBuilder()
OutputPhasedError os err flattenErrors
Expand Down