ruff server: Important errors are now shown as popups#10951
Conversation
fac5576 to
6e0b6ca
Compare
MichaReiser
left a comment
There was a problem hiding this comment.
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
MichaReiser
left a comment
There was a problem hiding this comment.
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/showMessageLSP 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 rundefinition incrates/ruff_server/src/server/api/requests/execute_command.rs:Then, try running a command like
Ruff: Format documentfrom the command palette (Ctrl/Cmd+Shift+P). You should see the following messages appear: