From 813d870a03fc03214c1287b8fc3452a06fcd9cc3 Mon Sep 17 00:00:00 2001 From: Max Brunsfeld Date: Mon, 17 Feb 2025 21:29:27 -0800 Subject: [PATCH] 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 Co-authored-by: Anthony Eid --- Cargo.lock | 371 ++++++++++-------- Cargo.toml | 14 +- crates/editor/src/editor_tests.rs | 4 +- .../src/test/editor_lsp_test_context.rs | 2 +- crates/extension/src/extension_builder.rs | 2 +- .../src/wasm_host/wit/since_v0_0_1.rs | 3 - .../src/wasm_host/wit/since_v0_0_4.rs | 3 - .../src/wasm_host/wit/since_v0_0_6.rs | 3 - .../src/wasm_host/wit/since_v0_1_0.rs | 8 - .../src/wasm_host/wit/since_v0_2_0.rs | 10 - crates/language/src/buffer.rs | 2 +- crates/language/src/buffer_tests.rs | 2 +- crates/language/src/language.rs | 7 +- crates/language/src/syntax_map.rs | 3 +- .../src/syntax_map/syntax_map_tests.rs | 2 +- 15 files changed, 225 insertions(+), 211 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 60086189e6..7d504f2e48 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -27,7 +27,7 @@ version = "0.24.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "dfbe277e56a376000877090da837660b4427aad530e3028d44e0bffe4f89a1c1" dependencies = [ - "gimli 0.31.1", + "gimli", ] [[package]] @@ -2057,6 +2057,9 @@ name = "bumpalo" version = "3.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "79296716171880943b8470b5f8d03aa55eb2e645a4874bdbb28adb49162e012c" +dependencies = [ + "allocator-api2", +] [[package]] name = "by_address" @@ -2421,7 +2424,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d067ad48b8650848b989a59a86c6c36a995d02d2bf778d45c3c5d57bc2718f02" dependencies = [ "smallvec", - "target-lexicon", + "target-lexicon 0.12.16", ] [[package]] @@ -3328,18 +3331,18 @@ dependencies = [ [[package]] name = "cranelift-bforest" -version = "0.112.3" +version = "0.116.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "69792bd40d21be8059f7c709f44200ded3bbd073df7eb3fa3c282b387c7ffa5b" +checksum = "e15d04a0ce86cb36ead88ad68cf693ffd6cda47052b9e0ac114bc47fd9cd23c4" dependencies = [ "cranelift-entity", ] [[package]] name = "cranelift-bitset" -version = "0.112.3" +version = "0.116.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "38da1eb6f7d8cdfa92f05acfae63c9a1d7a337e49ce7a2d0769c7fa03a2613a5" +checksum = "7c6e3969a7ce267259ce244b7867c5d3bc9e65b0a87e81039588dfdeaede9f34" dependencies = [ "serde", "serde_derive", @@ -3347,9 +3350,9 @@ dependencies = [ [[package]] name = "cranelift-codegen" -version = "0.112.3" +version = "0.116.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "709f5567a2bff9f06edf911a7cb5ebb091e4c81701714dc6ab574d08b4a69a0d" +checksum = "2c22032c4cb42558371cf516bb47f26cdad1819d3475c133e93c49f50ebf304e" dependencies = [ "bumpalo", "cranelift-bforest", @@ -3359,44 +3362,45 @@ dependencies = [ "cranelift-control", "cranelift-entity", "cranelift-isle", - "gimli 0.29.0", + "gimli", "hashbrown 0.14.5", "log", "regalloc2", "rustc-hash 2.1.1", + "serde", "smallvec", - "target-lexicon", + "target-lexicon 0.13.2", ] [[package]] name = "cranelift-codegen-meta" -version = "0.112.3" +version = "0.116.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "72d39a6b194c069fd091ca1f17b9d86ff1a4627ccad8806095828f61989a691f" +checksum = "c904bc71c61b27fc57827f4a1379f29de64fe95653b620a3db77d59655eee0b8" dependencies = [ "cranelift-codegen-shared", ] [[package]] name = "cranelift-codegen-shared" -version = "0.112.3" +version = "0.116.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "18f81aefad1f80ed4132ae33f40b92779eeb57edeb1e28bb24424a4098c963a2" +checksum = "40180f5497572f644ce88c255480981ae2ec1d7bb4d8e0c0136a13b87a2f2ceb" [[package]] name = "cranelift-control" -version = "0.112.3" +version = "0.116.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6adbaac785ad4683c4f199686f9e15c1471f52ae2f4c013a3be039b4719db754" +checksum = "26d132c6d0bd8a489563472afc171759da0707804a65ece7ceb15a8c6d7dd5ef" dependencies = [ "arbitrary", ] [[package]] name = "cranelift-entity" -version = "0.112.3" +version = "0.116.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "70b85ed43567e13782cd1b25baf42a8167ee57169a60dfd3d7307c6ca3839da0" +checksum = "4b2d0d9618275474fbf679dd018ac6e009acbd6ae6850f6a67be33fb3b00b323" dependencies = [ "cranelift-bitset", "serde", @@ -3405,47 +3409,31 @@ dependencies = [ [[package]] name = "cranelift-frontend" -version = "0.112.3" +version = "0.116.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8349f71373bb69c6f73992c6c1606236a66c8134e7a60e04e03fbd64b1aa7dcf" +checksum = "4fac41e16729107393174b0c9e3730fb072866100e1e64e80a1a963b2e484d57" dependencies = [ "cranelift-codegen", "log", "smallvec", - "target-lexicon", + "target-lexicon 0.13.2", ] [[package]] name = "cranelift-isle" -version = "0.112.3" +version = "0.116.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "464a6b958ce05e0c237c8b25508012b6c644e8c37348213a8c786ba29e28cfdb" +checksum = "1ca20d576e5070044d0a72a9effc2deacf4d6aa650403189d8ea50126483944d" [[package]] name = "cranelift-native" -version = "0.112.3" +version = "0.116.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ffc4acaf6894ee323ff4e9ce786bec09f0ebbe49941e8012f1c1052f1d965034" +checksum = "b8dee82f3f1f2c4cba9177f1cc5e350fe98764379bcd29340caa7b01f85076c7" dependencies = [ "cranelift-codegen", "libc", - "target-lexicon", -] - -[[package]] -name = "cranelift-wasm" -version = "0.112.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b878860895cca97454ef8d8b12bfda9d0889dd49efee175dba78d54ff8363ec2" -dependencies = [ - "cranelift-codegen", - "cranelift-entity", - "cranelift-frontend", - "itertools 0.12.1", - "log", - "smallvec", - "wasmparser 0.217.1", - "wasmtime-types", + "target-lexicon 0.13.2", ] [[package]] @@ -4445,9 +4433,9 @@ dependencies = [ "serde_json", "toml 0.8.20", "util", - "wasm-encoder 0.217.1", - "wasmparser 0.217.1", - "wit-component", + "wasm-encoder 0.221.3", + "wasmparser 0.221.3", + "wit-component 0.221.3", ] [[package]] @@ -4515,7 +4503,7 @@ dependencies = [ "toml 0.8.20", "url", "util", - "wasmparser 0.217.1", + "wasmparser 0.221.3", "wasmtime", "wasmtime-wasi", ] @@ -5263,21 +5251,15 @@ dependencies = [ [[package]] name = "gimli" -version = "0.29.0" +version = "0.31.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "40ecd4077b5ae9fd2e9e169b102c6c330d0605168eb0e8bf79952b256dbefffd" +checksum = "07e28edb80900c19c28f1072f2e8aeca7fa06b23cd4169cefe1af5aa3260783f" dependencies = [ "fallible-iterator", "indexmap", "stable_deref_trait", ] -[[package]] -name = "gimli" -version = "0.31.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "07e28edb80900c19c28f1072f2e8aeca7fa06b23cd4169cefe1af5aa3260783f" - [[package]] name = "git" version = "0.1.0" @@ -5706,7 +5688,6 @@ checksum = "e5274423e17b7c9fc20b6e7e208532f9b19825d82dfd615708b70edd83df41f1" dependencies = [ "ahash 0.8.11", "allocator-api2", - "serde", ] [[package]] @@ -5718,6 +5699,7 @@ dependencies = [ "allocator-api2", "equivalent", "foldhash", + "serde", ] [[package]] @@ -10449,6 +10431,18 @@ version = "0.10.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bd348ff538bc9caeda7ee8cad2d1d48236a1f443c1fa3913c6a02fe0043b1dd3" +[[package]] +name = "pulley-interpreter" +version = "29.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "62d95f8575df49a2708398182f49a888cf9dc30210fb1fd2df87c889edcee75d" +dependencies = [ + "cranelift-bitset", + "log", + "sptr", + "wasmtime-math", +] + [[package]] name = "qoi" version = "0.4.1" @@ -10829,14 +10823,15 @@ dependencies = [ [[package]] name = "regalloc2" -version = "0.10.2" +version = "0.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "12908dbeb234370af84d0579b9f68258a0f67e201412dd9a2814e6f45b2fc0f0" +checksum = "145c1c267e14f20fb0f88aa76a1c5ffec42d592c1d28b3cd9148ae35916158d3" dependencies = [ - "hashbrown 0.14.5", + "allocator-api2", + "bumpalo", + "hashbrown 0.15.2", "log", "rustc-hash 2.1.1", - "slice-group-by", "smallvec", ] @@ -12351,12 +12346,6 @@ dependencies = [ "zed_extension_api 0.1.0", ] -[[package]] -name = "slice-group-by" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "826167069c09b99d56f31e9ae5c99049e932a98c9dc2dac47645b08dbbf76ba7" - [[package]] name = "slotmap" version = "1.0.7" @@ -13272,6 +13261,12 @@ version = "0.12.16" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "61c41af27dd6d1e27b1b16b489db798443478cef1f06a660c96db617ba5de3b1" +[[package]] +name = "target-lexicon" +version = "0.13.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e502f78cdbb8ba4718f566c418c52bc729126ffd16baee5baa718cf25dd5a69a" + [[package]] name = "task" version = "0.1.0" @@ -14115,14 +14110,26 @@ dependencies = [ ] [[package]] -name = "tree-sitter" -version = "0.24.7" +name = "trait-variant" +version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a5387dffa7ffc7d2dae12b50c6f7aab8ff79d6210147c6613561fc3d474c6f75" +checksum = "70977707304198400eb4835a78f6a9f928bf41bba420deb8fdb175cd965d77a7" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.90", +] + +[[package]] +name = "tree-sitter" +version = "0.25.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5168a515fe492af54c5cc8800ff8c840be09fa5168de45838afaecd3e008bce4" dependencies = [ "cc", "regex", "regex-syntax 0.8.5", + "serde_json", "streaming-iterator", "tree-sitter-language", "wasmtime-c-api-impl", @@ -14246,12 +14253,12 @@ dependencies = [ [[package]] name = "tree-sitter-html" -version = "0.20.4" +version = "0.23.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8766b5ad3721517f8259e6394aefda9c686aebf7a8c74ab8624f2c3b46902fd5" +checksum = "261b708e5d92061ede329babaaa427b819329a9d427a1d710abb0f67bbef63ee" dependencies = [ "cc", - "tree-sitter", + "tree-sitter-language", ] [[package]] @@ -15034,11 +15041,12 @@ dependencies = [ [[package]] name = "wasm-encoder" -version = "0.217.1" +version = "0.221.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "10961fd76db420582926af70816dd205019d8152d9e51e1b939125dd1639f854" +checksum = "dc8444fe4920de80a4fe5ab564fff2ae58b6b73166b89751f8c6c93509da32e5" dependencies = [ "leb128", + "wasmparser 0.221.3", ] [[package]] @@ -15057,6 +15065,22 @@ dependencies = [ "wasmparser 0.201.0", ] +[[package]] +name = "wasm-metadata" +version = "0.221.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "11f4ef50d17e103a88774cd4aa5d06bfb1ae44036a8f3f1325e0e9b3e3417ac4" +dependencies = [ + "anyhow", + "indexmap", + "serde", + "serde_derive", + "serde_json", + "spdx", + "wasm-encoder 0.221.3", + "wasmparser 0.221.3", +] + [[package]] name = "wasm-streams" version = "0.4.2" @@ -15083,13 +15107,12 @@ dependencies = [ [[package]] name = "wasmparser" -version = "0.217.1" +version = "0.221.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "65a5a0689975b9fd93c02f5400cfd9669858b99607e54e7b892c6080cba598bb" +checksum = "d06bfa36ab3ac2be0dee563380147a5b81ba10dd8885d7fbbc9eb574be67d185" dependencies = [ - "ahash 0.8.11", "bitflags 2.8.0", - "hashbrown 0.14.5", + "hashbrown 0.15.2", "indexmap", "semver", "serde", @@ -15097,20 +15120,20 @@ dependencies = [ [[package]] name = "wasmprinter" -version = "0.217.1" +version = "0.221.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "324c6782d7b81c01625335d252653b26ea68e835ddb4aef4cb1ed3ea40ae3a49" +checksum = "7343c42a97f2926c7819ff81b64012092ae954c5d83ddd30c9fcdefd97d0b283" dependencies = [ "anyhow", "termcolor", - "wasmparser 0.217.1", + "wasmparser 0.221.3", ] [[package]] name = "wasmtime" -version = "25.0.3" +version = "29.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f38dbf42dc56a6fe41ccd77211ea8ec90855de05e52cd00df5a0a3bca87d6147" +checksum = "11976a250672556d1c4c04c6d5d7656ac9192ac9edc42a4587d6c21460010e69" dependencies = [ "anyhow", "async-trait", @@ -15122,7 +15145,6 @@ dependencies = [ "hashbrown 0.14.5", "indexmap", "libc", - "libm", "log", "mach2", "memfd", @@ -15131,14 +15153,16 @@ dependencies = [ "paste", "postcard", "psm", + "pulley-interpreter", "rustix", "semver", "serde", "serde_derive", "smallvec", "sptr", - "target-lexicon", - "wasmparser 0.217.1", + "target-lexicon 0.13.2", + "trait-variant", + "wasmparser 0.221.3", "wasmtime-asm-macros", "wasmtime-component-macro", "wasmtime-component-util", @@ -15146,30 +15170,30 @@ dependencies = [ "wasmtime-environ", "wasmtime-fiber", "wasmtime-jit-icache-coherence", + "wasmtime-math", "wasmtime-slab", "wasmtime-versioned-export-macros", "wasmtime-winch", - "windows-sys 0.52.0", + "windows-sys 0.59.0", ] [[package]] name = "wasmtime-asm-macros" -version = "25.0.3" +version = "29.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "30e0c7f9983c2d60109a939d9ab0e0df301901085c3608e1c22c27c98390a027" +checksum = "1f178b0d125201fbe9f75beaf849bd3e511891f9e45ba216a5b620802ccf64f2" dependencies = [ "cfg-if", ] [[package]] name = "wasmtime-c-api-impl" -version = "25.0.3" +version = "29.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ebfcdb4aa0f68020934099815cf6ef11dbbedaf070ef800b3f0a7f6ec7b7d005" +checksum = "ea30cef3608f2de5797c7bbb94c1ba4f3676d9a7f81ae86ced1b512e2766ed0c" dependencies = [ "anyhow", "log", - "once_cell", "tracing", "wasmtime", "wasmtime-c-api-macros", @@ -15177,9 +15201,9 @@ dependencies = [ [[package]] name = "wasmtime-c-api-macros" -version = "25.0.3" +version = "29.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "842c213ad4546fb0178735910b96ee7da303e1d745c3f42f4178b0de1da138b6" +checksum = "022a79ebe1124d5d384d82463d7e61c6b4dd857d81f15cb8078974eeb86db65b" dependencies = [ "proc-macro2", "quote", @@ -15187,9 +15211,9 @@ dependencies = [ [[package]] name = "wasmtime-component-macro" -version = "25.0.3" +version = "29.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0929ffffaca32dd8770b56848c94056036963ca05de25fb47cac644e20262168" +checksum = "d74de6592ed945d0a602f71243982a304d5d02f1e501b638addf57f42d57dfaf" dependencies = [ "anyhow", "proc-macro2", @@ -15197,20 +15221,20 @@ dependencies = [ "syn 2.0.90", "wasmtime-component-util", "wasmtime-wit-bindgen", - "wit-parser 0.217.1", + "wit-parser 0.221.3", ] [[package]] name = "wasmtime-component-util" -version = "25.0.3" +version = "29.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fdc29d2b56629d66d2fd791d1b46471d0016e0d684ed2dc299e870d127082268" +checksum = "707dc7b3c112ab5a366b30cfe2fb5b2f8e6a0f682f16df96a5ec582bfe6f056e" [[package]] name = "wasmtime-cranelift" -version = "25.0.3" +version = "29.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f8c8af1197703f4de556a274384adf5db36a146f9892bc9607bad16881e75c80" +checksum = "366be722674d4bf153290fbcbc4d7d16895cc82fb3e869f8d550ff768f9e9e87" dependencies = [ "anyhow", "cfg-if", @@ -15219,29 +15243,29 @@ dependencies = [ "cranelift-entity", "cranelift-frontend", "cranelift-native", - "cranelift-wasm", - "gimli 0.29.0", + "gimli", + "itertools 0.12.1", "log", "object", "smallvec", - "target-lexicon", + "target-lexicon 0.13.2", "thiserror 1.0.69", - "wasmparser 0.217.1", + "wasmparser 0.221.3", "wasmtime-environ", "wasmtime-versioned-export-macros", ] [[package]] name = "wasmtime-environ" -version = "25.0.3" +version = "29.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3f1b5af7bac868c5bce3b78a366a10677caacf6e6467c156301297e36ed31f3e" +checksum = "cdadc1af7097347aa276a4f008929810f726b5b46946971c660b6d421e9994ad" dependencies = [ "anyhow", "cpp_demangle", "cranelift-bitset", "cranelift-entity", - "gimli 0.29.0", + "gimli", "indexmap", "log", "object", @@ -15250,19 +15274,19 @@ dependencies = [ "semver", "serde", "serde_derive", - "target-lexicon", - "wasm-encoder 0.217.1", - "wasmparser 0.217.1", + "smallvec", + "target-lexicon 0.13.2", + "wasm-encoder 0.221.3", + "wasmparser 0.221.3", "wasmprinter", "wasmtime-component-util", - "wasmtime-types", ] [[package]] name = "wasmtime-fiber" -version = "25.0.3" +version = "29.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "665ccc1bb0f28496e6fa02e94c575ee9ad6e3202c7df8591e5dda78106d5aa4a" +checksum = "ccba90d4119f081bca91190485650730a617be1fff5228f8c4757ce133d21117" dependencies = [ "anyhow", "cc", @@ -15270,46 +15294,41 @@ dependencies = [ "rustix", "wasmtime-asm-macros", "wasmtime-versioned-export-macros", - "windows-sys 0.52.0", + "windows-sys 0.59.0", ] [[package]] name = "wasmtime-jit-icache-coherence" -version = "25.0.3" +version = "29.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5d7314e32c624f645ad7d6b9fc3ac89eb7d2b9aa06695d6445cec087958ec27d" +checksum = "ec5e8552e01692e6c2e5293171704fed8abdec79d1a6995a0870ab190e5747d1" dependencies = [ "anyhow", "cfg-if", "libc", - "windows-sys 0.52.0", + "windows-sys 0.59.0", +] + +[[package]] +name = "wasmtime-math" +version = "29.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "29210ec2aa25e00f4d54605cedaf080f39ec01a872c5bd520ad04c67af1dde17" +dependencies = [ + "libm", ] [[package]] name = "wasmtime-slab" -version = "25.0.3" +version = "29.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f75cba1a8cc327839f493cfc3036c9de3d077d59ab76296bc710ee5f95be5391" - -[[package]] -name = "wasmtime-types" -version = "25.0.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c6d83a7816947a4974e2380c311eacb1db009b8bad86081dc726b705603c93c7" -dependencies = [ - "anyhow", - "cranelift-entity", - "serde", - "serde_derive", - "smallvec", - "wasmparser 0.217.1", -] +checksum = "fcb5821a96fa04ac14bc7b158bb3d5cd7729a053db5a74dad396cd513a5e5ccf" [[package]] name = "wasmtime-versioned-export-macros" -version = "25.0.3" +version = "29.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6879a8e168aef3fe07335343b7fbede12fa494215e83322e173d4018e124a846" +checksum = "86ff86db216dc0240462de40c8290887a613dddf9685508eb39479037ba97b5b" dependencies = [ "proc-macro2", "quote", @@ -15318,9 +15337,9 @@ dependencies = [ [[package]] name = "wasmtime-wasi" -version = "25.0.3" +version = "29.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d042ea66b2834fb03b8a6968ef1a99a4b537211b00f7502a4d6a37f4eb2049b2" +checksum = "8d1be69bfcab1bdac74daa7a1f9695ab992b9c8e21b9b061e7d66434097e0ca4" dependencies = [ "anyhow", "async-trait", @@ -15335,30 +15354,30 @@ dependencies = [ "futures 0.3.31", "io-extras", "io-lifetimes", - "once_cell", "rustix", "system-interface", "thiserror 1.0.69", "tokio", "tracing", + "trait-variant", "url", "wasmtime", "wiggle", - "windows-sys 0.52.0", + "windows-sys 0.59.0", ] [[package]] name = "wasmtime-winch" -version = "25.0.3" +version = "29.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6baca2a919a288df653246069868b4de80f07e9679a8ef9b78ad79fc658ffd12" +checksum = "fdbabfb8f20502d5e1d81092b9ead3682ae59988487aafcd7567387b7a43cf8f" dependencies = [ "anyhow", "cranelift-codegen", - "gimli 0.29.0", + "gimli", "object", - "target-lexicon", - "wasmparser 0.217.1", + "target-lexicon 0.13.2", + "wasmparser 0.221.3", "wasmtime-cranelift", "wasmtime-environ", "winch-codegen", @@ -15366,14 +15385,14 @@ dependencies = [ [[package]] name = "wasmtime-wit-bindgen" -version = "25.0.3" +version = "29.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3f571f63ac1d532e986eb3973bbef3a45e4ae83de521a8d573b0fe0594dc9608" +checksum = "8358319c2dd1e4db79e3c1c5d3a5af84956615343f9f89f4e4996a36816e06e6" dependencies = [ "anyhow", - "heck 0.4.1", + "heck 0.5.0", "indexmap", - "wit-parser 0.217.1", + "wit-parser 0.221.3", ] [[package]] @@ -15601,9 +15620,9 @@ dependencies = [ [[package]] name = "wiggle" -version = "25.0.3" +version = "29.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4c8fdcd81702e0f46a8ab2ed28a5bf824aabf4a1af1673af496a020aacd0b6f9" +checksum = "4b9af35bc9629c52c261465320a9a07959164928b4241980ba1cf923b9e6751d" dependencies = [ "anyhow", "async-trait", @@ -15616,12 +15635,12 @@ dependencies = [ [[package]] name = "wiggle-generate" -version = "25.0.3" +version = "29.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "14f745361f0a9071aaabd05de1bb2b782d9f0597f30d9c0f20326224902e64d5" +checksum = "2cf267dd05673912c8138f4b54acabe6bd53407d9d1536f0fadb6520dd16e101" dependencies = [ "anyhow", - "heck 0.4.1", + "heck 0.5.0", "proc-macro2", "quote", "shellexpand 2.1.2", @@ -15631,9 +15650,9 @@ dependencies = [ [[package]] name = "wiggle-macro" -version = "25.0.3" +version = "29.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bfbdae3574621921ed3c13325edc910388487759d10fb330f656cfc69bee38db" +checksum = "08c5c473d4198e6c2d377f3809f713ff0c110cab88a0805ae099a82119ee250c" dependencies = [ "proc-macro2", "quote", @@ -15674,17 +15693,18 @@ checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" [[package]] name = "winch-codegen" -version = "0.23.3" +version = "29.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "01cd1dc56c5a45d509ff06e7ca8817eaa9ec3240096f07e71915d5d528658e8a" +checksum = "2f849ef2c5f46cb0a20af4b4487aaa239846e52e2c03f13fa3c784684552859c" dependencies = [ "anyhow", "cranelift-codegen", - "gimli 0.29.0", + "gimli", "regalloc2", "smallvec", - "target-lexicon", - "wasmparser 0.217.1", + "target-lexicon 0.13.2", + "thiserror 1.0.69", + "wasmparser 0.221.3", "wasmtime-cranelift", "wasmtime-environ", ] @@ -16178,9 +16198,9 @@ dependencies = [ "anyhow", "heck 0.4.1", "indexmap", - "wasm-metadata", + "wasm-metadata 0.201.0", "wit-bindgen-core", - "wit-component", + "wit-component 0.201.0", ] [[package]] @@ -16211,11 +16231,30 @@ dependencies = [ "serde_derive", "serde_json", "wasm-encoder 0.201.0", - "wasm-metadata", + "wasm-metadata 0.201.0", "wasmparser 0.201.0", "wit-parser 0.201.0", ] +[[package]] +name = "wit-component" +version = "0.221.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "66c55ca8772d2b270e28066caed50ce4e53a28c3ac10e01efbd90e5be31e448b" +dependencies = [ + "anyhow", + "bitflags 2.8.0", + "indexmap", + "log", + "serde", + "serde_derive", + "serde_json", + "wasm-encoder 0.221.3", + "wasm-metadata 0.221.3", + "wasmparser 0.221.3", + "wit-parser 0.221.3", +] + [[package]] name = "wit-parser" version = "0.201.0" @@ -16236,9 +16275,9 @@ dependencies = [ [[package]] name = "wit-parser" -version = "0.217.1" +version = "0.221.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e5aaf02882453eaeec4fe30f1e4263cfd8b8ea36dd00e1fe7d902d9cb498bccd" +checksum = "896112579ed56b4a538b07a3d16e562d101ff6265c46b515ce0c701eef16b2ac" dependencies = [ "anyhow", "id-arena", @@ -16249,7 +16288,7 @@ dependencies = [ "serde_derive", "serde_json", "unicode-xid", - "wasmparser 0.217.1", + "wasmparser 0.221.3", ] [[package]] diff --git a/Cargo.toml b/Cargo.toml index 224842c3f9..4b787d5e75 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -526,7 +526,7 @@ tiny_http = "0.8" toml = "0.8" tokio = { version = "1" } tower-http = "0.4.4" -tree-sitter = { version = "0.24", features = ["wasm"] } +tree-sitter = { version = "0.25.2", features = ["wasm"] } tree-sitter-bash = "0.23" tree-sitter-c = "0.23" tree-sitter-cpp = "0.23" @@ -539,7 +539,7 @@ tree-sitter-go-mod = { git = "https://github.com/camdencheek/tree-sitter-go-mod" tree-sitter-gowork = { git = "https://github.com/zed-industries/tree-sitter-go-work", rev = "acb0617bf7f4fda02c6217676cc64acb89536dc7" } tree-sitter-heex = { git = "https://github.com/zed-industries/tree-sitter-heex", rev = "1dd45142fbb05562e35b2040c6129c9bca346592" } tree-sitter-diff = "0.1.0" -tree-sitter-html = "0.20" +tree-sitter-html = "0.23" tree-sitter-jsdoc = "0.23" tree-sitter-json = "0.24" tree-sitter-md = { git = "https://github.com/tree-sitter-grammars/tree-sitter-markdown", rev = "9a23c1a96c0513d8fc6520972beedd419a973539" } @@ -555,18 +555,18 @@ unicode-segmentation = "1.10" unicode-script = "0.5.7" url = "2.2" uuid = { version = "1.1.2", features = ["v4", "v5", "v7", "serde"] } -wasmparser = "0.217" -wasm-encoder = "0.217" -wasmtime = { version = "25", default-features = false, features = [ +wasmparser = "0.221" +wasm-encoder = "0.221" +wasmtime = { version = "29", default-features = false, features = [ "async", "demangle", "runtime", "cranelift", "component-model", ] } -wasmtime-wasi = "25" +wasmtime-wasi = "29" which = "6.0.0" -wit-component = "0.201" +wit-component = "0.221" zed_llm_client = "0.4" zstd = "0.11" metal = "0.31" diff --git a/crates/editor/src/editor_tests.rs b/crates/editor/src/editor_tests.rs index c6005bd92b..144782b9a4 100644 --- a/crates/editor/src/editor_tests.rs +++ b/crates/editor/src/editor_tests.rs @@ -6283,7 +6283,7 @@ async fn test_autoclose_with_embedded_language(cx: &mut gpui::TestAppContext) { autoclose_before: "})]>".into(), ..Default::default() }, - Some(tree_sitter_html::language()), + Some(tree_sitter_html::LANGUAGE.into()), ) .with_injection_query( r#" @@ -9685,7 +9685,7 @@ async fn test_toggle_block_comment(cx: &mut gpui::TestAppContext) { block_comment: Some(("".into())), ..Default::default() }, - Some(tree_sitter_html::language()), + Some(tree_sitter_html::LANGUAGE.into()), ) .with_injection_query( r#" diff --git a/crates/editor/src/test/editor_lsp_test_context.rs b/crates/editor/src/test/editor_lsp_test_context.rs index 8a48700adc..45e28fa23a 100644 --- a/crates/editor/src/test/editor_lsp_test_context.rs +++ b/crates/editor/src/test/editor_lsp_test_context.rs @@ -254,7 +254,7 @@ impl EditorLspTestContext { word_characters: ['-'].into_iter().collect(), ..Default::default() }, - Some(tree_sitter_html::language()), + Some(tree_sitter_html::LANGUAGE.into()), ) .with_queries(LanguageQueries { brackets: Some(Cow::from(indoc! {r#" diff --git a/crates/extension/src/extension_builder.rs b/crates/extension/src/extension_builder.rs index a8f9675f27..9a634e6760 100644 --- a/crates/extension/src/extension_builder.rs +++ b/crates/extension/src/extension_builder.rs @@ -168,7 +168,7 @@ impl ExtensionBuilder { let wasm_bytes = fs::read(&wasm_path) .with_context(|| format!("failed to read output module `{}`", wasm_path.display()))?; - let encoder = ComponentEncoder::default() + let mut encoder = ComponentEncoder::default() .module(&wasm_bytes)? .adapter("wasi_snapshot_preview1", &adapter_bytes) .context("failed to load adapter module")? diff --git a/crates/extension_host/src/wasm_host/wit/since_v0_0_1.rs b/crates/extension_host/src/wasm_host/wit/since_v0_0_1.rs index 1ce43ca203..1ebf3ee3a7 100644 --- a/crates/extension_host/src/wasm_host/wit/since_v0_0_1.rs +++ b/crates/extension_host/src/wasm_host/wit/since_v0_0_1.rs @@ -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 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> { latest::nodejs::Host::node_binary_path(self).await diff --git a/crates/extension_host/src/wasm_host/wit/since_v0_0_4.rs b/crates/extension_host/src/wasm_host/wit/since_v0_0_4.rs index 315f69fc27..73fc9fec31 100644 --- a/crates/extension_host/src/wasm_host/wit/since_v0_0_4.rs +++ b/crates/extension_host/src/wasm_host/wit/since_v0_0_4.rs @@ -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 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> { latest::nodejs::Host::node_binary_path(self).await diff --git a/crates/extension_host/src/wasm_host/wit/since_v0_0_6.rs b/crates/extension_host/src/wasm_host/wit/since_v0_0_6.rs index 98ecdf40ec..3c0b682490 100644 --- a/crates/extension_host/src/wasm_host/wit/since_v0_0_6.rs +++ b/crates/extension_host/src/wasm_host/wit/since_v0_0_6.rs @@ -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 for latest::CodeLabel { } } -#[async_trait] impl HostWorktree for WasmState { async fn id(&mut self, delegate: Resource>) -> wasmtime::Result { 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, diff --git a/crates/extension_host/src/wasm_host/wit/since_v0_1_0.rs b/crates/extension_host/src/wasm_host/wit/since_v0_1_0.rs index 058a86ab36..37db2197c9 100644 --- a/crates/extension_host/src/wasm_host/wit/since_v0_1_0.rs +++ b/crates/extension_host/src/wasm_host/wit/since_v0_1_0.rs @@ -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 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>) -> wasmtime::Result { 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, diff --git a/crates/extension_host/src/wasm_host/wit/since_v0_2_0.rs b/crates/extension_host/src/wasm_host/wit/since_v0_2_0.rs index f9bebf0c01..15596ce65a 100644 --- a/crates/extension_host/src/wasm_host/wit/since_v0_2_0.rs +++ b/crates/extension_host/src/wasm_host/wit/since_v0_2_0.rs @@ -247,7 +247,6 @@ impl From 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>) -> wasmtime::Result { 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> { 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, diff --git a/crates/language/src/buffer.rs b/crates/language/src/buffer.rs index e3fbebb9c8..8d40d2dd49 100644 --- a/crates/language/src/buffer.rs +++ b/crates/language/src/buffer.rs @@ -2915,7 +2915,7 @@ impl BufferSnapshot { let mut error_ranges = Vec::>::new(); let mut matches = self.syntax.matches(range.clone(), &self.text, |grammar| { - Some(&grammar.error_query) + grammar.error_query.as_ref() }); while let Some(mat) = matches.peek() { let node = mat.captures[0].node; diff --git a/crates/language/src/buffer_tests.rs b/crates/language/src/buffer_tests.rs index 4a2f94b835..84aef374ca 100644 --- a/crates/language/src/buffer_tests.rs +++ b/crates/language/src/buffer_tests.rs @@ -3149,7 +3149,7 @@ fn html_lang() -> Language { block_comment: Some(("".into())), ..Default::default() }, - Some(tree_sitter_html::language()), + Some(tree_sitter_html::LANGUAGE.into()), ) .with_indents_query( " diff --git a/crates/language/src/language.rs b/crates/language/src/language.rs index 02facaed4a..06459df30b 100644 --- a/crates/language/src/language.rs +++ b/crates/language/src/language.rs @@ -915,7 +915,7 @@ impl GrammarId { pub struct Grammar { id: GrammarId, pub ts_language: tree_sitter::Language, - pub(crate) error_query: Query, + pub(crate) error_query: Option, pub(crate) highlights_query: Option, pub(crate) brackets_config: Option, pub(crate) redactions_config: Option, @@ -1070,7 +1070,7 @@ impl Language { override_config: None, redactions_config: None, runnable_config: None, - error_query: Query::new(&ts_language, "(ERROR) @error").unwrap(), + error_query: Query::new(&ts_language, "(ERROR) @error").ok(), ts_language, highlight_map: Default::default(), }) @@ -1723,12 +1723,13 @@ impl Grammar { .expect("incompatible grammar"); let mut chunks = text.chunks_in_range(0..text.len()); parser - .parse_with( + .parse_with_options( &mut move |offset, _| { chunks.seek(offset); chunks.next().unwrap_or("").as_bytes() }, old_tree.as_ref(), + None, ) .unwrap() }) diff --git a/crates/language/src/syntax_map.rs b/crates/language/src/syntax_map.rs index 7369501a06..e1dfe0eab1 100644 --- a/crates/language/src/syntax_map.rs +++ b/crates/language/src/syntax_map.rs @@ -1238,12 +1238,13 @@ fn parse_text( parser.set_included_ranges(&ranges)?; parser.set_language(&grammar.ts_language)?; parser - .parse_with( + .parse_with_options( &mut move |offset, _| { chunks.seek(start_byte + offset); chunks.next().unwrap_or("").as_bytes() }, old_tree.as_ref(), + None, ) .ok_or_else(|| anyhow::anyhow!("failed to parse")) }) diff --git a/crates/language/src/syntax_map/syntax_map_tests.rs b/crates/language/src/syntax_map/syntax_map_tests.rs index a3f2951f0b..39413936a2 100644 --- a/crates/language/src/syntax_map/syntax_map_tests.rs +++ b/crates/language/src/syntax_map/syntax_map_tests.rs @@ -1134,7 +1134,7 @@ fn html_lang() -> Language { }, ..Default::default() }, - Some(tree_sitter_html::language()), + Some(tree_sitter_html::LANGUAGE.into()), ) .with_highlights_query( r#"