ruff/crates/ruff_server/src
Jane Lewis 8338db6c12
ruff server: Formatting a document with syntax problems no longer spams a visible error popup (#11745)
## Summary

Fixes https://github.com/astral-sh/ruff-vscode/issues/482.

I've made adjustments to `format` and `format_range` that handle parsing
errors before they become server errors. We'll still log this as a
problem, but there will no longer be a visible popup.

## Test Plan

Instead of seeing a visible error when formatting a document with syntax
issues, you should see this warning in the LSP logs:

<img width="991" alt="Screenshot 2024-06-04 at 3 38 23 PM"
src="9d68947d-6462-4ca6-ab5a-65e573c91db6">

Similarly, if you try to format a range with syntax issues, you should
see this warning in the LSP logs instead of a visible error popup:

<img width="1010" alt="Screenshot 2024-06-04 at 3 39 10 PM"
src="99fff098-798d-406a-976e-81ead0da0352">

---------

Co-authored-by: Zanie Blue <contact@zanie.dev>
2024-06-04 17:18:21 -07:00
..
edit Rename document module to text_document (#11571) 2024-05-27 18:32:21 +02:00
server ruff server: Formatting a document with syntax problems no longer spams a visible error popup (#11745) 2024-06-04 17:18:21 -07:00
session ruff server: Add support for documents not exist on disk (#11588) 2024-05-31 08:34:10 +02:00
edit.rs ruff server: Add support for documents not exist on disk (#11588) 2024-05-31 08:34:10 +02:00
fix.rs ruff server: Add support for documents not exist on disk (#11588) 2024-05-31 08:34:10 +02:00
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 ruff server: Support Jupyter Notebook (*.ipynb) files (#11206) 2024-05-21 22:29:30 +00:00
lint.rs Maintain synchronicity between the lexer and the parser (#11457) 2024-06-03 18:23:50 +05:30
message.rs ruff server no longer hangs after shutdown (#11222) 2024-05-03 01:09:42 +00:00
server.rs ruff server: Add support for documents not exist on disk (#11588) 2024-05-31 08:34:10 +02:00
session.rs ruff server: Add support for documents not exist on disk (#11588) 2024-05-31 08:34:10 +02:00