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

Display error messages based on the transformed positions when source mapping is perfomed #1082

Merged
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
Original file line number Diff line number Diff line change
Expand Up @@ -129,12 +129,16 @@ class LoggedReporter(
(problem0.category, problem0.position, problem0.message, problem0.severity, problem0.rendered)
// Note: positions in reported errors can be fixed with `sourcePositionMapper`.
val transformedPos: Position = sourcePositionMapper(position)
val transformed = transformedPos.sourceFile != position.sourceFile
val problem = InterfaceUtil.problem(
category,
transformedPos,
message,
severity,
InterfaceUtil.jo2o(rendered)
// When the source mapping is performed,
// the information based on the `transformedPos` should be displayed
// even if the `rendered` is defined.
if (transformed) None else InterfaceUtil.jo2o(rendered)
)
allProblems += problem0
severity match {
Expand Down