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:
Max Brunsfeld 2024-09-16 17:10:57 -07:00 committed by GitHub
parent b54b3d6246
commit bc5ed1334f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
41 changed files with 366 additions and 387 deletions

View file

@ -94,7 +94,7 @@ where
let mut parser = PARSERS.lock().pop().unwrap_or_else(|| {
let mut parser = Parser::new();
parser
.set_wasm_store(WasmStore::new(WASM_ENGINE.clone()).unwrap())
.set_wasm_store(WasmStore::new(&WASM_ENGINE).unwrap())
.unwrap();
parser
});
@ -1485,6 +1485,13 @@ impl LanguageScope {
}
}
pub fn override_name(&self) -> Option<&str> {
let id = self.override_id?;
let grammar = self.language.grammar.as_ref()?;
let override_config = grammar.override_config.as_ref()?;
override_config.values.get(&id).map(|e| e.0.as_str())
}
fn config_override(&self) -> Option<&LanguageConfigOverride> {
let id = self.override_id?;
let grammar = self.language.grammar.as_ref()?;
@ -1755,8 +1762,8 @@ mod tests {
let languages = LanguageRegistry::test(cx.executor());
let languages = Arc::new(languages);
languages.register_native_grammars([
("json", tree_sitter_json::language()),
("rust", tree_sitter_rust::language()),
("json", tree_sitter_json::LANGUAGE),
("rust", tree_sitter_rust::LANGUAGE),
]);
languages.register_test_language(LanguageConfig {
name: "JSON".into(),