ruff/crates/ruff_server/src
Brent Westbrook d6009eb942
Unify Message variants (#18051)
## Summary

This PR unifies the ruff `Message` enum variants for syntax errors and
rule violations into a single `Message` struct consisting of a shared
`db::Diagnostic` and some additional, optional fields used for some rule
violations.

This version of `Message` is nearly a drop-in replacement for
`ruff_diagnostics::Diagnostic`, which is the next step I have in mind
for the refactor.

I think this is also a useful checkpoint because we could possibly add
some of these optional fields to the new `Diagnostic` type. I think
we've previously discussed wanting support for `Fix`es, but the other
fields seem less relevant, so we may just need to preserve the `Message`
wrapper for a bit longer.

## Test plan

Existing tests

---------

Co-authored-by: Micha Reiser <micha@reiser.io>
2025-05-19 13:34:04 -04:00
..
edit Switch to Rust 2024 edition (#18129) 2025-05-16 13:25:28 +02:00
server Switch to Rust 2024 edition (#18129) 2025-05-16 13:25:28 +02:00
session Switch to Rust 2024 edition (#18129) 2025-05-16 13:25:28 +02:00
edit.rs Split SourceLocation into LineColumn and SourceLocation (#17587) 2025-04-27 11:27:33 +01:00
fix.rs Switch to Rust 2024 edition (#18129) 2025-05-16 13:25:28 +02:00
format.rs Switch to Rust 2024 edition (#18129) 2025-05-16 13:25:28 +02:00
lib.rs Refactor workspace logic into workspace.rs (#16295) 2025-02-21 08:37:29 +00:00
lint.rs Unify Message variants (#18051) 2025-05-19 13:34:04 -04:00
logging.rs Switch to Rust 2024 edition (#18129) 2025-05-16 13:25:28 +02:00
message.rs Fix LSP show message macro to allow format args (#15487) 2025-01-15 08:11:49 +00:00
resolve.rs Root exclusions in the server to project root (#16043) 2025-02-10 04:57:14 +00:00
server.rs Switch to Rust 2024 edition (#18129) 2025-05-16 13:25:28 +02:00
session.rs Refactor workspace logic into workspace.rs (#16295) 2025-02-21 08:37:29 +00:00
workspace.rs Switch to Rust 2024 edition (#18129) 2025-05-16 13:25:28 +02:00