-
Notifications
You must be signed in to change notification settings - Fork 12
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
Fix: support configuring the indent_width for markdown files #132
base: main
Are you sure you want to change the base?
Conversation
@@ -8,6 +8,7 @@ use serde::Serialize; | |||
#[serde(rename_all = "camelCase")] | |||
pub struct Configuration { | |||
pub line_width: u32, | |||
pub indent_width: u32, |
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.
Could you add a test that exercises this option?
…ck if it is working as expected
@@ -49,6 +49,10 @@ impl ConfigurationBuilder { | |||
self.insert("lineWidth", (value as i32).into()) | |||
} | |||
|
|||
pub fn indent_width(&mut self, value: u32) -> &mut Self { | |||
self.insert("indentWidth", (value as i32).into()) | |||
} |
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.
Have you tested this out? I don't think it will work. I never added indent width to markdown because markdown is very specific about how indentation works. For example, code blocks are 4 spaces and some indent is 3 spaces.
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.
I will add a test to verify if it works correctly. Thank you for bringing this to my attention.
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.
@dsherret You’re right. I tried testing it after the modification, but it failed. Do you have any suggestions that could help resolve this issue?
Closes denoland/deno#26863
This PR supports configuring the indent width for markdown files.