rubberduck-ai / rubberduck-vscode

Use AI-powered code edits, explanations, code generation, error diagnosis, and chat in Visual Studio Code with the official OpenAI API.
https://marketplace.visualstudio.com/items?itemName=Rubberduck.rubberduck-vscode
MIT License
582 stars 70 forks source link

Better error messages #46

Closed nicoespeon closed 1 year ago

nicoespeon commented 1 year ago

Closes #41

The main change is that "error" isn't a state anymore, but an optional attribute of a Conversation. That way, we can show the error at the bottom of the conversation instead of replacing the whole thing (after a few experimentations, it felt to be the best alternative)

Simple Error Detailed Error
simpler error error

The "Dismiss" button clears the error. For detailed errors, it's possible to disable the Dismiss button, the Retry button, or both. The layout will adapt.

no retry

I also made it possible for detailed errors to be "warnings". It makes more sense when you want to report something to the user, but there is no need to retry. For instance:

warning level

But I still don't have a strong opinion on this. Feel free to iterate on that. Same story for the design: I went for something that looks better, but is not too fancy. Feel free to make updates.

Other things:

I have only ported the "syntax highlight" error so far. But with the system in place, we will be able to port more!