Bump tree-sitter and related core language parser libraries (#14986)

Closes https://github.com/zed-industries/zed/issues/4565

To fix issues with code blocks' parsing in Markdown, a
tree-sitter-markdown library update is needed.
But `tree_sitter::language` is used in many places within core Zed,
which forced more library updates.

Release Notes:

- Updated tree-sitter parsers for core languages

---------

Co-authored-by: Max Brunsfeld <max@zed.dev>
Co-authored-by: Piotr Osiewicz <piotr@zed.dev>
This commit is contained in:
Kirill Bulatov 2024-07-24 23:38:21 +03:00 committed by GitHub
parent fd4a4127eb
commit 596ee58be8
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
24 changed files with 282 additions and 196 deletions

126
Cargo.lock generated
View file

@ -2055,12 +2055,13 @@ dependencies = [
[[package]] [[package]]
name = "cc" name = "cc"
version = "1.0.90" version = "1.0.106"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8cd6604a82acf3039f1144f54b8eb34e91ffba622051189e71b781822d5ee1f5" checksum = "066fce287b1d4eafef758e89e09d724a24808a9196fe9756b8ca90e86d0719a2"
dependencies = [ dependencies = [
"jobserver", "jobserver",
"libc", "libc",
"once_cell",
] ]
[[package]] [[package]]
@ -2541,7 +2542,7 @@ dependencies = [
"time", "time",
"time_format", "time_format",
"title_bar", "title_bar",
"tree-sitter-markdown", "tree-sitter-md",
"ui", "ui",
"util", "util",
"vcs_menu", "vcs_menu",
@ -5771,9 +5772,9 @@ checksum = "8eaf4bc02d17cbdd7ff4c7438cafcdf7fb9a4613313ad11b4f8fefe7d3fa0130"
[[package]] [[package]]
name = "jobserver" name = "jobserver"
version = "0.1.28" version = "0.1.31"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ab46a6e9526ddef3ae7f787c06f0f2600639ba80ea3eade3d8e670a2230f51d6" checksum = "d2b099aaa34a9751c5bf0878add70444e1ed2dd73f347be99003d4577277de6e"
dependencies = [ dependencies = [
"libc", "libc",
] ]
@ -5918,7 +5919,7 @@ dependencies = [
"tree-sitter-heex", "tree-sitter-heex",
"tree-sitter-html", "tree-sitter-html",
"tree-sitter-json", "tree-sitter-json",
"tree-sitter-markdown", "tree-sitter-md",
"tree-sitter-ruby", "tree-sitter-ruby",
"tree-sitter-rust", "tree-sitter-rust",
"tree-sitter-typescript", "tree-sitter-typescript",
@ -6024,6 +6025,7 @@ dependencies = [
"node_runtime", "node_runtime",
"paths", "paths",
"project", "project",
"protols-tree-sitter-proto",
"regex", "regex",
"rope", "rope",
"rust-embed", "rust-embed",
@ -6045,8 +6047,7 @@ dependencies = [
"tree-sitter-gowork", "tree-sitter-gowork",
"tree-sitter-jsdoc", "tree-sitter-jsdoc",
"tree-sitter-json", "tree-sitter-json",
"tree-sitter-markdown", "tree-sitter-md",
"tree-sitter-proto",
"tree-sitter-python", "tree-sitter-python",
"tree-sitter-regex", "tree-sitter-regex",
"tree-sitter-rust", "tree-sitter-rust",
@ -8147,6 +8148,16 @@ version = "2.28.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "106dd99e98437432fed6519dedecfade6a06a73bb7b2a1e019fdd2bee5778d94" checksum = "106dd99e98437432fed6519dedecfade6a06a73bb7b2a1e019fdd2bee5778d94"
[[package]]
name = "protols-tree-sitter-proto"
version = "0.2.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9bac092da66e21a71eb832925de7b542f8ac34f75fd05cd2fc3e272863e3fd2b"
dependencies = [
"cc",
"tree-sitter",
]
[[package]] [[package]]
name = "psm" name = "psm"
version = "0.1.21" version = "0.1.21"
@ -8521,9 +8532,9 @@ dependencies = [
[[package]] [[package]]
name = "regex" name = "regex"
version = "1.10.3" version = "1.10.5"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b62dbe01f0b06f9d8dc7d49e05a0785f153b00b2c227856282f671e0318c9b15" checksum = "b91213439dad192326a0d7c6ee3955910425f441d7038e0d6933b0aec5c4517f"
dependencies = [ dependencies = [
"aho-corasick", "aho-corasick",
"memchr", "memchr",
@ -11073,7 +11084,7 @@ dependencies = [
"story", "story",
"theme", "theme",
"theme_selector", "theme_selector",
"tree-sitter-markdown", "tree-sitter-md",
"ui", "ui",
"util", "util",
"vcs_menu", "vcs_menu",
@ -11412,8 +11423,9 @@ dependencies = [
[[package]] [[package]]
name = "tree-sitter" name = "tree-sitter"
version = "0.20.100" version = "0.22.6"
source = "git+https://github.com/tree-sitter/tree-sitter?rev=7b4894ba2ae81b988846676f54c0988d4027ef4f#7b4894ba2ae81b988846676f54c0988d4027ef4f" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "df7cc499ceadd4dcdf7ec6d4cbc34ece92c3fa07821e287aedecd4416c516dca"
dependencies = [ dependencies = [
"cc", "cc",
"regex", "regex",
@ -11422,9 +11434,9 @@ dependencies = [
[[package]] [[package]]
name = "tree-sitter-bash" name = "tree-sitter-bash"
version = "0.20.5" version = "0.21.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "57da2032c37eb2ce29fd18df7d3b94355fec8d6d854d8f80934955df542b5906" checksum = "b5244703ad2e08a616d859a0557d7aa290adcd5e0990188a692e628ffe9dce40"
dependencies = [ dependencies = [
"cc", "cc",
"tree-sitter", "tree-sitter",
@ -11432,9 +11444,9 @@ dependencies = [
[[package]] [[package]]
name = "tree-sitter-c" name = "tree-sitter-c"
version = "0.20.6" version = "0.21.4"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "30b03bdf218020057abee831581a74bff8c298323d6c6cd1a70556430ded9f4b" checksum = "f956d5351d62652864a4ff3ae861747e7a1940dc96c9998ae400ac0d3ce30427"
dependencies = [ dependencies = [
"cc", "cc",
"tree-sitter", "tree-sitter",
@ -11442,9 +11454,9 @@ dependencies = [
[[package]] [[package]]
name = "tree-sitter-cpp" name = "tree-sitter-cpp"
version = "0.20.5" version = "0.22.3"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "46b04a5ada71059afb9895966a6cc1094acc8d2ea1971006db26573e7dfebb74" checksum = "1d509a22a992790d38f2c291961ff8a1ff016c437c7ec6befc9220b8eec8918c"
dependencies = [ dependencies = [
"cc", "cc",
"tree-sitter", "tree-sitter",
@ -11452,9 +11464,9 @@ dependencies = [
[[package]] [[package]]
name = "tree-sitter-css" name = "tree-sitter-css"
version = "0.20.0" version = "0.21.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c3306ddefa1d2681adda2613d11974ffabfbeb215e23235da6c862f3493a04fd" checksum = "e2f806f96136762b0121f5fdd7172a3dcd8f42d37a2f23ed7f11b35895e20eb4"
dependencies = [ dependencies = [
"cc", "cc",
"tree-sitter", "tree-sitter",
@ -11462,9 +11474,9 @@ dependencies = [
[[package]] [[package]]
name = "tree-sitter-elixir" name = "tree-sitter-elixir"
version = "0.1.1" version = "0.2.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1bc0b1f3e6d9f12ca22ae5171f32fd154e3aea29dff565d05ef785c28931415b" checksum = "df94bf7f057768b1cab2ee1f14812ed4ae33f9e04d09254043eeaa797db4ef70"
dependencies = [ dependencies = [
"cc", "cc",
"tree-sitter", "tree-sitter",
@ -11482,8 +11494,9 @@ dependencies = [
[[package]] [[package]]
name = "tree-sitter-go" name = "tree-sitter-go"
version = "0.20.0" version = "0.21.0"
source = "git+https://github.com/tree-sitter/tree-sitter-go?rev=b82ab803d887002a0af11f6ce63d72884580bf33#b82ab803d887002a0af11f6ce63d72884580bf33" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "55cb318be5ccf75f44e054acf6898a5c95d59b53443eed578e16be0cd7ec037f"
dependencies = [ dependencies = [
"cc", "cc",
"tree-sitter", "tree-sitter",
@ -11491,9 +11504,8 @@ dependencies = [
[[package]] [[package]]
name = "tree-sitter-gomod" name = "tree-sitter-gomod"
version = "1.0.1" version = "1.0.2"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "git+https://github.com/SomeoneToIgnore/tree-sitter-go-mod?rev=8c1f54f12bb4c846336b634bc817645d6f35d641#8c1f54f12bb4c846336b634bc817645d6f35d641"
checksum = "31d0a848a3a4a383fb97ef91241d972c3b996567cdc59040ad2c6fc48b874992"
dependencies = [ dependencies = [
"cc", "cc",
"tree-sitter", "tree-sitter",
@ -11502,7 +11514,7 @@ dependencies = [
[[package]] [[package]]
name = "tree-sitter-gowork" name = "tree-sitter-gowork"
version = "0.0.1" version = "0.0.1"
source = "git+https://github.com/d1y/tree-sitter-go-work#a2a4b99b53b3740855ff33f0b54cab0bb4ce6f45" source = "git+https://github.com/d1y/tree-sitter-go-work?rev=dcbabff454703c3a4bc98a23cf8778d4be46fd22#dcbabff454703c3a4bc98a23cf8778d4be46fd22"
dependencies = [ dependencies = [
"cc", "cc",
"tree-sitter", "tree-sitter",
@ -11511,7 +11523,7 @@ dependencies = [
[[package]] [[package]]
name = "tree-sitter-heex" name = "tree-sitter-heex"
version = "0.0.1" version = "0.0.1"
source = "git+https://github.com/phoenixframework/tree-sitter-heex?rev=2e1348c3cf2c9323e87c2744796cf3f3868aa82a#2e1348c3cf2c9323e87c2744796cf3f3868aa82a" source = "git+https://github.com/phoenixframework/tree-sitter-heex?rev=6dd0303acf7138dd2b9b432a229e16539581c701#6dd0303acf7138dd2b9b432a229e16539581c701"
dependencies = [ dependencies = [
"cc", "cc",
"tree-sitter", "tree-sitter",
@ -11519,9 +11531,9 @@ dependencies = [
[[package]] [[package]]
name = "tree-sitter-html" name = "tree-sitter-html"
version = "0.19.0" version = "0.20.3"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "184e6b77953a354303dc87bf5fe36558c83569ce92606e7b382a0dc1b7443443" checksum = "95b3492b08a786bf5cc79feb0ef2ff3b115d5174364e0ddfd7860e0b9b088b53"
dependencies = [ dependencies = [
"cc", "cc",
"tree-sitter", "tree-sitter",
@ -11529,8 +11541,9 @@ dependencies = [
[[package]] [[package]]
name = "tree-sitter-jsdoc" name = "tree-sitter-jsdoc"
version = "0.20.0" version = "0.21.0"
source = "git+https://github.com/tree-sitter/tree-sitter-jsdoc?rev=6a6cf9e7341af32d8e2b2e24a37fbfebefc3dc55#6a6cf9e7341af32d8e2b2e24a37fbfebefc3dc55" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8d07920101ff12a59574890318a37fa7e18d9c06d9aa4be334aa24adbb480f18"
dependencies = [ dependencies = [
"cc", "cc",
"tree-sitter", "tree-sitter",
@ -11538,27 +11551,18 @@ dependencies = [
[[package]] [[package]]
name = "tree-sitter-json" name = "tree-sitter-json"
version = "0.20.2" version = "0.21.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5a9a38a9c679b55cc8d17350381ec08d69fa1a17a53fcf197f344516e485ed4d" checksum = "5b737dcb73c35d74b7d64a5f3dde158113c86a012bf3cee2bfdf2150d23b05db"
dependencies = [ dependencies = [
"cc", "cc",
"tree-sitter", "tree-sitter",
] ]
[[package]] [[package]]
name = "tree-sitter-markdown" name = "tree-sitter-md"
version = "0.0.1" version = "0.2.3"
source = "git+https://github.com/MDeiml/tree-sitter-markdown?rev=330ecab87a3e3a7211ac69bbadc19eabecdb1cca#330ecab87a3e3a7211ac69bbadc19eabecdb1cca" source = "git+https://github.com/zed-industries/tree-sitter-markdown?rev=e3855e37f8f2c71aa7513c18a9c95fb7461b1b10#e3855e37f8f2c71aa7513c18a9c95fb7461b1b10"
dependencies = [
"cc",
"tree-sitter",
]
[[package]]
name = "tree-sitter-proto"
version = "0.0.2"
source = "git+https://github.com/rewinfrey/tree-sitter-proto?rev=36d54f288aee112f13a67b550ad32634d0c2cb52#36d54f288aee112f13a67b550ad32634d0c2cb52"
dependencies = [ dependencies = [
"cc", "cc",
"tree-sitter", "tree-sitter",
@ -11566,9 +11570,9 @@ dependencies = [
[[package]] [[package]]
name = "tree-sitter-python" name = "tree-sitter-python"
version = "0.20.4" version = "0.21.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e6c93b1b1fbd0d399db3445f51fd3058e43d0b4dcff62ddbdb46e66550978aa5" checksum = "b4066c6cf678f962f8c2c4561f205945c84834cce73d981e71392624fdc390a9"
dependencies = [ dependencies = [
"cc", "cc",
"tree-sitter", "tree-sitter",
@ -11576,9 +11580,9 @@ dependencies = [
[[package]] [[package]]
name = "tree-sitter-regex" name = "tree-sitter-regex"
version = "0.20.0" version = "0.21.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "efb5a53e9c990757895476216796b170fd81e4d173d08f8b082279c4e6ff8c5c" checksum = "5ff1286fe9651b2797484839ffa37aa76c8618d4ccb6836d7e31765dfd60c0d5"
dependencies = [ dependencies = [
"cc", "cc",
"tree-sitter", "tree-sitter",
@ -11586,9 +11590,9 @@ dependencies = [
[[package]] [[package]]
name = "tree-sitter-ruby" name = "tree-sitter-ruby"
version = "0.20.0" version = "0.21.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0ac30cbb1560363ae76e1ccde543d6d99087421e228cc47afcec004b86bb711a" checksum = "c0031f687c0772f2dad7b77104c43428611099a1804c81244ada21560f41f0b1"
dependencies = [ dependencies = [
"cc", "cc",
"tree-sitter", "tree-sitter",
@ -11596,9 +11600,9 @@ dependencies = [
[[package]] [[package]]
name = "tree-sitter-rust" name = "tree-sitter-rust"
version = "0.20.4" version = "0.21.2"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b0832309b0b2b6d33760ce5c0e818cb47e1d72b468516bfe4134408926fa7594" checksum = "277690f420bf90741dea984f3da038ace46c4fe6047cba57a66822226cde1c93"
dependencies = [ dependencies = [
"cc", "cc",
"tree-sitter", "tree-sitter",
@ -11606,9 +11610,9 @@ dependencies = [
[[package]] [[package]]
name = "tree-sitter-typescript" name = "tree-sitter-typescript"
version = "0.20.5" version = "0.21.2"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c8bc1d2c24276a48ef097a71b56888ac9db63717e8f8d0b324668a27fd619670" checksum = "ecb35d98a688378e56c18c9c159824fd16f730ccbea19aacf4f206e5d5438ed9"
dependencies = [ dependencies = [
"cc", "cc",
"tree-sitter", "tree-sitter",
@ -11616,9 +11620,9 @@ dependencies = [
[[package]] [[package]]
name = "tree-sitter-yaml" name = "tree-sitter-yaml"
version = "0.0.1" version = "0.6.1"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "324767d0ad6bc588467aa4b98f6f5cd6eda64ece1eae568f8fcf5b899bcf0fe9" checksum = "aad27ec46ad343d8b514f64dd3fdffb478c592ece561b6c935d90ef55589c6b6"
dependencies = [ dependencies = [
"cc", "cc",
"tree-sitter", "tree-sitter",
@ -13683,7 +13687,7 @@ dependencies = [
"terminal_view", "terminal_view",
"theme", "theme",
"theme_selector", "theme_selector",
"tree-sitter-markdown", "tree-sitter-md",
"tree-sitter-rust", "tree-sitter-rust",
"ui", "ui",
"url", "url",

View file

@ -366,6 +366,7 @@ runtimelib = { version = "0.12", default-features = false, features = [
"async-dispatcher-runtime", "async-dispatcher-runtime",
] } ] }
rusqlite = { version = "0.29.0", features = ["blob", "array", "modern_sqlite"] } rusqlite = { version = "0.29.0", features = ["blob", "array", "modern_sqlite"] }
rustc-demangle = "0.1.23"
rust-embed = { version = "8.4", features = ["include-exclude"] } rust-embed = { version = "8.4", features = ["include-exclude"] }
schemars = {version = "0.8", features = ["impl_json_schema"]} schemars = {version = "0.8", features = ["impl_json_schema"]}
semver = "1.0" semver = "1.0"
@ -402,29 +403,28 @@ tiny_http = "0.8"
toml = "0.8" toml = "0.8"
tokio = { version = "1", features = ["full"] } tokio = { version = "1", features = ["full"] }
tower-http = "0.4.4" tower-http = "0.4.4"
tree-sitter = { version = "0.20", features = ["wasm"] } tree-sitter = { version = "0.22", features = ["wasm"] }
tree-sitter-bash = "0.20.5" tree-sitter-bash = "0.21"
tree-sitter-c = "0.20.1" tree-sitter-c = "0.21"
tree-sitter-cpp = "0.20.5" tree-sitter-cpp = "0.22"
tree-sitter-css = "0.20" tree-sitter-css = "0.21"
tree-sitter-elixir = "0.1.1" tree-sitter-elixir = "0.2"
tree-sitter-embedded-template = "0.20.0" tree-sitter-embedded-template = "0.20.0"
tree-sitter-go = { git = "https://github.com/tree-sitter/tree-sitter-go", rev = "b82ab803d887002a0af11f6ce63d72884580bf33" } tree-sitter-go = "0.21"
tree-sitter-gomod = "1.0.1" tree-sitter-go-mod = { git = "https://github.com/SomeoneToIgnore/tree-sitter-go-mod", rev = "8c1f54f12bb4c846336b634bc817645d6f35d641", package = "tree-sitter-gomod"}
tree-sitter-gowork = { git = "https://github.com/d1y/tree-sitter-go-work" } tree-sitter-gowork = { git = "https://github.com/d1y/tree-sitter-go-work", rev = "dcbabff454703c3a4bc98a23cf8778d4be46fd22" }
rustc-demangle = "0.1.23" tree-sitter-heex = { git = "https://github.com/phoenixframework/tree-sitter-heex", rev = "6dd0303acf7138dd2b9b432a229e16539581c701" }
tree-sitter-heex = { git = "https://github.com/phoenixframework/tree-sitter-heex", rev = "2e1348c3cf2c9323e87c2744796cf3f3868aa82a" } tree-sitter-html = "0.20"
tree-sitter-html = "0.19.0" tree-sitter-jsdoc = "0.21"
tree-sitter-jsdoc = { git = "https://github.com/tree-sitter/tree-sitter-jsdoc", rev = "6a6cf9e7341af32d8e2b2e24a37fbfebefc3dc55" } tree-sitter-json = "0.21"
tree-sitter-json = "0.20.2" tree-sitter-md = { git = "https://github.com/zed-industries/tree-sitter-markdown", rev = "e3855e37f8f2c71aa7513c18a9c95fb7461b1b10" }
tree-sitter-markdown = { git = "https://github.com/MDeiml/tree-sitter-markdown", rev = "330ecab87a3e3a7211ac69bbadc19eabecdb1cca" } protols-tree-sitter-proto = "0.2"
tree-sitter-proto = { git = "https://github.com/rewinfrey/tree-sitter-proto", rev = "36d54f288aee112f13a67b550ad32634d0c2cb52" } tree-sitter-python = "0.21"
tree-sitter-python = "0.20.2" tree-sitter-regex = "0.21"
tree-sitter-regex = "0.20.0" tree-sitter-ruby = "0.21"
tree-sitter-ruby = "0.20.0" tree-sitter-rust = "0.21"
tree-sitter-rust = "0.20.3" tree-sitter-typescript = "0.21"
tree-sitter-typescript = "0.20.5" tree-sitter-yaml = "0.6"
tree-sitter-yaml = "0.0.1"
unindent = "0.1.7" unindent = "0.1.7"
unicase = "2.6" unicase = "2.6"
unicode-segmentation = "1.10" unicode-segmentation = "1.10"
@ -484,9 +484,6 @@ features = [
"Win32_UI_WindowsAndMessaging", "Win32_UI_WindowsAndMessaging",
] ]
[patch.crates-io]
tree-sitter = { git = "https://github.com/tree-sitter/tree-sitter", rev = "7b4894ba2ae81b988846676f54c0988d4027ef4f" }
[profile.dev] [profile.dev]
split-debuginfo = "unpacked" split-debuginfo = "unpacked"
debug = "limited" debug = "limited"

View file

@ -78,7 +78,7 @@ pretty_assertions.workspace = true
project = { workspace = true, features = ["test-support"] } project = { workspace = true, features = ["test-support"] }
rpc = { workspace = true, features = ["test-support"] } rpc = { workspace = true, features = ["test-support"] }
settings = { workspace = true, features = ["test-support"] } settings = { workspace = true, features = ["test-support"] }
tree-sitter-markdown.workspace = true tree-sitter-md.workspace = true
util = { workspace = true, features = ["test-support"] } util = { workspace = true, features = ["test-support"] }
http_client = { workspace = true, features = ["test-support"] } http_client = { workspace = true, features = ["test-support"] }
workspace = { workspace = true, features = ["test-support"] } workspace = { workspace = true, features = ["test-support"] }

View file

@ -4716,12 +4716,13 @@ async fn test_select_larger_smaller_syntax_node(cx: &mut gpui::TestAppContext) {
let buffer = cx.new_model(|cx| Buffer::local(text, cx).with_language(language, cx)); let buffer = cx.new_model(|cx| Buffer::local(text, cx).with_language(language, cx));
let buffer = cx.new_model(|cx| MultiBuffer::singleton(buffer, cx)); let buffer = cx.new_model(|cx| MultiBuffer::singleton(buffer, cx));
let (view, cx) = cx.add_window_view(|cx| build_editor(buffer, cx)); let (editor, cx) = cx.add_window_view(|cx| build_editor(buffer, cx));
view.condition::<crate::EditorEvent>(&cx, |view, cx| !view.buffer.read(cx).is_parsing(cx)) editor
.condition::<crate::EditorEvent>(&cx, |view, cx| !view.buffer.read(cx).is_parsing(cx))
.await; .await;
_ = view.update(cx, |view, cx| { editor.update(cx, |view, cx| {
view.change_selections(None, cx, |s| { view.change_selections(None, cx, |s| {
s.select_display_ranges([ s.select_display_ranges([
DisplayPoint::new(DisplayRow(0), 25)..DisplayPoint::new(DisplayRow(0), 25), DisplayPoint::new(DisplayRow(0), 25)..DisplayPoint::new(DisplayRow(0), 25),
@ -4731,94 +4732,126 @@ async fn test_select_larger_smaller_syntax_node(cx: &mut gpui::TestAppContext) {
}); });
view.select_larger_syntax_node(&SelectLargerSyntaxNode, cx); view.select_larger_syntax_node(&SelectLargerSyntaxNode, cx);
}); });
assert_eq!( editor.update(cx, |editor, cx| {
view.update(cx, |view, cx| { view.selections.display_ranges(cx) }), assert_text_with_selections(
&[ editor,
DisplayPoint::new(DisplayRow(0), 23)..DisplayPoint::new(DisplayRow(0), 27), indoc! {r#"
DisplayPoint::new(DisplayRow(2), 35)..DisplayPoint::new(DisplayRow(2), 7), use mod1::mod2::{mod3, «mod4ˇ»};
DisplayPoint::new(DisplayRow(3), 15)..DisplayPoint::new(DisplayRow(3), 21),
]
);
_ = view.update(cx, |view, cx| { fn fn_1«ˇ(param1: bool, param2: &str)» {
let var1 = "«textˇ»";
}
"#},
cx,
);
});
editor.update(cx, |view, cx| {
view.select_larger_syntax_node(&SelectLargerSyntaxNode, cx);
});
editor.update(cx, |editor, cx| {
assert_text_with_selections(
editor,
indoc! {r#"
use mod1::mod2::«{mod3, mod4}ˇ»;
«ˇfn fn_1(param1: bool, param2: &str) {
let var1 = "text";
}»
"#},
cx,
);
});
editor.update(cx, |view, cx| {
view.select_larger_syntax_node(&SelectLargerSyntaxNode, cx); view.select_larger_syntax_node(&SelectLargerSyntaxNode, cx);
}); });
assert_eq!( assert_eq!(
view.update(cx, |view, cx| view.selections.display_ranges(cx)), editor.update(cx, |view, cx| view.selections.display_ranges(cx)),
&[
DisplayPoint::new(DisplayRow(0), 16)..DisplayPoint::new(DisplayRow(0), 28),
DisplayPoint::new(DisplayRow(4), 1)..DisplayPoint::new(DisplayRow(2), 0),
]
);
_ = view.update(cx, |view, cx| {
view.select_larger_syntax_node(&SelectLargerSyntaxNode, cx);
});
assert_eq!(
view.update(cx, |view, cx| view.selections.display_ranges(cx)),
&[DisplayPoint::new(DisplayRow(5), 0)..DisplayPoint::new(DisplayRow(0), 0)] &[DisplayPoint::new(DisplayRow(5), 0)..DisplayPoint::new(DisplayRow(0), 0)]
); );
// Trying to expand the selected syntax node one more time has no effect. // Trying to expand the selected syntax node one more time has no effect.
_ = view.update(cx, |view, cx| { editor.update(cx, |view, cx| {
view.select_larger_syntax_node(&SelectLargerSyntaxNode, cx); view.select_larger_syntax_node(&SelectLargerSyntaxNode, cx);
}); });
assert_eq!( assert_eq!(
view.update(cx, |view, cx| view.selections.display_ranges(cx)), editor.update(cx, |view, cx| view.selections.display_ranges(cx)),
&[DisplayPoint::new(DisplayRow(5), 0)..DisplayPoint::new(DisplayRow(0), 0)] &[DisplayPoint::new(DisplayRow(5), 0)..DisplayPoint::new(DisplayRow(0), 0)]
); );
_ = view.update(cx, |view, cx| { editor.update(cx, |view, cx| {
view.select_smaller_syntax_node(&SelectSmallerSyntaxNode, cx); view.select_smaller_syntax_node(&SelectSmallerSyntaxNode, cx);
}); });
assert_eq!( editor.update(cx, |editor, cx| {
view.update(cx, |view, cx| view.selections.display_ranges(cx)), assert_text_with_selections(
&[ editor,
DisplayPoint::new(DisplayRow(0), 16)..DisplayPoint::new(DisplayRow(0), 28), indoc! {r#"
DisplayPoint::new(DisplayRow(4), 1)..DisplayPoint::new(DisplayRow(2), 0), use mod1::mod2::«{mod3, mod4}ˇ»;
]
);
_ = view.update(cx, |view, cx| { «ˇfn fn_1(param1: bool, param2: &str) {
view.select_smaller_syntax_node(&SelectSmallerSyntaxNode, cx); let var1 = "text";
}»
"#},
cx,
);
}); });
assert_eq!(
view.update(cx, |view, cx| view.selections.display_ranges(cx)),
&[
DisplayPoint::new(DisplayRow(0), 23)..DisplayPoint::new(DisplayRow(0), 27),
DisplayPoint::new(DisplayRow(2), 35)..DisplayPoint::new(DisplayRow(2), 7),
DisplayPoint::new(DisplayRow(3), 15)..DisplayPoint::new(DisplayRow(3), 21),
]
);
_ = view.update(cx, |view, cx| { editor.update(cx, |view, cx| {
view.select_smaller_syntax_node(&SelectSmallerSyntaxNode, cx); view.select_smaller_syntax_node(&SelectSmallerSyntaxNode, cx);
}); });
assert_eq!( editor.update(cx, |editor, cx| {
view.update(cx, |view, cx| view.selections.display_ranges(cx)), assert_text_with_selections(
&[ editor,
DisplayPoint::new(DisplayRow(0), 25)..DisplayPoint::new(DisplayRow(0), 25), indoc! {r#"
DisplayPoint::new(DisplayRow(2), 24)..DisplayPoint::new(DisplayRow(2), 12), use mod1::mod2::{mod3, «mod4ˇ»};
DisplayPoint::new(DisplayRow(3), 18)..DisplayPoint::new(DisplayRow(3), 18),
] fn fn_1«ˇ(param1: bool, param2: &str)» {
); let var1 = "«textˇ»";
}
"#},
cx,
);
});
editor.update(cx, |view, cx| {
view.select_smaller_syntax_node(&SelectSmallerSyntaxNode, cx);
});
editor.update(cx, |editor, cx| {
assert_text_with_selections(
editor,
indoc! {r#"
use mod1::mod2::{mod3, mo«ˇ»d4};
fn fn_1(para«ˇm1: bool, pa»ram2: &str) {
let var1 = "te«ˇ»xt";
}
"#},
cx,
);
});
// Trying to shrink the selected syntax node one more time has no effect. // Trying to shrink the selected syntax node one more time has no effect.
_ = view.update(cx, |view, cx| { editor.update(cx, |view, cx| {
view.select_smaller_syntax_node(&SelectSmallerSyntaxNode, cx); view.select_smaller_syntax_node(&SelectSmallerSyntaxNode, cx);
}); });
assert_eq!( editor.update(cx, |editor, cx| {
view.update(cx, |view, cx| view.selections.display_ranges(cx)), assert_text_with_selections(
&[ editor,
DisplayPoint::new(DisplayRow(0), 25)..DisplayPoint::new(DisplayRow(0), 25), indoc! {r#"
DisplayPoint::new(DisplayRow(2), 24)..DisplayPoint::new(DisplayRow(2), 12), use mod1::mod2::{mod3, mo«ˇ»d4};
DisplayPoint::new(DisplayRow(3), 18)..DisplayPoint::new(DisplayRow(3), 18),
] fn fn_1(para«ˇm1: bool, pa»ram2: &str) {
); let var1 = "te«ˇ»xt";
}
"#},
cx,
);
});
// Ensure that we keep expanding the selection if the larger selection starts or ends within // Ensure that we keep expanding the selection if the larger selection starts or ends within
// a fold. // a fold.
_ = view.update(cx, |view, cx| { editor.update(cx, |view, cx| {
view.fold_ranges( view.fold_ranges(
vec![ vec![
( (
@ -4835,14 +4868,19 @@ async fn test_select_larger_smaller_syntax_node(cx: &mut gpui::TestAppContext) {
); );
view.select_larger_syntax_node(&SelectLargerSyntaxNode, cx); view.select_larger_syntax_node(&SelectLargerSyntaxNode, cx);
}); });
assert_eq!( editor.update(cx, |editor, cx| {
view.update(cx, |view, cx| view.selections.display_ranges(cx)), assert_text_with_selections(
&[ editor,
DisplayPoint::new(DisplayRow(0), 16)..DisplayPoint::new(DisplayRow(0), 28), indoc! {r#"
DisplayPoint::new(DisplayRow(2), 35)..DisplayPoint::new(DisplayRow(2), 7), use mod1::mod2::«{mod3, mod4}ˇ»;
DisplayPoint::new(DisplayRow(3), 4)..DisplayPoint::new(DisplayRow(3), 23),
] fn fn_1«ˇ(param1: bool, param2: &str)» {
); «let var1 = "text";ˇ»
}
"#},
cx,
);
});
} }
#[gpui::test] #[gpui::test]
@ -8173,11 +8211,13 @@ async fn test_toggle_block_comment(cx: &mut gpui::TestAppContext) {
); );
cx.executor().run_until_parked(); cx.executor().run_until_parked();
cx.update_editor(|editor, cx| editor.toggle_comments(&ToggleComments::default(), cx)); cx.update_editor(|editor, cx| editor.toggle_comments(&ToggleComments::default(), cx));
// TODO this is how it actually worked in Zed Stable, which is not very ergonomic.
// Uncommenting and commenting from this position brings in even more wrong artifacts.
cx.assert_editor_state( cx.assert_editor_state(
&r#" &r#"
<!-- ˇ<script> --> <!-- ˇ<script> -->
// ˇvar x = new Y(); // ˇvar x = new Y();
<!-- ˇ</script> --> // ˇ</script>
"# "#
.unindent(), .unindent(),
); );

View file

@ -62,6 +62,7 @@ pub fn select_ranges(editor: &mut Editor, marked_text: &str, cx: &mut ViewContex
editor.change_selections(None, cx, |s| s.select_ranges(text_ranges)); editor.change_selections(None, cx, |s| s.select_ranges(text_ranges));
} }
#[track_caller]
pub fn assert_text_with_selections( pub fn assert_text_with_selections(
editor: &mut Editor, editor: &mut Editor,
marked_text: &str, marked_text: &str,

View file

@ -78,7 +78,7 @@ tree-sitter-embedded-template.workspace = true
tree-sitter-heex.workspace = true tree-sitter-heex.workspace = true
tree-sitter-html.workspace = true tree-sitter-html.workspace = true
tree-sitter-json.workspace = true tree-sitter-json.workspace = true
tree-sitter-markdown.workspace = true tree-sitter-md.workspace = true
tree-sitter-ruby.workspace = true tree-sitter-ruby.workspace = true
tree-sitter-rust.workspace = true tree-sitter-rust.workspace = true
tree-sitter-typescript.workspace = true tree-sitter-typescript.workspace = true

View file

@ -1858,11 +1858,13 @@ fn test_language_scope_at_with_javascript(cx: &mut AppContext) {
let element_config = snapshot let element_config = snapshot
.language_scope_at(text.find("<F>").unwrap()) .language_scope_at(text.find("<F>").unwrap())
.unwrap(); .unwrap();
assert_eq!(element_config.line_comment_prefixes(), &[]); // TODO nested blocks after newlines are captured with all whitespaces
assert_eq!( // https://github.com/tree-sitter/tree-sitter-typescript/issues/306
element_config.block_comment_delimiters(), // assert_eq!(element_config.line_comment_prefixes(), &[]);
Some((&"{/*".into(), &"*/}".into())) // assert_eq!(
); // element_config.block_comment_delimiters(),
// Some((&"{/*".into(), &"*/}".into()))
// );
assert_eq!( assert_eq!(
element_config.brackets().map(|e| e.1).collect::<Vec<_>>(), element_config.brackets().map(|e| e.1).collect::<Vec<_>>(),
&[true, true] &[true, true]

View file

@ -180,7 +180,9 @@ fn test_syntax_map_layers_for_range(cx: &mut AppContext) {
fn test_dynamic_language_injection(cx: &mut AppContext) { fn test_dynamic_language_injection(cx: &mut AppContext) {
let registry = Arc::new(LanguageRegistry::test(cx.background_executor().clone())); let registry = Arc::new(LanguageRegistry::test(cx.background_executor().clone()));
let markdown = Arc::new(markdown_lang()); let markdown = Arc::new(markdown_lang());
let markdown_inline = Arc::new(markdown_inline_lang());
registry.add(markdown.clone()); registry.add(markdown.clone());
registry.add(markdown_inline.clone());
registry.add(Arc::new(rust_lang())); registry.add(Arc::new(rust_lang()));
registry.add(Arc::new(ruby_lang())); registry.add(Arc::new(ruby_lang()));
@ -200,12 +202,14 @@ fn test_dynamic_language_injection(cx: &mut AppContext) {
let mut syntax_map = SyntaxMap::new(); let mut syntax_map = SyntaxMap::new();
syntax_map.set_language_registry(registry.clone()); syntax_map.set_language_registry(registry.clone());
syntax_map.reparse(markdown.clone(), &buffer); syntax_map.reparse(markdown.clone(), &buffer);
syntax_map.reparse(markdown_inline.clone(), &buffer);
assert_layers_for_range( assert_layers_for_range(
&syntax_map, &syntax_map,
&buffer, &buffer,
Point::new(3, 0)..Point::new(3, 0), Point::new(3, 0)..Point::new(3, 0),
&[ &[
"...(fenced_code_block (fenced_code_block_delimiter) (info_string (language)) (code_fence_content) (fenced_code_block_delimiter...", "(document (section (paragraph (inline)) (fenced_code_block (fenced_code_block_delimiter) (info_string (language)) (block_continuation) (code_fence_content (block_continuation)) (fenced_code_block_delimiter))))",
"(inline (code_span (code_span_delimiter) (code_span_delimiter)))",
"...(function_item name: (identifier) parameters: (parameters) body: (block)...", "...(function_item name: (identifier) parameters: (parameters) body: (block)...",
], ],
); );
@ -215,12 +219,14 @@ fn test_dynamic_language_injection(cx: &mut AppContext) {
buffer.edit([(macro_name_range, "ruby")]); buffer.edit([(macro_name_range, "ruby")]);
syntax_map.interpolate(&buffer); syntax_map.interpolate(&buffer);
syntax_map.reparse(markdown.clone(), &buffer); syntax_map.reparse(markdown.clone(), &buffer);
syntax_map.reparse(markdown_inline.clone(), &buffer);
assert_layers_for_range( assert_layers_for_range(
&syntax_map, &syntax_map,
&buffer, &buffer,
Point::new(3, 0)..Point::new(3, 0), Point::new(3, 0)..Point::new(3, 0),
&[ &[
"...(fenced_code_block (fenced_code_block_delimiter) (info_string (language)) (code_fence_content) (fenced_code_block_delimiter...", "(document (section (paragraph (inline)) (fenced_code_block (fenced_code_block_delimiter) (info_string (language)) (block_continuation) (code_fence_content (block_continuation)) (fenced_code_block_delimiter))))",
"(inline (code_span (code_span_delimiter) (code_span_delimiter)))",
"...(call method: (identifier) arguments: (argument_list (call method: (identifier) arguments: (argument_list) block: (block)...", "...(call method: (identifier) arguments: (argument_list (call method: (identifier) arguments: (argument_list) block: (block)...",
], ],
); );
@ -230,25 +236,29 @@ fn test_dynamic_language_injection(cx: &mut AppContext) {
buffer.edit([(macro_name_range, "html")]); buffer.edit([(macro_name_range, "html")]);
syntax_map.interpolate(&buffer); syntax_map.interpolate(&buffer);
syntax_map.reparse(markdown.clone(), &buffer); syntax_map.reparse(markdown.clone(), &buffer);
syntax_map.reparse(markdown_inline.clone(), &buffer);
assert_layers_for_range( assert_layers_for_range(
&syntax_map, &syntax_map,
&buffer, &buffer,
Point::new(3, 0)..Point::new(3, 0), Point::new(3, 0)..Point::new(3, 0),
&[ &[
"...(fenced_code_block (fenced_code_block_delimiter) (info_string (language)) (code_fence_content) (fenced_code_block_delimiter..." "(document (section (paragraph (inline)) (fenced_code_block (fenced_code_block_delimiter) (info_string (language)) (block_continuation) (code_fence_content (block_continuation)) (fenced_code_block_delimiter))))",
"(inline (code_span (code_span_delimiter) (code_span_delimiter)))",
], ],
); );
assert!(syntax_map.contains_unknown_injections()); assert!(syntax_map.contains_unknown_injections());
registry.add(Arc::new(html_lang())); registry.add(Arc::new(html_lang()));
syntax_map.reparse(markdown.clone(), &buffer); syntax_map.reparse(markdown.clone(), &buffer);
syntax_map.reparse(markdown_inline.clone(), &buffer);
assert_layers_for_range( assert_layers_for_range(
&syntax_map, &syntax_map,
&buffer, &buffer,
Point::new(3, 0)..Point::new(3, 0), Point::new(3, 0)..Point::new(3, 0),
&[ &[
"...(fenced_code_block (fenced_code_block_delimiter) (info_string (language)) (code_fence_content) (fenced_code_block_delimiter...", "(document (section (paragraph (inline)) (fenced_code_block (fenced_code_block_delimiter) (info_string (language)) (block_continuation) (code_fence_content (block_continuation)) (fenced_code_block_delimiter))))",
"(fragment (text))", "(inline (code_span (code_span_delimiter) (code_span_delimiter)))",
"(document (text))",
], ],
); );
assert!(!syntax_map.contains_unknown_injections()); assert!(!syntax_map.contains_unknown_injections());
@ -769,9 +779,9 @@ fn test_empty_combined_injections_inside_injections(cx: &mut AppContext) {
&buffer, &buffer,
Point::new(0, 0)..Point::new(5, 0), Point::new(0, 0)..Point::new(5, 0),
&[ &[
"...(paragraph)...", "(document (section (fenced_code_block (fenced_code_block_delimiter) (info_string (language)) (block_continuation) (code_fence_content (block_continuation)) (fenced_code_block_delimiter)) (paragraph (inline))))",
"(template...", "(template...",
"(fragment...", "(document (text))",
// The ruby syntax tree should be empty, since there are // The ruby syntax tree should be empty, since there are
// no interpolations in the ERB template. // no interpolations in the ERB template.
"(program)", "(program)",
@ -1055,6 +1065,7 @@ fn test_edit_sequence(
registry.add(Arc::new(html_lang())); registry.add(Arc::new(html_lang()));
registry.add(Arc::new(erb_lang())); registry.add(Arc::new(erb_lang()));
registry.add(Arc::new(markdown_lang())); registry.add(Arc::new(markdown_lang()));
registry.add(Arc::new(markdown_inline_lang()));
let language = registry let language = registry
.language_for_name(language_name) .language_for_name(language_name)
@ -1228,7 +1239,7 @@ fn markdown_lang() -> Language {
}, },
..Default::default() ..Default::default()
}, },
Some(tree_sitter_markdown::language()), Some(tree_sitter_md::language()),
) )
.with_injection_query( .with_injection_query(
r#" r#"
@ -1241,6 +1252,16 @@ fn markdown_lang() -> Language {
.unwrap() .unwrap()
} }
fn markdown_inline_lang() -> Language {
Language::new(
LanguageConfig {
name: "Markdown-Inline".into(),
..LanguageConfig::default()
},
Some(tree_sitter_md::inline_language()),
)
}
fn elixir_lang() -> Language { fn elixir_lang() -> Language {
Language::new( Language::new(
LanguageConfig { LanguageConfig {

View file

@ -42,12 +42,12 @@ tree-sitter-c.workspace = true
tree-sitter-cpp.workspace = true tree-sitter-cpp.workspace = true
tree-sitter-css.workspace = true tree-sitter-css.workspace = true
tree-sitter-go.workspace = true tree-sitter-go.workspace = true
tree-sitter-gomod.workspace = true tree-sitter-go-mod.workspace = true
tree-sitter-gowork.workspace = true tree-sitter-gowork.workspace = true
tree-sitter-jsdoc.workspace = true tree-sitter-jsdoc.workspace = true
tree-sitter-json.workspace = true tree-sitter-json.workspace = true
tree-sitter-markdown.workspace = true tree-sitter-md.workspace = true
tree-sitter-proto.workspace = true protols-tree-sitter-proto.workspace = true
tree-sitter-python.workspace = true tree-sitter-python.workspace = true
tree-sitter-regex.workspace = true tree-sitter-regex.workspace = true
tree-sitter-rust.workspace = true tree-sitter-rust.workspace = true

View file

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

View file

@ -34,7 +34,7 @@
(var_spec (var_spec
name: (identifier) @name) @item)) name: (identifier) @name) @item))
(method_spec (method_elem
name: (_) @name name: (_) @name
parameters: (parameter_list parameters: (parameter_list
"(" @context "(" @context

View file

@ -41,13 +41,14 @@ pub fn init(
("cpp", tree_sitter_cpp::language()), ("cpp", tree_sitter_cpp::language()),
("css", tree_sitter_css::language()), ("css", tree_sitter_css::language()),
("go", tree_sitter_go::language()), ("go", tree_sitter_go::language()),
("gomod", tree_sitter_gomod::language()), ("gomod", tree_sitter_go_mod::language()),
("gowork", tree_sitter_gowork::language()), ("gowork", tree_sitter_gowork::language()),
("jsdoc", tree_sitter_jsdoc::language()), ("jsdoc", tree_sitter_jsdoc::language()),
("json", tree_sitter_json::language()), ("json", tree_sitter_json::language()),
("jsonc", tree_sitter_json::language()), ("jsonc", tree_sitter_json::language()),
("markdown", tree_sitter_markdown::language()), ("markdown", tree_sitter_md::language()),
("proto", tree_sitter_proto::language()), ("markdown-inline", tree_sitter_md::inline_language()),
("proto", protols_tree_sitter_proto::language()),
("python", tree_sitter_python::language()), ("python", tree_sitter_python::language()),
("regex", tree_sitter_regex::language()), ("regex", tree_sitter_regex::language()),
("rust", tree_sitter_rust::language()), ("rust", tree_sitter_rust::language()),
@ -136,6 +137,7 @@ pub fn init(
json_task_context() json_task_context()
); );
language!("markdown"); language!("markdown");
language!("markdown-inline");
language!( language!(
"python", "python",
vec![Arc::new(python::PythonLspAdapter::new( vec![Arc::new(python::PythonLspAdapter::new(

View file

@ -0,0 +1,15 @@
name = "Markdown-Inline"
grammar = "markdown-inline"
path_suffixes = []
word_characters = ["-"]
brackets = [
{ start = "{", end = "}", close = true, newline = true },
{ start = "[", end = "]", close = true, newline = true },
{ start = "(", end = ")", close = true, newline = true },
{ start = "<", end = ">", close = true, newline = true },
{ start = "\"", end = "\"", close = false, newline = false },
{ start = "'", end = "'", close = false, newline = false },
{ start = "`", end = "`", close = false, newline = false },
]
tab_size = 2

View file

@ -0,0 +1,6 @@
(emphasis) @emphasis
(strong_emphasis) @emphasis.strong
(code_span) @text.literal
(link_text) @link_text
(link_label) @link_text
(link_destination) @link_uri

View file

@ -1,6 +1,3 @@
(emphasis) @emphasis
(strong_emphasis) @emphasis.strong
[ [
(atx_heading) (atx_heading)
(setext_heading) (setext_heading)
@ -14,11 +11,6 @@
(list_marker_parenthesis) (list_marker_parenthesis)
] @punctuation.list_marker ] @punctuation.list_marker
(code_span) @text.literal
(fenced_code_block (fenced_code_block
(info_string (info_string
(language) @text.literal)) (language) @text.literal))
(link_destination) @link_uri
(link_text) @link_text

View file

@ -2,3 +2,6 @@
(info_string (info_string
(language) @language) (language) @language)
(code_fence_content) @content) (code_fence_content) @content)
((inline) @content
(#set! "language" "markdown-inline"))

View file

@ -31,7 +31,7 @@ serde_derive.workspace = true
serde_json.workspace = true serde_json.workspace = true
serde_json_lenient.workspace = true serde_json_lenient.workspace = true
smallvec.workspace = true smallvec.workspace = true
tree-sitter-json = "*" tree-sitter-json.workspace = true
tree-sitter.workspace = true tree-sitter.workspace = true
util.workspace = true util.workspace = true

View file

@ -67,6 +67,6 @@ pretty_assertions.workspace = true
project = { workspace = true, features = ["test-support"] } project = { workspace = true, features = ["test-support"] }
rpc = { workspace = true, features = ["test-support"] } rpc = { workspace = true, features = ["test-support"] }
settings = { workspace = true, features = ["test-support"] } settings = { workspace = true, features = ["test-support"] }
tree-sitter-markdown.workspace = true tree-sitter-md.workspace = true
util = { workspace = true, features = ["test-support"] } util = { workspace = true, features = ["test-support"] }
workspace = { workspace = true, features = ["test-support"] } workspace = { workspace = true, features = ["test-support"] }

View file

@ -122,7 +122,7 @@ editor = { workspace = true, features = ["test-support"] }
gpui = { workspace = true, features = ["test-support"] } gpui = { workspace = true, features = ["test-support"] }
language = { workspace = true, features = ["test-support"] } language = { workspace = true, features = ["test-support"] }
project = { workspace = true, features = ["test-support"] } project = { workspace = true, features = ["test-support"] }
tree-sitter-markdown.workspace = true tree-sitter-md.workspace = true
tree-sitter-rust.workspace = true tree-sitter-rust.workspace = true
workspace = { workspace = true, features = ["test-support"] } workspace = { workspace = true, features = ["test-support"] }

View file

@ -3326,6 +3326,7 @@ mod tests {
#[gpui::test] #[gpui::test]
async fn test_bundled_languages(cx: &mut TestAppContext) { async fn test_bundled_languages(cx: &mut TestAppContext) {
env_logger::builder().is_test(true).try_init().ok();
let settings = cx.update(|cx| SettingsStore::test(cx)); let settings = cx.update(|cx| SettingsStore::test(cx));
cx.set_global(settings); cx.set_global(settings);
let languages = LanguageRegistry::test(cx.executor()); let languages = LanguageRegistry::test(cx.executor());
@ -3490,7 +3491,7 @@ mod tests {
}, },
..Default::default() ..Default::default()
}, },
Some(tree_sitter_markdown::language()), Some(tree_sitter_md::language()),
)) ))
} }

View file

@ -43,7 +43,7 @@ See https://github.com/golang/tools/blob/master/gopls/doc/inlayHints.md for more
# Go Mod # Go Mod
- Tree Sitter: [tree-sitter-gomod](https://github.com/camdencheek/tree-sitter-go-mod) - Tree Sitter: [tree-sitter-go-mod](https://github.com/camdencheek/tree-sitter-go-mod)
- Language Server: N/A - Language Server: N/A
# Go Sum # Go Sum

View file

@ -2,5 +2,5 @@
Markdown support is available natively in Zed. Markdown support is available natively in Zed.
- Tree Sitter: [tree-sitter-markdown](https://github.com/MDeiml/tree-sitter-markdown) - Tree Sitter: [tree-sitter-md](https://github.com/tree-sitter-grammars/tree-sitter-markdown)
- Language Server: N/A - Language Server: N/A

View file

@ -2,5 +2,5 @@
Proto support is available natively in Zed. Proto support is available natively in Zed.
- Tree-Sitter: [tree-sitter-proto](https://github.com/rewinfrey/tree-sitter-proto) - Tree-Sitter: [protols-tree-sitter-proto](https://github.com/coder3101/tree-sitter-proto)
- Language-Server: N/A - Language-Server: N/A

View file

@ -39,5 +39,7 @@ extend-ignore-re = [
# crates/collab/src/api/events.rs # crates/collab/src/api/events.rs
"rename = \"sesssion_id\"", "rename = \"sesssion_id\"",
"doas", "doas",
# ProtoLS crate with tree-sitter Protobuf grammar.
"protols"
] ]
check-filename = true check-filename = true