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

Every explanation is printed twice with -explain and sbt #18774

Closed
mrdziuban opened this issue Oct 27, 2023 · 4 comments · Fixed by #18779
Closed

Every explanation is printed twice with -explain and sbt #18774

mrdziuban opened this issue Oct 27, 2023 · 4 comments · Fixed by #18779

Comments

@mrdziuban
Copy link

Compiler version

3.3.1

Minimized code

I'm not sure if this is an issue with Scala or sbt, so please let me know if I should open an issue with sbt instead!

https://github.com/mrdziuban/dotty-explain-issue

val test = nonExistent

Output

[error] -- [E006] Not Found Error: /Users/matt/dotty-explain-test/src/main/scala/example/Test.scala:3:11
[error] 3 |val test = nonExistent
[error]   |           ^^^^^^^^^^^
[error]   |           Not found: nonExistent
[error]   |-----------------------------------------------------------------------------
[error]   | Explanation (enabled by `-explain`)
[error]   |- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
[error]   | The identifier for `nonExistent` is not bound, that is,
[error]   | no declaration for this identifier can be found.
[error]   | That can happen, for example, if `nonExistent` or its declaration has either been
[error]   | misspelt or if an import is missing.
[error]    -----------------------------------------------------------------------------
[error] Explanation
[error] ===========
[error] The identifier for `nonExistent` is not bound, that is,
[error] no declaration for this identifier can be found.
[error] That can happen, for example, if `nonExistent` or its declaration has either been
[error] misspelt or if an import is missing.

Expectation

The explanation should only be printed once

@mrdziuban mrdziuban added itype:bug stat:needs triage Every issue needs to have an "area" and "itype" label labels Oct 27, 2023
@som-snytt
Copy link
Contributor

I have to repeat everything to my teenager, and more than twice. They should just call this parent mode.

@som-snytt
Copy link
Contributor

There are a couple of dimensions of freedom -- a previous improvement plus something for metals -- but I think the improvement to render the explanation with the message is preferable to the old big blue explanations header, which is presumptively deprecated.

I don't know how to test if whatever API for metals is satisfied!

@nicolasstucki nicolasstucki added area:sbt-bridge area:tooling and removed stat:needs triage Every issue needs to have an "area" and "itype" label labels Oct 30, 2023
@mrdziuban
Copy link
Author

Not 100% sure if scastie uses metals (I think it does?), but for what it's worth, it only shows the explanation with the blue header

image

@som-snytt
Copy link
Contributor

I see I accidentally deprecated the blue explanation; I'll revert that part.

I did not drill thru the API, but Problem distinguishes message and optional rendered, where message gets the blue explanation and rendered gets the boxed explanation. If clients are happy with this division or duplication of labor, then that seems fine to me.

nicolasstucki added a commit that referenced this issue Nov 15, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants