Skip to content

ruff server: Formatting a document with syntax problems no longer spams a visible error popup#11745

Merged
snowsignal merged 3 commits intomainfrom
jane/server/error-spam
Jun 5, 2024
Merged

ruff server: Formatting a document with syntax problems no longer spams a visible error popup#11745
snowsignal merged 3 commits intomainfrom
jane/server/error-spam

Conversation

@snowsignal
Copy link
Copy Markdown
Contributor

Summary

Fixes astral-sh/ruff-vscode#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:

Screenshot 2024-06-04 at 3 38 23 PM

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:

Screenshot 2024-06-04 at 3 39 10 PM

@snowsignal snowsignal added the server Related to the LSP server label Jun 4, 2024
@codspeed-hq
Copy link
Copy Markdown

codspeed-hq bot commented Jun 4, 2024

CodSpeed Performance Report

Merging #11745 will not alter performance

Comparing jane/server/error-spam (9293364) with main (d056d09)

Summary

✅ 30 untouched benchmarks

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Jun 4, 2024

ruff-ecosystem results

Linter (stable)

✅ ecosystem check detected no linter changes.

Linter (preview)

✅ ecosystem check detected no linter changes.

Comment thread crates/ruff_server/src/format.rs Outdated
Co-authored-by: Zanie Blue <contact@zanie.dev>
Comment thread crates/ruff_server/src/format.rs Outdated
Comment thread crates/ruff_server/src/format.rs Outdated
@snowsignal snowsignal merged commit 8338db6 into main Jun 5, 2024
@snowsignal snowsignal deleted the jane/server/error-spam branch June 5, 2024 00:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

server Related to the LSP server

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Ruff Native Server spams Ruff encountered a problem. Check the logs for more details. with bad symbols.

3 participants