Bump tree-sitter and related core language parser libraries (#14986)

Closes https://github.com/zed-industries/zed/issues/4565

To fix issues with code blocks' parsing in Markdown, a
tree-sitter-markdown library update is needed.
But `tree_sitter::language` is used in many places within core Zed,
which forced more library updates.

Release Notes:

- Updated tree-sitter parsers for core languages

---------

Co-authored-by: Max Brunsfeld <max@zed.dev>
Co-authored-by: Piotr Osiewicz <piotr@zed.dev>
This commit is contained in:
Kirill Bulatov 2024-07-24 23:38:21 +03:00 committed by GitHub
parent fd4a4127eb
commit 596ee58be8
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
24 changed files with 282 additions and 196 deletions

View file

@ -87,12 +87,12 @@
"typename"
"union"
"using"
"virtual"
"volatile"
"while"
(primitive_type)
(sized_type_specifier)
(type_qualifier)
(virtual)
] @keyword
[

View file

@ -34,7 +34,7 @@
(var_spec
name: (identifier) @name) @item))
(method_spec
(method_elem
name: (_) @name
parameters: (parameter_list
"(" @context

View file

@ -41,13 +41,14 @@ pub fn init(
("cpp", tree_sitter_cpp::language()),
("css", tree_sitter_css::language()),
("go", tree_sitter_go::language()),
("gomod", tree_sitter_gomod::language()),
("gomod", tree_sitter_go_mod::language()),
("gowork", tree_sitter_gowork::language()),
("jsdoc", tree_sitter_jsdoc::language()),
("json", tree_sitter_json::language()),
("jsonc", tree_sitter_json::language()),
("markdown", tree_sitter_markdown::language()),
("proto", tree_sitter_proto::language()),
("markdown", tree_sitter_md::language()),
("markdown-inline", tree_sitter_md::inline_language()),
("proto", protols_tree_sitter_proto::language()),
("python", tree_sitter_python::language()),
("regex", tree_sitter_regex::language()),
("rust", tree_sitter_rust::language()),
@ -136,6 +137,7 @@ pub fn init(
json_task_context()
);
language!("markdown");
language!("markdown-inline");
language!(
"python",
vec![Arc::new(python::PythonLspAdapter::new(

View file

@ -0,0 +1,15 @@
name = "Markdown-Inline"
grammar = "markdown-inline"
path_suffixes = []
word_characters = ["-"]
brackets = [
{ start = "{", end = "}", close = true, newline = true },
{ start = "[", end = "]", close = true, newline = true },
{ start = "(", end = ")", close = true, newline = true },
{ start = "<", end = ">", close = true, newline = true },
{ start = "\"", end = "\"", close = false, newline = false },
{ start = "'", end = "'", close = false, newline = false },
{ start = "`", end = "`", close = false, newline = false },
]
tab_size = 2

View file

@ -0,0 +1,6 @@
(emphasis) @emphasis
(strong_emphasis) @emphasis.strong
(code_span) @text.literal
(link_text) @link_text
(link_label) @link_text
(link_destination) @link_uri

View file

@ -1,6 +1,3 @@
(emphasis) @emphasis
(strong_emphasis) @emphasis.strong
[
(atx_heading)
(setext_heading)
@ -14,11 +11,6 @@
(list_marker_parenthesis)
] @punctuation.list_marker
(code_span) @text.literal
(fenced_code_block
(info_string
(language) @text.literal))
(link_destination) @link_uri
(link_text) @link_text

View file

@ -2,3 +2,6 @@
(info_string
(language) @language)
(code_fence_content) @content)
((inline) @content
(#set! "language" "markdown-inline"))