-
Notifications
You must be signed in to change notification settings - Fork 24
Follow-up to the fields added in #173, and add Problem#rendered #175
Conversation
It turns out that there is more boilerplate to fill that I missed. Also add deprecation notices.
@eed3si9n This PR contains 494f384 which is part of the https://github.com/sbt/util/tree/v1.2.1 tag but seems to be missing from the https://github.com/sbt/util/tree/1.2.x branch. |
*/ | ||
default Optional<String> rendered() { return Optional.empty(); } | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you also add the excellent commit message as documentation here? It explains pretty good why this field is necessary and how it differs from message.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Which part of the commit message exactly? I've tried to keep the comment generic enough since the implementation may change.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This new addition makes sense, good job.
Dotty has its own logic for displaying problems with the proper file path, position, and caret, but if we store this information in Problem#message we end up with duplicated information in the output since Zinc will prepend/append similar things (see sbt.internal.inc.ProblemStringFormats). So far, we worked around this in Dotty by using an empty position in the sbt bridge reporter, but this means that crucial semantic information that could be used by a Build Server Protocol implementation and other tools is lost. This commit allows us to avoid by adding an optional `rendered` field to `Problem`: when this field is set, its value controls what the user sees, otherwise we fallback to the default behavior (the logic to do this will be added to Zinc after this PR is merged and a new release of sbt-util is made).
18269e6
to
15522a0
Compare
See sbt/util#175 for more information.
A validation involving this pull request is in progress... |
This comment has been minimized.
This comment has been minimized.
See sbt/util#175 for more information.
This comment has been minimized.
This comment has been minimized.
The formatting was added in #174. I forgot to merge it. |
And bump util to 1.2.2 to include sbt/util#175
And bump util to 1.2.2 to include sbt/util#175
And bump util to 1.2.2 to include sbt/util#175
No description provided.