astral-sh / ruff

An extremely fast Python linter and code formatter, written in Rust.
https://docs.astral.sh/ruff
MIT License
31.36k stars 1.05k forks source link

Display syntax errors in a separate window #11729

Open dhruvmanila opened 3 months ago

dhruvmanila commented 3 months ago

Currently, the playground displays the AST and tokens even if it contains syntax errors. It would be useful to have a separate window to display all the syntax errors in a pretty format like the one used in parser snapshots. For example:

  |
1 | x: int =
  |         ^ Syntax Error: Expected an expression
  |

The design would be something like:

playground design with syntax error tab

Alternative

An alternative design would be to actually have a diagnostics window similar to https://biomejs.dev/playground/ and https://pyright-play.net/.

dhruvmanila commented 3 months ago

This is not a priority but something which is good to have.