Repository: ast-grep/ast-grep (language: rust)

Issue:
[bug] NAPI incorrect node range for nested JSX element
### Please read the FAQ for the bug you encountered.

- [X] I have read the existing FAQ

### ⏯ Playground Link

https://ast-grep.github.io/playground.html#eyJtb2RlIjoiUGF0Y2giLCJsYW5nIjoidHN4IiwicXVlcnkiOiJleHBvcnQgZnVuY3Rpb24gYXNkKCkge1xuICAgICQkJFxufSIsInJld3JpdGUiOiIiLCJzdHJpY3RuZXNzIjoic2lnbmF0dXJlIiwic2VsZWN0b3IiOiIiLCJjb25maWciOiJydWxlOlxuICBraW5kOiBzdHJ1Y3RfaXRlbVxuIiwic291cmNlIjoiaW1wb3J0IHsgQnV0dG9uLCBGb3JtIH0gZnJvbSAnQGNvbXBhbnkvb2xkLXVpJztcblxuZnVuY3Rpb24gQ29tcG9uZW50KCkge1xuICByZXR1cm4gKFxuICAgIDxGb3JtPlxuICAgICAgPEJ1dHRvbiBvbkNsaWNrPXtjYWxsYmFja30gdmFyaWFudD1cInByaW1hcnlcIj5TdWJtaXQ8L0J1dHRvbj5cbiAgICA8L0Zvcm0+XG4gICk7XG59In0=

### 💻 Code

In playground Button has range 5,6 - 5,66.

### 🙁 Actual behavior

With @ast-grep/napi Button has range 4,10 - 5,66.

### 🙂 Expected behavior

With @ast-grep/napi Button should have range 5,6 - 5,66.

### Additional information about the issue

For some reason it takes into account leading spaces and newline.


Discussion / hints:
Tracked by 
https://github.com/tree-sitter/tree-sitter-typescript/issues/306

I think it could be fixed by bumping the tree-sitter version

Fix patch:
diff --git a/Cargo.lock b/Cargo.lock
index 2306db03a2..344da74b70 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -155,7 +155,7 @@ dependencies = [
  "serde",
  "serde_yaml",
  "thiserror",
- "tree-sitter-typescript",
+ "tree-sitter-typescript 0.21.2",
 ]
 
 [[package]]
@@ -166,7 +166,7 @@ dependencies = [
  "regex",
  "thiserror",
  "tree-sitter-facade-sg",
- "tree-sitter-typescript",
+ "tree-sitter-typescript 0.21.2",
 ]
 
 [[package]]
@@ -200,7 +200,7 @@ dependencies = [
  "tree-sitter-java",
  "tree-sitter-javascript",
  "tree-sitter-json",
- "tree-sitter-kotlin",
+ "tree-sitter-kotlin-sg",
  "tree-sitter-lua",
  "tree-sitter-php",
  "tree-sitter-python",
@@ -209,7 +209,7 @@ dependencies = [
  "tree-sitter-scala",
  "tree-sitter-sequel",
  "tree-sitter-swift",
- "tree-sitter-typescript",
+ "tree-sitter-typescript 0.23.2",
  "tree-sitter-yaml",
 ]
 
@@ -384,9 +384,12 @@ checksum = "37b2a672a2cb129a2e41c10b1224bb368f9f37a2b16b612598138befd7b37eb5"
 
 [[package]]
 name = "cc"
-version = "1.0.104"
+version = "1.2.3"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "74b6a57f98764a267ff415d50a25e6e166f3831a5071af4995296ea97d210490"
+checksum = "27f657647bcff5394bf56c7317665bbf790a137a50eaaa5c6bfbb9e27a518f2d"
+dependencies = [
+ "shlex",
+]
 
 [[package]]
 name = "cfg-if"
@@ -1579,6 +1582,12 @@ dependencies = [
  "unsafe-libyaml",
 ]
 
+[[package]]
+name = "shlex"
+version = "1.3.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "0fda2ff0d084019ba4d7c6f371c95d8fd75ce3524c3cb8fb653a3023f6323e64"
+
 [[package]]
 name = "signal-hook"
 version = "0.3.17"
@@ -1631,6 +1640,12 @@ version = "1.13.2"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 checksum = "3c5e1a9a646d36c3599cd173a41282daf47c44583ad367b8e6837255952e5c67"
 
+[[package]]
+name = "streaming-iterator"
+version = "0.1.9"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "2b2231b7c3057d5e4ad0156fb3dc807d900806020c5ffa3ee6ff2c8c76fb8520"
+
 [[package]]
 name = "strsim"
 version = "0.11.1"
@@ -1871,82 +1886,86 @@ dependencies = [
 
 [[package]]
 name = "tree-sitter"
-version = "0.22.6"
+version = "0.24.4"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "df7cc499ceadd4dcdf7ec6d4cbc34ece92c3fa07821e287aedecd4416c516dca"
+checksum = "b67baf55e7e1b6806063b1e51041069c90afff16afcbbccd278d899f9d84bca4"
 dependencies = [
  "cc",
  "regex",
+ "regex-syntax",
+ "streaming-iterator",
+ "tree-sitter-language",
 ]
 
 [[package]]
 name = "tree-sitter-bash"
-version = "0.21.0"
+version = "0.23.3"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "b5244703ad2e08a616d859a0557d7aa290adcd5e0990188a692e628ffe9dce40"
+checksum = "329a4d48623ac337d42b1df84e81a1c9dbb2946907c102ca72db158c1964a52e"
 dependencies = [
  "cc",
- "tree-sitter",
+ "tree-sitter-language",
 ]
 
 [[package]]
 name = "tree-sitter-c"
-version = "0.21.4"
+version = "0.23.2"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "f956d5351d62652864a4ff3ae861747e7a1940dc96c9998ae400ac0d3ce30427"
+checksum = "db56fadd8c3c6bc880dffcf1177c9d1c54a71a5207716db8660189082e63b587"
 dependencies = [
  "cc",
- "tree-sitter",
+ "tree-sitter-language",
 ]
 
 [[package]]
 name = "tree-sitter-c-sharp"
-version = "0.21.3"
+version = "0.23.1"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "8997ad04502208449025114e434c9024a33a74e700513c702a9d2cac6522a771"
+checksum = "67f06accca7b45351758663b8215089e643d53bd9a660ce0349314263737fcb0"
 dependencies = [
  "cc",
- "tree-sitter",
+ "tree-sitter-language",
 ]
 
 [[package]]
 name = "tree-sitter-cpp"
-version = "0.22.3"
+version = "0.23.4"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "1d509a22a992790d38f2c291961ff8a1ff016c437c7ec6befc9220b8eec8918c"
+checksum = "df2196ea9d47b4ab4a31b9297eaa5a5d19a0b121dceb9f118f6790ad0ab94743"
 dependencies = [
  "cc",
- "tree-sitter",
+ "tree-sitter-language",
 ]
 
 [[package]]
 name = "tree-sitter-css"
-version = "0.21.1"
+version = "0.23.1"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "5e08e324b1cf60fd3291774b49724c66de2ce8fcf4d358d0b4b82e37b41b1c9b"
+checksum = "25435a275adb3226b6fddab891bbc50d1a500774a44ceb97022a39666ccda75d"
 dependencies = [
  "cc",
- "tree-sitter",
+ "tree-sitter-language",
 ]
 
 [[package]]
 name = "tree-sitter-elixir"
-version = "0.2.0"
+version = "0.3.2"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "df94bf7f057768b1cab2ee1f14812ed4ae33f9e04d09254043eeaa797db4ef70"
+checksum = "2e638e171093d14ef295b7ea5093319ca53cc936a43c2cd37ee0460b8be60481"
 dependencies = [
  "cc",
- "tree-sitter",
+ "tree-sitter-language",
 ]
 
 [[package]]
 name = "tree-sitter-facade-sg"
-version = "0.22.2"
+version = "0.24.5"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "dd61195e2ff046b232da116521697f4aadb99221c0afaae9cc5b491bae82d6ab"
+checksum = "9195ab85ddd7df7ddac5b2e397ec6264816ae640346013002ceccf0f9b3578f1"
 dependencies = [
  "js-sys",
  "tree-sitter",
+ "tree-sitter-language",
  "wasm-bindgen",
  "web-sys",
  "web-tree-sitter-sg",
@@ -1954,152 +1973,158 @@ dependencies = [
 
 [[package]]
 name = "tree-sitter-go"
-version = "0.21.2"
+version = "0.23.4"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "b8d702a98d3c7e70e466456e58ff2b1ac550bf1e29b97e5770676d2fdabec00d"
+checksum = "b13d476345220dbe600147dd444165c5791bf85ef53e28acbedd46112ee18431"
 dependencies = [
  "cc",
- "tree-sitter",
+ "tree-sitter-language",
 ]
 
 [[package]]
 name = "tree-sitter-haskell"
-version = "0.21.0"
+version = "0.23.1"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "ef25a7e6c73cc1cbe0c0b7dbd5406e7b3485b370bd61c5d8d852ae0781f9bf9a"
+checksum = "977c51e504548cba13fc27cb5a2edab2124cf6716a1934915d07ab99523b05a4"
 dependencies = [
  "cc",
- "tree-sitter",
+ "tree-sitter-language",
 ]
 
 [[package]]
 name = "tree-sitter-html"
-version = "0.20.4"
+version = "0.23.2"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "8766b5ad3721517f8259e6394aefda9c686aebf7a8c74ab8624f2c3b46902fd5"
+checksum = "261b708e5d92061ede329babaaa427b819329a9d427a1d710abb0f67bbef63ee"
 dependencies = [
  "cc",
- "tree-sitter",
+ "tree-sitter-language",
 ]
 
 [[package]]
 name = "tree-sitter-java"
-version = "0.21.0"
+version = "0.23.4"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "33bc21adf831a773c075d9d00107ab43965e6a6ea7607b47fd9ec6f3db4b481b"
+checksum = "6f9b24494d5f386acb2c086e0541c1b145692e0e012101ddb8257737b83c2803"
 dependencies = [
  "cc",
- "tree-sitter",
+ "tree-sitter-language",
 ]
 
 [[package]]
 name = "tree-sitter-javascript"
-version = "0.21.4"
+version = "0.23.1"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "8710a71bc6779e33811a8067bdda3ed08bed1733296ff915e44faf60f8c533d7"
+checksum = "bf40bf599e0416c16c125c3cec10ee5ddc7d1bb8b0c60fa5c4de249ad34dc1b1"
 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-kotlin"
-version = "0.3.8"
+name = "tree-sitter-kotlin-sg"
+version = "0.4.0"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "54ff60aeb036f5762515ceb31404512ea4f9599764bcd3857074bb82867bdd34"
+checksum = "a0e175b7530765d1e36ad234a7acaa8b2a3316153f239d724376c7ee5e8d8e98"
 dependencies = [
  "cc",
- "tree-sitter",
+ "tree-sitter-language",
 ]
 
+[[package]]
+name = "tree-sitter-language"
+version = "0.1.2"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "e8ddffe35a0e5eeeadf13ff7350af564c6e73993a24db62caee1822b185c2600"
+
 [[package]]
 name = "tree-sitter-lua"
-version = "0.1.0"
+version = "0.2.0"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "3b9fe6fc87bd480e1943fc1fcb02453fb2da050e4e8ce0daa67d801544046856"
+checksum = "5cdb9adf0965fec58e7660cbb3a059dbb12ebeec9459e6dcbae3db004739641e"
 dependencies = [
  "cc",
- "tree-sitter",
+ "tree-sitter-language",
 ]
 
 [[package]]
 name = "tree-sitter-php"
-version = "0.23.0"
+version = "0.23.11"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "701096cc0c7c8e5c33ec0be7ea4d7aed971ee07043af5c35581c029805527ac5"
+checksum = "f066e94e9272cfe4f1dcb07a1c50c66097eca648f2d7233d299c8ae9ed8c130c"
 dependencies = [
  "cc",
- "tree-sitter",
+ "tree-sitter-language",
 ]
 
 [[package]]
 name = "tree-sitter-python"
-version = "0.21.0"
+version = "0.23.5"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "b4066c6cf678f962f8c2c4561f205945c84834cce73d981e71392624fdc390a9"
+checksum = "70beaa47e19e1529e8787fc0a80ebbae5a9fdaefc5fcc8972c885c9abf6ab0f0"
 dependencies = [
  "cc",
- "tree-sitter",
+ "tree-sitter-language",
 ]
 
 [[package]]
 name = "tree-sitter-ruby"
-version = "0.21.0"
+version = "0.23.1"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "c0031f687c0772f2dad7b77104c43428611099a1804c81244ada21560f41f0b1"
+checksum = "be0484ea4ef6bb9c575b4fdabde7e31340a8d2dbc7d52b321ac83da703249f95"
 dependencies = [
  "cc",
- "tree-sitter",
+ "tree-sitter-language",
 ]
 
 [[package]]
 name = "tree-sitter-rust"
-version = "0.21.2"
+version = "0.23.2"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "277690f420bf90741dea984f3da038ace46c4fe6047cba57a66822226cde1c93"
+checksum = "a4d64d449ca63e683c562c7743946a646671ca23947b9c925c0cfbe65051a4af"
 dependencies = [
  "cc",
- "tree-sitter",
+ "tree-sitter-language",
 ]
 
 [[package]]
 name = "tree-sitter-scala"
-version = "0.22.1"
+version = "0.23.3"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "a464d8e2e1837cf20b34204c51c369da3483e55c3ea013c6db81a04439e17895"
+checksum = "ab837c0df7ffb6c315fd1cd792164375b3ec0c282ea35f639231f138044f8d0c"
 dependencies = [
  "cc",
- "tree-sitter",
+ "tree-sitter-language",
 ]
 
 [[package]]
 name = "tree-sitter-sequel"
-version = "0.3.5"
+version = "0.3.7"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "8e39194c44ad71033d8b09d225c03e154dee9b788c6a113bce7feb809f39480f"
+checksum = "23b40eae724945161b8a26347740a8db4ad815ee98c8c2d99a122db9dd763f1f"
 dependencies = [
  "cc",
- "tree-sitter",
+ "tree-sitter-language",
 ]
 
 [[package]]
 name = "tree-sitter-swift"
-version = "0.5.0"
+version = "0.6.0"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "75fd4af840121c5add7a20372be867c04fc398edf3edb2c64286b56f2da28c43"
+checksum = "d65aeb41726119416567d0333ec17580ac4abfb96db1f67c4bd638c65f9992fe"
 dependencies = [
  "cc",
- "tree-sitter",
+ "tree-sitter-language",
 ]
 
 [[package]]
@@ -2112,14 +2137,24 @@ dependencies = [
  "tree-sitter",
 ]
 
+[[package]]
+name = "tree-sitter-typescript"
+version = "0.23.2"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "6c5f76ed8d947a75cc446d5fccd8b602ebf0cde64ccf2ffa434d873d7a575eff"
+dependencies = [
+ "cc",
+ "tree-sitter-language",
+]
+
 [[package]]
 name = "tree-sitter-yaml"
-version = "0.6.1"
+version = "0.7.0"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "aad27ec46ad343d8b514f64dd3fdffb478c592ece561b6c935d90ef55589c6b6"
+checksum = "d0c99f2b92b677f1a18b6b232fa9329afb5758118238a7d0b29cae324ef50d5e"
 dependencies = [
  "cc",
- "tree-sitter",
+ "tree-sitter-language",
 ]
 
 [[package]]
@@ -2288,9 +2323,9 @@ dependencies = [
 
 [[package]]
 name = "web-tree-sitter-sg"
-version = "0.22.2"
+version = "0.24.5"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "95c730606d55f4635802e65d47e91dc08f0f46f886ef5c29f571e0e6c685330a"
+checksum = "69cf7d34b16550f076d75b4a5d4673f1a9692f79787d040e3ac7ddb04e5c48a0"
 dependencies = [
  "js-sys",
  "wasm-bindgen",
diff --git a/Cargo.toml b/Cargo.toml
index 1ba2817493..25198e070c 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -32,7 +32,7 @@ bit-set = { version = "0.8.0" }
 ignore = { version = "0.4.22" }
 regex = { version = "1.10.4" }
 serde = { version = "1.0.200", features = ["derive"] }
-tree-sitter = { version = "0.22.0", package = "tree-sitter-facade-sg" }
+tree-sitter = { version = "0.24.5", package = "tree-sitter-facade-sg" }
 thiserror = "2.0.0"
 schemars = "0.8.17"
-anyhow = "1.0.82"
+anyhow = "1.0.82"
\ No newline at end of file
diff --git a/crates/dynamic/Cargo.toml b/crates/dynamic/Cargo.toml
index f620bf0ebe..5ee5ae90f0 100644
--- a/crates/dynamic/Cargo.toml
+++ b/crates/dynamic/Cargo.toml
@@ -17,4 +17,4 @@ ignore.workspace = true
 libloading = "0.8.3"
 serde.workspace = true
 thiserror.workspace = true
-tree-sitter-native = { version = "0.22.6", package = "tree-sitter" }
\ No newline at end of file
+tree-sitter-native = { version = "0.24.4", package = "tree-sitter" }
\ No newline at end of file
diff --git a/crates/language/Cargo.toml b/crates/language/Cargo.toml
index 762b0d200c..bfa351d0a6 100644
--- a/crates/language/Cargo.toml
+++ b/crates/language/Cargo.toml
@@ -16,29 +16,29 @@ ast-grep-core.workspace = true
 ignore.workspace = true
 serde.workspace = true
 
-tree-sitter-bash = { version = "0.21.0", optional = true }
-tree-sitter-c = { version = "0.21.0", optional = true }
-tree-sitter-cpp = { version = "0.22.0", optional = true }
-tree-sitter-c-sharp = { version = "0.21.1", optional = true }
-tree-sitter-css = { version = "0.21.0", optional = true }
-tree-sitter-elixir = { version = "0.2.0", optional = true }
-tree-sitter-go = { version = "0.21.0", optional = true }
-tree-sitter-haskell = { version = "0.21.0", optional = true }
-tree-sitter-html = { version = "0.20.3", optional = true }
-tree-sitter-java = { version = "0.21.0", optional = true }
-tree-sitter-javascript = { version = "0.21.3", optional = true }
-tree-sitter-json = { version = "0.21.0", optional = true }
-tree-sitter-kotlin = { version = "0.3.6", optional = true }
-tree-sitter-lua = { version = "0.1.0", optional = true }
-tree-sitter-php = { version = "0.23.0", optional = true }
-tree-sitter-python = { version = "0.21.0", optional = true }
-tree-sitter-ruby = { version = "0.21.0", optional = true }
-tree-sitter-rust = { version = "0.21.2", optional = true }
-tree-sitter-scala = { version = "0.22.0", optional = true }
-tree-sitter-sequel  = { version = "0.3.3", optional = true }
-tree-sitter-swift = { version = "=0.5.0", optional = true }
-tree-sitter-typescript= { version = "0.21.1", optional = true }
-tree-sitter-yaml = { version = "0.6.1", optional = true }
+tree-sitter-bash = { version = "0.23.0", optional = true }
+tree-sitter-c = { version = "0.23.0", optional = true }
+tree-sitter-cpp = { version = "0.23.0", optional = true }
+tree-sitter-c-sharp = { version = "0.23.0", optional = true }
+tree-sitter-css = { version = "0.23.0", optional = true }
+tree-sitter-elixir = { version = "0.3.0", optional = true }
+tree-sitter-go = { version = "0.23.0", optional = true }
+tree-sitter-haskell = { version = "0.23.0", optional = true }
+tree-sitter-html = { version = "0.23.0", optional = true }
+tree-sitter-java = { version = "0.23.0", optional = true }
+tree-sitter-javascript = { version = "0.23.0", optional = true }
+tree-sitter-json = { version = "0.23.0", optional = true }
+tree-sitter-kotlin = { version = "0.4.0", optional = true, package = "tree-sitter-kotlin-sg" }
+tree-sitter-lua = { version = "0.2.0", optional = true }
+tree-sitter-php = { version = "0.23.11", optional = true }
+tree-sitter-python = { version = "0.23.0", optional = true }
+tree-sitter-ruby = { version = "0.23.0", optional = true }
+tree-sitter-rust = { version = "0.23.0", optional = true }
+tree-sitter-scala = { version = "0.23.0", optional = true }
+tree-sitter-sequel  = { version = "0.3.7", optional = true }
+tree-sitter-swift = { version = "0.6.0", optional = true }
+tree-sitter-typescript= { version = "0.23.2", optional = true }
+tree-sitter-yaml = { version = "0.7.0", optional = true }
 
 [features]
 builtin-parser = [
diff --git a/crates/language/src/go.rs b/crates/language/src/go.rs
index bc7254aabb..d441056a78 100644
--- a/crates/language/src/go.rs
+++ b/crates/language/src/go.rs
@@ -49,14 +49,13 @@ func intSeq() {
 }"#,
     r#"defer func() {
 $$$BODY }()"#,
-    r#"func b() { $$$BODY}"#,
+    r#"func b() { $$$BODY }"#,
   )?;
   assert_eq!(
     ret,
     r#"
 func intSeq() {
-  func b() { i++
-}
+  func b() { i++ }
 }"#
   );
   Ok(())
diff --git a/crates/language/src/parsers.rs b/crates/language/src/parsers.rs
index 12e754e378..c0b6c0e9b1 100644
--- a/crates/language/src/parsers.rs
+++ b/crates/language/src/parsers.rs
@@ -9,76 +9,76 @@ mod parser_implementation {
   use ast_grep_core::language::TSLanguage;
 
   pub fn language_bash() -> TSLanguage {
-    tree_sitter_bash::language().into()
+    tree_sitter_bash::LANGUAGE.into()
   }
   pub fn language_c() -> TSLanguage {
-    tree_sitter_c::language().into()
+    tree_sitter_c::LANGUAGE.into()
   }
   pub fn language_cpp() -> TSLanguage {
-    tree_sitter_cpp::language().into()
+    tree_sitter_cpp::LANGUAGE.into()
   }
   pub fn language_c_sharp() -> TSLanguage {
-    tree_sitter_c_sharp::language().into()
+    tree_sitter_c_sharp::LANGUAGE.into()
   }
   pub fn language_css() -> TSLanguage {
-    tree_sitter_css::language().into()
+    tree_sitter_css::LANGUAGE.into()
   }
   pub fn language_elixir() -> TSLanguage {
-    tree_sitter_elixir::language().into()
+    tree_sitter_elixir::LANGUAGE.into()
   }
   pub fn language_go() -> TSLanguage {
-    tree_sitter_go::language().into()
+    tree_sitter_go::LANGUAGE.into()
   }
   pub fn language_haskell() -> TSLanguage {
-    tree_sitter_haskell::language().into()
+    tree_sitter_haskell::LANGUAGE.into()
   }
   pub fn language_html() -> TSLanguage {
-    tree_sitter_html::language().into()
+    tree_sitter_html::LANGUAGE.into()
   }
   pub fn language_java() -> TSLanguage {
-    tree_sitter_java::language().into()
+    tree_sitter_java::LANGUAGE.into()
   }
   pub fn language_javascript() -> TSLanguage {
-    tree_sitter_javascript::language().into()
+    tree_sitter_javascript::LANGUAGE.into()
   }
   pub fn language_json() -> TSLanguage {
-    tree_sitter_json::language().into()
+    tree_sitter_json::LANGUAGE.into()
   }
   pub fn language_kotlin() -> TSLanguage {
-    tree_sitter_kotlin::language().into()
+    tree_sitter_kotlin::LANGUAGE.into()
   }
   pub fn language_lua() -> TSLanguage {
-    tree_sitter_lua::language().into()
+    tree_sitter_lua::LANGUAGE.into()
   }
   pub fn language_php() -> TSLanguage {
-    tree_sitter_php::language_php().into()
+    tree_sitter_php::LANGUAGE_PHP.into()
   }
   pub fn language_python() -> TSLanguage {
-    tree_sitter_python::language().into()
+    tree_sitter_python::LANGUAGE.into()
   }
   pub fn language_ruby() -> TSLanguage {
-    tree_sitter_ruby::language().into()
+    tree_sitter_ruby::LANGUAGE.into()
   }
   pub fn language_rust() -> TSLanguage {
-    tree_sitter_rust::language().into()
+    tree_sitter_rust::LANGUAGE.into()
   }
   pub fn language_scala() -> TSLanguage {
-    tree_sitter_scala::language().into()
+    tree_sitter_scala::LANGUAGE.into()
   }
   pub fn language_sql() -> TSLanguage {
-    tree_sitter_sequel::language().into()
+    tree_sitter_sequel::LANGUAGE.into()
   }
   pub fn language_swift() -> TSLanguage {
-    tree_sitter_swift::language().into()
+    tree_sitter_swift::LANGUAGE.into()
   }
   pub fn language_tsx() -> TSLanguage {
-    tree_sitter_typescript::language_tsx().into()
+    tree_sitter_typescript::LANGUAGE_TSX.into()
   }
   pub fn language_typescript() -> TSLanguage {
-    tree_sitter_typescript::language_typescript().into()
+    tree_sitter_typescript::LANGUAGE_TYPESCRIPT.into()
   }
   pub fn language_yaml() -> TSLanguage {
-    tree_sitter_yaml::language().into()
+    tree_sitter_yaml::LANGUAGE.into()
   }
 }
 


Test patch: