Skip to content

Commit

Permalink
refactor(rome_rowan): Split API/Cursor files (rome#2330)
Browse files Browse the repository at this point in the history
Split the cursor and api files into subfiles to make it easier to navigate the code. I frequently struggled to find the right place to add an implementation. I hope, this will help a bit.

Doesn't contain any logical change.
  • Loading branch information
MichaReiser authored Mar 31, 2022
1 parent fdf6bb0 commit e2799fd
Show file tree
Hide file tree
Showing 22 changed files with 3,331 additions and 3,263 deletions.
3 changes: 1 addition & 2 deletions crates/rome_formatter/src/format_element.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
use rome_js_syntax::{AstNode, SyntaxNode};
use rome_rowan::api::SyntaxTriviaPieceComments;
use rome_rowan::{Language, SyntaxToken, TextRange};
use rome_rowan::{Language, SyntaxToken, SyntaxTriviaPieceComments, TextRange};

use crate::format_elements;
use crate::intersperse::{Intersperse, IntersperseFn};
Expand Down
3 changes: 1 addition & 2 deletions crates/rome_formatter/src/formatter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,7 @@ use crate::{
ToFormatElement,
};
use rome_js_syntax::{AstNode, AstNodeList, AstSeparatedList, JsLanguage, SyntaxNode, SyntaxToken};
use rome_rowan::api::SyntaxTriviaPiece;
use rome_rowan::Language;
use rome_rowan::{Language, SyntaxTriviaPiece};

/// Handles the formatting of a CST and stores the options how the CST should be formatted (user preferences).
/// The formatter is passed to the [ToFormatElement] implementation of every node in the CST so that they
Expand Down
3 changes: 1 addition & 2 deletions crates/rome_js_parser/src/token_source.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@ use rome_diagnostics::file::FileId;
use rome_diagnostics::Diagnostic;
use rome_js_syntax::JsSyntaxKind;
use rome_js_syntax::JsSyntaxKind::EOF;
use rome_rowan::api::TriviaPieceKind;
use rome_rowan::TextSize;
use rome_rowan::{TextSize, TriviaPieceKind};
use std::collections::VecDeque;

/// A comment or a whitespace trivia in the source code.
Expand Down
5 changes: 3 additions & 2 deletions crates/rome_js_syntax/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,9 @@ pub use self::generated::*;
pub use ast::{AstNode, AstNodeList, AstSeparatedList, AstToken, SyntaxError, SyntaxResult};
pub use expr_ext::*;
pub use modifier_ext::*;
use rome_rowan::api::TriviaPieceKind;
pub use rome_rowan::{SyntaxText, TextLen, TextRange, TextSize, TokenAtOffset, WalkEvent};
pub use rome_rowan::{
SyntaxText, TextLen, TextRange, TextSize, TokenAtOffset, TriviaPieceKind, WalkEvent,
};
pub use stmt_ext::*;
pub use syntax_node::*;
pub use util::SyntaxNodeExt;
Expand Down
Loading

0 comments on commit e2799fd

Please sign in to comment.