astral-sh / ruff-lsp

A Language Server Protocol implementation for Ruff.
Other
1.25k stars 45 forks source link

Avoid disable rule comment code action for `E999` #449

Closed dhruvmanila closed 2 months ago

dhruvmanila commented 2 months ago

Summary

This PR updates the ruff-lsp server to avoid generating the "disable for this line" code action for E999 (syntax error). This is a follow-up to https://github.com/astral-sh/ruff/pull/11901 which does the same for the new server.

Test Plan

Run it locally and make sure there are no quick fixes in the VS Code menu:

Screenshot 2024-06-19 at 07 31 55 Screenshot 2024-06-19 at 07 31 40
dhruvmanila commented 2 months ago

Note: Do not merge this PR right now, it needs to be clubbed with the 0.5 release mainly to match the behavior with ruff server.

dhruvmanila commented 2 months ago

This is not required now since the noqa_row field in the JSON output will be null in case of syntax errors with https://github.com/astral-sh/ruff/pull/11901