-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
ruff server
: Important errors are now shown as popups
#10951
Conversation
fac5576
to
6e0b6ca
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Having to call both tracing::error
and show_err_msg!
is a bit verbose but I could see why it is needed. I think my main challenge as a developer would be is to know where I need to use what (not all tracing sides have a show_err_msg
call but all show_err_msg
calls have a tracing::error
call).
|
f0837b3
to
6cec603
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The code looks good.
To me it's still unclear when to use show_err_msg
and tracing:error and why/when I need to use both
Having to call both tracing::error and show_err_msg! is a bit verbose but I could see why it is needed. I think my main challenge as a developer would be is to know where I need to use what (not all tracing sides have a show_err_msg call but all show_err_msg calls have a tracing::error call).
Not all errors need to be surfaced to the user as visibly as a popup, which is why only some of the error logs also show a message to the user. |
d2b1045
to
11c9136
Compare
Summary
Fixes #10866.
Introduces the
show_err_msg!
macro which will send a message to be shown as a popup to the client via thewindow/showMessage
LSP method.Test Plan
Insert various
show_err_msg!
calls in common code paths (for example, at the beginning ofevent_loop
) and confirm that these messages appear in your editor.To test that panicking works correctly, add this to the top of the
fn run
definition incrates/ruff_server/src/server/api/requests/execute_command.rs
:Then, try running a command like
Ruff: Format document
from the command palette (Ctrl/Cmd+Shift+P
). You should see the following messages appear: