ruff/crates/ruff_server/src
Dhruv Manilawala e6e09ea93a
Avoid syntax error notification for source code actions (#12148)
## Summary

This PR avoids the error notification if a user selects the source code
actions and there's a syntax error in the source.

Before https://github.com/astral-sh/ruff/pull/12134, the change would've
been different. But that PR disables generating fixes if there's a
syntax error. This means that we can return an empty map instead as
there won't be any fixes in the diagnostics returned by the `lint_fix`
function.

For reference, following are the screenshot as on `main` with the error:

**VS Code:**

<img width="1715" alt="Screenshot 2024-07-02 at 16 39 59"
src="62f3e99b-0b0c-4608-84a2-26aeabcc6933">

**Neovim:**

<img width="1717" alt="Screenshot 2024-07-02 at 16 38 50"
src="5d637c36-d7f8-4a3b-8011-9a89708919a8">

fixes: #11931

## Test Plan

Considering the following code snippet where there are two diagnostics
(syntax error and useless semicolon `E703`):
```py
x;

y =
```

### VS Code


943537fc-ed8d-448d-8a36-1e34536c4f3e

### Neovim


4e6f3372-6e5b-4380-8919-6221066efd5b
2024-07-04 09:37:16 +05:30
..
edit Fix replacement edit range computation (#12171) 2024-07-04 09:24:07 +05:30
server Add server config to filter out syntax error diagnostics (#12059) 2024-06-27 13:44:11 +02:00
session Add server config to filter out syntax error diagnostics (#12059) 2024-06-27 13:44:11 +02:00
edit.rs Add Jupyter Notebook document change snapshot test (#11944) 2024-06-21 05:29:27 +00:00
fix.rs Avoid syntax error notification for source code actions (#12148) 2024-07-04 09:37:16 +05:30
format.rs ruff server: Formatting a document with syntax problems no longer spams a visible error popup (#11745) 2024-06-04 17:18:21 -07:00
lib.rs Add Jupyter Notebook document change snapshot test (#11944) 2024-06-21 05:29:27 +00:00
lint.rs Remove E999 to find diagnostic severity (#12080) 2024-06-28 09:31:35 +05:30
message.rs ruff server: Tracing system now respects log level and trace level, with options to log to a file (#11747) 2024-06-11 11:29:47 -07:00
server.rs Add supported commands in server capabilities (#11850) 2024-06-13 09:32:43 +05:30
session.rs Add Jupyter Notebook document change snapshot test (#11944) 2024-06-21 05:29:27 +00:00
trace.rs ruff server: Support the usage of tildes and environment variables in logFile (#11945) 2024-06-20 18:51:46 +00:00