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

Add extra format selection tests #125

Open
DavisVaughan opened this issue Jan 2, 2025 · 0 comments
Open

Add extra format selection tests #125

DavisVaughan opened this issue Jan 2, 2025 · 0 comments

Comments

@DavisVaughan
Copy link
Collaborator

We currently don't have any tests ensuring that other things inside braces don't get formatted when we select a portion of a braced list

Tests 1 and 3 here should format the whole braced expressions, but tests 2 and 4 should only format the selection itself

            #[rustfmt::skip]
            let (doc, range) = TextDocument::doodle_and_range(
"0+0
1+1
<<{
  2+2>>
  3+3
}
4+4
",
            );
            let output = client.format_document_range(&doc, range);
            insta::assert_snapshot!(output);

            #[rustfmt::skip]
            let (doc, range) = TextDocument::doodle_and_range(
"0+0
1+1
{<<
  2+2>>
  3+3
}
4+4
",
            );
            let output = client.format_document_range(&doc, range);
            insta::assert_snapshot!(output);

            #[rustfmt::skip]
            let (doc, range) = TextDocument::doodle_and_range(
"0+0
1+1
{
  2+2
  <<3+3
}>>
4+4
",
            );
            let output = client.format_document_range(&doc, range);
            insta::assert_snapshot!(output);

            #[rustfmt::skip]
            let (doc, range) = TextDocument::doodle_and_range(
"0+0
1+1
{
  2+2
  <<3+3
>>}
4+4
",
            );
            let output = client.format_document_range(&doc, range);
            insta::assert_snapshot!(output);
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

No branches or pull requests

1 participant