From bacdbdaff5407b4f59e11c16811a6ce087dbadf9 Mon Sep 17 00:00:00 2001 From: Afnan Enayet Date: Sat, 13 Jan 2024 22:51:47 -0500 Subject: [PATCH] fix: Update markdown grammar properly (#803) Use the correct branch for the markdown grammar and update the build + tests for the new grammar version. --- build.rs | 5 ++--- grammars/tree-sitter-markdown | 2 +- ...rkdown_split_graphemes_true_strip_whitespace_true.snap | 8 ++++---- 3 files changed, 7 insertions(+), 8 deletions(-) diff --git a/build.rs b/build.rs index 46a05b87..a9ecd8d2 100644 --- a/build.rs +++ b/build.rs @@ -335,9 +335,8 @@ fn grammars() -> Vec> { }, GrammarCompileInfo { display_name: "markdown", - path: PathBuf::from("grammars/tree-sitter-markdown"), - c_sources: vec!["parser.c"], - cpp_sources: vec!["scanner.cc"], + path: PathBuf::from("grammars/tree-sitter-markdown/tree-sitter-markdown"), + c_sources: vec!["parser.c", "scanner.c"], ..Default::default() }, // Add new grammars here... ]; diff --git a/grammars/tree-sitter-markdown b/grammars/tree-sitter-markdown index be3e08ac..8b39fdfa 160000 --- a/grammars/tree-sitter-markdown +++ b/grammars/tree-sitter-markdown @@ -1 +1 @@ -Subproject commit be3e08acfd85bd87d85f41fde74fdcec25f76dbe +Subproject commit 8b39fdfa99f0a4736091b6223b85120e33da7bad diff --git a/tests/snapshots/regression_test__tests__short_markdown_split_graphemes_true_strip_whitespace_true.snap b/tests/snapshots/regression_test__tests__short_markdown_split_graphemes_true_strip_whitespace_true.snap index 9fcd3f6b..b08416bb 100644 --- a/tests/snapshots/regression_test__tests__short_markdown_split_graphemes_true_strip_whitespace_true.snap +++ b/tests/snapshots/regression_test__tests__short_markdown_split_graphemes_true_strip_whitespace_true.snap @@ -11,7 +11,7 @@ RichHunks( line_index: 5, entries: [ Entry { - reference: {Node paragraph (4, 0) - (6, 0)}, + reference: {Node inline (4, 0) - (5, 14)}, text: "3", start_position: Point { row: 5, @@ -21,7 +21,7 @@ RichHunks( row: 5, column: 14, }, - kind_id: 127, + kind_id: 204, }, ], }, @@ -35,7 +35,7 @@ RichHunks( line_index: 6, entries: [ Entry { - reference: {Node paragraph (5, 0) - (7, 0)}, + reference: {Node inline (5, 0) - (6, 14)}, text: "2", start_position: Point { row: 6, @@ -45,7 +45,7 @@ RichHunks( row: 6, column: 14, }, - kind_id: 127, + kind_id: 204, }, ], },