mirror of
https://github.com/astral-sh/ruff.git
synced 2025-09-30 05:45:24 +00:00
Remove dependency on ruff_rowan
(#2875)
This PR removes the dependency on `ruff_rowan` (i.e., Rome's fork of rust-analyzer's `rowan`), and in turn, trims out a lot of code in `ruff_formatter` that isn't necessary (or isn't _yet_ necessary) to power the autoformatter. We may end up pulling some of this back in -- TBD. For example, the autoformatter has its own comment representation right now, but we may eventually want to use the `comments.rs` data structures defined in `rome_formatter`.
This commit is contained in:
parent
5a84df293f
commit
f661c90bd7
61 changed files with 39 additions and 17489 deletions
|
@ -1,5 +1,5 @@
|
|||
use crate::prelude::TagKind;
|
||||
use ruff_rowan::{SyntaxError, TextRange};
|
||||
use ruff_text_size::TextRange;
|
||||
use std::error::Error;
|
||||
|
||||
#[derive(Debug, PartialEq, Eq, Copy, Clone)]
|
||||
|
@ -43,20 +43,6 @@ impl std::fmt::Display for FormatError {
|
|||
|
||||
impl Error for FormatError {}
|
||||
|
||||
impl From<SyntaxError> for FormatError {
|
||||
fn from(error: SyntaxError) -> Self {
|
||||
FormatError::from(&error)
|
||||
}
|
||||
}
|
||||
|
||||
impl From<&SyntaxError> for FormatError {
|
||||
fn from(syntax_error: &SyntaxError) -> Self {
|
||||
match syntax_error {
|
||||
SyntaxError::MissingRequiredChild => FormatError::SyntaxError,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl From<PrintError> for FormatError {
|
||||
fn from(error: PrintError) -> Self {
|
||||
FormatError::from(&error)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue