astral-sh / ruff

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

Syntax highlighting in code frames and diffs #10835

Open MichaReiser opened 5 months ago

MichaReiser commented 5 months ago

We should consider highlighting code frames and diffs.

I think a good first step would be to implement semantic highlighting into ruff server that, given a string, emits a description of the highlighting. The codeframe and diff rendering can then reuse the same infrastructure to implement.

This is related to https://github.com/astral-sh/ruff-lsp/issues/237

Zander-1024 commented 3 months ago

This is really important. I hope this feature can be implemented soon.

SnirShechter commented 2 months ago

I'd very much like to see that.

Currently when using VSCode, you must use the Python extension for syntax highlighting so ruff can't completely replace it and they be used together (which kind-of misses the point of being fast when you must use another extension that's slow).

danny-huang-openfind commented 2 days ago

While this feature is also important to me, I believe a linter shouldn't be concerned with it. Ruff should focus on "making every kind of linter work within its scope," rather than "trying to solve everything."