Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 0 additions & 29 deletions crates/biome_markdown_factory/src/generated/node_factory.rs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

33 changes: 0 additions & 33 deletions crates/biome_markdown_factory/src/generated/syntax_factory.rs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions crates/biome_markdown_formatter/src/comments.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ use biome_formatter::{
use biome_markdown_syntax::MarkdownLanguage;
use biome_rowan::SyntaxTriviaPieceComments;

use crate::MdFormatContext;
use crate::MarkdownFormatContext;

#[derive(Eq, PartialEq, Copy, Clone, Debug, Default)]
pub struct MarkdownCommentStyle;
Expand Down Expand Up @@ -34,7 +34,7 @@ impl CommentStyle for MarkdownCommentStyle {
pub struct FormatMarkdownLeadingComment;

impl FormatRule<SourceComment<MarkdownLanguage>> for FormatMarkdownLeadingComment {
type Context = MdFormatContext;
type Context = MarkdownFormatContext;

fn fmt(
&self,
Expand Down
8 changes: 4 additions & 4 deletions crates/biome_markdown_formatter/src/context.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ use crate::comments::{FormatMarkdownLeadingComment, MarkdownCommentStyle};

pub type MarkdownComments = Comments<MarkdownLanguage>;

pub struct MdFormatContext {
pub struct MarkdownFormatContext {
source_map: Option<TransformSourceMap>,
options: MdFormatOptions,
comments: Rc<MarkdownComments>,
Expand All @@ -25,7 +25,7 @@ pub struct MdFormatOptions {
trailing_newline: TrailingNewline,
}

impl CstFormatContext for MdFormatContext {
impl CstFormatContext for MarkdownFormatContext {
type Language = MarkdownLanguage;
type Style = MarkdownCommentStyle;
type CommentRule = FormatMarkdownLeadingComment;
Expand Down Expand Up @@ -98,7 +98,7 @@ impl MdFormatOptions {
}
}

impl MdFormatContext {
impl MarkdownFormatContext {
pub fn new(options: MdFormatOptions) -> Self {
Self {
options,
Expand All @@ -117,7 +117,7 @@ impl MdFormatContext {
}
}

impl FormatContext for MdFormatContext {
impl FormatContext for MarkdownFormatContext {
type Options = MdFormatOptions;

fn options(&self) -> &Self::Options {
Expand Down
18 changes: 9 additions & 9 deletions crates/biome_markdown_formatter/src/cst.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use crate::{MdFormatContext, prelude::*};
use crate::{MarkdownFormatContext, prelude::*};
use biome_formatter::trivia::{FormatToken, format_skipped_token_trivia};
use biome_formatter::{FormatOwnedWithRule, FormatRefWithRule, FormatResult};
use biome_markdown_syntax::{
Expand All @@ -9,7 +9,7 @@ use biome_markdown_syntax::{
pub struct FormatMdSyntaxToken;

impl FormatRule<MarkdownSyntaxToken> for FormatMdSyntaxToken {
type Context = MdFormatContext;
type Context = MarkdownFormatContext;

fn fmt(
&self,
Expand All @@ -23,49 +23,49 @@ impl FormatRule<MarkdownSyntaxToken> for FormatMdSyntaxToken {
}
}

impl FormatToken<MarkdownLanguage, MdFormatContext> for FormatMdSyntaxToken {
impl FormatToken<MarkdownLanguage, MarkdownFormatContext> for FormatMdSyntaxToken {
fn format_skipped_token_trivia(
&self,
token: &MarkdownSyntaxToken,
f: &mut Formatter<MdFormatContext>,
f: &mut Formatter<MarkdownFormatContext>,
) -> FormatResult<()> {
format_skipped_token_trivia(token).fmt(f)
}
}

impl FormatRule<MarkdownSyntaxNode> for FormatMdSyntaxToken {
type Context = MdFormatContext;
type Context = MarkdownFormatContext;

fn fmt(&self, node: &MarkdownSyntaxNode, f: &mut MarkdownFormatter) -> FormatResult<()> {
map_syntax_node!(node.clone(), node => node.format().fmt(f))
}
}

impl AsFormat<MdFormatContext> for MarkdownSyntaxNode {
impl AsFormat<MarkdownFormatContext> for MarkdownSyntaxNode {
type Format<'a> = FormatRefWithRule<'a, Self, FormatMdSyntaxToken>;

fn format(&self) -> Self::Format<'_> {
FormatRefWithRule::new(self, FormatMdSyntaxToken)
}
}

impl IntoFormat<MdFormatContext> for MarkdownSyntaxNode {
impl IntoFormat<MarkdownFormatContext> for MarkdownSyntaxNode {
type Format = FormatOwnedWithRule<Self, FormatMdSyntaxToken>;

fn into_format(self) -> Self::Format {
FormatOwnedWithRule::new(self, FormatMdSyntaxToken)
}
}

impl AsFormat<MdFormatContext> for MarkdownSyntaxToken {
impl AsFormat<MarkdownFormatContext> for MarkdownSyntaxToken {
type Format<'a> = FormatRefWithRule<'a, Self, FormatMdSyntaxToken>;

fn format(&self) -> Self::Format<'_> {
FormatRefWithRule::new(self, FormatMdSyntaxToken)
}
}

impl IntoFormat<MdFormatContext> for MarkdownSyntaxToken {
impl IntoFormat<MarkdownFormatContext> for MarkdownSyntaxToken {
type Format = FormatOwnedWithRule<Self, FormatMdSyntaxToken>;

fn into_format(self) -> Self::Format {
Expand Down
Loading
Loading