Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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 #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="https://github.com/astral-sh/ruff/assets/67177269/62f3e99b-0b0c-4608-84a2-26aeabcc6933"> **Neovim:** <img width="1717" alt="Screenshot 2024-07-02 at 16 38 50" src="https://github.com/astral-sh/ruff/assets/67177269/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 https://github.com/astral-sh/ruff/assets/67177269/943537fc-ed8d-448d-8a36-1e34536c4f3e ### Neovim https://github.com/astral-sh/ruff/assets/67177269/4e6f3372-6e5b-4380-8919-6221066efd5b
- Loading branch information