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

@ -110,8 +110,7 @@ jobs:
timeout-minutes: 60
name: (Linux) Run Clippy and tests
runs-on:
- self-hosted
- deploy
- hosted-linux-x86-1
steps:
- name: Add Rust to the PATH
run: echo "$HOME/.cargo/bin" >> $GITHUB_PATH
@ -121,6 +120,9 @@ jobs:
with:
clean: false
- name: Install Linux dependencies
run: ./script/linux
- name: cargo clippy
run: ./script/clippy
@ -271,22 +273,21 @@ jobs:
timeout-minutes: 60
name: Create a Linux bundle
runs-on:
- self-hosted
- deploy
- hosted-linux-x86-1
if: ${{ startsWith(github.ref, 'refs/tags/v') || contains(github.event.pull_request.labels.*.name, 'run-bundling') }}
needs: [linux_tests]
env:
ZED_CLIENT_CHECKSUM_SEED: ${{ secrets.ZED_CLIENT_CHECKSUM_SEED }}
ZED_CLOUD_PROVIDER_ADDITIONAL_MODELS_JSON: ${{ secrets.ZED_CLOUD_PROVIDER_ADDITIONAL_MODELS_JSON }}
steps:
- name: Add Rust to the PATH
run: echo "$HOME/.cargo/bin" >> $GITHUB_PATH
- name: Checkout repo
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4
with:
clean: false
- name: Install Linux dependencies
run: ./script/linux
- name: Limit target directory size
run: script/clear-target-dir-if-larger-than 100
@ -354,23 +355,9 @@ jobs:
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4
with:
clean: false
- name: "Setup jq"
uses: dcarbone/install-jq-action@8867ddb4788346d7c22b72ea2e2ffe4d514c7bcb # v2
- name: Set up Clang
run: |
sudo apt-get update
sudo apt-get install -y llvm-15 clang-15 build-essential cmake pkg-config libasound2-dev libfontconfig-dev libwayland-dev libxkbcommon-x11-dev libssl-dev libsqlite3-dev libzstd-dev libvulkan1 libgit2-dev
echo "/usr/lib/llvm-15/bin" >> $GITHUB_PATH
- uses: rui314/setup-mold@0bf4f07ef9048ec62a45f9dbf2f098afa49695f0 # v1
with:
mold-version: 2.32.0
- name: rustup
run: |
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
echo "$HOME/.cargo/bin" >> $GITHUB_PATH
- name: Install Linux dependencies
run: ./script/linux
- name: Limit target directory size
run: script/clear-target-dir-if-larger-than 100

View file

@ -145,23 +145,8 @@ jobs:
with:
clean: false
- name: "Setup jq"
uses: dcarbone/install-jq-action@8867ddb4788346d7c22b72ea2e2ffe4d514c7bcb # v2
- name: Set up Clang
run: |
sudo apt-get update
sudo apt-get install -y llvm-10 clang-10 build-essential cmake pkg-config libasound2-dev libfontconfig-dev libwayland-dev libxkbcommon-x11-dev libssl-dev libsqlite3-dev libzstd-dev libvulkan1 libgit2-dev
echo "/usr/lib/llvm-10/bin" >> $GITHUB_PATH
- uses: rui314/setup-mold@0bf4f07ef9048ec62a45f9dbf2f098afa49695f0 # v1
with:
mold-version: 2.32.0
- name: rustup
run: |
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
echo "$HOME/.cargo/bin" >> $GITHUB_PATH
- name: Install Linux dependencies
run: ./script/linux
- name: Limit target directory size
run: script/clear-target-dir-if-larger-than 100

354
Cargo.lock generated
View file

@ -25,7 +25,7 @@ version = "0.22.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "6e4503c46a5c0c7844e948c9a4d6acd9f50cccb4de1c48eb9e291ea17470c678"
dependencies = [
"gimli 0.29.0",
"gimli",
]
[[package]]
@ -1486,7 +1486,7 @@ dependencies = [
"cfg-if",
"libc",
"miniz_oxide 0.7.4",
"object 0.36.4",
"object",
"rustc-demangle",
]
@ -3033,27 +3033,38 @@ dependencies = [
[[package]]
name = "cranelift-bforest"
version = "0.108.1"
version = "0.111.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "29daf137addc15da6bab6eae2c4a11e274b1d270bf2759508e62f6145e863ef6"
checksum = "b80c3a50b9c4c7e5b5f73c0ed746687774fc9e36ef652b110da8daebf0c6e0e6"
dependencies = [
"cranelift-entity",
]
[[package]]
name = "cranelift-codegen"
version = "0.108.1"
name = "cranelift-bitset"
version = "0.111.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "de619867d5de4c644b7fd9904d6e3295269c93d8a71013df796ab338681222d4"
checksum = "38778758c2ca918b05acb2199134e0c561fb577c50574259b26190b6c2d95ded"
dependencies = [
"serde",
"serde_derive",
]
[[package]]
name = "cranelift-codegen"
version = "0.111.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "58258667ad10e468bfc13a8d620f50dfcd4bb35d668123e97defa2549b9ad397"
dependencies = [
"bumpalo",
"cranelift-bforest",
"cranelift-bitset",
"cranelift-codegen-meta",
"cranelift-codegen-shared",
"cranelift-control",
"cranelift-entity",
"cranelift-isle",
"gimli 0.28.1",
"gimli",
"hashbrown 0.14.5",
"log",
"regalloc2",
@ -3064,43 +3075,44 @@ dependencies = [
[[package]]
name = "cranelift-codegen-meta"
version = "0.108.1"
version = "0.111.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "29f5cf277490037d8dae9513d35e0ee8134670ae4a964a5ed5b198d4249d7c10"
checksum = "043f0b702e529dcb07ff92bd7d40e7d5317b5493595172c5eb0983343751ee06"
dependencies = [
"cranelift-codegen-shared",
]
[[package]]
name = "cranelift-codegen-shared"
version = "0.108.1"
version = "0.111.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8c3e22ecad1123343a3c09ac6ecc532bb5c184b6fcb7888df0ea953727f79924"
checksum = "7763578888ab53eca5ce7da141953f828e82c2bfadcffc106d10d1866094ffbb"
[[package]]
name = "cranelift-control"
version = "0.108.1"
version = "0.111.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "53ca3ec6d30bce84ccf59c81fead4d16381a3ef0ef75e8403bc1e7385980da09"
checksum = "32db15f08c05df570f11e8ab33cb1ec449a64b37c8a3498377b77650bef33d8b"
dependencies = [
"arbitrary",
]
[[package]]
name = "cranelift-entity"
version = "0.108.1"
version = "0.111.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7eabb8d36b0ca8906bec93c78ea516741cac2d7e6b266fa7b0ffddcc09004990"
checksum = "5289cdb399381a27e7bbfa1b42185916007c3d49aeef70b1d01cb4caa8010130"
dependencies = [
"cranelift-bitset",
"serde",
"serde_derive",
]
[[package]]
name = "cranelift-frontend"
version = "0.108.1"
version = "0.111.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "44b42630229e49a8cfcae90bdc43c8c4c08f7a7aa4618b67f79265cd2f996dd2"
checksum = "31ba8ab24eb9470477e98ddfa3c799a649ac5a0d9a2042868c4c952133c234e8"
dependencies = [
"cranelift-codegen",
"log",
@ -3110,15 +3122,15 @@ dependencies = [
[[package]]
name = "cranelift-isle"
version = "0.108.1"
version = "0.111.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "918d1e36361805dfe0b6cdfd5a5ffdb5d03fa796170c5717d2727cbe623b93a0"
checksum = "2b72a3c5c166a70426dcb209bdd0bb71a787c1ea76023dc0974fbabca770e8f9"
[[package]]
name = "cranelift-native"
version = "0.108.1"
version = "0.111.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "75aea85a0d7e1800b14ce9d3f53adf8ad4d1ee8a9e23b0269bdc50285e93b9b3"
checksum = "46a42424c956bbc31fc5c2706073df896156c5420ae8fa2a5d48dbc7b295d71b"
dependencies = [
"cranelift-codegen",
"libc",
@ -3127,9 +3139,9 @@ dependencies = [
[[package]]
name = "cranelift-wasm"
version = "0.108.1"
version = "0.111.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "dac491fd3473944781f0cf9528c90cc899d18ad438da21961a839a3a44d57dfb"
checksum = "49778df4289933d735b93c30a345513e030cf83101de0036e19b760f8aa09f68"
dependencies = [
"cranelift-codegen",
"cranelift-entity",
@ -3137,7 +3149,7 @@ dependencies = [
"itertools 0.12.1",
"log",
"smallvec",
"wasmparser 0.207.0",
"wasmparser 0.215.0",
"wasmtime-types",
]
@ -4091,8 +4103,8 @@ dependencies = [
"ui",
"url",
"util",
"wasm-encoder 0.201.0",
"wasmparser 0.201.0",
"wasm-encoder 0.215.0",
"wasmparser 0.215.0",
"wasmtime",
"wasmtime-wasi",
"wit-component",
@ -4804,21 +4816,15 @@ dependencies = [
[[package]]
name = "gimli"
version = "0.28.1"
version = "0.29.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "4271d37baee1b8c7e4b708028c57d816cf9d2434acb33a549475f78c181f6253"
checksum = "40ecd4077b5ae9fd2e9e169b102c6c330d0605168eb0e8bf79952b256dbefffd"
dependencies = [
"fallible-iterator",
"indexmap 2.4.0",
"stable_deref_trait",
]
[[package]]
name = "gimli"
version = "0.29.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "40ecd4077b5ae9fd2e9e169b102c6c330d0605168eb0e8bf79952b256dbefffd"
[[package]]
name = "git"
version = "0.1.0"
@ -5187,6 +5193,7 @@ checksum = "e5274423e17b7c9fc20b6e7e208532f9b19825d82dfd615708b70edd83df41f1"
dependencies = [
"ahash 0.8.11",
"allocator-api2",
"serde",
]
[[package]]
@ -7406,24 +7413,15 @@ dependencies = [
"malloc_buf",
]
[[package]]
name = "object"
version = "0.33.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d8dd6c0cdf9429bce006e1362bfce61fa1bfd8c898a643ed8d2b471934701d3d"
dependencies = [
"crc32fast",
"hashbrown 0.14.5",
"indexmap 2.4.0",
"memchr",
]
[[package]]
name = "object"
version = "0.36.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "084f1a5821ac4c651660a94a7153d27ac9d8a53736203f58b31945ded098070a"
dependencies = [
"crc32fast",
"hashbrown 0.14.5",
"indexmap 2.4.0",
"memchr",
]
@ -8569,11 +8567,10 @@ checksum = "106dd99e98437432fed6519dedecfade6a06a73bb7b2a1e019fdd2bee5778d94"
[[package]]
name = "protols-tree-sitter-proto"
version = "0.2.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9bac092da66e21a71eb832925de7b542f8ac34f75fd05cd2fc3e272863e3fd2b"
source = "git+https://github.com/zed-industries/tree-sitter-proto?rev=0848bd30a64be48772e15fbb9d5ba8c0cc5772ad#0848bd30a64be48772e15fbb9d5ba8c0cc5772ad"
dependencies = [
"cc",
"tree-sitter",
"tree-sitter-language",
]
[[package]]
@ -11971,110 +11968,112 @@ dependencies = [
[[package]]
name = "tree-sitter"
version = "0.22.6"
source = "git+https://github.com/tree-sitter/tree-sitter?rev=7f4a57817d58a2f134fe863674acad6bbf007228#7f4a57817d58a2f134fe863674acad6bbf007228"
version = "0.23.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "20f4cd3642c47a85052a887d86704f4eac272969f61b686bdd3f772122aabaff"
dependencies = [
"cc",
"regex",
"regex-syntax 0.8.4",
"tree-sitter-language",
"wasmtime-c-api-impl",
]
[[package]]
name = "tree-sitter-bash"
version = "0.21.0"
version = "0.23.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b5244703ad2e08a616d859a0557d7aa290adcd5e0990188a692e628ffe9dce40"
checksum = "3aa5e1c6bd02c0053f3f68edcf5d8866b38a8640584279e30fca88149ce14dda"
dependencies = [
"cc",
"tree-sitter",
"tree-sitter-language",
]
[[package]]
name = "tree-sitter-c"
version = "0.21.4"
version = "0.23.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f956d5351d62652864a4ff3ae861747e7a1940dc96c9998ae400ac0d3ce30427"
checksum = "e795ad541f7ae6a80d22975296340a75a12a29afd3a7089f4368021613728e17"
dependencies = [
"cc",
"tree-sitter",
"tree-sitter-language",
]
[[package]]
name = "tree-sitter-cpp"
version = "0.22.3"
version = "0.23.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1d509a22a992790d38f2c291961ff8a1ff016c437c7ec6befc9220b8eec8918c"
checksum = "c0a588a816017469b69f2e3544742e34a5a59dddfb4b9457b657a6052e2ea39c"
dependencies = [
"cc",
"tree-sitter",
"tree-sitter-language",
]
[[package]]
name = "tree-sitter-css"
version = "0.21.1"
version = "0.23.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5e08e324b1cf60fd3291774b49724c66de2ce8fcf4d358d0b4b82e37b41b1c9b"
checksum = "8d0018d6b1692a806f9cddaa1e5616951fd58840c39a0b21401b55ab3df12292"
dependencies = [
"cc",
"tree-sitter",
"tree-sitter-language",
]
[[package]]
name = "tree-sitter-elixir"
version = "0.2.0"
version = "0.3.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "df94bf7f057768b1cab2ee1f14812ed4ae33f9e04d09254043eeaa797db4ef70"
checksum = "6174acad8a059851f6f768d7893f4b25eedc80eb6643283d545dd71bbb38222a"
dependencies = [
"cc",
"tree-sitter",
"tree-sitter-language",
]
[[package]]
name = "tree-sitter-embedded-template"
version = "0.20.0"
version = "0.23.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "33817ade928c73a32d4f904a602321e09de9fc24b71d106f3b4b3f8ab30dcc38"
checksum = "9644d7586ebe850c84037ee2f4804dda4a9348eef053be6b1e0d7712342a2495"
dependencies = [
"cc",
"tree-sitter",
"tree-sitter-language",
]
[[package]]
name = "tree-sitter-go"
version = "0.21.2"
version = "0.23.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b8d702a98d3c7e70e466456e58ff2b1ac550bf1e29b97e5770676d2fdabec00d"
checksum = "caf57626e4c9b6d6efaf8a8d5ee1241c5f178ae7bfdf693713ae6a774f01424e"
dependencies = [
"cc",
"tree-sitter",
"tree-sitter-language",
]
[[package]]
name = "tree-sitter-gomod"
version = "1.0.2"
source = "git+https://github.com/camdencheek/tree-sitter-go-mod?rev=1f55029bacd0a6a11f6eb894c4312d429dcf735c#1f55029bacd0a6a11f6eb894c4312d429dcf735c"
source = "git+https://github.com/zed-industries/tree-sitter-go-mod?rev=a9aea5e358cde4d0f8ff20b7bc4fa311e359c7ca#a9aea5e358cde4d0f8ff20b7bc4fa311e359c7ca"
dependencies = [
"cc",
"tree-sitter",
"tree-sitter-language",
]
[[package]]
name = "tree-sitter-gowork"
version = "0.0.1"
source = "git+https://github.com/d1y/tree-sitter-go-work?rev=dcbabff454703c3a4bc98a23cf8778d4be46fd22#dcbabff454703c3a4bc98a23cf8778d4be46fd22"
source = "git+https://github.com/zed-industries/tree-sitter-go-work?rev=acb0617bf7f4fda02c6217676cc64acb89536dc7#acb0617bf7f4fda02c6217676cc64acb89536dc7"
dependencies = [
"cc",
"tree-sitter",
"tree-sitter-language",
]
[[package]]
name = "tree-sitter-heex"
version = "0.0.1"
source = "git+https://github.com/phoenixframework/tree-sitter-heex?rev=6dd0303acf7138dd2b9b432a229e16539581c701#6dd0303acf7138dd2b9b432a229e16539581c701"
source = "git+https://github.com/zed-industries/tree-sitter-heex?rev=1dd45142fbb05562e35b2040c6129c9bca346592#1dd45142fbb05562e35b2040c6129c9bca346592"
dependencies = [
"cc",
"tree-sitter",
"tree-sitter-language",
]
[[package]]
@ -12089,96 +12088,96 @@ dependencies = [
[[package]]
name = "tree-sitter-jsdoc"
version = "0.21.0"
version = "0.23.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8d07920101ff12a59574890318a37fa7e18d9c06d9aa4be334aa24adbb480f18"
checksum = "f8c4049eb0ad690e34e5f63640f75ce12a2ff8ba18344d0a13926805b139c0c8"
dependencies = [
"cc",
"tree-sitter",
"tree-sitter-language",
]
[[package]]
name = "tree-sitter-json"
version = "0.21.0"
version = "0.23.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5b737dcb73c35d74b7d64a5f3dde158113c86a012bf3cee2bfdf2150d23b05db"
checksum = "86a5d6b3ea17e06e7a34aabeadd68f5866c0d0f9359155d432095f8b751865e4"
dependencies = [
"cc",
"tree-sitter",
"tree-sitter-language",
]
[[package]]
name = "tree-sitter-language"
version = "0.1.0"
source = "git+https://github.com/tree-sitter/tree-sitter?rev=7f4a57817d58a2f134fe863674acad6bbf007228#7f4a57817d58a2f134fe863674acad6bbf007228"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2545046bd1473dac6c626659cc2567c6c0ff302fc8b84a56c4243378276f7f57"
[[package]]
name = "tree-sitter-md"
version = "0.2.3"
source = "git+https://github.com/zed-industries/tree-sitter-markdown?rev=e3855e37f8f2c71aa7513c18a9c95fb7461b1b10#e3855e37f8f2c71aa7513c18a9c95fb7461b1b10"
version = "0.3.2"
source = "git+https://github.com/zed-industries/tree-sitter-markdown?rev=4cfa6aad6b75052a5077c80fd934757d9267d81b#4cfa6aad6b75052a5077c80fd934757d9267d81b"
dependencies = [
"cc",
"tree-sitter",
"tree-sitter-language",
]
[[package]]
name = "tree-sitter-python"
version = "0.21.0"
version = "0.23.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b4066c6cf678f962f8c2c4561f205945c84834cce73d981e71392624fdc390a9"
checksum = "65661b1a3e24139e2e54207e47d910ab07e28790d78efc7d5dc3a11ce2a110eb"
dependencies = [
"cc",
"tree-sitter",
"tree-sitter-language",
]
[[package]]
name = "tree-sitter-regex"
version = "0.21.0"
version = "0.23.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5ff1286fe9651b2797484839ffa37aa76c8618d4ccb6836d7e31765dfd60c0d5"
checksum = "0b9a7087b1cf769c96b7e74414947df067fb6135f04d176fd23be08b9396cc0e"
dependencies = [
"cc",
"tree-sitter",
"tree-sitter-language",
]
[[package]]
name = "tree-sitter-ruby"
version = "0.21.0"
version = "0.23.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c0031f687c0772f2dad7b77104c43428611099a1804c81244ada21560f41f0b1"
checksum = "6ec5ee842e27791e0adffa0b2a177614de51d2a26e5c7e84d014ed7f097e5ed0"
dependencies = [
"cc",
"tree-sitter",
"tree-sitter-language",
]
[[package]]
name = "tree-sitter-rust"
version = "0.21.2"
version = "0.23.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "277690f420bf90741dea984f3da038ace46c4fe6047cba57a66822226cde1c93"
checksum = "cffbbcb780348fbae8395742ae5b34c1fd794e4085d43aac9f259387f9a84dc8"
dependencies = [
"cc",
"tree-sitter",
"tree-sitter-language",
]
[[package]]
name = "tree-sitter-typescript"
version = "0.21.2"
version = "0.23.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ecb35d98a688378e56c18c9c159824fd16f730ccbea19aacf4f206e5d5438ed9"
checksum = "aecf1585ae2a9dddc2b1d4c0e2140b2ec9876e2a25fd79de47fcf7dae0384685"
dependencies = [
"cc",
"tree-sitter",
"tree-sitter-language",
]
[[package]]
name = "tree-sitter-yaml"
version = "0.6.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "aad27ec46ad343d8b514f64dd3fdffb478c592ece561b6c935d90ef55589c6b6"
source = "git+https://github.com/zed-industries/tree-sitter-yaml?rev=baff0b51c64ef6a1fb1f8390f3ad6015b83ec13a#baff0b51c64ef6a1fb1f8390f3ad6015b83ec13a"
dependencies = [
"cc",
"tree-sitter",
"tree-sitter-language",
]
[[package]]
@ -12812,9 +12811,9 @@ dependencies = [
[[package]]
name = "wasm-encoder"
version = "0.207.0"
version = "0.215.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d996306fb3aeaee0d9157adbe2f670df0236caf19f6728b221e92d0f27b3fe17"
checksum = "4fb56df3e06b8e6b77e37d2969a50ba51281029a9aeb3855e76b7f49b6418847"
dependencies = [
"leb128",
]
@ -12848,35 +12847,38 @@ dependencies = [
[[package]]
name = "wasmparser"
version = "0.207.0"
version = "0.215.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e19bb9f8ab07616da582ef8adb24c54f1424c7ec876720b7da9db8ec0626c92c"
checksum = "53fbde0881f24199b81cf49b6ff8f9c145ac8eb1b7fc439adb5c099734f7d90e"
dependencies = [
"ahash 0.8.11",
"bitflags 2.6.0",
"hashbrown 0.14.5",
"indexmap 2.4.0",
"semver",
"serde",
]
[[package]]
name = "wasmprinter"
version = "0.207.0"
version = "0.215.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9c2d8a7b4dabb460208e6b4334d9db5766e84505038b2529e69c3d07ac619115"
checksum = "d8e9a325d85053408209b3d2ce5eaddd0dd6864d1cff7a007147ba073157defc"
dependencies = [
"anyhow",
"wasmparser 0.207.0",
"termcolor",
"wasmparser 0.215.0",
]
[[package]]
name = "wasmtime"
version = "21.0.1"
version = "24.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f92a1370c66a0022e6d92dcc277e2c84f5dece19569670b8ce7db8162560d8b6"
checksum = "9a5883d64dfc8423c56e3d8df27cffc44db25336aa468e8e0724fddf30a333d7"
dependencies = [
"anyhow",
"async-trait",
"bitflags 2.6.0",
"bumpalo",
"cc",
"cfg-if",
@ -12888,8 +12890,7 @@ dependencies = [
"log",
"mach2",
"memfd",
"memoffset",
"object 0.33.0",
"object",
"once_cell",
"paste",
"postcard",
@ -12901,7 +12902,7 @@ dependencies = [
"smallvec",
"sptr",
"target-lexicon",
"wasmparser 0.207.0",
"wasmparser 0.215.0",
"wasmtime-asm-macros",
"wasmtime-component-macro",
"wasmtime-component-util",
@ -12917,18 +12918,18 @@ dependencies = [
[[package]]
name = "wasmtime-asm-macros"
version = "21.0.1"
version = "24.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "6dee8679c974a7f258c03d60d3c747c426ed219945b6d08cbc77fd2eab15b2d1"
checksum = "1c4dc7e2a379c0dd6be5b55857d14c4b277f43a9c429a9e14403eb61776ae3be"
dependencies = [
"cfg-if",
]
[[package]]
name = "wasmtime-c-api-impl"
version = "21.0.1"
version = "24.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "76af8b62c8d2814b7d5975c5dc140122e4c086150db6c15d25a4b76f11c929dd"
checksum = "765e302e7d9125e614aaeec3ad6b6083605393004eca00214106a4ff6b47fc58"
dependencies = [
"anyhow",
"log",
@ -12940,9 +12941,9 @@ dependencies = [
[[package]]
name = "wasmtime-c-api-macros"
version = "21.0.1"
version = "24.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d74b92f917c9ced9c6262a00e9cb982ebac183e6900b4d44e2480f936b9495eb"
checksum = "2d09d02eaa84aa2de5babee7b0296557ad6e4903bb10aa8d135e393e753a43d6"
dependencies = [
"proc-macro2",
"quote",
@ -12950,9 +12951,9 @@ dependencies = [
[[package]]
name = "wasmtime-component-macro"
version = "21.0.1"
version = "24.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "32cae30035f1cf97dcc6657c979cf39f99ce6be93583675eddf4aeaa5548509c"
checksum = "4b07773d1c3dab5f014ec61316ee317aa424033e17e70a63abdf7c3a47e58fcf"
dependencies = [
"anyhow",
"proc-macro2",
@ -12960,20 +12961,20 @@ dependencies = [
"syn 2.0.76",
"wasmtime-component-util",
"wasmtime-wit-bindgen",
"wit-parser 0.207.0",
"wit-parser 0.215.0",
]
[[package]]
name = "wasmtime-component-util"
version = "21.0.1"
version = "24.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f7ae611f08cea620c67330925be28a96115bf01f8f393a6cbdf4856a86087134"
checksum = "e38d735320f4e83478369ce649ad8fe87c6b893220902e798547a225fc0c5874"
[[package]]
name = "wasmtime-cranelift"
version = "21.0.1"
version = "24.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b2909406a6007e28be964067167890bca4574bd48a9ff18f1fa9f4856d89ea40"
checksum = "e570d831d0785d93d7d8c722b1eb9a34e0d0c1534317666f65892818358a2da9"
dependencies = [
"anyhow",
"cfg-if",
@ -12983,36 +12984,38 @@ dependencies = [
"cranelift-frontend",
"cranelift-native",
"cranelift-wasm",
"gimli 0.28.1",
"gimli",
"log",
"object 0.33.0",
"object",
"target-lexicon",
"thiserror",
"wasmparser 0.207.0",
"wasmparser 0.215.0",
"wasmtime-environ",
"wasmtime-versioned-export-macros",
]
[[package]]
name = "wasmtime-environ"
version = "21.0.1"
version = "24.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "40e227f9ed2f5421473723d6c0352b5986e6e6044fde5410a274a394d726108f"
checksum = "c5fe80dfbd81687431a7d4f25929fae1ae96894786d5c96b14ae41164ee97377"
dependencies = [
"anyhow",
"cpp_demangle",
"cranelift-bitset",
"cranelift-entity",
"gimli 0.28.1",
"gimli",
"indexmap 2.4.0",
"log",
"object 0.33.0",
"object",
"postcard",
"rustc-demangle",
"semver",
"serde",
"serde_derive",
"target-lexicon",
"wasm-encoder 0.207.0",
"wasmparser 0.207.0",
"wasm-encoder 0.215.0",
"wasmparser 0.215.0",
"wasmprinter",
"wasmtime-component-util",
"wasmtime-types",
@ -13020,9 +13023,9 @@ dependencies = [
[[package]]
name = "wasmtime-fiber"
version = "21.0.1"
version = "24.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "42edb392586d07038c1638e854382db916b6ca7845a2e6a7f8dc49e08907acdd"
checksum = "0f39043d13c7b58db69dc9a0feb191a961e75a9ec2402aebf42de183c022bb8a"
dependencies = [
"anyhow",
"cc",
@ -13035,9 +13038,9 @@ dependencies = [
[[package]]
name = "wasmtime-jit-icache-coherence"
version = "21.0.1"
version = "24.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "afe088f9b56bb353adaf837bf7e10f1c2e1676719dd5be4cac8e37f2ba1ee5bc"
checksum = "d15de8429db996f0d17a4163a35eccc3f874cbfb50f29c379951ea1bbb39452e"
dependencies = [
"anyhow",
"cfg-if",
@ -13047,28 +13050,29 @@ dependencies = [
[[package]]
name = "wasmtime-slab"
version = "21.0.1"
version = "24.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "4ff75cafffe47b04b036385ce3710f209153525b0ed19d57b0cf44a22d446460"
checksum = "1f68d38fa6b30c5e1fc7d608263062997306f79e577ebd197ddcd6b0f55d87d1"
[[package]]
name = "wasmtime-types"
version = "21.0.1"
version = "24.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2f2fa462bfea3220711c84e2b549f147e4df89eeb49b8a2a3d89148f6cc4a8b1"
checksum = "6634e7079d9c5cfc81af8610ed59b488cc5b7f9777a2f4c1667a2565c2e45249"
dependencies = [
"anyhow",
"cranelift-entity",
"serde",
"serde_derive",
"smallvec",
"wasmparser 0.207.0",
"wasmparser 0.215.0",
]
[[package]]
name = "wasmtime-versioned-export-macros"
version = "21.0.1"
version = "24.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d4cedc5bfef3db2a85522ee38564b47ef3b7fc7c92e94cacbce99808e63cdd47"
checksum = "3850e3511d6c7f11a72d571890b0ed5f6204681f7f050b9de2690e7f13123fed"
dependencies = [
"proc-macro2",
"quote",
@ -13077,9 +13081,9 @@ dependencies = [
[[package]]
name = "wasmtime-wasi"
version = "21.0.1"
version = "24.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "bdbbe94245904d4c96c7c5f7b55bad896cc27908644efd9442063c0748b631fc"
checksum = "545ae8298ffce025604f7480f9c7d6948c985bef7ce9aee249ef79307813e83c"
dependencies = [
"anyhow",
"async-trait",
@ -13108,16 +13112,16 @@ dependencies = [
[[package]]
name = "wasmtime-winch"
version = "21.0.1"
version = "24.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "97b27054fed6be4f3800aba5766f7ef435d4220ce290788f021a08d4fa573108"
checksum = "2a25199625effa4c13dd790d64bd56884b014c69829431bfe43991c740bd5bc1"
dependencies = [
"anyhow",
"cranelift-codegen",
"gimli 0.28.1",
"object 0.33.0",
"gimli",
"object",
"target-lexicon",
"wasmparser 0.207.0",
"wasmparser 0.215.0",
"wasmtime-cranelift",
"wasmtime-environ",
"winch-codegen",
@ -13125,14 +13129,14 @@ dependencies = [
[[package]]
name = "wasmtime-wit-bindgen"
version = "21.0.1"
version = "24.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c936a52ce69c28de2aa3b5fb4f2dbbb2966df304f04cccb7aca4ba56d915fda0"
checksum = "3cb331ac7ed1d5ba49cddcdb6b11973752a857148858bb308777d2fc5584121f"
dependencies = [
"anyhow",
"heck 0.4.1",
"indexmap 2.4.0",
"wit-parser 0.207.0",
"wit-parser 0.215.0",
]
[[package]]
@ -13313,9 +13317,9 @@ dependencies = [
[[package]]
name = "wiggle"
version = "21.0.1"
version = "24.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a89ea6f74ece6d1cfbd089783006b8eb69a0219ca83cad22068f0d9fa9df3f91"
checksum = "cc850ca3c02c5835934d23f28cec4c5a3fb66fe0b4ecd968bbb35609dda5ddc0"
dependencies = [
"anyhow",
"async-trait",
@ -13328,9 +13332,9 @@ dependencies = [
[[package]]
name = "wiggle-generate"
version = "21.0.1"
version = "24.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "36beda94813296ecaf0d91b7ada9da073fd41865ba339bdd3b7764e2e785b8e9"
checksum = "634b8804a67200bcb43ea8af5f7c53e862439a086b68b16fd333454bc74d5aab"
dependencies = [
"anyhow",
"heck 0.4.1",
@ -13343,9 +13347,9 @@ dependencies = [
[[package]]
name = "wiggle-macro"
version = "21.0.1"
version = "24.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0b47d2b4442ce93106dba5d1a9c59d5f85b5732878bb3d0598d3c93c0d01b16b"
checksum = "474b7cbdb942c74031e619d66c600bba7f73867c5800fc2c2306cf307649be2f"
dependencies = [
"proc-macro2",
"quote",
@ -13386,17 +13390,17 @@ checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f"
[[package]]
name = "winch-codegen"
version = "0.19.1"
version = "0.22.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1dc69899ccb2da7daa4df31426dcfd284b104d1a85e1dae35806df0c46187f87"
checksum = "073efe897d9ead7fc609874f94580afc831114af5149b6a90ee0a3a39b497fe0"
dependencies = [
"anyhow",
"cranelift-codegen",
"gimli 0.28.1",
"gimli",
"regalloc2",
"smallvec",
"target-lexicon",
"wasmparser 0.207.0",
"wasmparser 0.215.0",
"wasmtime-cranelift",
"wasmtime-environ",
]
@ -13903,9 +13907,9 @@ dependencies = [
[[package]]
name = "wit-parser"
version = "0.207.0"
version = "0.215.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "78c83dab33a9618d86cfe3563cc864deffd08c17efc5db31a3b7cd1edeffe6e1"
checksum = "935a97eaffd57c3b413aa510f8f0b550a4a9fe7d59e79cd8b89a83dcb860321f"
dependencies = [
"anyhow",
"id-arena",
@ -13916,7 +13920,7 @@ dependencies = [
"serde_derive",
"serde_json",
"unicode-xid",
"wasmparser 0.207.0",
"wasmparser 0.215.0",
]
[[package]]

View file

@ -430,43 +430,43 @@ tiny_http = "0.8"
toml = "0.8"
tokio = { version = "1", features = ["full"] }
tower-http = "0.4.4"
tree-sitter = { version = "0.22", features = ["wasm"] }
tree-sitter-bash = "0.21"
tree-sitter-c = "0.21"
tree-sitter-cpp = "0.22"
tree-sitter-css = "0.21"
tree-sitter-elixir = "0.2"
tree-sitter-embedded-template = "0.20.0"
tree-sitter-go = "0.21"
tree-sitter-go-mod = { git = "https://github.com/camdencheek/tree-sitter-go-mod", rev = "1f55029bacd0a6a11f6eb894c4312d429dcf735c", package = "tree-sitter-gomod" }
tree-sitter-gowork = { git = "https://github.com/d1y/tree-sitter-go-work", rev = "dcbabff454703c3a4bc98a23cf8778d4be46fd22" }
tree-sitter-heex = { git = "https://github.com/phoenixframework/tree-sitter-heex", rev = "6dd0303acf7138dd2b9b432a229e16539581c701" }
tree-sitter = { version = "0.23", features = ["wasm"] }
tree-sitter-bash = "0.23"
tree-sitter-c = "0.23"
tree-sitter-cpp = "0.23"
tree-sitter-css = "0.23"
tree-sitter-elixir = "0.3"
tree-sitter-embedded-template = "0.23.0"
tree-sitter-go = "0.23"
tree-sitter-go-mod = { git = "https://github.com/zed-industries/tree-sitter-go-mod", rev = "a9aea5e358cde4d0f8ff20b7bc4fa311e359c7ca", package = "tree-sitter-gomod" }
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-html = "0.20"
tree-sitter-jsdoc = "0.21"
tree-sitter-json = "0.21"
tree-sitter-md = { git = "https://github.com/zed-industries/tree-sitter-markdown", rev = "e3855e37f8f2c71aa7513c18a9c95fb7461b1b10" }
protols-tree-sitter-proto = "0.2"
tree-sitter-python = "0.21"
tree-sitter-regex = "0.21"
tree-sitter-ruby = "0.21"
tree-sitter-rust = "0.21"
tree-sitter-typescript = "0.21"
tree-sitter-yaml = "0.6"
tree-sitter-jsdoc = "0.23"
tree-sitter-json = "0.23"
tree-sitter-md = { git = "https://github.com/zed-industries/tree-sitter-markdown", rev = "4cfa6aad6b75052a5077c80fd934757d9267d81b" }
protols-tree-sitter-proto = { git = "https://github.com/zed-industries/tree-sitter-proto", rev = "0848bd30a64be48772e15fbb9d5ba8c0cc5772ad" }
tree-sitter-python = "0.23"
tree-sitter-regex = "0.23"
tree-sitter-ruby = "0.23"
tree-sitter-rust = "0.23"
tree-sitter-typescript = "0.23"
tree-sitter-yaml = { git = "https://github.com/zed-industries/tree-sitter-yaml", rev = "baff0b51c64ef6a1fb1f8390f3ad6015b83ec13a" }
unindent = "0.1.7"
unicase = "2.6"
unicode-segmentation = "1.10"
url = "2.2"
uuid = { version = "1.1.2", features = ["v4", "v5", "serde"] }
wasmparser = "0.201"
wasm-encoder = "0.201"
wasmtime = { version = "21.0.1", default-features = false, features = [
wasmparser = "0.215"
wasm-encoder = "0.215"
wasmtime = { version = "24", default-features = false, features = [
"async",
"demangle",
"runtime",
"cranelift",
"component-model",
] }
wasmtime-wasi = "21.0.1"
wasmtime-wasi = "24"
which = "6.0.0"
wit-component = "0.201"
@ -523,10 +523,6 @@ features = [
"Win32_UI_WindowsAndMessaging",
]
[patch.crates-io]
# Patch Tree-sitter for updated wasmtime.
tree-sitter = { git = "https://github.com/tree-sitter/tree-sitter", rev = "7f4a57817d58a2f134fe863674acad6bbf007228" }
[profile.dev]
split-debuginfo = "unpacked"
debug = "limited"

View file

@ -3359,7 +3359,7 @@ mod tests {
},
..Default::default()
},
Some(tree_sitter_rust::language()),
Some(tree_sitter_rust::LANGUAGE.into()),
)
.with_indents_query(
r#"

View file

@ -63,6 +63,6 @@ fn rust_lang() -> Arc<Language> {
},
..Default::default()
},
Some(tree_sitter_rust::language()),
Some(tree_sitter_rust::LANGUAGE.into()),
))
}

View file

@ -2273,7 +2273,7 @@ async fn test_propagate_saves_and_fs_changes(
},
..Default::default()
},
Some(tree_sitter_rust::language()),
Some(tree_sitter_rust::LANGUAGE.into()),
));
let javascript = Arc::new(Language::new(
LanguageConfig {
@ -2284,7 +2284,7 @@ async fn test_propagate_saves_and_fs_changes(
},
..Default::default()
},
Some(tree_sitter_rust::language()),
Some(tree_sitter_rust::LANGUAGE.into()),
));
for client in [&client_a, &client_b, &client_c] {
client.language_registry().add(rust.clone());
@ -3855,7 +3855,7 @@ async fn test_collaborating_with_diagnostics(
},
..Default::default()
},
Some(tree_sitter_rust::language()),
Some(tree_sitter_rust::LANGUAGE.into()),
)));
let mut fake_language_servers = client_a
.language_registry()
@ -4458,7 +4458,7 @@ async fn test_prettier_formatting_buffer(
},
..Default::default()
},
Some(tree_sitter_rust::language()),
Some(tree_sitter_rust::LANGUAGE.into()),
)));
let mut fake_language_servers = client_a.language_registry().register_fake_lsp(
"TypeScript",

View file

@ -1645,7 +1645,7 @@ pub mod tests {
},
..Default::default()
},
Some(tree_sitter_rust::language()),
Some(tree_sitter_rust::LANGUAGE.into()),
)
.with_highlights_query(
r#"
@ -1750,7 +1750,7 @@ pub mod tests {
},
..Default::default()
},
Some(tree_sitter_rust::language()),
Some(tree_sitter_rust::LANGUAGE.into()),
)
.with_highlights_query(
r#"
@ -1833,7 +1833,7 @@ pub mod tests {
},
..Default::default()
},
Some(tree_sitter_rust::language()),
Some(tree_sitter_rust::LANGUAGE.into()),
)
.with_highlights_query(
r#"

View file

@ -2322,7 +2322,7 @@ async fn test_newline_above(cx: &mut gpui::TestAppContext) {
let language = Arc::new(
Language::new(
LanguageConfig::default(),
Some(tree_sitter_rust::language()),
Some(tree_sitter_rust::LANGUAGE.into()),
)
.with_indents_query(r#"(_ "(" ")" @end) @indent"#)
.unwrap(),
@ -2370,7 +2370,7 @@ async fn test_newline_below(cx: &mut gpui::TestAppContext) {
let language = Arc::new(
Language::new(
LanguageConfig::default(),
Some(tree_sitter_rust::language()),
Some(tree_sitter_rust::LANGUAGE.into()),
)
.with_indents_query(r#"(_ "(" ")" @end) @indent"#)
.unwrap(),
@ -2524,7 +2524,7 @@ async fn test_tab_in_leading_whitespace_auto_indents_lines(cx: &mut gpui::TestAp
let language = Arc::new(
Language::new(
LanguageConfig::default(),
Some(tree_sitter_rust::language()),
Some(tree_sitter_rust::LANGUAGE.into()),
)
.with_indents_query(r#"(_ "(" ")" @end) @indent"#)
.unwrap(),
@ -2585,7 +2585,7 @@ async fn test_tab_with_mixed_whitespace(cx: &mut gpui::TestAppContext) {
let language = Arc::new(
Language::new(
LanguageConfig::default(),
Some(tree_sitter_rust::language()),
Some(tree_sitter_rust::LANGUAGE.into()),
)
.with_indents_query(r#"(_ "{" "}" @end) @indent"#)
.unwrap(),
@ -4311,7 +4311,7 @@ async fn test_paste_multiline(cx: &mut gpui::TestAppContext) {
let mut cx = EditorTestContext::new(cx).await;
let language = Arc::new(Language::new(
LanguageConfig::default(),
Some(tree_sitter_rust::language()),
Some(tree_sitter_rust::LANGUAGE.into()),
));
cx.update_buffer(|buffer, cx| buffer.set_language(Some(language), cx));
@ -5022,7 +5022,7 @@ async fn test_select_larger_smaller_syntax_node(cx: &mut gpui::TestAppContext) {
let language = Arc::new(Language::new(
LanguageConfig::default(),
Some(tree_sitter_rust::language()),
Some(tree_sitter_rust::LANGUAGE.into()),
));
let text = r#"
@ -5231,7 +5231,7 @@ async fn test_autoindent_selections(cx: &mut gpui::TestAppContext) {
},
..Default::default()
},
Some(tree_sitter_rust::language()),
Some(tree_sitter_rust::LANGUAGE.into()),
)
.with_indents_query(
r#"
@ -5324,7 +5324,7 @@ async fn test_autoclose_and_auto_surround_pairs(cx: &mut gpui::TestAppContext) {
autoclose_before: "})]".to_string(),
..Default::default()
},
Some(tree_sitter_rust::language()),
Some(tree_sitter_rust::LANGUAGE.into()),
));
cx.language_registry().add(language.clone());
@ -5496,7 +5496,7 @@ async fn test_always_treat_brackets_as_autoclosed_skip_over(cx: &mut gpui::TestA
autoclose_before: "})]".to_string(),
..Default::default()
},
Some(tree_sitter_rust::language()),
Some(tree_sitter_rust::LANGUAGE.into()),
));
cx.language_registry().add(language.clone());
@ -5636,7 +5636,7 @@ async fn test_autoclose_with_embedded_language(cx: &mut gpui::TestAppContext) {
autoclose_before: "})]>".into(),
..Default::default()
},
Some(tree_sitter_typescript::language_tsx()),
Some(tree_sitter_typescript::LANGUAGE_TSX.into()),
));
cx.language_registry().add(html_language.clone());
@ -5811,7 +5811,7 @@ async fn test_autoclose_with_overrides(cx: &mut gpui::TestAppContext) {
autoclose_before: "})]>".into(),
..Default::default()
},
Some(tree_sitter_rust::language()),
Some(tree_sitter_rust::LANGUAGE.into()),
)
.with_override_query("(string_literal) @string")
.unwrap(),
@ -5916,7 +5916,7 @@ async fn test_surround_with_pair(cx: &mut gpui::TestAppContext) {
},
..Default::default()
},
Some(tree_sitter_rust::language()),
Some(tree_sitter_rust::LANGUAGE.into()),
));
let text = r#"
@ -6065,7 +6065,7 @@ async fn test_delete_autoclose_pair(cx: &mut gpui::TestAppContext) {
autoclose_before: "}".to_string(),
..Default::default()
},
Some(tree_sitter_rust::language()),
Some(tree_sitter_rust::LANGUAGE.into()),
));
let text = r#"
@ -6192,7 +6192,7 @@ async fn test_always_treat_brackets_as_autoclosed_delete(cx: &mut gpui::TestAppC
autoclose_before: "})]".to_string(),
..Default::default()
},
Some(tree_sitter_rust::language()),
Some(tree_sitter_rust::LANGUAGE.into()),
));
cx.language_registry().add(language.clone());
@ -6262,7 +6262,7 @@ async fn test_auto_replace_emoji_shortcode(cx: &mut gpui::TestAppContext) {
let language = Arc::new(Language::new(
LanguageConfig::default(),
Some(tree_sitter_rust::language()),
Some(tree_sitter_rust::LANGUAGE.into()),
));
let buffer = cx.new_model(|cx| Buffer::local("", cx).with_language(language, cx));
@ -6937,7 +6937,7 @@ async fn test_document_format_manual_trigger(cx: &mut gpui::TestAppContext) {
},
..LanguageConfig::default()
},
Some(tree_sitter_rust::language()),
Some(tree_sitter_rust::LANGUAGE.into()),
)));
update_test_language_settings(cx, |settings| {
// Enable Prettier formatting for the same buffer, and ensure
@ -7272,7 +7272,7 @@ async fn test_handle_input_for_show_signature_help_auto_signature_help_true(
autoclose_before: "})]".to_string(),
..Default::default()
},
Some(tree_sitter_rust::language()),
Some(tree_sitter_rust::LANGUAGE.into()),
);
let language = Arc::new(language);
@ -7414,7 +7414,7 @@ async fn test_handle_input_with_different_show_signature_settings(cx: &mut gpui:
autoclose_before: "})]".to_string(),
..Default::default()
},
Some(tree_sitter_rust::language()),
Some(tree_sitter_rust::LANGUAGE.into()),
);
let language = Arc::new(language);
@ -8207,7 +8207,7 @@ async fn test_toggle_comment(cx: &mut gpui::TestAppContext) {
line_comments: vec!["// ".into(), "//! ".into(), "/// ".into()],
..Default::default()
},
Some(tree_sitter_rust::language()),
Some(tree_sitter_rust::LANGUAGE.into()),
));
cx.update_buffer(|buffer, cx| buffer.set_language(Some(language), cx));
@ -8328,7 +8328,7 @@ async fn test_advance_downward_on_toggle_comment(cx: &mut gpui::TestAppContext)
line_comments: vec!["// ".into()],
..Default::default()
},
Some(tree_sitter_rust::language()),
Some(tree_sitter_rust::LANGUAGE.into()),
));
let mut cx = EditorTestContext::new(cx).await;
@ -8481,7 +8481,7 @@ async fn test_toggle_block_comment(cx: &mut gpui::TestAppContext) {
line_comments: vec!["// ".into()],
..Default::default()
},
Some(tree_sitter_typescript::language_tsx()),
Some(tree_sitter_typescript::LANGUAGE_TSX.into()),
));
cx.language_registry().add(html_language.clone());
@ -8889,7 +8889,7 @@ async fn test_extra_newline_insertion(cx: &mut gpui::TestAppContext) {
},
..Default::default()
},
Some(tree_sitter_rust::language()),
Some(tree_sitter_rust::LANGUAGE.into()),
)
.with_indents_query("")
.unwrap(),
@ -9725,7 +9725,7 @@ async fn test_on_type_formatting_not_triggered(cx: &mut gpui::TestAppContext) {
},
..Default::default()
},
Some(tree_sitter_rust::language()),
Some(tree_sitter_rust::LANGUAGE.into()),
)));
let mut fake_servers = language_registry.register_fake_lsp(
"Rust",
@ -9838,7 +9838,7 @@ async fn test_language_server_restart_due_to_settings_change(cx: &mut gpui::Test
},
..Default::default()
},
Some(tree_sitter_rust::language()),
Some(tree_sitter_rust::LANGUAGE.into()),
)));
let mut fake_servers = language_registry.register_fake_lsp(
"Rust",
@ -10071,7 +10071,7 @@ async fn test_completions_in_languages_with_extra_word_characters(cx: &mut gpui:
.collect(),
..Default::default()
},
Some(tree_sitter_typescript::language_tsx()),
Some(tree_sitter_typescript::LANGUAGE_TSX.into()),
)
.with_override_query("(jsx_self_closing_element) @element")
.unwrap(),
@ -10174,7 +10174,7 @@ async fn test_document_format_with_prettier(cx: &mut gpui::TestAppContext) {
},
..Default::default()
},
Some(tree_sitter_rust::language()),
Some(tree_sitter_rust::LANGUAGE.into()),
)));
update_test_language_settings(cx, |settings| {
settings.defaults.prettier = Some(PrettierSettings {
@ -13891,7 +13891,7 @@ pub(crate) fn rust_lang() -> Arc<Language> {
},
..Default::default()
},
Some(tree_sitter_rust::language()),
Some(tree_sitter_rust::LANGUAGE.into()),
))
}

View file

@ -78,7 +78,7 @@ mod tests {
},
..Default::default()
},
Some(tree_sitter_rust::language()),
Some(tree_sitter_rust::LANGUAGE.into()),
)
.with_brackets_query(indoc! {r#"
("{" @open "}" @close)

View file

@ -1575,7 +1575,7 @@ pub mod tests {
},
..Default::default()
},
Some(tree_sitter_rust::language()),
Some(tree_sitter_rust::LANGUAGE.into()),
)));
let fake_servers = language_registry.register_fake_lsp(
name,

View file

@ -1599,7 +1599,7 @@ mod tests {
},
..Default::default()
},
Some(tree_sitter_rust::language()),
Some(tree_sitter_rust::LANGUAGE.into()),
))
}

View file

@ -125,7 +125,7 @@ impl EditorLspTestContext {
},
..Default::default()
},
Some(tree_sitter_rust::language()),
Some(tree_sitter_rust::LANGUAGE.into()),
)
.with_queries(LanguageQueries {
indents: Some(Cow::from(indoc! {r#"
@ -184,7 +184,7 @@ impl EditorLspTestContext {
word_characters,
..Default::default()
},
Some(tree_sitter_typescript::language_typescript()),
Some(tree_sitter_typescript::LANGUAGE_TYPESCRIPT.into()),
)
.with_queries(LanguageQueries {
brackets: Some(Cow::from(indoc! {r#"

View file

@ -18,7 +18,7 @@ use wasm_encoder::{ComponentSectionId, Encode as _, RawSection, Section as _};
use wasmparser::Parser;
use wit_component::ComponentEncoder;
/// Currently, we compile with Rust's `wasm32-wasi` target, which works with WASI `preview1`.
/// Currently, we compile with Rust's `wasm32-wasip1` target, which works with WASI `preview1`.
/// But the WASM component model is based on WASI `preview2`. So we need an 'adapter' WASM
/// module, which implements the `preview1` interface in terms of `preview2`.
///
@ -447,7 +447,7 @@ impl ExtensionBuilder {
}
// This was adapted from:
// https://github.com/bytecodealliance/wasm-tools/1791a8f139722e9f8679a2bd3d8e423e55132b22/src/bin/wasm-tools/strip.rs
// https://github.com/bytecodealliance/wasm-tools/blob/1791a8f139722e9f8679a2bd3d8e423e55132b22/src/bin/wasm-tools/strip.rs
fn strip_custom_sections(&self, input: &Vec<u8>) -> Result<Vec<u8>> {
use wasmparser::Payload::*;
@ -458,13 +458,15 @@ impl ExtensionBuilder {
for payload in Parser::new(0).parse_all(input) {
let payload = payload?;
let component_header = wasm_encoder::Component::HEADER;
let module_header = wasm_encoder::Module::HEADER;
// Track nesting depth, so that we don't mess with inner producer sections:
match payload {
Version { encoding, .. } => {
output.extend_from_slice(match encoding {
wasmparser::Encoding::Component => &wasm_encoder::Component::HEADER,
wasmparser::Encoding::Module => &wasm_encoder::Module::HEADER,
wasmparser::Encoding::Component => &component_header,
wasmparser::Encoding::Module => &module_header,
});
}
ModuleSection { .. } | ComponentSection { .. } => {
@ -476,7 +478,7 @@ impl ExtensionBuilder {
Some(c) => c,
None => break,
};
if output.starts_with(&wasm_encoder::Component::HEADER) {
if output.starts_with(&component_header) {
parent.push(ComponentSectionId::Component as u8);
output.encode(&mut parent);
} else {

View file

@ -127,7 +127,7 @@ impl WasmHost {
},
);
let (mut extension, instance) = Extension::instantiate_async(
let mut extension = Extension::instantiate_async(
&mut store,
this.release_channel,
zed_api_version,
@ -143,7 +143,6 @@ impl WasmHost {
let (tx, mut rx) = mpsc::unbounded::<ExtensionCall>();
executor
.spawn(async move {
let _instance = instance;
while let Some(call) = rx.next().await {
(call)(&mut extension, &mut store).await;
}

View file

@ -13,7 +13,7 @@ use language::{LanguageServerName, LspAdapterDelegate};
use semantic_version::SemanticVersion;
use std::{ops::RangeInclusive, sync::Arc};
use wasmtime::{
component::{Component, Instance, Linker, Resource},
component::{Component, Linker, Resource},
Store,
};
@ -75,57 +75,55 @@ impl Extension {
release_channel: ReleaseChannel,
version: SemanticVersion,
component: &Component,
) -> Result<(Self, Instance)> {
) -> Result<Self> {
// Note: The release channel can be used to stage a new version of the extension API.
let _ = release_channel;
let allow_latest_version = match release_channel {
ReleaseChannel::Dev | ReleaseChannel::Nightly => true,
ReleaseChannel::Stable | ReleaseChannel::Preview => false,
};
if allow_latest_version && version >= latest::MIN_VERSION {
let (extension, instance) =
let extension =
latest::Extension::instantiate_async(store, component, latest::linker())
.await
.context("failed to instantiate wasm extension")?;
Ok((Self::V020(extension), instance))
Ok(Self::V020(extension))
} else if version >= since_v0_1_0::MIN_VERSION {
let (extension, instance) = since_v0_1_0::Extension::instantiate_async(
let extension = since_v0_1_0::Extension::instantiate_async(
store,
component,
since_v0_1_0::linker(),
)
.await
.context("failed to instantiate wasm extension")?;
Ok((Self::V010(extension), instance))
Ok(Self::V010(extension))
} else if version >= since_v0_0_6::MIN_VERSION {
let (extension, instance) = since_v0_0_6::Extension::instantiate_async(
let extension = since_v0_0_6::Extension::instantiate_async(
store,
component,
since_v0_0_6::linker(),
)
.await
.context("failed to instantiate wasm extension")?;
Ok((Self::V006(extension), instance))
Ok(Self::V006(extension))
} else if version >= since_v0_0_4::MIN_VERSION {
let (extension, instance) = since_v0_0_4::Extension::instantiate_async(
let extension = since_v0_0_4::Extension::instantiate_async(
store,
component,
since_v0_0_4::linker(),
)
.await
.context("failed to instantiate wasm extension")?;
Ok((Self::V004(extension), instance))
Ok(Self::V004(extension))
} else {
let (extension, instance) = since_v0_0_1::Extension::instantiate_async(
let extension = since_v0_0_1::Extension::instantiate_async(
store,
component,
since_v0_0_1::linker(),
)
.await
.context("failed to instantiate wasm extension")?;
Ok((Self::V001(extension), instance))
Ok(Self::V001(extension))
}
}

View file

@ -30,15 +30,7 @@ pub type ExtensionWorktree = Arc<dyn LspAdapterDelegate>;
pub fn linker() -> &'static Linker<WasmState> {
static LINKER: OnceLock<Linker<WasmState>> = OnceLock::new();
LINKER.get_or_init(|| {
super::new_linker(|linker, f| {
Extension::add_to_linker(linker, f)?;
latest::zed::extension::github::add_to_linker(linker, f)?;
latest::zed::extension::nodejs::add_to_linker(linker, f)?;
latest::zed::extension::platform::add_to_linker(linker, f)?;
Ok(())
})
})
LINKER.get_or_init(|| super::new_linker(Extension::add_to_linker))
}
impl From<Command> for latest::Command {

View file

@ -39,7 +39,7 @@ async fn main() -> Result<()> {
let args = Args::parse();
let fs = Arc::new(RealFs::default());
let engine = wasmtime::Engine::default();
let mut wasm_store = WasmStore::new(engine)?;
let mut wasm_store = WasmStore::new(&engine)?;
let extension_path = args
.source_dir

View file

@ -79,7 +79,7 @@ fn test_select_language(cx: &mut AppContext) {
},
..Default::default()
},
Some(tree_sitter_rust::language()),
Some(tree_sitter_rust::LANGUAGE.into()),
)));
registry.add(Arc::new(Language::new(
LanguageConfig {
@ -90,7 +90,7 @@ fn test_select_language(cx: &mut AppContext) {
},
..Default::default()
},
Some(tree_sitter_rust::language()),
Some(tree_sitter_rust::LANGUAGE.into()),
)));
// matching file extension
@ -1671,7 +1671,7 @@ fn test_autoindent_language_without_indents_query(cx: &mut AppContext) {
auto_indent_using_last_non_empty_line: false,
..Default::default()
},
Some(tree_sitter_json::language()),
Some(tree_sitter_json::LANGUAGE.into()),
)),
cx,
);
@ -1999,7 +1999,7 @@ fn test_language_scope_at_with_javascript(cx: &mut AppContext) {
.collect(),
..Default::default()
},
Some(tree_sitter_typescript::language_tsx()),
Some(tree_sitter_typescript::LANGUAGE_TSX.into()),
)
.with_override_query(
r#"
@ -2121,7 +2121,7 @@ fn test_language_scope_at_with_rust(cx: &mut AppContext) {
},
..Default::default()
},
Some(tree_sitter_rust::language()),
Some(tree_sitter_rust::LANGUAGE.into()),
)
.with_override_query(
r#"
@ -2731,7 +2731,7 @@ fn ruby_lang() -> Language {
line_comments: vec!["# ".into()],
..Default::default()
},
Some(tree_sitter_ruby::language()),
Some(tree_sitter_ruby::LANGUAGE.into()),
)
.with_indents_query(
r#"
@ -2782,7 +2782,7 @@ fn erb_lang() -> Language {
block_comment: Some(("<%#".into(), "%>".into())),
..Default::default()
},
Some(tree_sitter_embedded_template::language()),
Some(tree_sitter_embedded_template::LANGUAGE.into()),
)
.with_injection_query(
r#"
@ -2812,7 +2812,7 @@ fn rust_lang() -> Language {
},
..Default::default()
},
Some(tree_sitter_rust::language()),
Some(tree_sitter_rust::LANGUAGE.into()),
)
.with_indents_query(
r#"
@ -2870,7 +2870,7 @@ fn json_lang() -> Language {
},
..Default::default()
},
Some(tree_sitter_json::language()),
Some(tree_sitter_json::LANGUAGE.into()),
)
}
@ -2880,7 +2880,7 @@ fn javascript_lang() -> Language {
name: "JavaScript".into(),
..Default::default()
},
Some(tree_sitter_typescript::language_tsx()),
Some(tree_sitter_typescript::LANGUAGE_TSX.into()),
)
.with_brackets_query(
r#"
@ -2907,7 +2907,7 @@ pub fn markdown_lang() -> Language {
},
..Default::default()
},
Some(tree_sitter_md::language()),
Some(tree_sitter_md::LANGUAGE.into()),
)
.with_injection_query(
r#"
@ -2930,7 +2930,7 @@ pub fn markdown_inline_lang() -> Language {
hidden: true,
..LanguageConfig::default()
},
Some(tree_sitter_md::inline_language()),
Some(tree_sitter_md::INLINE_LANGUAGE.into()),
)
.with_highlights_query("(emphasis) @emphasis")
.unwrap()

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(),

View file

@ -439,12 +439,12 @@ impl LanguageRegistry {
/// grammar controls how the source code is parsed.
pub fn register_native_grammars(
&self,
grammars: impl IntoIterator<Item = (impl Into<Arc<str>>, tree_sitter::Language)>,
grammars: impl IntoIterator<Item = (impl Into<Arc<str>>, impl Into<tree_sitter::Language>)>,
) {
self.state.write().grammars.extend(
grammars
.into_iter()
.map(|(name, grammar)| (name.into(), AvailableGrammar::Native(grammar))),
.map(|(name, grammar)| (name.into(), AvailableGrammar::Native(grammar.into()))),
);
}

View file

@ -1160,7 +1160,7 @@ fn ruby_lang() -> Language {
},
..Default::default()
},
Some(tree_sitter_ruby::language()),
Some(tree_sitter_ruby::LANGUAGE.into()),
)
.with_highlights_query(
r#"
@ -1182,7 +1182,7 @@ fn erb_lang() -> Language {
},
..Default::default()
},
Some(tree_sitter_embedded_template::language()),
Some(tree_sitter_embedded_template::LANGUAGE.into()),
)
.with_highlights_query(
r#"
@ -1218,7 +1218,7 @@ fn rust_lang() -> Language {
},
..Default::default()
},
Some(tree_sitter_rust::language()),
Some(tree_sitter_rust::LANGUAGE.into()),
)
.with_highlights_query(
r#"
@ -1247,7 +1247,7 @@ fn elixir_lang() -> Language {
},
..Default::default()
},
Some(tree_sitter_elixir::language()),
Some(tree_sitter_elixir::LANGUAGE.into()),
)
.with_highlights_query(
r#"
@ -1267,7 +1267,7 @@ fn heex_lang() -> Language {
},
..Default::default()
},
Some(tree_sitter_heex::language()),
Some(tree_sitter_heex::LANGUAGE.into()),
)
.with_injection_query(
r#"

View file

@ -43,7 +43,7 @@ async fn test_lsp_logs(cx: &mut TestAppContext) {
},
..Default::default()
},
Some(tree_sitter_rust::language()),
Some(tree_sitter_rust::LANGUAGE.into()),
)));
let mut fake_rust_servers = language_registry.register_fake_lsp(
"Rust",

View file

@ -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);

View file

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

View file

@ -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 */

View file

@ -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()),

View file

@ -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 {

View file

@ -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);

View file

@ -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);

View file

@ -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() {

View file

@ -1234,7 +1234,7 @@ fn main() {
collapsed_placeholder: " /* ... */ ".to_string(),
..Default::default()
},
Some(tree_sitter_rust::language()),
Some(tree_sitter_rust::LANGUAGE.into()),
))
}

View file

@ -484,7 +484,7 @@ mod tests {
},
..Default::default()
},
Some(tree_sitter_rust::language()),
Some(tree_sitter_rust::LANGUAGE.into()),
)
.with_outline_query(
r#"(struct_item

View file

@ -4787,7 +4787,7 @@ mod tests {
},
..Default::default()
},
Some(tree_sitter_rust::language()),
Some(tree_sitter_rust::LANGUAGE.into()),
)
.with_highlights_query(
r#"

View file

@ -5339,7 +5339,7 @@ fn rust_lang() -> Arc<Language> {
},
..Default::default()
},
Some(tree_sitter_rust::language()),
Some(tree_sitter_rust::LANGUAGE.into()),
))
}
@ -5353,7 +5353,7 @@ fn typescript_lang() -> Arc<Language> {
},
..Default::default()
},
Some(tree_sitter_typescript::language_typescript()),
Some(tree_sitter_typescript::LANGUAGE_TYPESCRIPT.into()),
))
}
@ -5367,7 +5367,7 @@ fn tsx_lang() -> Arc<Language> {
},
..Default::default()
},
Some(tree_sitter_typescript::language_tsx()),
Some(tree_sitter_typescript::LANGUAGE_TSX.into()),
))
}

View file

@ -471,10 +471,12 @@ mod tests {
#[gpui::test]
fn test_markdown_code_blocks(cx: &mut AppContext) {
let markdown = languages::language("markdown", tree_sitter_md::language());
let typescript =
languages::language("typescript", tree_sitter_typescript::language_typescript());
let python = languages::language("python", tree_sitter_python::language());
let markdown = languages::language("markdown", tree_sitter_md::LANGUAGE.into());
let typescript = languages::language(
"typescript",
tree_sitter_typescript::LANGUAGE_TYPESCRIPT.into(),
);
let python = languages::language("python", tree_sitter_python::LANGUAGE.into());
let language_registry = Arc::new(LanguageRegistry::new(cx.background_executor().clone()));
language_registry.add(markdown.clone());
language_registry.add(typescript.clone());

View file

@ -398,7 +398,7 @@ mod tests {
},
..Default::default()
},
Some(tree_sitter_rust::language()),
Some(tree_sitter_rust::LANGUAGE.into()),
)
.with_outline_query(
"

View file

@ -15,7 +15,6 @@ use std::{
sync::{Arc, LazyLock},
};
use tree_sitter::Query;
use tree_sitter_json::language;
use util::{merge_non_null_json_value_into, RangeExt, ResultExt as _};
use crate::{SettingsJsonSchemaParams, WorktreeId};
@ -955,12 +954,17 @@ fn replace_value_in_json_text(
new_value: &serde_json::Value,
) -> (Range<usize>, String) {
static PAIR_QUERY: LazyLock<Query> = LazyLock::new(|| {
Query::new(&language(), "(pair key: (string) @key value: (_) @value)")
.expect("Failed to create PAIR_QUERY")
Query::new(
&tree_sitter_json::LANGUAGE.into(),
"(pair key: (string) @key value: (_) @value)",
)
.expect("Failed to create PAIR_QUERY")
});
let mut parser = tree_sitter::Parser::new();
parser.set_language(&tree_sitter_json::language()).unwrap();
parser
.set_language(&tree_sitter_json::LANGUAGE.into())
.unwrap();
let syntax_tree = parser.parse(text, None).unwrap();
let mut cursor = tree_sitter::QueryCursor::new();

View file

@ -226,7 +226,7 @@ mod tests {
let rust_language = Arc::new(
Language::new(
LanguageConfig::default(),
Some(tree_sitter_rust::language()),
Some(tree_sitter_rust::LANGUAGE.into()),
)
.with_outline_query(
r#"(function_item
@ -240,7 +240,7 @@ mod tests {
let typescript_language = Arc::new(
Language::new(
LanguageConfig::default(),
Some(tree_sitter_typescript::language_typescript()),
Some(tree_sitter_typescript::LANGUAGE_TYPESCRIPT.into()),
)
.with_outline_query(
r#"(function_declaration

View file

@ -1192,7 +1192,7 @@ async fn test_toggle_comments(cx: &mut gpui::TestAppContext) {
line_comments: vec!["// ".into(), "//! ".into(), "/// ".into()],
..Default::default()
},
Some(language::tree_sitter_rust::language()),
Some(language::tree_sitter_rust::LANGUAGE.into()),
));
cx.update_buffer(|buffer, cx| buffer.set_language(Some(language), cx));

View file

@ -3445,7 +3445,7 @@ mod tests {
},
..Default::default()
},
Some(tree_sitter_rust::language()),
Some(tree_sitter_rust::LANGUAGE.into()),
))
}
@ -3459,7 +3459,7 @@ mod tests {
},
..Default::default()
},
Some(tree_sitter_md::language()),
Some(tree_sitter_md::LANGUAGE.into()),
))
}