Bump Tree-sitter for bug fixes affecting YAML parser loaded via WASM (#25054)

Closes https://github.com/zed-industries/zed/issues/24742
Closes #24632

This PR bumps Tree-sitter to bring in bug fixes:
* https://github.com/tree-sitter/tree-sitter/pull/4218
* https://github.com/tree-sitter/tree-sitter/pull/4213
* https://github.com/tree-sitter/tree-sitter/pull/4210

I've also bumped Wasmtime and wit-bindgen, since the new Tree-sitter
uses a newer wasmtime.

Release Notes:

- Fixed a parsing bug that caused memory leaks and crashes when using
the Ansible extension

---------

Co-authored-by: Anthony <anthony@zed.dev>
Co-authored-by: Anthony Eid <hello@anthonyeid.me>
This commit is contained in:
Max Brunsfeld 2025-02-17 21:29:27 -08:00 committed by GitHub
parent 8942e657aa
commit 813d870a03
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
15 changed files with 225 additions and 211 deletions

View file

@ -2,7 +2,6 @@ use super::latest;
use crate::wasm_host::wit::since_v0_0_4;
use crate::wasm_host::WasmState;
use anyhow::Result;
use async_trait::async_trait;
use extension::{ExtensionLanguageServerProxy, WorktreeDelegate};
use language::LanguageServerBinaryStatus;
use semantic_version::SemanticVersion;
@ -59,7 +58,6 @@ impl From<Command> for latest::Command {
}
}
#[async_trait]
impl HostWorktree for WasmState {
async fn read_text_file(
&mut self,
@ -89,7 +87,6 @@ impl HostWorktree for WasmState {
}
}
#[async_trait]
impl ExtensionImports for WasmState {
async fn node_binary_path(&mut self) -> wasmtime::Result<Result<String, String>> {
latest::nodejs::Host::node_binary_path(self).await

View file

@ -1,7 +1,6 @@
use super::latest;
use crate::wasm_host::WasmState;
use anyhow::Result;
use async_trait::async_trait;
use extension::WorktreeDelegate;
use semantic_version::SemanticVersion;
use std::sync::{Arc, OnceLock};
@ -67,7 +66,6 @@ impl From<Command> for latest::Command {
}
}
#[async_trait]
impl HostWorktree for WasmState {
async fn read_text_file(
&mut self,
@ -98,7 +96,6 @@ impl HostWorktree for WasmState {
}
}
#[async_trait]
impl ExtensionImports for WasmState {
async fn node_binary_path(&mut self) -> wasmtime::Result<Result<String, String>> {
latest::nodejs::Host::node_binary_path(self).await

View file

@ -1,7 +1,6 @@
use super::{latest, since_v0_1_0};
use crate::wasm_host::WasmState;
use anyhow::Result;
use async_trait::async_trait;
use extension::WorktreeDelegate;
use semantic_version::SemanticVersion;
use std::sync::{Arc, OnceLock};
@ -111,7 +110,6 @@ impl From<CodeLabel> for latest::CodeLabel {
}
}
#[async_trait]
impl HostWorktree for WasmState {
async fn id(&mut self, delegate: Resource<Arc<dyn WorktreeDelegate>>) -> wasmtime::Result<u64> {
latest::HostWorktree::id(self, delegate).await
@ -153,7 +151,6 @@ impl HostWorktree for WasmState {
}
}
#[async_trait]
impl ExtensionImports for WasmState {
async fn get_settings(
&mut self,

View file

@ -4,7 +4,6 @@ use ::settings::{Settings, WorktreeId};
use anyhow::{anyhow, bail, Context, Result};
use async_compression::futures::bufread::GzipDecoder;
use async_tar::Archive;
use async_trait::async_trait;
use extension::{ExtensionLanguageServerProxy, KeyValueStoreDelegate, WorktreeDelegate};
use futures::{io::BufReader, FutureExt as _};
use futures::{lock::Mutex, AsyncReadExt};
@ -228,7 +227,6 @@ impl From<latest::lsp::SymbolKind> for lsp::SymbolKind {
}
}
#[async_trait]
impl HostKeyValueStore for WasmState {
async fn insert(
&mut self,
@ -246,7 +244,6 @@ impl HostKeyValueStore for WasmState {
}
}
#[async_trait]
impl HostWorktree for WasmState {
async fn id(&mut self, delegate: Resource<Arc<dyn WorktreeDelegate>>) -> wasmtime::Result<u64> {
latest::HostWorktree::id(self, delegate).await
@ -288,10 +285,8 @@ impl HostWorktree for WasmState {
}
}
#[async_trait]
impl common::Host for WasmState {}
#[async_trait]
impl http_client::Host for WasmState {
async fn fetch(
&mut self,
@ -328,7 +323,6 @@ impl http_client::Host for WasmState {
}
}
#[async_trait]
impl http_client::HostHttpResponseStream for WasmState {
async fn next_chunk(
&mut self,
@ -415,10 +409,8 @@ async fn convert_response(
Ok(extension_response)
}
#[async_trait]
impl lsp::Host for WasmState {}
#[async_trait]
impl ExtensionImports for WasmState {
async fn get_settings(
&mut self,

View file

@ -247,7 +247,6 @@ impl From<SlashCommandArgumentCompletion> for extension::SlashCommandArgumentCom
}
}
#[async_trait]
impl HostKeyValueStore for WasmState {
async fn insert(
&mut self,
@ -265,7 +264,6 @@ impl HostKeyValueStore for WasmState {
}
}
#[async_trait]
impl HostProject for WasmState {
async fn worktree_ids(
&mut self,
@ -281,7 +279,6 @@ impl HostProject for WasmState {
}
}
#[async_trait]
impl HostWorktree for WasmState {
async fn id(&mut self, delegate: Resource<Arc<dyn WorktreeDelegate>>) -> wasmtime::Result<u64> {
let delegate = self.table.get(&delegate)?;
@ -331,10 +328,8 @@ impl HostWorktree for WasmState {
}
}
#[async_trait]
impl common::Host for WasmState {}
#[async_trait]
impl http_client::Host for WasmState {
async fn fetch(
&mut self,
@ -371,7 +366,6 @@ impl http_client::Host for WasmState {
}
}
#[async_trait]
impl http_client::HostHttpResponseStream for WasmState {
async fn next_chunk(
&mut self,
@ -458,7 +452,6 @@ async fn convert_response(
Ok(extension_response)
}
#[async_trait]
impl nodejs::Host for WasmState {
async fn node_binary_path(&mut self) -> wasmtime::Result<Result<String, String>> {
self.host
@ -525,7 +518,6 @@ impl From<::http_client::github::GithubReleaseAsset> for github::GithubReleaseAs
}
}
#[async_trait]
impl github::Host for WasmState {
async fn latest_github_release(
&mut self,
@ -565,7 +557,6 @@ impl github::Host for WasmState {
}
}
#[async_trait]
impl platform::Host for WasmState {
async fn current_platform(&mut self) -> Result<(platform::Os, platform::Architecture)> {
Ok((
@ -588,7 +579,6 @@ impl platform::Host for WasmState {
#[async_trait]
impl slash_command::Host for WasmState {}
#[async_trait]
impl ExtensionImports for WasmState {
async fn get_settings(
&mut self,