-
Notifications
You must be signed in to change notification settings - Fork 70
feat: bump typstyle to v0.13.9 and add config for hard wrap #1737
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
Conversation
1d56f44
to
eb10071
Compare
eb10071
to
6ecfcf6
Compare
we should remove the |
a5e81af
to
358e739
Compare
crates/tinymist/src/config.rs
Outdated
@@ -116,7 +116,8 @@ pub struct Config { | |||
pub formatter_print_width: Option<u32>, | |||
/// Sets the indent size (using space) for the formatter. | |||
pub formatter_indent_size: Option<u32>, | |||
|
|||
/// Sets the hard line wrapping mode for the formatter. | |||
pub formatter_hard_wrap: Option<bool>, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
bikeshedding time, this should be "prose wrap". Existing editors and tools say "line wrap", "word wrap", or "prose wrap" and I haven't seen any configuration named "hard wrap". I understand "hard wrap" comes from "hard line wrap", but it becomes unclear when we omit the thing to wrap. Meanwhile, formatterPrintWidth
already means hard line wrap that the formatter should fit in best effort, then "hard wrap" might be confusing. People may also ask: does "hard wrap" mean that whether "formatterPrintWidth" should be respect or not?
For the concrete name, I haven't decide a certain good choice:
- By mode:
formatterMarkupWrap
: wrap lines under markup mode.formatterMathWrap
orformatterEquationWrap
may mean: wrap lines under math mode.formatterCommentWrap
may mean: wrap lines under comment mode.
- By abstract concepts:
formatterProseWrap
: wrap proses under comment, math, or markup mode.formatterEquationWrap
may mean: wrap lines in equations.
- Special cases:
formatterCodeInProseWrap
: this is subtle that whether we will do it or not.
// Show the following hash expression be affected by prose configuration?
lorem #a-func-call-between-proses(a, b, c) ipsum.
Make things clear will benefit to extend the semantics in future. For example, prettier's prose wrap has mode more than true
(always) or false
(preserve?):
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed, PTAL
9df1e1b
to
3f9b26b
Compare
8e3d0f5
to
296371c
Compare
296371c
to
0aa3d63
Compare
TODO:
enabled
,disabled
,auto
enum for hard wrapping?