Skip to content
This repository was archived by the owner on Jun 10, 2020. It is now read-only.

Follow-up to the fields added in #173, and add Problem#rendered #175

Merged
merged 4 commits into from
Aug 29, 2018

Conversation

smarter
Copy link
Contributor

@smarter smarter commented Aug 27, 2018

No description provided.

eed3si9n and others added 3 commits August 16, 2018 16:36
It turns out that there is more boilerplate to fill that I missed.

Also add deprecation notices.
@smarter
Copy link
Contributor Author

smarter commented Aug 27, 2018

@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(); }
}
Copy link

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.

Copy link
Contributor Author

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.

Copy link
Member

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).
smarter added a commit to smarter/zinc that referenced this pull request Aug 28, 2018
@typesafe-tools
Copy link

A validation involving this pull request is in progress...

@typesafe-tools

This comment has been minimized.

smarter added a commit to smarter/zinc that referenced this pull request Aug 28, 2018
@smarter

This comment has been minimized.

@eed3si9n
Copy link
Member

The formatting was added in #174. I forgot to merge it.

@eed3si9n eed3si9n merged commit 94cb6bf into sbt:1.2.x Aug 29, 2018
smarter added a commit to smarter/zinc that referenced this pull request Aug 30, 2018
smarter added a commit to smarter/zinc that referenced this pull request Aug 30, 2018
jvican pushed a commit to scalacenter/zinc that referenced this pull request Dec 15, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants