From 50fadf453fd8dec17a5ced43b2bcc82cdbf588fd Mon Sep 17 00:00:00 2001 From: Myriad-Dreamin <35292584+Myriad-Dreamin@users.noreply.github.com> Date: Sat, 7 Sep 2024 08:12:09 +0800 Subject: [PATCH] fix: process overlapping cases in line folding only mode (3ab4fa62) (#588) * fix: process overlapping cases in line folding only mode (3ab4fa62) * fix: snapshot --- .../folding_range/nested-blocks-2.typ | 7 +++ .../snaps/test@nested-blocks-2.typ.snap | 54 +++++++++++++++++++ tests/e2e/main.rs | 2 +- 3 files changed, 62 insertions(+), 1 deletion(-) create mode 100644 crates/tinymist-query/src/fixtures/folding_range/nested-blocks-2.typ create mode 100644 crates/tinymist-query/src/fixtures/folding_range/snaps/test@nested-blocks-2.typ.snap diff --git a/crates/tinymist-query/src/fixtures/folding_range/nested-blocks-2.typ b/crates/tinymist-query/src/fixtures/folding_range/nested-blocks-2.typ new file mode 100644 index 00000000..cc07c118 --- /dev/null +++ b/crates/tinymist-query/src/fixtures/folding_range/nested-blocks-2.typ @@ -0,0 +1,7 @@ +#let slides(..args) = args +#slides[ + + = Heading +][ + +] diff --git a/crates/tinymist-query/src/fixtures/folding_range/snaps/test@nested-blocks-2.typ.snap b/crates/tinymist-query/src/fixtures/folding_range/snaps/test@nested-blocks-2.typ.snap new file mode 100644 index 00000000..7ede8f62 --- /dev/null +++ b/crates/tinymist-query/src/fixtures/folding_range/snaps/test@nested-blocks-2.typ.snap @@ -0,0 +1,54 @@ +--- +source: crates/tinymist-query/src/folding_range.rs +expression: "JsonRepr::new_pure(json!({ \"false\": result_false, \"true\": result_true, }))" +input_file: crates/tinymist-query/src/fixtures/folding_range/nested-blocks-2.typ +--- +{ + "false": [ + { + "collapsedText": "Heading", + "endCharacter": 11, + "endLine": 4, + "startCharacter": 4, + "startLine": 3 + }, + { + "collapsedText": "", + "endCharacter": 1, + "endLine": 4, + "startCharacter": 7, + "startLine": 1 + }, + { + "collapsedText": "", + "endCharacter": 1, + "endLine": 6, + "startCharacter": 1, + "startLine": 4 + }, + { + "collapsedText": "", + "endCharacter": 1, + "endLine": 6, + "startCharacter": 7, + "startLine": 1 + } + ], + "true": [ + { + "collapsedText": "", + "endLine": 3, + "startLine": 2 + }, + { + "collapsedText": "", + "endLine": 6, + "startLine": 4 + }, + { + "collapsedText": "", + "endLine": 6, + "startLine": 1 + } + ] +} diff --git a/tests/e2e/main.rs b/tests/e2e/main.rs index 65b1a988..ffcc8969 100644 --- a/tests/e2e/main.rs +++ b/tests/e2e/main.rs @@ -385,7 +385,7 @@ fn e2e() { }); let hash = replay_log(&tinymist_binary, &root.join("vscode")); - insta::assert_snapshot!(hash, @"siphash128_13:5e46fecd62a56ad654d933738ef4b753"); + insta::assert_snapshot!(hash, @"siphash128_13:6b2341befebb4a33dc86f0d934aa43"); } }