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

Allow spans in help to provide structured suggestions #241

Open
LukeMathWalker opened this issue Mar 2, 2023 · 3 comments
Open

Allow spans in help to provide structured suggestions #241

LukeMathWalker opened this issue Mar 2, 2023 · 3 comments
Labels
enhancement New feature or request

Comments

@LukeMathWalker
Copy link
Contributor

LukeMathWalker commented Mar 2, 2023

Depending on the failure mode, it may be possible to suggest a fix to the user.
In those cases, it'd very nice to be able to show them a PR-like code suggestion - what to remove and/or what to add with respect to a span pointing at their code.

The precedent I'm looking at here is Rust's suggestion machinery (here).

Going with a practical example:
image

I'd love for that code snippet in help to be rendered using the same style of the code snippets above, with ::<GenericType> in green to stress that it's an addition.

Is this a usecase you'd be interested to support?

@zkat
Copy link
Owner

zkat commented Mar 2, 2023

how do you feel about using the Advice diagnostic level for this, actually? That's what it was originally meant for, after all.

@LukeMathWalker
Copy link
Contributor Author

LukeMathWalker commented Mar 3, 2023

That could definitely work! I hadn't realised there was an Advice severity level 😅
I'll experiment and report back.

@zkat zkat added the enhancement New feature or request label Mar 6, 2023
@zkat
Copy link
Owner

zkat commented Mar 30, 2023

@LukeMathWalker how did your experiment go?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants