Skip to content

feat: improve args layout with modified pretty.rs #282

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from 1 commit
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
3 changes: 1 addition & 2 deletions Cargo.lock

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

1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -77,3 +77,4 @@ debug = true

[patch.crates-io]
# tinymist-world = { git = "https://github.com/Myriad-Dreamin/tinymist", rev = "84569fb98c4eeea65d91677c31d803718143fc10" }
pretty = { git = "https://github.com/QuadnucYard/pretty.rs.git", rev = "106ee15a0ea3ca4a8f501ab8235d7bbc48dfa92f" }
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

consider publish it to crates io when we want to merge this. I remember if we have git deps, we will not be able to publish typstyle to crates.io

89 changes: 0 additions & 89 deletions crates/typstyle-core/src/pretty/doc_ext.rs

This file was deleted.

6 changes: 1 addition & 5 deletions crates/typstyle-core/src/pretty/layout/list.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,7 @@ use typst_syntax::{ast::*, SyntaxKind, SyntaxNode};

use crate::{
ext::StrExt,
pretty::{
doc_ext::{DocBuilderFlatten, DocExt},
style::FoldStyle,
ArenaDoc, Context, Mode, PrettyPrinter,
},
pretty::{style::FoldStyle, ArenaDoc, Context, Mode, PrettyPrinter},
};

pub struct ListStylist<'a> {
Expand Down
2 changes: 1 addition & 1 deletion crates/typstyle-core/src/pretty/layout/plain.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ use typst_syntax::{ast::AstNode, SyntaxKind, SyntaxNode};

use crate::{
ext::StrExt,
pretty::{doc_ext::DocExt, layout::flow::FlowStylist, ArenaDoc, Context, PrettyPrinter},
pretty::{layout::flow::FlowStylist, ArenaDoc, Context, PrettyPrinter},
};

#[derive(Debug)]
Expand Down
1 change: 0 additions & 1 deletion crates/typstyle-core/src/pretty/markup.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ use smallvec::SmallVec;
use typst_syntax::{ast::*, SyntaxKind, SyntaxNode};

use super::{
doc_ext::DocExt,
layout::flow::FlowItem,
util::{is_comment_node, is_only_one_and},
ArenaDoc, Context, Mode, PrettyPrinter,
Expand Down
2 changes: 1 addition & 1 deletion crates/typstyle-core/src/pretty/math_align.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ use pretty::DocAllocator;
use typst_syntax::{ast::*, SyntaxKind, SyntaxNode};
use unicode_width::UnicodeWidthStr;

use super::{context::AlignMode, doc_ext::AllocExt, ArenaDoc, Context, PrettyPrinter};
use super::{context::AlignMode, ArenaDoc, Context, PrettyPrinter};
use crate::{ext::StrExt, AttrStore};

impl<'a> PrettyPrinter<'a> {
Expand Down
1 change: 0 additions & 1 deletion crates/typstyle-core/src/pretty/mod.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
pub mod context;
pub mod doc_ext;
pub mod style;

mod code_chain;
Expand Down
2 changes: 1 addition & 1 deletion crates/typstyle-core/src/pretty/text.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use pretty::{Arena, DocAllocator};
use typst_syntax::ast::*;

use super::{doc_ext::DocExt, ArenaDoc, PrettyPrinter};
use super::{ArenaDoc, PrettyPrinter};
use crate::ext::StrExt;

impl<'a> PrettyPrinter<'a> {
Expand Down
Loading