docs: adds `rome_rowan` and the `rome_js_parser` to the deployed crates
MODIFY
.cargo/config.toml
.cargo/config.toml
@@ -3,7 +3,21 @@ lint = "clippy --workspace --all-targets --verbose -- --deny warnings"
format = "fmt --all --verbose"
codegen = "run -p xtask_codegen --"
lintdoc = "run -p xtask_lintdoc --"
-documentation = "doc -p rome_*formatter -p rome_control_flow -p rome_analyze -p rome_*_syntax -p rome_*_factory -p rome_diagnostics -p rome_service -p rome_cli -p rome_console --no-deps"
+documentation = """
+ doc \
+ -p rome_*formatter \
+ -p rome_control_flow \
+ -p rome_*analyze \
+ -p rome_*_syntax \
+ -p rome_*_factory \
+ -p rome_diagnostics \
+ -p rome_service \
+ -p rome_cli \
+ -p rome_console \
+ -p rome_*parser \
+ -p rome_rowan
+ --no-deps
+"""
bench_parser = "run -p xtask_bench --release -- --feature parser"
bench_formatter = "run -p xtask_bench --release -- --feature formatter"
bench_analyzer = "run -p xtask_bench --release -- --feature analyzer"

MODIFY
crates/rome_js_parser/src/lexer/mod.rs
crates/rome_js_parser/src/lexer/mod.rs
@@ -106,7 +106,7 @@ impl LexContext {
}
}
-/// Context in which the [Lexer]'s current should be re-lexed.
+/// Context in which the [LexContext]'s current should be re-lexed.
#[derive(Debug, Copy, Clone, Eq, PartialEq)]
pub enum ReLexContext {
/// Re-lexes a `/` or `/=` token as a regular expression.

MODIFY
crates/rome_js_parser/src/lib.rs
crates/rome_js_parser/src/lib.rs
//! Instead use functions such as [parse_script], [parse_module], and [] which offer abstracted versions for parsing.
//!
//! Notable features of the parser are:
-//! - Extremely fast parsing and lexing through the extremely fast [`rome_js_lexer`].
+//! - Extremely fast parsing and lexing through the extremely fast lexer.
//! - Ability to do Lossy or Lossless parsing on demand without explicit whitespace handling.
//! - Customizable, able to parse any fragments of JS code at your discretion.
//! - Completely error tolerant, able to produce an AST from any source code.
//! - Cheap incremental reparsing of changed text.
//!
//! The crate further includes utilities such as:
-//! - ANSI syntax highlighting of nodes (through [`util`]) or text through [`rome_js_lexer`].
+//! - ANSI syntax highlighting of nodes or text through `lexer`.
//!
//! It is inspired by the rust analyzer parser but adapted for JavaScript.
//!
//! # Syntax Nodes vs AST Nodes
-//! The crate relies on a concept of untyped [`SyntaxNode`]s vs typed [`AstNode`]s.
+//! The crate relies on a concept of untyped [rome_js_syntax::JsSyntaxNode]s vs typed [rome_rowan::AstNode]s.
//! Syntax nodes represent the syntax tree in an untyped way. They represent a location in an immutable
-//! tree with two pointers. The syntax tree is composed of [`SyntaxNode`]s and [`SyntaxToken`]s in a nested
+//! tree with two pointers. The syntax tree is composed of [rome_js_syntax::JsSyntaxNode]s and [rome_js_syntax::JsSyntaxToken]s in a nested
//! tree structure. Each node can have parents, siblings, children, descendants, etc.
//!
-//! [`AstNode`]s represent a typed version of a syntax node. They have the same exact representation as syntax nodes
+//! [rome_rowan::AstNode]s represent a typed version of a syntax node. They have the same exact representation as syntax nodes
//! therefore a conversion between either has zero runtime cost. Every piece of data of an ast node is optional,
//! this is due to the fact that the parser is completely error tolerant.
//!

MODIFY
crates/rome_js_parser/src/lossless_tree_sink.rs
crates/rome_js_parser/src/lossless_tree_sink.rs
@@ -63,7 +63,7 @@ impl<'a> LosslessTreeSink<'a> {
/// Finishes the tree and return the root node with possible parser errors.
///
- /// If tree is finished without a [SyntaxKind::EOF], one will be generated and all pending trivia
+ /// If tree is finished without a [rome_js_syntax::JsSyntaxKind::EOF], one will be generated and all pending trivia
/// will be appended to its leading trivia.
pub fn finish(self) -> (JsSyntaxNode, Vec<ParseDiagnostic>) {
(self.inner.finish(), self.errors)

MODIFY
crates/rome_js_parser/src/parse.rs
crates/rome_js_parser/src/parse.rs
@@ -127,8 +127,8 @@ pub fn parse_common(
(events, errors, trivia)
}
-/// Parse text into a [`Parse`](Parse) which can then be turned into an untyped root [`SyntaxNode`](SyntaxNode).
-/// Or turned into a typed [`Script`](Script) with [`tree`](Parse::tree).
+/// Parse text into a [`Parse`](Parse) which can then be turned into an untyped root [`JsSyntaxNode`](JsSyntaxNode).
+/// Or turned into a typed [`JsScript`](JsScript) with [`tree`](Parse::tree).
///
/// ```
/// use rome_js_parser::parse_script;
@@ -168,7 +168,7 @@ pub fn parse_script(text: &str, file_id: usize) -> Parse<JsScript> {
.unwrap()
}
-/// Same as [`parse_text`] but configures the parser to parse an ECMAScript module instead of a script
+/// Same as `parse_text` but configures the parser to parse an ECMAScript module instead of a script
pub fn parse_module(text: &str, file_id: usize) -> Parse<JsModule> {
parse(text, file_id, SourceType::js_module())
.cast::<JsModule>()
@@ -186,8 +186,8 @@ pub fn parse(text: &str, file_id: usize, source_type: SourceType) -> Parse<JsAny
})
}
-/// Losslessly Parse text into an expression [`Parse`](Parse) which can then be turned into an untyped root [`SyntaxNode`](SyntaxNode).
-/// Or turned into a typed [`Expr`](Expr) with [`tree`](Parse::tree).
+/// Losslessly Parse text into an expression [`Parse`](Parse) which can then be turned into an untyped root [`JsSyntaxNode`](JsSyntaxNode).
+/// Or turned into a typed [`JsExpressionSnipped`](JsExpressionSnipped) with [`tree`](Parse::tree).
pub fn parse_expression(text: &str, file_id: usize) -> Parse<JsExpressionSnipped> {
let mut parser = crate::Parser::new(text, file_id, SourceType::js_module());
crate::syntax::expr::parse_expression_snipped(&mut parser).unwrap();

docs: adds `rome_rowan` and the `rome_js_parser` to the deployed crates (#2913)