Skip to content
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 expressions indent #152

Merged
merged 6 commits into from
Jan 28, 2025
Merged

Fix expressions indent #152

merged 6 commits into from
Jan 28, 2025

Conversation

bnchi
Copy link
Contributor

@bnchi bnchi commented Oct 17, 2024

fixes #150

I'm not sure if that's the right approach to go about fixing this issue as this is the first time that I work on the compiler, hopefully it's :). Thanks

@bnchi
Copy link
Contributor Author

bnchi commented Oct 18, 2024

Clippy seems to be complaining on a file that's not edited in this PR, probably a new version of Clippy is detecting some issues in the present written code ?

@bnchi bnchi mentioned this pull request Oct 20, 2024
1 task
@bnchi
Copy link
Contributor Author

bnchi commented Oct 20, 2024

I've raised a PR #154 to fix the jobs that are failing here.

@bnchi
Copy link
Contributor Author

bnchi commented Jan 17, 2025

If you have the time do you mind reviewing this @wooorm ?

Copy link
Owner

@wooorm wooorm left a comment

Choose a reason for hiding this comment

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

Thanks for your patience <3

use crate::{MdxExpressionKind, MdxExpressionParse, MdxSignal};
use alloc::boxed::Box;

pub const INDENT_SIZE: usize = 4;
Copy link
Owner

Choose a reason for hiding this comment

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

Suggested change
pub const INDENT_SIZE: usize = 4;
pub const INDENT_SIZE: usize = 2;

There were some inconsistencies in the JS APIs, value is 2 now: https://github.com/micromark/micromark-extension-mdx-expression/blob/7c305ffb7dbce7a452c54d4f4a5fbd2e19652be0/packages/micromark-factory-mdx-expression/dev/index.js#L37

Copy link
Owner

Choose a reason for hiding this comment

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

Copy link
Contributor Author

@bnchi bnchi Jan 24, 2025

Choose a reason for hiding this comment

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

In markdown-rs the indent size is 4

There's a comment which notes the above statement in here :

micromark/micromark-extension-mdx-expression@103af9a#diff-c2e30ee41c9d137472ba9d4238ac9f7397b19a6294ad47e259f58906b60f4fdfR257

so I think there might be some subtlety here which i don't quite understand

Copy link
Contributor Author

Choose a reason for hiding this comment

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

one more thing: changing the indent size in here will break other tests

Copy link
Owner

Choose a reason for hiding this comment

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

Yeah, there are different places with different values. I managed to straighten that out in the JS world!

Copy link
Owner

Choose a reason for hiding this comment

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

I’ll try my hand at this!

use crate::{MdxExpressionKind, MdxExpressionParse, MdxSignal};
use alloc::boxed::Box;

pub const INDENT_SIZE: usize = 4;
Copy link
Owner

Choose a reason for hiding this comment

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

I’ll try my hand at this!

@wooorm wooorm merged commit d5a0f56 into wooorm:main Jan 28, 2025
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

MdxFlowExpression doesn't seem to preserve white space in values
2 participants