Upgrade tree sitter and all grammars (#17734)
Fixes https://github.com/zed-industries/zed/issues/5291 Release Notes: - Fixed a bug where the 'toggle comments' command didn't use the right comment syntax in JSX and TSX elements. --------- Co-authored-by: Conrad <conrad@zed.dev> Co-authored-by: Conrad Irwin <conrad.irwin@gmail.com> Co-authored-by: Kirill Bulatov <mail4score@gmail.com>
This commit is contained in:
parent
b54b3d6246
commit
bc5ed1334f
41 changed files with 366 additions and 387 deletions
|
@ -346,7 +346,7 @@ mod tests {
|
|||
});
|
||||
});
|
||||
});
|
||||
let language = crate::language("c", tree_sitter_c::language());
|
||||
let language = crate::language("c", tree_sitter_c::LANGUAGE.into());
|
||||
|
||||
cx.new_model(|cx| {
|
||||
let mut buffer = Buffer::local("", cx).with_language(language, cx);
|
||||
|
|
|
@ -94,12 +94,12 @@
|
|||
"typename"
|
||||
"union"
|
||||
"using"
|
||||
"virtual"
|
||||
"while"
|
||||
(primitive_type)
|
||||
(sized_type_specifier)
|
||||
(storage_class_specifier)
|
||||
(type_qualifier)
|
||||
(virtual)
|
||||
] @keyword
|
||||
|
||||
[
|
||||
|
|
|
@ -140,7 +140,7 @@ mod tests {
|
|||
|
||||
#[gpui::test]
|
||||
async fn test_outline(cx: &mut TestAppContext) {
|
||||
let language = crate::language("css", tree_sitter_css::language());
|
||||
let language = crate::language("css", tree_sitter_css::LANGUAGE.into());
|
||||
|
||||
let text = r#"
|
||||
/* Import statement */
|
||||
|
|
|
@ -614,7 +614,7 @@ mod tests {
|
|||
#[gpui::test]
|
||||
async fn test_go_label_for_completion() {
|
||||
let adapter = Arc::new(GoLspAdapter);
|
||||
let language = language("go", tree_sitter_go::language());
|
||||
let language = language("go", tree_sitter_go::LANGUAGE.into());
|
||||
|
||||
let theme = SyntaxTheme::new_test([
|
||||
("type", Hsla::default()),
|
||||
|
|
|
@ -36,25 +36,25 @@ pub fn init(
|
|||
cx: &mut AppContext,
|
||||
) {
|
||||
languages.register_native_grammars([
|
||||
("bash", tree_sitter_bash::language()),
|
||||
("c", tree_sitter_c::language()),
|
||||
("cpp", tree_sitter_cpp::language()),
|
||||
("css", tree_sitter_css::language()),
|
||||
("go", tree_sitter_go::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_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()),
|
||||
("tsx", tree_sitter_typescript::language_tsx()),
|
||||
("typescript", tree_sitter_typescript::language_typescript()),
|
||||
("yaml", tree_sitter_yaml::language()),
|
||||
("bash", tree_sitter_bash::LANGUAGE),
|
||||
("c", tree_sitter_c::LANGUAGE),
|
||||
("cpp", tree_sitter_cpp::LANGUAGE),
|
||||
("css", tree_sitter_css::LANGUAGE),
|
||||
("go", tree_sitter_go::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_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),
|
||||
("tsx", tree_sitter_typescript::LANGUAGE_TSX),
|
||||
("typescript", tree_sitter_typescript::LANGUAGE_TYPESCRIPT),
|
||||
("yaml", tree_sitter_yaml::LANGUAGE),
|
||||
]);
|
||||
|
||||
macro_rules! language {
|
||||
|
|
|
@ -307,7 +307,7 @@ mod tests {
|
|||
#[gpui::test]
|
||||
async fn test_python_autoindent(cx: &mut TestAppContext) {
|
||||
cx.executor().set_block_on_ticks(usize::MAX..=usize::MAX);
|
||||
let language = crate::language("python", tree_sitter_python::language());
|
||||
let language = crate::language("python", tree_sitter_python::LANGUAGE.into());
|
||||
cx.update(|cx| {
|
||||
let test_settings = SettingsStore::test(cx);
|
||||
cx.set_global(test_settings);
|
||||
|
|
|
@ -743,7 +743,7 @@ mod tests {
|
|||
#[gpui::test]
|
||||
async fn test_rust_label_for_completion() {
|
||||
let adapter = Arc::new(RustLspAdapter);
|
||||
let language = language("rust", tree_sitter_rust::language());
|
||||
let language = language("rust", tree_sitter_rust::LANGUAGE.into());
|
||||
let grammar = language.grammar().unwrap();
|
||||
let theme = SyntaxTheme::new_test([
|
||||
("type", Hsla::default()),
|
||||
|
@ -868,7 +868,7 @@ mod tests {
|
|||
#[gpui::test]
|
||||
async fn test_rust_label_for_symbol() {
|
||||
let adapter = Arc::new(RustLspAdapter);
|
||||
let language = language("rust", tree_sitter_rust::language());
|
||||
let language = language("rust", tree_sitter_rust::LANGUAGE.into());
|
||||
let grammar = language.grammar().unwrap();
|
||||
let theme = SyntaxTheme::new_test([
|
||||
("type", Hsla::default()),
|
||||
|
@ -920,7 +920,7 @@ mod tests {
|
|||
});
|
||||
});
|
||||
|
||||
let language = crate::language("rust", tree_sitter_rust::language());
|
||||
let language = crate::language("rust", tree_sitter_rust::LANGUAGE.into());
|
||||
|
||||
cx.new_model(|cx| {
|
||||
let mut buffer = Buffer::local("", cx).with_language(language, cx);
|
||||
|
|
|
@ -555,7 +555,10 @@ mod tests {
|
|||
|
||||
#[gpui::test]
|
||||
async fn test_outline(cx: &mut TestAppContext) {
|
||||
let language = crate::language("typescript", tree_sitter_typescript::language_typescript());
|
||||
let language = crate::language(
|
||||
"typescript",
|
||||
tree_sitter_typescript::LANGUAGE_TYPESCRIPT.into(),
|
||||
);
|
||||
|
||||
let text = r#"
|
||||
function a() {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue