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

Improve suggestion text clarity when printing ErrorWithSuggestion #4589

Open
JeffreyCA opened this issue Nov 25, 2024 · 0 comments
Open

Improve suggestion text clarity when printing ErrorWithSuggestion #4589

JeffreyCA opened this issue Nov 25, 2024 · 0 comments

Comments

@JeffreyCA
Copy link

JeffreyCA commented Nov 25, 2024

Originally posted by @ellismg in #4585 (comment):

One of the things that jumped out at me with them (which I don't think is a problem introduced by this PR) is that the suggestion text is sort of hard to find, especially with the large amount of red text before.

In a future PR we might want to introduce some whitespace (and maybe some color?) to help it pop a little more - just my two cents.

The place where this happens is in:

if errors.As(err, &suggestionErr) {
m.console.Message(ctx, suggestionErr.Suggestion)
}

I think to customize this we could use one of the pre-defined text formats in colors.go or possibly define a new format for error suggestions:

Current

Image

With newline

Image

Bold

Image

Italics

Image

Underline

Image

Warning

Image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant