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:
Charlie Marsh 2023-02-14 22:54:08 -05:00 committed by GitHub
parent 5a84df293f
commit f661c90bd7
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
61 changed files with 39 additions and 17489 deletions

View file

@ -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)