on master help sign in
highlight 140 languages: compile in every crates.io tree-sitter grammar compatible with 0.27 that has a highlights query, vendoring unexported queries
commit43ed2683b4d38bc05ac17cf5b75225d9672d5343 authoriko <ilyakooo0@gmail.com> dateSat 26 Sep 2026, 05:16 (1 month ago) parent9ad6e43
37 files changed+6697−171
Cargo.lock+1322−35 SPEC.md+11−6 crates/fold-tui/Cargo.toml+132−14 crates/fold-tui/queries/README.md+38 crates/fold-tui/queries/ada.scm+196 crates/fold-tui/queries/applesoft.scm+124 crates/fold-tui/queries/caddy.scm+52 crates/fold-tui/queries/cfml.scm+400 crates/fold-tui/queries/cfquery.scm+383 crates/fold-tui/queries/cfscript.scm+408 crates/fold-tui/queries/d.scm+259 crates/fold-tui/queries/dafny.scm+99 crates/fold-tui/queries/dm.scm+147 crates/fold-tui/queries/fsharp-signature.scm+298 crates/fold-tui/queries/gomod.scm+20 crates/fold-tui/queries/gwbasic.scm+12 crates/fold-tui/queries/ink.scm+30 crates/fold-tui/queries/integerbasic.scm+117 crates/fold-tui/queries/julia.scm+325 crates/fold-tui/queries/matlab.scm+157 crates/fold-tui/queries/merlin6502.scm+184 crates/fold-tui/queries/msbasic2.scm+11 crates/fold-tui/queries/newick.scm+8 crates/fold-tui/queries/nginx.scm+59 crates/fold-tui/queries/pascal.scm+345 crates/fold-tui/queries/pgn.scm+29 crates/fold-tui/queries/plpgsql.scm+153 crates/fold-tui/queries/postgres.scm+358 crates/fold-tui/queries/prisma.scm+39 crates/fold-tui/queries/proto.scm+190 crates/fold-tui/queries/qbasic.scm+19 crates/fold-tui/queries/systemverilog.scm+325 crates/fold-tui/queries/templ.scm+51 crates/fold-tui/queries/vue.scm+162 crates/fold-tui/src/app.rs+1 crates/fold-tui/src/app/grammars.rs+154 crates/fold-tui/src/app/highlight.rs+79−116
Cargo.lock+1322−35
@@ -168,9 +168,9 @@ dependencies = [
168168
169169[[package]]
170170name = "cc"
171−version = "1.4.5"
171+version = "1.2.67"
172172source = "registry+https://github.com/rust-lang/crates.io-index"
173−checksum = "005ec2760ca554fae18df7a11195552ec576cd665632a881bc011d5bb2fd4d80"
173+checksum = "e17dd265a7d0f31ef544e1b20e03add05d3b45b491b633b10d67145d2acc1a38"
174174dependencies = [
175175 "find-msvc-tools",
176176 "shlex",
@@ -510,20 +510,137 @@ dependencies = [
510510 "ratatui",
511511 "tempfile",
512512 "tree-sitter",
513+ "tree-sitter-ada",
514+ "tree-sitter-agda",
515+ "tree-sitter-al",
516+ "tree-sitter-applesoft",
517+ "tree-sitter-arduino",
518+ "tree-sitter-arkts",
519+ "tree-sitter-asm",
520+ "tree-sitter-astro-next",
521+ "tree-sitter-autohotkey",
513522 "tree-sitter-bash",
523+ "tree-sitter-batch",
524+ "tree-sitter-bicep",
514525 "tree-sitter-c",
526+ "tree-sitter-c-sharp",
527+ "tree-sitter-caddy",
528+ "tree-sitter-cfml",
529+ "tree-sitter-clojure-orchard",
530+ "tree-sitter-cmake",
531+ "tree-sitter-containerfile",
532+ "tree-sitter-cpp",
515533 "tree-sitter-css",
534+ "tree-sitter-cuda",
535+ "tree-sitter-cypher",
536+ "tree-sitter-d",
537+ "tree-sitter-dafny",
538+ "tree-sitter-dart",
539+ "tree-sitter-devicetree",
540+ "tree-sitter-diff",
541+ "tree-sitter-dm",
542+ "tree-sitter-elisp",
543+ "tree-sitter-elixir",
544+ "tree-sitter-elm",
545+ "tree-sitter-embedded-template",
546+ "tree-sitter-erlang",
547+ "tree-sitter-fortran",
548+ "tree-sitter-fsharp",
549+ "tree-sitter-gdshader",
550+ "tree-sitter-gitcommit",
551+ "tree-sitter-gleam",
552+ "tree-sitter-glsl",
516553 "tree-sitter-go",
554+ "tree-sitter-gomod-orchard",
555+ "tree-sitter-gosum-orchard",
556+ "tree-sitter-gwbasic",
557+ "tree-sitter-handlebars",
558+ "tree-sitter-harn",
559+ "tree-sitter-haskell",
560+ "tree-sitter-heex",
517561 "tree-sitter-highlight",
518562 "tree-sitter-html",
563+ "tree-sitter-ini",
564+ "tree-sitter-ink-lbz",
565+ "tree-sitter-integerbasic",
566+ "tree-sitter-irules",
567+ "tree-sitter-java",
568+ "tree-sitter-javadoc",
519569 "tree-sitter-javascript",
570+ "tree-sitter-jinja2",
571+ "tree-sitter-jsdoc",
520572 "tree-sitter-json",
573+ "tree-sitter-jsonnet",
574+ "tree-sitter-julia",
575+ "tree-sitter-kconfig",
576+ "tree-sitter-kotlin-sg",
577+ "tree-sitter-lambdamoo",
578+ "tree-sitter-llvm",
579+ "tree-sitter-lua",
580+ "tree-sitter-luau",
581+ "tree-sitter-make",
582+ "tree-sitter-matlab",
583+ "tree-sitter-merlin6502",
584+ "tree-sitter-mlir",
585+ "tree-sitter-msbasic2",
586+ "tree-sitter-newick",
587+ "tree-sitter-nginx",
521588 "tree-sitter-nix",
589+ "tree-sitter-objc",
590+ "tree-sitter-ocaml",
591+ "tree-sitter-ocamllex",
592+ "tree-sitter-odin",
593+ "tree-sitter-openscad-ng",
594+ "tree-sitter-pascal",
595+ "tree-sitter-pgn",
596+ "tree-sitter-php",
597+ "tree-sitter-postgres",
598+ "tree-sitter-powershell",
599+ "tree-sitter-printf",
600+ "tree-sitter-prisma-io",
601+ "tree-sitter-prolog",
602+ "tree-sitter-properties",
603+ "tree-sitter-proto",
604+ "tree-sitter-puppet",
522605 "tree-sitter-python",
606+ "tree-sitter-qbasic",
607+ "tree-sitter-ql",
608+ "tree-sitter-qmljs",
609+ "tree-sitter-qsharp",
610+ "tree-sitter-r",
611+ "tree-sitter-racket",
612+ "tree-sitter-regex",
613+ "tree-sitter-requirements",
614+ "tree-sitter-riscv",
615+ "tree-sitter-ruby",
616+ "tree-sitter-rush",
523617 "tree-sitter-rust",
618+ "tree-sitter-sas",
619+ "tree-sitter-scala",
620+ "tree-sitter-scheme",
621+ "tree-sitter-sdml",
622+ "tree-sitter-sequel",
623+ "tree-sitter-sequel-tsql",
624+ "tree-sitter-sfapex",
625+ "tree-sitter-starlark",
626+ "tree-sitter-svelte-ng",
627+ "tree-sitter-svg",
628+ "tree-sitter-swift",
629+ "tree-sitter-sysml",
630+ "tree-sitter-systemverilog",
631+ "tree-sitter-templ",
632+ "tree-sitter-tlaplus",
633+ "tree-sitter-tmux",
524634 "tree-sitter-toml-ng",
635+ "tree-sitter-tsquery",
525636 "tree-sitter-typescript",
637+ "tree-sitter-varlink",
638+ "tree-sitter-vhdl",
639+ "tree-sitter-vue-next",
640+ "tree-sitter-xml",
526641 "tree-sitter-yaml",
642+ "tree-sitter-zig",
643+ "tree-sitter-zsh",
527644 "tui-textarea",
528645 "unicode-width 0.2.0",
529646]
@@ -1466,109 +1583,1049 @@ dependencies = [
14661583 "tree-sitter-language",
14671584]
14681585
1586+[[package]]
1587+name = "tree-sitter-ada"
1588+version = "0.1.0"
1589+source = "registry+https://github.com/rust-lang/crates.io-index"
1590+checksum = "8d9fcdd64359c98fcc99d72f6d3d6ca5d6d76ce325ac39430b1d283a0fb61ca1"
1591+dependencies = [
1592+ "cc",
1593+ "tree-sitter-language",
1594+]
1595+
1596+[[package]]
1597+name = "tree-sitter-agda"
1598+version = "1.3.3"
1599+source = "registry+https://github.com/rust-lang/crates.io-index"
1600+checksum = "79170741bc75a42d93a69f7e2d39bece006bea602af30650f7f323645094d693"
1601+dependencies = [
1602+ "cc",
1603+ "tree-sitter-language",
1604+]
1605+
1606+[[package]]
1607+name = "tree-sitter-al"
1608+version = "4.4.0"
1609+source = "registry+https://github.com/rust-lang/crates.io-index"
1610+checksum = "f74c9d7887308b7ffd93ae3d0684cff9ad4d6d532497dcd213e69170a6e0d44d"
1611+dependencies = [
1612+ "cc",
1613+ "tree-sitter-language",
1614+]
1615+
1616+[[package]]
1617+name = "tree-sitter-applesoft"
1618+version = "5.0.0"
1619+source = "registry+https://github.com/rust-lang/crates.io-index"
1620+checksum = "95df4aeaf78d227b34a109f57debb1b18b96176fc8b98ef6d60f821f42bbd342"
1621+dependencies = [
1622+ "cc",
1623+ "tree-sitter-language",
1624+]
1625+
1626+[[package]]
1627+name = "tree-sitter-arduino"
1628+version = "0.24.0"
1629+source = "registry+https://github.com/rust-lang/crates.io-index"
1630+checksum = "8a26fe49dcba4e91b7caca0fcfacff90d54029de5dde266af9818af7aab1c4e4"
1631+dependencies = [
1632+ "cc",
1633+ "tree-sitter-language",
1634+]
1635+
1636+[[package]]
1637+name = "tree-sitter-arkts"
1638+version = "0.3.0"
1639+source = "registry+https://github.com/rust-lang/crates.io-index"
1640+checksum = "a3f34bb5f7037c2e13d4d2e42d6828f3cc0899666e77d4c6a0594348900fd629"
1641+dependencies = [
1642+ "cc",
1643+ "tree-sitter-language",
1644+]
1645+
1646+[[package]]
1647+name = "tree-sitter-asm"
1648+version = "0.24.0"
1649+source = "registry+https://github.com/rust-lang/crates.io-index"
1650+checksum = "743a0377253cd5505841e61ba1093a04b3a949b2b751752ff956040dda14f1bc"
1651+dependencies = [
1652+ "cc",
1653+ "tree-sitter-language",
1654+]
1655+
1656+[[package]]
1657+name = "tree-sitter-astro-next"
1658+version = "0.1.1"
1659+source = "registry+https://github.com/rust-lang/crates.io-index"
1660+checksum = "794a4a59fc2d88e49b4bc41fef9522d77184a36f4e68bbaf545cd1eb2364c46e"
1661+dependencies = [
1662+ "cc",
1663+ "tree-sitter-language",
1664+]
1665+
1666+[[package]]
1667+name = "tree-sitter-autohotkey"
1668+version = "1.0.1"
1669+source = "registry+https://github.com/rust-lang/crates.io-index"
1670+checksum = "2dfa4b3017b9a0a5e310128ba29ae1c561dc76d2f0c0c9c420a25c04ffe59481"
1671+dependencies = [
1672+ "cc",
1673+ "tree-sitter-language",
1674+]
1675+
14691676[[package]]
14701677name = "tree-sitter-bash"
14711678version = "0.25.1"
14721679source = "registry+https://github.com/rust-lang/crates.io-index"
1473−checksum = "9e5ec769279cc91b561d3df0d8a5deb26b0ad40d183127f409494d6d8fc53062"
1680+checksum = "9e5ec769279cc91b561d3df0d8a5deb26b0ad40d183127f409494d6d8fc53062"
1681+dependencies = [
1682+ "cc",
1683+ "tree-sitter-language",
1684+]
1685+
1686+[[package]]
1687+name = "tree-sitter-batch"
1688+version = "0.11.1"
1689+source = "registry+https://github.com/rust-lang/crates.io-index"
1690+checksum = "46fea9ee100103c3d5fc3c8243da6e8f95163657486040503b8514c9952b79da"
1691+dependencies = [
1692+ "cc",
1693+ "tree-sitter-language",
1694+]
1695+
1696+[[package]]
1697+name = "tree-sitter-bicep"
1698+version = "1.1.0"
1699+source = "registry+https://github.com/rust-lang/crates.io-index"
1700+checksum = "c02553520c500f552f1dee90d02a29717c82d5b395204b3995d356c6d15931f9"
1701+dependencies = [
1702+ "cc",
1703+ "tree-sitter-language",
1704+]
1705+
1706+[[package]]
1707+name = "tree-sitter-c"
1708+version = "0.24.2"
1709+source = "registry+https://github.com/rust-lang/crates.io-index"
1710+checksum = "a9b2eb57a55fed6b00812912e730b7a275cf4fe98bfd6a5d76263d4438371728"
1711+dependencies = [
1712+ "cc",
1713+ "tree-sitter-language",
1714+]
1715+
1716+[[package]]
1717+name = "tree-sitter-c-sharp"
1718+version = "0.23.5"
1719+source = "registry+https://github.com/rust-lang/crates.io-index"
1720+checksum = "c1aac67f1ad71de1d6d39708d34811081c26dfa495658de6c14c34200849357c"
1721+dependencies = [
1722+ "cc",
1723+ "tree-sitter-language",
1724+]
1725+
1726+[[package]]
1727+name = "tree-sitter-caddy"
1728+version = "0.1.0"
1729+source = "registry+https://github.com/rust-lang/crates.io-index"
1730+checksum = "26d38dd2a0da1a89e290b49d54aea92a59caf8ad6babde6a8f74be7f1ba2fd54"
1731+dependencies = [
1732+ "cc",
1733+ "tree-sitter-language",
1734+]
1735+
1736+[[package]]
1737+name = "tree-sitter-cfml"
1738+version = "0.26.39"
1739+source = "registry+https://github.com/rust-lang/crates.io-index"
1740+checksum = "48ea148734644b79470e2e2a4c6b548382520cb0c5444af7713d38462c14a66f"
1741+dependencies = [
1742+ "cc",
1743+ "tree-sitter-language",
1744+]
1745+
1746+[[package]]
1747+name = "tree-sitter-clojure-orchard"
1748+version = "0.2.8"
1749+source = "registry+https://github.com/rust-lang/crates.io-index"
1750+checksum = "67b854ba5935d62a713280b867c09cae08c6ad2286895734b5550ed02122d8fd"
1751+dependencies = [
1752+ "cc",
1753+ "tree-sitter-language",
1754+]
1755+
1756+[[package]]
1757+name = "tree-sitter-cmake"
1758+version = "0.7.5"
1759+source = "registry+https://github.com/rust-lang/crates.io-index"
1760+checksum = "d22893fac54133fdb93497efc45713d53a96d93b035288c7a8ab0c2af77c0ddd"
1761+dependencies = [
1762+ "cc",
1763+ "tree-sitter-language",
1764+]
1765+
1766+[[package]]
1767+name = "tree-sitter-containerfile"
1768+version = "0.9.2"
1769+source = "registry+https://github.com/rust-lang/crates.io-index"
1770+checksum = "f4811d55a5a2c32bb024b441c32b7417c3ec1af1a080a25fa20d321627b65a2b"
1771+dependencies = [
1772+ "cc",
1773+ "tree-sitter-language",
1774+]
1775+
1776+[[package]]
1777+name = "tree-sitter-cpp"
1778+version = "0.23.4"
1779+source = "registry+https://github.com/rust-lang/crates.io-index"
1780+checksum = "df2196ea9d47b4ab4a31b9297eaa5a5d19a0b121dceb9f118f6790ad0ab94743"
1781+dependencies = [
1782+ "cc",
1783+ "tree-sitter-language",
1784+]
1785+
1786+[[package]]
1787+name = "tree-sitter-css"
1788+version = "0.25.0"
1789+source = "registry+https://github.com/rust-lang/crates.io-index"
1790+checksum = "a5cbc5e18f29a2c6d6435891f42569525cf95435a3e01c2f1947abcde178686f"
1791+dependencies = [
1792+ "cc",
1793+ "tree-sitter-language",
1794+]
1795+
1796+[[package]]
1797+name = "tree-sitter-cuda"
1798+version = "0.21.2"
1799+source = "registry+https://github.com/rust-lang/crates.io-index"
1800+checksum = "e88ed4ad300c2fb7ed7dde1d9c1b0926bd93fc8ae1c8766898191bd85f2220f5"
1801+dependencies = [
1802+ "cc",
1803+ "tree-sitter-language",
1804+]
1805+
1806+[[package]]
1807+name = "tree-sitter-cypher"
1808+version = "0.2.6"
1809+source = "registry+https://github.com/rust-lang/crates.io-index"
1810+checksum = "c22e06abe4ed210fabe796dd72bf5ca56f788f633b993ed303525178ca7b4608"
1811+dependencies = [
1812+ "cc",
1813+ "tree-sitter-language",
1814+]
1815+
1816+[[package]]
1817+name = "tree-sitter-d"
1818+version = "0.8.2"
1819+source = "registry+https://github.com/rust-lang/crates.io-index"
1820+checksum = "66c6fa0082e20747a92c5c863cadb7775fbe344f212837f03fc0f7187adf6fd1"
1821+dependencies = [
1822+ "cc",
1823+ "tree-sitter-language",
1824+]
1825+
1826+[[package]]
1827+name = "tree-sitter-dafny"
1828+version = "0.1.0"
1829+source = "registry+https://github.com/rust-lang/crates.io-index"
1830+checksum = "8c0d15ae3182196f73a30b4ddf3e68ee0f72757ba7ec0d133ffcb9d0fa737fc9"
1831+dependencies = [
1832+ "cc",
1833+ "tree-sitter-language",
1834+]
1835+
1836+[[package]]
1837+name = "tree-sitter-dart"
1838+version = "0.2.0"
1839+source = "registry+https://github.com/rust-lang/crates.io-index"
1840+checksum = "325dd1e24ee9ee21111e9c43680ae7d6010aaa9f282b048a99b9c7163c1cf553"
1841+dependencies = [
1842+ "cc",
1843+ "tree-sitter-language",
1844+]
1845+
1846+[[package]]
1847+name = "tree-sitter-devicetree"
1848+version = "0.15.0"
1849+source = "registry+https://github.com/rust-lang/crates.io-index"
1850+checksum = "6264316c288e1d4fed3002fb6c2d7a8e90d65d519e2ecf64a60c5abd0ee35481"
1851+dependencies = [
1852+ "cc",
1853+ "tree-sitter-language",
1854+]
1855+
1856+[[package]]
1857+name = "tree-sitter-diff"
1858+version = "0.1.0"
1859+source = "registry+https://github.com/rust-lang/crates.io-index"
1860+checksum = "dfe1e5ca280a65dfe5ba4205c1bcc84edf486464fed315db53dee6da9a335889"
1861+dependencies = [
1862+ "cc",
1863+ "tree-sitter-language",
1864+]
1865+
1866+[[package]]
1867+name = "tree-sitter-dm"
1868+version = "0.25.4"
1869+source = "registry+https://github.com/rust-lang/crates.io-index"
1870+checksum = "762b578ec076df149d5121d96a2ac76c977702c13541564646f56984fda9731d"
1871+dependencies = [
1872+ "cc",
1873+ "tree-sitter-language",
1874+]
1875+
1876+[[package]]
1877+name = "tree-sitter-elisp"
1878+version = "1.7.2"
1879+source = "registry+https://github.com/rust-lang/crates.io-index"
1880+checksum = "6b8b82ab7474028f20d2119285566f219209ebdbeec767fa28025b70f94f8cf3"
1881+dependencies = [
1882+ "cc",
1883+ "tree-sitter-language",
1884+]
1885+
1886+[[package]]
1887+name = "tree-sitter-elixir"
1888+version = "0.3.5"
1889+source = "registry+https://github.com/rust-lang/crates.io-index"
1890+checksum = "66dd064a762ed95bfc29857fa3cb7403bb1e5cb88112de0f6341b7e47284ba40"
1891+dependencies = [
1892+ "cc",
1893+ "tree-sitter-language",
1894+]
1895+
1896+[[package]]
1897+name = "tree-sitter-elm"
1898+version = "5.9.4"
1899+source = "registry+https://github.com/rust-lang/crates.io-index"
1900+checksum = "807f387a83c88d894b978edeff024f26a2935505de83237f57c77f9aa2de4ee7"
1901+dependencies = [
1902+ "cc",
1903+ "tree-sitter-language",
1904+]
1905+
1906+[[package]]
1907+name = "tree-sitter-embedded-template"
1908+version = "0.25.0"
1909+source = "registry+https://github.com/rust-lang/crates.io-index"
1910+checksum = "833d528e8fcb4e49ddb04d4d6450ddb8ac08f282a58fec94ce981c9c5dbf7e3a"
1911+dependencies = [
1912+ "cc",
1913+ "tree-sitter-language",
1914+]
1915+
1916+[[package]]
1917+name = "tree-sitter-erlang"
1918+version = "0.20.0"
1919+source = "registry+https://github.com/rust-lang/crates.io-index"
1920+checksum = "3107efc581d335488dc38d2f51ca8b7a6a98e36f07f95a8e963f031edda6f568"
1921+dependencies = [
1922+ "cc",
1923+ "tree-sitter-language",
1924+]
1925+
1926+[[package]]
1927+name = "tree-sitter-fortran"
1928+version = "0.6.0"
1929+source = "registry+https://github.com/rust-lang/crates.io-index"
1930+checksum = "ea5fea41363a9b59666001dc26c4b356d4e164da27c6ce31145e00aba6bf9b16"
1931+dependencies = [
1932+ "cc",
1933+ "tree-sitter-language",
1934+]
1935+
1936+[[package]]
1937+name = "tree-sitter-fsharp"
1938+version = "0.3.12"
1939+source = "registry+https://github.com/rust-lang/crates.io-index"
1940+checksum = "87affbae0d85926cebaa1abb18660904540708ab2c9ed7547f4809e6188125db"
1941+dependencies = [
1942+ "cc",
1943+ "tree-sitter-language",
1944+]
1945+
1946+[[package]]
1947+name = "tree-sitter-gdshader"
1948+version = "0.4.0"
1949+source = "registry+https://github.com/rust-lang/crates.io-index"
1950+checksum = "f915f22caa639690f4df0017ef06f6217573cd7ebca8d83d67a5220ec4a7844a"
1951+dependencies = [
1952+ "cc",
1953+ "tree-sitter-language",
1954+]
1955+
1956+[[package]]
1957+name = "tree-sitter-gitcommit"
1958+version = "0.5.0"
1959+source = "registry+https://github.com/rust-lang/crates.io-index"
1960+checksum = "38b051221607cfde94e2d0132ad99ef50a9f78a990c068380717ea0a4ce61899"
1961+dependencies = [
1962+ "cc",
1963+ "tree-sitter-language",
1964+]
1965+
1966+[[package]]
1967+name = "tree-sitter-gleam"
1968+version = "1.0.0"
1969+source = "registry+https://github.com/rust-lang/crates.io-index"
1970+checksum = "f0175c53793bda5d444360dd5add25463d18d66afb7f521d6791e2fc61bf2fb3"
1971+dependencies = [
1972+ "cc",
1973+ "tree-sitter-language",
1974+]
1975+
1976+[[package]]
1977+name = "tree-sitter-glsl"
1978+version = "0.2.0"
1979+source = "registry+https://github.com/rust-lang/crates.io-index"
1980+checksum = "df0ee57cbf4c2b35d3a7f17a01bf33c0ef2e85987cb85e516ac8c6904c4e62ac"
1981+dependencies = [
1982+ "cc",
1983+ "tree-sitter-language",
1984+]
1985+
1986+[[package]]
1987+name = "tree-sitter-go"
1988+version = "0.25.0"
1989+source = "registry+https://github.com/rust-lang/crates.io-index"
1990+checksum = "c8560a4d2f835cc0d4d2c2e03cbd0dde2f6114b43bc491164238d333e28b16ea"
1991+dependencies = [
1992+ "cc",
1993+ "tree-sitter-language",
1994+]
1995+
1996+[[package]]
1997+name = "tree-sitter-gomod-orchard"
1998+version = "0.5.3"
1999+source = "registry+https://github.com/rust-lang/crates.io-index"
2000+checksum = "8755c634adc6dafdd0c622920be61facd377b6583949ff7904eee577ce01645d"
2001+dependencies = [
2002+ "cc",
2003+ "tree-sitter-language",
2004+]
2005+
2006+[[package]]
2007+name = "tree-sitter-gosum-orchard"
2008+version = "0.3.3"
2009+source = "registry+https://github.com/rust-lang/crates.io-index"
2010+checksum = "4a269f866df50eea3531a91b3603c951a2d9459a54f6b19bb89c86d3c0eb05b4"
2011+dependencies = [
2012+ "cc",
2013+ "tree-sitter-language",
2014+]
2015+
2016+[[package]]
2017+name = "tree-sitter-gwbasic"
2018+version = "0.2.0"
2019+source = "registry+https://github.com/rust-lang/crates.io-index"
2020+checksum = "87f9d9d9fef555166cc1e31e57754d199552c24559424179323c27456e64a9aa"
2021+dependencies = [
2022+ "cc",
2023+ "tree-sitter-language",
2024+]
2025+
2026+[[package]]
2027+name = "tree-sitter-handlebars"
2028+version = "0.1.0"
2029+source = "registry+https://github.com/rust-lang/crates.io-index"
2030+checksum = "d62b536144a4cf982ff473e1495a485ffa1229554ecc468b6c33c3ca4c53ae1c"
2031+dependencies = [
2032+ "cc",
2033+ "tree-sitter-language",
2034+]
2035+
2036+[[package]]
2037+name = "tree-sitter-harn"
2038+version = "0.10.141"
2039+source = "registry+https://github.com/rust-lang/crates.io-index"
2040+checksum = "07bb291f02829c851fcca5b3ff532f8acca036602ca5f15f541b6fbf0f250a97"
2041+dependencies = [
2042+ "cc",
2043+ "tree-sitter-language",
2044+]
2045+
2046+[[package]]
2047+name = "tree-sitter-haskell"
2048+version = "0.23.1"
2049+source = "registry+https://github.com/rust-lang/crates.io-index"
2050+checksum = "977c51e504548cba13fc27cb5a2edab2124cf6716a1934915d07ab99523b05a4"
2051+dependencies = [
2052+ "cc",
2053+ "tree-sitter-language",
2054+]
2055+
2056+[[package]]
2057+name = "tree-sitter-heex"
2058+version = "0.8.1"
2059+source = "registry+https://github.com/rust-lang/crates.io-index"
2060+checksum = "732a4d5994094920f52c4d74bc336cd3739536d68d6140939bc62194f04f4f00"
2061+dependencies = [
2062+ "cc",
2063+ "tree-sitter-language",
2064+]
2065+
2066+[[package]]
2067+name = "tree-sitter-highlight"
2068+version = "0.27.0"
2069+source = "registry+https://github.com/rust-lang/crates.io-index"
2070+checksum = "fa86266a9dc1aae627034551d45e84427a45c70914a8629608ed1bd093214c28"
2071+dependencies = [
2072+ "regex",
2073+ "streaming-iterator",
2074+ "thiserror",
2075+ "tree-sitter",
2076+]
2077+
2078+[[package]]
2079+name = "tree-sitter-html"
2080+version = "0.23.2"
2081+source = "registry+https://github.com/rust-lang/crates.io-index"
2082+checksum = "261b708e5d92061ede329babaaa427b819329a9d427a1d710abb0f67bbef63ee"
2083+dependencies = [
2084+ "cc",
2085+ "tree-sitter-language",
2086+]
2087+
2088+[[package]]
2089+name = "tree-sitter-ini"
2090+version = "1.4.0"
2091+source = "registry+https://github.com/rust-lang/crates.io-index"
2092+checksum = "387f79682cd53b7c0a5777c96e601a02b9965a787984ef86dbb8952bdab2d62f"
2093+dependencies = [
2094+ "cc",
2095+ "tree-sitter-language",
2096+]
2097+
2098+[[package]]
2099+name = "tree-sitter-ink-lbz"
2100+version = "0.0.5"
2101+source = "registry+https://github.com/rust-lang/crates.io-index"
2102+checksum = "d57e430493707c89d223ca6c9743a12915a20d3b97c5f8fea16065c2e823747e"
2103+dependencies = [
2104+ "cc",
2105+ "tree-sitter-language",
2106+]
2107+
2108+[[package]]
2109+name = "tree-sitter-integerbasic"
2110+version = "3.0.0"
2111+source = "registry+https://github.com/rust-lang/crates.io-index"
2112+checksum = "a85f32b692c4df974d82f0566d7622dba330e7a89514f75d778a97e13ef32b3a"
2113+dependencies = [
2114+ "cc",
2115+ "tree-sitter-language",
2116+]
2117+
2118+[[package]]
2119+name = "tree-sitter-irules"
2120+version = "0.2.0"
2121+source = "registry+https://github.com/rust-lang/crates.io-index"
2122+checksum = "909291f3c6c83dc183990d9daf16cc7bf07401cae30fa786dff107ab4c882646"
2123+dependencies = [
2124+ "cc",
2125+ "tree-sitter-language",
2126+]
2127+
2128+[[package]]
2129+name = "tree-sitter-java"
2130+version = "0.23.5"
2131+source = "registry+https://github.com/rust-lang/crates.io-index"
2132+checksum = "0aa6cbcdc8c679b214e616fd3300da67da0e492e066df01bcf5a5921a71e90d6"
2133+dependencies = [
2134+ "cc",
2135+ "tree-sitter-language",
2136+]
2137+
2138+[[package]]
2139+name = "tree-sitter-javadoc"
2140+version = "0.3.1"
2141+source = "registry+https://github.com/rust-lang/crates.io-index"
2142+checksum = "f383b40994c833d8fb85ca2e0b04ed20b6551846cdfbc39a184ef1fd0880b403"
2143+dependencies = [
2144+ "cc",
2145+ "tree-sitter-language",
2146+]
2147+
2148+[[package]]
2149+name = "tree-sitter-javascript"
2150+version = "0.25.0"
2151+source = "registry+https://github.com/rust-lang/crates.io-index"
2152+checksum = "68204f2abc0627a90bdf06e605f5c470aa26fdcb2081ea553a04bdad756693f5"
2153+dependencies = [
2154+ "cc",
2155+ "tree-sitter-language",
2156+]
2157+
2158+[[package]]
2159+name = "tree-sitter-jinja2"
2160+version = "0.0.16"
2161+source = "registry+https://github.com/rust-lang/crates.io-index"
2162+checksum = "124f888283869ed15d544d840b908551d9a5d58c326395236df2492873ee1f86"
2163+dependencies = [
2164+ "cc",
2165+ "tree-sitter-language",
2166+]
2167+
2168+[[package]]
2169+name = "tree-sitter-jsdoc"
2170+version = "0.25.0"
2171+source = "registry+https://github.com/rust-lang/crates.io-index"
2172+checksum = "7a70da85d41e05dae5d323a4b76fa0955d16fa0394415cea2034de046a21ea6a"
2173+dependencies = [
2174+ "cc",
2175+ "tree-sitter-language",
2176+]
2177+
2178+[[package]]
2179+name = "tree-sitter-json"
2180+version = "0.24.8"
2181+source = "registry+https://github.com/rust-lang/crates.io-index"
2182+checksum = "4d727acca406c0020cffc6cf35516764f36c8e3dc4408e5ebe2cb35a947ec471"
2183+dependencies = [
2184+ "cc",
2185+ "tree-sitter-language",
2186+]
2187+
2188+[[package]]
2189+name = "tree-sitter-jsonnet"
2190+version = "0.0.1"
2191+source = "registry+https://github.com/rust-lang/crates.io-index"
2192+checksum = "38ce8f9839652bd0effc7c384d42d1a1da3ba0c0313b85bb9a723b80cd91ca6c"
2193+dependencies = [
2194+ "cc",
2195+ "tree-sitter-language",
2196+]
2197+
2198+[[package]]
2199+name = "tree-sitter-julia"
2200+version = "0.23.1"
2201+source = "registry+https://github.com/rust-lang/crates.io-index"
2202+checksum = "4144731a178812ee867619b1e98b3b91e54c1652304b26e5ebe3175b701de323"
2203+dependencies = [
2204+ "cc",
2205+ "tree-sitter-language",
2206+]
2207+
2208+[[package]]
2209+name = "tree-sitter-kconfig"
2210+version = "1.3.0"
2211+source = "registry+https://github.com/rust-lang/crates.io-index"
2212+checksum = "ed450ee48fc3fe7690fd62d43d1cffc60158e3769fe0e2e6552fe0d1635af768"
2213+dependencies = [
2214+ "cc",
2215+ "tree-sitter-language",
2216+]
2217+
2218+[[package]]
2219+name = "tree-sitter-kotlin-sg"
2220+version = "0.4.1"
2221+source = "registry+https://github.com/rust-lang/crates.io-index"
2222+checksum = "c06ec43ae3c12165d4ac08afe4e1f5fc6757ffe274fa7bd5af9007ef11ba4319"
2223+dependencies = [
2224+ "cc",
2225+ "tree-sitter-language",
2226+]
2227+
2228+[[package]]
2229+name = "tree-sitter-lambdamoo"
2230+version = "0.2.5"
2231+source = "registry+https://github.com/rust-lang/crates.io-index"
2232+checksum = "7ac00974aa6fb4c27041fe4fe1500a150121b7cef6ff458c085957d9f6b789a0"
2233+dependencies = [
2234+ "cc",
2235+ "tree-sitter-language",
2236+]
2237+
2238+[[package]]
2239+name = "tree-sitter-language"
2240+version = "0.1.8"
2241+source = "registry+https://github.com/rust-lang/crates.io-index"
2242+checksum = "ca0d1bf6fdd806e43ae5198f82f527056d359def39e54e67a0f478ac09dac081"
2243+
2244+[[package]]
2245+name = "tree-sitter-llvm"
2246+version = "1.1.0"
2247+source = "registry+https://github.com/rust-lang/crates.io-index"
2248+checksum = "6fb805528a695786436a5eca32ce0ce252e8488c6e2074b7cf2e14d7ef55a42d"
2249+dependencies = [
2250+ "cc",
2251+ "tree-sitter-language",
2252+]
2253+
2254+[[package]]
2255+name = "tree-sitter-lua"
2256+version = "0.5.0"
2257+source = "registry+https://github.com/rust-lang/crates.io-index"
2258+checksum = "8daaf5f4235188a58603c39760d5fa5d4b920d36a299c934adddae757f32a10c"
2259+dependencies = [
2260+ "cc",
2261+ "tree-sitter-language",
2262+]
2263+
2264+[[package]]
2265+name = "tree-sitter-luau"
2266+version = "1.2.0"
2267+source = "registry+https://github.com/rust-lang/crates.io-index"
2268+checksum = "871abeb427d719788bb38094facd7ff082908ef2b93c1d3d6a5f6025330120f4"
2269+dependencies = [
2270+ "cc",
2271+ "tree-sitter-language",
2272+]
2273+
2274+[[package]]
2275+name = "tree-sitter-make"
2276+version = "1.1.1"
2277+source = "registry+https://github.com/rust-lang/crates.io-index"
2278+checksum = "c5998dc7cbcbdab19fae8aefef982bf2d6544513d8d2e69cc44aec4c63810104"
2279+dependencies = [
2280+ "cc",
2281+ "tree-sitter-language",
2282+]
2283+
2284+[[package]]
2285+name = "tree-sitter-matlab"
2286+version = "1.3.1"
2287+source = "registry+https://github.com/rust-lang/crates.io-index"
2288+checksum = "97962a0daf32492453fbea1984d34c4d8460b66b95c6c04feecc4cbf1b00a984"
2289+dependencies = [
2290+ "cc",
2291+ "tree-sitter-language",
2292+]
2293+
2294+[[package]]
2295+name = "tree-sitter-merlin6502"
2296+version = "4.0.0"
2297+source = "registry+https://github.com/rust-lang/crates.io-index"
2298+checksum = "6dc294ec60805a418014c269cbd744a37938b95c8e34a311e285e64b54bf6f2a"
2299+dependencies = [
2300+ "cc",
2301+ "tree-sitter-language",
2302+]
2303+
2304+[[package]]
2305+name = "tree-sitter-mlir"
2306+version = "0.2.0"
2307+source = "registry+https://github.com/rust-lang/crates.io-index"
2308+checksum = "320b666c557a183fc0d2fba89181aefccffa936a6f50249887d3bb5ec5cb3c32"
2309+dependencies = [
2310+ "cc",
2311+ "tree-sitter-language",
2312+]
2313+
2314+[[package]]
2315+name = "tree-sitter-msbasic2"
2316+version = "0.2.0"
2317+source = "registry+https://github.com/rust-lang/crates.io-index"
2318+checksum = "a555f9f0ccd1a94b602d11477b77d5db2957056b090767b70780435068afa7e2"
2319+dependencies = [
2320+ "cc",
2321+ "tree-sitter-language",
2322+]
2323+
2324+[[package]]
2325+name = "tree-sitter-newick"
2326+version = "1.1.0"
2327+source = "registry+https://github.com/rust-lang/crates.io-index"
2328+checksum = "08c5785bcf2ade84e16242b1a8d1f574334ddd26032c15a5d9bcc012e013f4e1"
2329+dependencies = [
2330+ "cc",
2331+ "tree-sitter-language",
2332+]
2333+
2334+[[package]]
2335+name = "tree-sitter-nginx"
2336+version = "1.0.1"
2337+source = "registry+https://github.com/rust-lang/crates.io-index"
2338+checksum = "ad358057b6fa3bd3acaab22ab1c866d4746a2417d9f70b7e91cc7cc8732a5716"
2339+dependencies = [
2340+ "cc",
2341+ "tree-sitter-language",
2342+]
2343+
2344+[[package]]
2345+name = "tree-sitter-nix"
2346+version = "0.3.0"
2347+source = "registry+https://github.com/rust-lang/crates.io-index"
2348+checksum = "4952a9733f3a98f6683a0ccd1035d84ab7a52f7e84eeed58548d86765ad92de3"
2349+dependencies = [
2350+ "cc",
2351+ "tree-sitter-language",
2352+]
2353+
2354+[[package]]
2355+name = "tree-sitter-objc"
2356+version = "3.0.2"
2357+source = "registry+https://github.com/rust-lang/crates.io-index"
2358+checksum = "9ca8bb556423fc176f0535e79d525f783a6684d3c9da81bf9d905303c129e1d2"
2359+dependencies = [
2360+ "cc",
2361+ "tree-sitter-language",
2362+]
2363+
2364+[[package]]
2365+name = "tree-sitter-ocaml"
2366+version = "0.26.0"
2367+source = "registry+https://github.com/rust-lang/crates.io-index"
2368+checksum = "43adb10fcccbcbbce0f4adc9dab7cd55f0a5eafc2d71bd4c03fcc5d6767066e0"
2369+dependencies = [
2370+ "cc",
2371+ "tree-sitter-language",
2372+]
2373+
2374+[[package]]
2375+name = "tree-sitter-ocamllex"
2376+version = "0.24.0"
2377+source = "registry+https://github.com/rust-lang/crates.io-index"
2378+checksum = "2b70dec1fd237eafb123304653c3cf9fb99b4c507a463ea468c64da7b6a57c9c"
2379+dependencies = [
2380+ "cc",
2381+ "tree-sitter-language",
2382+]
2383+
2384+[[package]]
2385+name = "tree-sitter-odin"
2386+version = "1.3.0"
2387+source = "registry+https://github.com/rust-lang/crates.io-index"
2388+checksum = "24db210fe9ba2237c71c5030d7b146c7025420ba72dd8013d13cd822c3a8d77a"
2389+dependencies = [
2390+ "cc",
2391+ "tree-sitter-language",
2392+]
2393+
2394+[[package]]
2395+name = "tree-sitter-openscad-ng"
2396+version = "0.7.1"
2397+source = "registry+https://github.com/rust-lang/crates.io-index"
2398+checksum = "a9286371873e82cb888be0d9394dd3c6a6aaca66fa2fd31879baafb2e4008488"
2399+dependencies = [
2400+ "cc",
2401+ "tree-sitter-language",
2402+]
2403+
2404+[[package]]
2405+name = "tree-sitter-pascal"
2406+version = "0.10.2"
2407+source = "registry+https://github.com/rust-lang/crates.io-index"
2408+checksum = "adb51e9a57493fd237e4517566749f7f7453349261a72a427e5f11d3b34b72a8"
2409+dependencies = [
2410+ "cc",
2411+ "tree-sitter-language",
2412+]
2413+
2414+[[package]]
2415+name = "tree-sitter-pgn"
2416+version = "1.4.3"
2417+source = "registry+https://github.com/rust-lang/crates.io-index"
2418+checksum = "5558419ecc5a8a799306938be9ae8870987650ddd350d648dcaca58face09ab8"
2419+dependencies = [
2420+ "cc",
2421+ "tree-sitter-language",
2422+]
2423+
2424+[[package]]
2425+name = "tree-sitter-php"
2426+version = "0.24.2"
2427+source = "registry+https://github.com/rust-lang/crates.io-index"
2428+checksum = "0d8c17c3ab69052c5eeaa7ff5cd972dd1bc25d1b97ee779fec391ad3b5df5592"
2429+dependencies = [
2430+ "cc",
2431+ "tree-sitter-language",
2432+]
2433+
2434+[[package]]
2435+name = "tree-sitter-postgres"
2436+version = "1.2.4"
2437+source = "registry+https://github.com/rust-lang/crates.io-index"
2438+checksum = "2552ec55c9813f358da70926587b2bbfceff6a7b75456b2ddf8abfb223dcf3a7"
2439+dependencies = [
2440+ "cc",
2441+ "tree-sitter-language",
2442+]
2443+
2444+[[package]]
2445+name = "tree-sitter-powershell"
2446+version = "0.26.4"
2447+source = "registry+https://github.com/rust-lang/crates.io-index"
2448+checksum = "3faf304d44b9ddd4a7d97804bb8de7daf564336dd5a526dc6de5b39238243022"
2449+dependencies = [
2450+ "cc",
2451+ "tree-sitter-language",
2452+]
2453+
2454+[[package]]
2455+name = "tree-sitter-printf"
2456+version = "0.5.1"
2457+source = "registry+https://github.com/rust-lang/crates.io-index"
2458+checksum = "dffcc6f600c438d5df02ebc29d3a197023dd46554940b6ff155448bd3d140a3e"
2459+dependencies = [
2460+ "cc",
2461+ "tree-sitter-language",
2462+]
2463+
2464+[[package]]
2465+name = "tree-sitter-prisma-io"
2466+version = "1.6.0"
2467+source = "registry+https://github.com/rust-lang/crates.io-index"
2468+checksum = "c35912d65a6adb07f781db46d843bf0464935e267da6ed192705516adafc7c24"
2469+dependencies = [
2470+ "cc",
2471+ "tree-sitter-language",
2472+]
2473+
2474+[[package]]
2475+name = "tree-sitter-prolog"
2476+version = "0.1.0"
2477+source = "registry+https://github.com/rust-lang/crates.io-index"
2478+checksum = "1d475fc08c018acb005af5a1030fe9752c918c65d7d263ad5edafe8488157f02"
14742479dependencies = [
14752480 "cc",
14762481 "tree-sitter-language",
14772482]
14782483
14792484[[package]]
1480−name = "tree-sitter-c"
1481−version = "0.24.2"
2485+name = "tree-sitter-properties"
2486+version = "0.3.0"
14822487source = "registry+https://github.com/rust-lang/crates.io-index"
1483−checksum = "a9b2eb57a55fed6b00812912e730b7a275cf4fe98bfd6a5d76263d4438371728"
2488+checksum = "0a6c2f38dea68abd782573bb6ec3dbd14175cce2953f693055743925d785ceeb"
14842489dependencies = [
14852490 "cc",
14862491 "tree-sitter-language",
14872492]
14882493
14892494[[package]]
1490−name = "tree-sitter-css"
1491−version = "0.25.0"
2495+name = "tree-sitter-proto"
2496+version = "0.6.0"
14922497source = "registry+https://github.com/rust-lang/crates.io-index"
1493−checksum = "a5cbc5e18f29a2c6d6435891f42569525cf95435a3e01c2f1947abcde178686f"
2498+checksum = "9c93b6f1ed20de442e900eb636f2176af6063953dfaa9f76bf168dd3b490a3a1"
14942499dependencies = [
14952500 "cc",
14962501 "tree-sitter-language",
14972502]
14982503
14992504[[package]]
1500−name = "tree-sitter-go"
2505+name = "tree-sitter-puppet"
2506+version = "1.3.0"
2507+source = "registry+https://github.com/rust-lang/crates.io-index"
2508+checksum = "f258d076394303cf7b3ddba2204ab9b0c06ff091bb5b58b1d5b68b64eeb5f126"
2509+dependencies = [
2510+ "cc",
2511+ "tree-sitter-language",
2512+]
2513+
2514+[[package]]
2515+name = "tree-sitter-python"
15012516version = "0.25.0"
15022517source = "registry+https://github.com/rust-lang/crates.io-index"
1503−checksum = "c8560a4d2f835cc0d4d2c2e03cbd0dde2f6114b43bc491164238d333e28b16ea"
2518+checksum = "6bf85fd39652e740bf60f46f4cda9492c3a9ad75880575bf14960f775cb74a1c"
15042519dependencies = [
15052520 "cc",
15062521 "tree-sitter-language",
15072522]
15082523
15092524[[package]]
1510−name = "tree-sitter-highlight"
1511−version = "0.27.0"
2525+name = "tree-sitter-qbasic"
2526+version = "0.2.0"
15122527source = "registry+https://github.com/rust-lang/crates.io-index"
1513−checksum = "fa86266a9dc1aae627034551d45e84427a45c70914a8629608ed1bd093214c28"
2528+checksum = "32fcea65fab003a3fe41980be136590da1c3a51eeabde3973e972890e2292e78"
15142529dependencies = [
1515− "regex",
1516− "streaming-iterator",
1517− "thiserror",
1518− "tree-sitter",
2530+ "cc",
2531+ "tree-sitter-language",
15192532]
15202533
15212534[[package]]
1522−name = "tree-sitter-html"
1523−version = "0.23.2"
2535+name = "tree-sitter-ql"
2536+version = "0.23.1"
15242537source = "registry+https://github.com/rust-lang/crates.io-index"
1525−checksum = "261b708e5d92061ede329babaaa427b819329a9d427a1d710abb0f67bbef63ee"
2538+checksum = "80b7bcaf39acefbb199417a6ec2fd0c038083ba115da3e4f4426c820dc76d386"
15262539dependencies = [
15272540 "cc",
15282541 "tree-sitter-language",
15292542]
15302543
15312544[[package]]
1532−name = "tree-sitter-javascript"
1533−version = "0.25.0"
2545+name = "tree-sitter-qmljs"
2546+version = "0.3.1"
15342547source = "registry+https://github.com/rust-lang/crates.io-index"
1535−checksum = "68204f2abc0627a90bdf06e605f5c470aa26fdcb2081ea553a04bdad756693f5"
2548+checksum = "e6ed3a7040df54fed1183801ad482139622bf9b9ec1c5f7ee36c5ece25806c58"
15362549dependencies = [
15372550 "cc",
15382551 "tree-sitter-language",
15392552]
15402553
15412554[[package]]
1542−name = "tree-sitter-json"
1543−version = "0.24.8"
2555+name = "tree-sitter-qsharp"
2556+version = "0.2.0"
15442557source = "registry+https://github.com/rust-lang/crates.io-index"
1545−checksum = "4d727acca406c0020cffc6cf35516764f36c8e3dc4408e5ebe2cb35a947ec471"
2558+checksum = "05f8bbbaec6c9de62ca6becbc88dd5f038a074b0d675b8b3022f5ce36a106aed"
15462559dependencies = [
15472560 "cc",
15482561 "tree-sitter-language",
15492562]
15502563
15512564[[package]]
1552−name = "tree-sitter-language"
1553−version = "0.1.8"
2565+name = "tree-sitter-r"
2566+version = "1.3.0"
15542567source = "registry+https://github.com/rust-lang/crates.io-index"
1555−checksum = "ca0d1bf6fdd806e43ae5198f82f527056d359def39e54e67a0f478ac09dac081"
2568+checksum = "ffc9954ec870dcad6cffdd302b405306c68cf031ed79a78cd9746f6740d9fe20"
2569+dependencies = [
2570+ "cc",
2571+ "tree-sitter-language",
2572+]
15562573
15572574[[package]]
1558−name = "tree-sitter-nix"
1559−version = "0.3.0"
2575+name = "tree-sitter-racket"
2576+version = "0.25.0"
15602577source = "registry+https://github.com/rust-lang/crates.io-index"
1561−checksum = "4952a9733f3a98f6683a0ccd1035d84ab7a52f7e84eeed58548d86765ad92de3"
2578+checksum = "066bd54f4513d35a21b44f733da74bb065bb6734e565db96b516a79dd7c29e5f"
15622579dependencies = [
15632580 "cc",
15642581 "tree-sitter-language",
15652582]
15662583
15672584[[package]]
1568−name = "tree-sitter-python"
2585+name = "tree-sitter-regex"
15692586version = "0.25.0"
15702587source = "registry+https://github.com/rust-lang/crates.io-index"
1571−checksum = "6bf85fd39652e740bf60f46f4cda9492c3a9ad75880575bf14960f775cb74a1c"
2588+checksum = "bd8a59be9f0ac131fd8f062eaaba14882b2fa5a6a7882a20134cb1d60df2e625"
2589+dependencies = [
2590+ "cc",
2591+ "tree-sitter-language",
2592+]
2593+
2594+[[package]]
2595+name = "tree-sitter-requirements"
2596+version = "0.6.1"
2597+source = "registry+https://github.com/rust-lang/crates.io-index"
2598+checksum = "ed29064ba695cb72a992d9f3fd9678a1000fd619954f0bc62afd937c61d9bbba"
2599+dependencies = [
2600+ "cc",
2601+ "tree-sitter-language",
2602+]
2603+
2604+[[package]]
2605+name = "tree-sitter-riscv"
2606+version = "0.3.1"
2607+source = "registry+https://github.com/rust-lang/crates.io-index"
2608+checksum = "2d2d6a0e21aa0d6ac067fc14ce1d455de1df53da572faf89e920520811f63f82"
2609+dependencies = [
2610+ "cc",
2611+ "tree-sitter-language",
2612+]
2613+
2614+[[package]]
2615+name = "tree-sitter-ruby"
2616+version = "0.23.1"
2617+source = "registry+https://github.com/rust-lang/crates.io-index"
2618+checksum = "be0484ea4ef6bb9c575b4fdabde7e31340a8d2dbc7d52b321ac83da703249f95"
2619+dependencies = [
2620+ "cc",
2621+ "tree-sitter-language",
2622+]
2623+
2624+[[package]]
2625+name = "tree-sitter-rush"
2626+version = "0.2.0"
2627+source = "registry+https://github.com/rust-lang/crates.io-index"
2628+checksum = "5ba64f2e7449ed421cfb95388ca542bf6ce143ee59a9f3f287fc16d0a5abe7a0"
15722629dependencies = [
15732630 "cc",
15742631 "tree-sitter-language",
@@ -1584,6 +2641,166 @@ dependencies = [
15842641 "tree-sitter-language",
15852642]
15862643
2644+[[package]]
2645+name = "tree-sitter-sas"
2646+version = "0.4.2"
2647+source = "registry+https://github.com/rust-lang/crates.io-index"
2648+checksum = "cb4d6233b3cf8a9d495ecc6ed8fec7e6a29ec15a0c5808ef046504c28e52334c"
2649+dependencies = [
2650+ "cc",
2651+ "tree-sitter-language",
2652+]
2653+
2654+[[package]]
2655+name = "tree-sitter-scala"
2656+version = "0.26.2"
2657+source = "registry+https://github.com/rust-lang/crates.io-index"
2658+checksum = "24e0ab4505990bfe30051761d40a7bf4033ce5a81c9eda9e20e987a5cdc84826"
2659+dependencies = [
2660+ "cc",
2661+ "tree-sitter-language",
2662+]
2663+
2664+[[package]]
2665+name = "tree-sitter-scheme"
2666+version = "0.24.7"
2667+source = "registry+https://github.com/rust-lang/crates.io-index"
2668+checksum = "8a7e7f156bdf38145f26705d1733185698845307d3e9d9c071ecce4375575131"
2669+dependencies = [
2670+ "cc",
2671+ "tree-sitter-language",
2672+]
2673+
2674+[[package]]
2675+name = "tree-sitter-sdml"
2676+version = "0.4.14"
2677+source = "registry+https://github.com/rust-lang/crates.io-index"
2678+checksum = "556ffac44de200072680c34a7a6b5702361c587e2dbcdb0a5f1296066d09dc19"
2679+dependencies = [
2680+ "cc",
2681+ "tree-sitter-language",
2682+]
2683+
2684+[[package]]
2685+name = "tree-sitter-sequel"
2686+version = "0.3.11"
2687+source = "registry+https://github.com/rust-lang/crates.io-index"
2688+checksum = "9d198ad3c319c02e43c21efa1ec796b837afcb96ffaef1a40c1978fbdcec7d17"
2689+dependencies = [
2690+ "cc",
2691+ "tree-sitter-language",
2692+]
2693+
2694+[[package]]
2695+name = "tree-sitter-sequel-tsql"
2696+version = "0.4.2"
2697+source = "registry+https://github.com/rust-lang/crates.io-index"
2698+checksum = "08d02793ddf858f2fc6376c7c12d50a4a29797c834b8ddbafe752290d9cbdb59"
2699+dependencies = [
2700+ "cc",
2701+ "tree-sitter-language",
2702+]
2703+
2704+[[package]]
2705+name = "tree-sitter-sfapex"
2706+version = "3.0.1"
2707+source = "registry+https://github.com/rust-lang/crates.io-index"
2708+checksum = "e902b5d7951d1477ff43ad5ec8b2e6adae029cce593a770c64e10362ee7dec7b"
2709+dependencies = [
2710+ "cc",
2711+ "tree-sitter-language",
2712+]
2713+
2714+[[package]]
2715+name = "tree-sitter-starlark"
2716+version = "1.3.0"
2717+source = "registry+https://github.com/rust-lang/crates.io-index"
2718+checksum = "8934f282d085cc4b9ee28aa688aa3fbe8aa3766201c2a6252f411d45b4c3a721"
2719+dependencies = [
2720+ "cc",
2721+ "tree-sitter-language",
2722+]
2723+
2724+[[package]]
2725+name = "tree-sitter-svelte-ng"
2726+version = "1.0.2"
2727+source = "registry+https://github.com/rust-lang/crates.io-index"
2728+checksum = "ef0a71f9cf5e94373cc86c64893630c8a29bb25d3390a248268d08af2165fa37"
2729+dependencies = [
2730+ "cc",
2731+ "tree-sitter-language",
2732+]
2733+
2734+[[package]]
2735+name = "tree-sitter-svg"
2736+version = "0.3.0"
2737+source = "registry+https://github.com/rust-lang/crates.io-index"
2738+checksum = "1289ec0f2cfad205d328c8f135c903ab53c657a7486acc7832833532b2e8dadb"
2739+dependencies = [
2740+ "cc",
2741+ "tree-sitter-language",
2742+]
2743+
2744+[[package]]
2745+name = "tree-sitter-swift"
2746+version = "0.7.3"
2747+source = "registry+https://github.com/rust-lang/crates.io-index"
2748+checksum = "fe36052155b9dd69ca82b3b8f1b4ccfb2d867125ac1a4db1dd7331829242668c"
2749+dependencies = [
2750+ "cc",
2751+ "tree-sitter-language",
2752+]
2753+
2754+[[package]]
2755+name = "tree-sitter-sysml"
2756+version = "0.1.0"
2757+source = "registry+https://github.com/rust-lang/crates.io-index"
2758+checksum = "72ea5ec06e683683af8b53d3cff9bc42c1d997b75b43e46968bd2504be002f15"
2759+dependencies = [
2760+ "cc",
2761+ "tree-sitter-language",
2762+]
2763+
2764+[[package]]
2765+name = "tree-sitter-systemverilog"
2766+version = "0.4.1"
2767+source = "registry+https://github.com/rust-lang/crates.io-index"
2768+checksum = "7d9f02d7fd20691acb5edf44a782f0b9fa278d9987befb1ae597c768707b95e6"
2769+dependencies = [
2770+ "cc",
2771+ "tree-sitter-language",
2772+]
2773+
2774+[[package]]
2775+name = "tree-sitter-templ"
2776+version = "2.2.0"
2777+source = "registry+https://github.com/rust-lang/crates.io-index"
2778+checksum = "86206f76eb2af238a5a7cc53a3d2c750a57a7e7311dc7f86da121264606d8619"
2779+dependencies = [
2780+ "cc",
2781+ "tree-sitter-language",
2782+]
2783+
2784+[[package]]
2785+name = "tree-sitter-tlaplus"
2786+version = "1.5.0"
2787+source = "registry+https://github.com/rust-lang/crates.io-index"
2788+checksum = "ddaacc0337bfee38f233a91a704dc36b887a0c385348163f65344d64b73f79e1"
2789+dependencies = [
2790+ "cc",
2791+ "tree-sitter-language",
2792+]
2793+
2794+[[package]]
2795+name = "tree-sitter-tmux"
2796+version = "0.1.4"
2797+source = "registry+https://github.com/rust-lang/crates.io-index"
2798+checksum = "0736784697bba41dec00519a8808bba8665f7407ace89f62e7f689856af8e790"
2799+dependencies = [
2800+ "cc",
2801+ "tree-sitter-language",
2802+]
2803+
15872804[[package]]
15882805name = "tree-sitter-toml-ng"
15892806version = "0.7.0"
@@ -1594,6 +2811,16 @@ dependencies = [
15942811 "tree-sitter-language",
15952812]
15962813
2814+[[package]]
2815+name = "tree-sitter-tsquery"
2816+version = "0.8.0"
2817+source = "registry+https://github.com/rust-lang/crates.io-index"
2818+checksum = "c1b31e95ea85379972abf3b6857a59b2f6fb7ef3b5e47e9a4fb6c07111dee5e6"
2819+dependencies = [
2820+ "cc",
2821+ "tree-sitter-language",
2822+]
2823+
15972824[[package]]
15982825name = "tree-sitter-typescript"
15992826version = "0.23.2"
@@ -1604,6 +2831,46 @@ dependencies = [
16042831 "tree-sitter-language",
16052832]
16062833
2834+[[package]]
2835+name = "tree-sitter-varlink"
2836+version = "0.6.1"
2837+source = "registry+https://github.com/rust-lang/crates.io-index"
2838+checksum = "f341405b5e4e2ac614086fd1e632e9dab8973f63695eab763a2fef8316224318"
2839+dependencies = [
2840+ "cc",
2841+ "tree-sitter-language",
2842+]
2843+
2844+[[package]]
2845+name = "tree-sitter-vhdl"
2846+version = "1.4.0"
2847+source = "registry+https://github.com/rust-lang/crates.io-index"
2848+checksum = "0feb025ddf87c45bb98335ef2a2493cac08ec6b74d33201d1bf75df2be08de23"
2849+dependencies = [
2850+ "cc",
2851+ "tree-sitter-language",
2852+]
2853+
2854+[[package]]
2855+name = "tree-sitter-vue-next"
2856+version = "0.1.0"
2857+source = "registry+https://github.com/rust-lang/crates.io-index"
2858+checksum = "e9ac89acaa8165aaabfa8ae9683aa423b0d2bf42c815dae5ca031a36a75525f1"
2859+dependencies = [
2860+ "cc",
2861+ "tree-sitter-language",
2862+]
2863+
2864+[[package]]
2865+name = "tree-sitter-xml"
2866+version = "0.7.0"
2867+source = "registry+https://github.com/rust-lang/crates.io-index"
2868+checksum = "e670041f591d994f54d597ddcd8f4ebc930e282c4c76a42268743b71f0c8b6b3"
2869+dependencies = [
2870+ "cc",
2871+ "tree-sitter-language",
2872+]
2873+
16072874[[package]]
16082875name = "tree-sitter-yaml"
16092876version = "0.7.2"
@@ -1614,6 +2881,26 @@ dependencies = [
16142881 "tree-sitter-language",
16152882]
16162883
2884+[[package]]
2885+name = "tree-sitter-zig"
2886+version = "1.1.2"
2887+source = "registry+https://github.com/rust-lang/crates.io-index"
2888+checksum = "ab11fc124851b0db4dd5e55983bbd9631192e93238389dcd44521715e5d53e28"
2889+dependencies = [
2890+ "cc",
2891+ "tree-sitter-language",
2892+]
2893+
2894+[[package]]
2895+name = "tree-sitter-zsh"
2896+version = "0.63.4"
2897+source = "registry+https://github.com/rust-lang/crates.io-index"
2898+checksum = "907f7ea76070507d7a6b054b38f1475caa7db085437911352ca0f361f08f142e"
2899+dependencies = [
2900+ "cc",
2901+ "tree-sitter-language",
2902+]
2903+
16172904[[package]]
16182905name = "tui-textarea"
16192906version = "0.7.0"
SPEC.md+11−6
@@ -1028,12 +1028,17 @@ Line-based, not a full renderer: headings coloured by level, task checkboxes sho
10281028
10291029**Fenced code** sits on a tinted background, its fence dimmed and its info string in the
10301030accent colour, and is **syntax-highlighted** with tree-sitter when the info string's first
1031−word names a known language: Rust (`rust`, `rs`), Python (`python`, `py`), JavaScript
1032−(`js`, `jsx`), TypeScript (`ts`, `tsx`), shell (`bash`, `sh`, `zsh`, `console`), JSON,
1033−TOML, YAML, Go, C, Nix, HTML and CSS. `rust,ignore`, `{.python}` and `sh title=x` work
1034−too. The grammars are compiled into the binary and each is loaded on first use; the block
1035−is highlighted as a whole (so a string or comment spanning lines is right) and cached until
1036−its text changes. Any other language, or a block its grammar cannot parse, is shown in the
1031+word names a known language. The app compiles in every tree-sitter grammar published on
1032+crates.io that builds against its tree-sitter version and has a highlights query — about
1033+140 languages, from Ada to Zig, including every mainstream programming, shell, markup,
1034+config, query and hardware-description language that has such a crate — keyed by the
1035+language's name and its usual fence aliases (`rs`, `py`, `js`, `ts`, `sh`, `c++`, `c#`,
1036+`kt`, `rb`, `hs`, `ex`, `yml`, `makefile`, `dockerfile`, `sql`, …). Where a grammar crate
1037+ships a highlights query without exporting it, the app carries a copy
1038+(`crates/fold-tui/queries/`, with its provenance). `rust,ignore`, `{.python}` and `sh
1039+title=x` work too. Each grammar is loaded on first use; the block is highlighted as a whole
1040+(so a string or comment spanning lines is right) and cached until its text changes. Any
1041+other language, or a block its grammar cannot parse, is shown in the
10371042plain code colour. Highlighting is the reading pane's only: the editor is a plain text box
10381043(§10.6). Raw text is
10391044never hidden: `#`, `-`, `**` and link targets stay on screen, dimmed. `zr` shows exact
crates/fold-tui/Cargo.toml+132−14
@@ -13,22 +13,140 @@ jiff.workspace = true
1313nucleo.workspace = true
1414unicode-width.workspace = true
1515anyhow.workspace = true
16−# syntax highlighting of fenced code in the reading pane (§10.9)
16+# syntax highlighting of fenced code in the reading pane (§10.9); grammar
17+# versions are pinned to the ones the query table was checked against
1718tree-sitter = "0.27"
1819tree-sitter-highlight = "0.27"
19−tree-sitter-rust = "0.24"
20−tree-sitter-python = "0.25"
21−tree-sitter-javascript = "0.25"
22−tree-sitter-typescript = "0.23"
23−tree-sitter-bash = "0.25"
24−tree-sitter-json = "0.24"
25−tree-sitter-toml-ng = "0.7"
26−tree-sitter-yaml = "0.7"
27−tree-sitter-go = "0.25"
28−tree-sitter-c = "0.24"
29−tree-sitter-nix = "0.3"
30−tree-sitter-html = "0.23"
31−tree-sitter-css = "0.25"
20+tree-sitter-ada = "=0.1.0"
21+tree-sitter-agda = "=1.3.3"
22+tree-sitter-al = "=4.4.0"
23+tree-sitter-applesoft = "=5.0.0"
24+tree-sitter-arduino = "=0.24.0"
25+tree-sitter-arkts = "=0.3.0"
26+tree-sitter-asm = "=0.24.0"
27+tree-sitter-astro-next = "=0.1.1"
28+tree-sitter-autohotkey = "=1.0.1"
29+tree-sitter-bash = "=0.25.1"
30+tree-sitter-batch = "=0.11.1"
31+tree-sitter-bicep = "=1.1.0"
32+tree-sitter-c = "=0.24.2"
33+tree-sitter-c-sharp = "=0.23.5"
34+tree-sitter-caddy = "=0.1.0"
35+tree-sitter-cfml = "=0.26.39"
36+tree-sitter-clojure-orchard = "=0.2.8"
37+tree-sitter-cmake = "=0.7.5"
38+tree-sitter-containerfile = "=0.9.2"
39+tree-sitter-cpp = "=0.23.4"
40+tree-sitter-css = "=0.25.0"
41+tree-sitter-cuda = "=0.21.2"
42+tree-sitter-cypher = "=0.2.6"
43+tree-sitter-d = "=0.8.2"
44+tree-sitter-dafny = "=0.1.0"
45+tree-sitter-dart = "=0.2.0"
46+tree-sitter-devicetree = "=0.15.0"
47+tree-sitter-diff = "=0.1.0"
48+tree-sitter-dm = "=0.25.4"
49+tree-sitter-elisp = "=1.7.2"
50+tree-sitter-elixir = "=0.3.5"
51+tree-sitter-elm = "=5.9.4"
52+tree-sitter-embedded-template = "=0.25.0"
53+tree-sitter-erlang = "=0.20.0"
54+tree-sitter-fortran = "=0.6.0"
55+tree-sitter-fsharp = "=0.3.12"
56+tree-sitter-gdshader = "=0.4.0"
57+tree-sitter-gitcommit = "=0.5.0"
58+tree-sitter-gleam = "=1.0.0"
59+tree-sitter-glsl = "=0.2.0"
60+tree-sitter-go = "=0.25.0"
61+tree-sitter-gomod-orchard = "=0.5.3"
62+tree-sitter-gosum-orchard = "=0.3.3"
63+tree-sitter-gwbasic = "=0.2.0"
64+tree-sitter-handlebars = "=0.1.0"
65+tree-sitter-harn = "=0.10.141"
66+tree-sitter-haskell = "=0.23.1"
67+tree-sitter-heex = "=0.8.1"
68+tree-sitter-html = "=0.23.2"
69+tree-sitter-ini = "=1.4.0"
70+tree-sitter-ink-lbz = "=0.0.5"
71+tree-sitter-integerbasic = "=3.0.0"
72+tree-sitter-irules = "=0.2.0"
73+tree-sitter-java = "=0.23.5"
74+tree-sitter-javadoc = "=0.3.1"
75+tree-sitter-javascript = "=0.25.0"
76+tree-sitter-jinja2 = "=0.0.16"
77+tree-sitter-jsdoc = "=0.25.0"
78+tree-sitter-json = "=0.24.8"
79+tree-sitter-jsonnet = "=0.0.1"
80+tree-sitter-julia = "=0.23.1"
81+tree-sitter-kconfig = "=1.3.0"
82+tree-sitter-kotlin-sg = "=0.4.1"
83+tree-sitter-lambdamoo = "=0.2.5"
84+tree-sitter-llvm = "=1.1.0"
85+tree-sitter-lua = "=0.5.0"
86+tree-sitter-luau = "=1.2.0"
87+tree-sitter-make = "=1.1.1"
88+tree-sitter-matlab = "=1.3.1"
89+tree-sitter-merlin6502 = "=4.0.0"
90+tree-sitter-mlir = "=0.2.0"
91+tree-sitter-msbasic2 = "=0.2.0"
92+tree-sitter-newick = "=1.1.0"
93+tree-sitter-nginx = "=1.0.1"
94+tree-sitter-nix = "=0.3.0"
95+tree-sitter-objc = "=3.0.2"
96+tree-sitter-ocaml = "=0.26.0"
97+tree-sitter-ocamllex = "=0.24.0"
98+tree-sitter-odin = "=1.3.0"
99+tree-sitter-openscad-ng = "=0.7.1"
100+tree-sitter-pascal = "=0.10.2"
101+tree-sitter-pgn = "=1.4.3"
102+tree-sitter-php = "=0.24.2"
103+tree-sitter-postgres = "=1.2.4"
104+tree-sitter-powershell = "=0.26.4"
105+tree-sitter-printf = "=0.5.1"
106+tree-sitter-prisma-io = "=1.6.0"
107+tree-sitter-prolog = "=0.1.0"
108+tree-sitter-properties = "=0.3.0"
109+tree-sitter-proto = "=0.6.0"
110+tree-sitter-puppet = "=1.3.0"
111+tree-sitter-python = "=0.25.0"
112+tree-sitter-qbasic = "=0.2.0"
113+tree-sitter-ql = "=0.23.1"
114+tree-sitter-qmljs = "=0.3.1"
115+tree-sitter-qsharp = "=0.2.0"
116+tree-sitter-r = "=1.3.0"
117+tree-sitter-racket = "=0.25.0"
118+tree-sitter-regex = "=0.25.0"
119+tree-sitter-requirements = "=0.6.1"
120+tree-sitter-riscv = "=0.3.1"
121+tree-sitter-ruby = "=0.23.1"
122+tree-sitter-rush = "=0.2.0"
123+tree-sitter-rust = "=0.24.2"
124+tree-sitter-sas = "=0.4.2"
125+tree-sitter-scala = "=0.26.2"
126+tree-sitter-scheme = "=0.24.7"
127+tree-sitter-sdml = "=0.4.14"
128+tree-sitter-sequel = "=0.3.11"
129+tree-sitter-sequel-tsql = "=0.4.2"
130+tree-sitter-sfapex = "=3.0.1"
131+tree-sitter-starlark = "=1.3.0"
132+tree-sitter-svelte-ng = "=1.0.2"
133+tree-sitter-svg = "=0.3.0"
134+tree-sitter-swift = "=0.7.3"
135+tree-sitter-sysml = "=0.1.0"
136+tree-sitter-systemverilog = "=0.4.1"
137+tree-sitter-templ = "=2.2.0"
138+tree-sitter-tlaplus = "=1.5.0"
139+tree-sitter-tmux = "=0.1.4"
140+tree-sitter-toml-ng = "=0.7.0"
141+tree-sitter-tsquery = "=0.8.0"
142+tree-sitter-typescript = "=0.23.2"
143+tree-sitter-varlink = "=0.6.1"
144+tree-sitter-vhdl = "=1.4.0"
145+tree-sitter-vue-next = "=0.1.0"
146+tree-sitter-xml = "=0.7.0"
147+tree-sitter-yaml = "=0.7.2"
148+tree-sitter-zig = "=1.1.2"
149+tree-sitter-zsh = "=0.63.4"
32150
33151[dev-dependencies]
34152insta = "1"
crates/fold-tui/queries/README.mdnew file+38
@@ -0,0 +1,38 @@
1+# Vendored highlight queries
2+
3+These grammar crates ship a `highlights.scm` in their package but do not export it from
4+their Rust bindings, so fold includes a copy (§10.9). Each file is the crate's own query,
5+unmodified (files listed together are concatenated in order), under the crate's licence.
6+
7+| File | From crate | Path in the crate | Licence |
8+|---|---|---|---|
9+| `ada.scm` | `tree-sitter-ada` 0.1.0 | `queries/highlights.scm` | MIT |
10+| `applesoft.scm` | `tree-sitter-applesoft` 5.0.0 | `queries/highlights.scm` | MIT |
11+| `caddy.scm` | `tree-sitter-caddy` 0.1.0 | `queries/highlights.scm` | GPL-3.0 |
12+| `cfml.scm` | `tree-sitter-cfml` 0.26.39 | `cfml/queries/highlights.scm` | MIT |
13+| `cfquery.scm` | `tree-sitter-cfml` 0.26.39 | `cfquery/queries/highlights.scm` | MIT |
14+| `cfscript.scm` | `tree-sitter-cfml` 0.26.39 | `cfscript/queries/highlights.scm` | MIT |
15+| `d.scm` | `tree-sitter-d` 0.8.2 | `queries/highlights.scm` | MIT |
16+| `dafny.scm` | `tree-sitter-dafny` 0.1.0 | `queries/highlights.scm` | MIT |
17+| `dm.scm` | `tree-sitter-dm` 0.25.4 | `queries/highlights.scm` | MIT |
18+| `fsharp-signature.scm` | `tree-sitter-fsharp` 0.3.12 | `fsharp_signature/queries/highlights.scm` | MIT |
19+| `gomod.scm` | `tree-sitter-gomod-orchard` 0.5.3 | `queries/highlights.scm` | MIT |
20+| `gwbasic.scm` | `tree-sitter-gwbasic` 0.2.0 | `queries/highlights.scm` | MIT |
21+| `ink.scm` | `tree-sitter-ink-lbz` 0.0.5 | `queries/highlights.scm` | MIT |
22+| `integerbasic.scm` | `tree-sitter-integerbasic` 3.0.0 | `queries/highlights.scm` | MIT |
23+| `julia.scm` | `tree-sitter-julia` 0.23.1 | `queries/highlights.scm` | MIT |
24+| `matlab.scm` | `tree-sitter-matlab` 1.3.1 | `queries/neovim/highlights.scm` | MIT |
25+| `merlin6502.scm` | `tree-sitter-merlin6502` 4.0.0 | `queries/highlights.scm` | MIT |
26+| `msbasic2.scm` | `tree-sitter-msbasic2` 0.2.0 | `queries/highlights.scm` | MIT |
27+| `newick.scm` | `tree-sitter-newick` 1.1.0 | `queries/highlights.scm` | see crate |
28+| `nginx.scm` | `tree-sitter-nginx` 1.0.1 | `queries/highlights.scm` | MIT |
29+| `pascal.scm` | `tree-sitter-pascal` 0.10.2 | `queries/highlights.scm` | MIT |
30+| `pgn.scm` | `tree-sitter-pgn` 1.4.3 | `queries/highlights.scm` | BSD-2-Clause |
31+| `plpgsql.scm` | `tree-sitter-postgres` 1.2.4 | `plpgsql/queries/highlights.scm` | BSD-3-Clause |
32+| `postgres.scm` | `tree-sitter-postgres` 1.2.4 | `postgres/queries/highlights.scm` | BSD-3-Clause |
33+| `prisma.scm` | `tree-sitter-prisma-io` 1.6.0 | `queries/highlights.scm` | MIT |
34+| `proto.scm` | `tree-sitter-proto` 0.6.0 | `queries/highlights.scm` | MIT |
35+| `qbasic.scm` | `tree-sitter-qbasic` 0.2.0 | `queries/highlights.scm` | MIT |
36+| `systemverilog.scm` | `tree-sitter-systemverilog` 0.4.1 | `queries/highlights.scm` | MIT |
37+| `templ.scm` | `tree-sitter-templ` 2.2.0 | `queries/templ/highlights.scm` | MIT |
38+| `vue.scm` | `tree-sitter-vue-next` 0.1.0 | `queries/html_tags/highlights.scm`, `queries/vue/highlights.scm` | MIT |
crates/fold-tui/queries/ada.scmnew file+196
@@ -0,0 +1,196 @@
1+;; highlight queries.
2+;; See the syntax at https://tree-sitter.github.io/tree-sitter/using-parsers#pattern-matching-with-queries
3+;; See also https://github.com/nvim-treesitter/nvim-treesitter/blob/master/CONTRIBUTING.md#parser-configurations
4+;; for a list of recommended @ tags, though not all of them have matching
5+;; highlights in neovim.
6+
7+[
8+ "abort"
9+ "abs"
10+ "abstract"
11+ "accept"
12+ "access"
13+ "all"
14+ "array"
15+ "at"
16+ "begin"
17+ "declare"
18+ "delay"
19+ "delta"
20+ "digits"
21+ "do"
22+ "end"
23+ "entry"
24+ "exit"
25+ "generic"
26+ "interface"
27+ "is"
28+ "limited"
29+ "null"
30+ "of"
31+ "others"
32+ "out"
33+ "pragma"
34+ "private"
35+ "range"
36+ "synchronized"
37+ "tagged"
38+ "task"
39+ "terminate"
40+ "until"
41+ "when"
42+] @keyword
43+[
44+ "aliased"
45+ "constant"
46+ "renames"
47+] @storageclass
48+[
49+ "mod"
50+ "new"
51+ "protected"
52+ "record"
53+ "subtype"
54+ "type"
55+] @keyword.type
56+[
57+ "with"
58+ "use"
59+] @include
60+[
61+ "body"
62+ "function"
63+ "overriding"
64+ "procedure"
65+ "package"
66+ "separate"
67+] @keyword.function
68+[
69+ "and"
70+ "in"
71+ "not"
72+ "or"
73+ "xor"
74+] @keyword.operator
75+[
76+ "while"
77+ "loop"
78+ "for"
79+ "parallel"
80+ "reverse"
81+ "some"
82+] @repeat
83+[
84+ "return"
85+] @keyword.return
86+[
87+ "case"
88+ "if"
89+ "else"
90+ "then"
91+ "elsif"
92+ "select"
93+] @conditional
94+[
95+ "exception"
96+ "raise"
97+] @exception
98+(comment) @comment @spell
99+(string_literal) @string
100+(character_literal) @string
101+(numeric_literal) @number
102+
103+;; Highlight the name of subprograms
104+(procedure_specification name: (_) @function)
105+(function_specification name: (_) @function)
106+(package_declaration name: (_) @function)
107+(package_body name: (_) @function)
108+(generic_instantiation name: (_) @function)
109+(entry_declaration . (identifier) @function)
110+
111+;; Some keywords should take different categories depending on the context
112+(use_clause "use" @include "type" @include)
113+(with_clause "private" @include)
114+(with_clause "limited" @include)
115+(use_clause (_) @namespace)
116+(with_clause (_) @namespace)
117+
118+(loop_statement "end" @keyword.repeat)
119+(if_statement "end" @conditional)
120+(loop_parameter_specification "in" @keyword.repeat)
121+(loop_parameter_specification "in" @keyword.repeat)
122+(iterator_specification ["in" "of"] @keyword.repeat)
123+(range_attribute_designator "range" @keyword.repeat)
124+
125+(raise_statement "with" @exception)
126+
127+(gnatprep_declarative_if_statement) @preproc
128+(gnatprep_if_statement) @preproc
129+(gnatprep_identifier) @preproc
130+
131+(subprogram_declaration "is" @keyword.function "abstract" @keyword.function)
132+(aspect_specification "with" @keyword.function)
133+
134+(full_type_declaration "is" @keyword.type)
135+(subtype_declaration "is" @keyword.type)
136+(record_definition "end" @keyword.type)
137+(full_type_declaration (_ "access" @keyword.type))
138+(array_type_definition "array" @keyword.type "of" @keyword.type)
139+(access_to_object_definition "access" @keyword.type)
140+(access_to_object_definition "access" @keyword.type
141+ [
142+ (general_access_modifier "constant" @keyword.type)
143+ (general_access_modifier "all" @keyword.type)
144+ ]
145+)
146+(range_constraint "range" @keyword.type)
147+(signed_integer_type_definition "range" @keyword.type)
148+(index_subtype_definition "range" @keyword.type)
149+(record_type_definition "abstract" @keyword.type)
150+(record_type_definition "tagged" @keyword.type)
151+(record_type_definition "limited" @keyword.type)
152+(record_type_definition (record_definition "null" @keyword.type))
153+(private_type_declaration "is" @keyword.type "private" @keyword.type)
154+(private_type_declaration "tagged" @keyword.type)
155+(private_type_declaration "limited" @keyword.type)
156+(task_type_declaration "task" @keyword.type "is" @keyword.type)
157+
158+;; Gray the body of expression functions
159+(expression_function_declaration
160+ (function_specification)
161+ "is"
162+ (_) @attribute
163+)
164+(subprogram_declaration (aspect_specification) @attribute)
165+
166+;; Highlight full subprogram specifications
167+;(subprogram_body
168+; [
169+; (procedure_specification)
170+; (function_specification)
171+; ] @function.spec
172+;)
173+
174+((comment) @comment.documentation
175+ . [
176+ (entry_declaration)
177+ (subprogram_declaration)
178+ (parameter_specification)
179+ ])
180+
181+(compilation_unit
182+ . (comment) @comment.documentation)
183+
184+(component_list
185+ (component_declaration)
186+ . (comment) @comment.documentation)
187+
188+(enumeration_type_definition
189+ (identifier)
190+ . (comment) @comment.documentation)
191+
192+;; Highlight errors in red. This is not very useful in practice, as text will
193+;; be highlighted as user types, and the error could be elsewhere in the code.
194+;; This also requires defining :hi @error guifg=Red for instance.
195+(ERROR) @error
196+
crates/fold-tui/queries/applesoft.scmnew file+124
@@ -0,0 +1,124 @@
1+(linenum) @tag
2+(name_fn) @function
3+(name_amp) @string
4+(comment_text) @comment
5+
6+(int) @number
7+(real) @number
8+(str) @string
9+(data_literal) @string
10+(data_real) @number
11+(data_int) @number
12+(data_str) @string
13+
14+(name_real) @variable
15+(name_int) @variable
16+(name_str) @variable
17+
18+(tok_rem) @comment
19+(tok_plus) @operator
20+(tok_minus) @operator
21+(tok_times) @operator
22+(tok_div) @operator
23+(tok_pow) @operator
24+(tok_gtr) @operator
25+(tok_eq) @operator
26+(tok_less) @operator
27+(tok_and) @operator
28+(tok_or) @operator
29+(tok_not) @operator
30+(tok_end) @keyword.builtin
31+(tok_for) @keyword.builtin
32+(tok_next) @keyword.builtin
33+(tok_data) @keyword.builtin
34+(tok_input) @keyword.builtin
35+(tok_del) @keyword.builtin
36+(tok_dim) @keyword.builtin
37+(tok_read) @keyword.builtin
38+(tok_gr) @keyword.builtin
39+(tok_text) @keyword.builtin
40+(tok_prn) @keyword.builtin
41+(tok_inn) @keyword.builtin
42+(tok_call) @keyword.builtin
43+(tok_plot) @keyword.builtin
44+(tok_hlin) @keyword.builtin
45+(tok_vlin) @keyword.builtin
46+(tok_hgr2) @keyword.builtin
47+(tok_hgr) @keyword.builtin
48+(tok_hcoloreq) @keyword.builtin
49+(tok_hplot) @keyword.builtin
50+(tok_draw) @keyword.builtin
51+(tok_xdraw) @keyword.builtin
52+(tok_htab) @keyword.builtin
53+(tok_home) @keyword.builtin
54+(tok_roteq) @keyword.builtin
55+(tok_scaleeq) @keyword.builtin
56+(tok_shload) @keyword.builtin
57+(tok_trace) @keyword.builtin
58+(tok_notrace) @keyword.builtin
59+(tok_normal) @keyword.builtin
60+(tok_inverse) @keyword.builtin
61+(tok_flash) @keyword.builtin
62+(tok_coloreq) @keyword.builtin
63+(tok_pop) @keyword.builtin
64+(tok_vtab) @keyword.builtin
65+(tok_himem) @keyword.builtin
66+(tok_lomem) @keyword.builtin
67+(tok_onerr) @keyword.builtin
68+(tok_resume) @keyword.builtin
69+(tok_recall) @keyword.builtin
70+(tok_store) @keyword.builtin
71+(tok_speedeq) @keyword.builtin
72+(tok_let) @keyword.builtin
73+(tok_goto) @keyword.builtin
74+(tok_run) @keyword.builtin
75+(tok_if) @keyword.builtin
76+(tok_restore) @keyword.builtin
77+(tok_amp) @keyword.builtin
78+(tok_gosub) @keyword.builtin
79+(tok_return) @keyword.builtin
80+(tok_stop) @keyword.builtin
81+(tok_on) @keyword.builtin
82+(tok_wait) @keyword.builtin
83+(tok_load) @keyword.builtin
84+(tok_save) @keyword.builtin
85+(tok_def) @keyword.builtin
86+(tok_poke) @keyword.builtin
87+(tok_print) @keyword.builtin
88+(tok_cont) @keyword.builtin
89+(tok_list) @keyword.builtin
90+(tok_clear) @keyword.builtin
91+(tok_get) @keyword.builtin
92+(tok_new) @keyword.builtin
93+(tok_tabp) @keyword.builtin
94+(tok_to) @keyword.builtin
95+(tok_fn) @keyword.builtin
96+(tok_spcp) @keyword.builtin
97+(tok_then) @keyword.builtin
98+(tok_at) @keyword.builtin
99+(tok_step) @keyword.builtin
100+(tok_sgn) @function.builtin
101+(tok_int) @function.builtin
102+(tok_abs) @function.builtin
103+(tok_usr) @function.builtin
104+(tok_fre) @function.builtin
105+(tok_scrnp) @function.builtin
106+(tok_pdl) @function.builtin
107+(tok_pos) @function.builtin
108+(tok_sqr) @function.builtin
109+(tok_rnd) @function.builtin
110+(tok_log) @function.builtin
111+(tok_exp) @function.builtin
112+(tok_cos) @function.builtin
113+(tok_sin) @function.builtin
114+(tok_tan) @function.builtin
115+(tok_atn) @function.builtin
116+(tok_peek) @function.builtin
117+(tok_len) @function.builtin
118+(tok_str) @function.builtin
119+(tok_val) @function.builtin
120+(tok_asc) @function.builtin
121+(tok_chr) @function.builtin
122+(tok_left) @function.builtin
123+(tok_right) @function.builtin
124+(tok_mid) @function.builtin
crates/fold-tui/queries/caddy.scmnew file+52
@@ -0,0 +1,52 @@
1+(comment) @comment @spell
2+
3+[
4+ (env)
5+ (argv)
6+ (block_variable)
7+ (placeholder)
8+] @constant
9+
10+(value) @variable
11+(directive (keyword) @attribute)
12+(global_options (option (keyword) @attribute))
13+
14+(keyword) @keyword
15+
16+(boolean) @boolean
17+
18+(placeholder
19+ [
20+ "{"
21+ "}"
22+ ] @punctuation.special)
23+
24+
25+[
26+ (auto)
27+] @variable.builtin
28+
29+[
30+ (string_literal)
31+ (quoted_string_literal)
32+ (address)
33+] @string
34+
35+[
36+ (matcher)
37+ (route)
38+ (snippet_name)
39+] @string.special
40+
41+[
42+ (numeric_literal)
43+ (time)
44+ (size)
45+ (ip_literal)
46+] @number
47+
48+[
49+ "{"
50+ "}"
51+] @punctuation.bracket
52+
crates/fold-tui/queries/cfml.scmnew file+400
@@ -0,0 +1,400 @@
1+; Document and structure (from Lucee-style rules)
2+(program) @document
3+
4+(doctype) @doctype
5+
6+(entity) @constant
7+
8+(html_text) @text
9+
10+(cdata_section
11+ ["<![CDATA[" "]]>"] @punctuation.special)
12+
13+(cdata_text) @text
14+
15+(erroneous_end_tag_name) @tag.error
16+
17+(erroneous_cf_end_tag_name) @tag.error
18+
19+(attribute_name) @attribute
20+
21+(cf_attribute_name) @attribute
22+
23+(attribute_value) @string
24+
25+(script_text) @embedded
26+
27+(style_text) @embedded
28+
29+(start_tag) @tag
30+
31+(end_tag) @tag
32+
33+(self_closing_tag) @tag
34+
35+(cf_selfclose_tag) @tag
36+
37+(cf_start_tag_with_selfclose) @tag
38+
39+(cf_output_tag) @tag
40+
41+(cf_function_tag) @tag
42+
43+(cf_script_tag) @tag
44+
45+(cf_start_tag) @tag
46+
47+(cf_end_tag) @tag
48+
49+(cf_if_tag) @tag
50+
51+(cf_query_tag) @tag
52+
53+(cf_savecontent_tag) @tag
54+
55+(cf_else_tag) @tag
56+
57+(cf_elseif_tag) @tag
58+
59+(cf_return_tag) @tag
60+
61+(cf_xml_tag) @tag
62+
63+(cf_component_open_tag) @tag
64+
65+(cf_component_close_tag) @tag
66+
67+(tag_name) @tag
68+
69+(cf_tag_name) @tag
70+
71+; Variables
72+;----------
73+(identifier) @variable
74+
75+; CFML scopes
76+;-------------
77+((identifier) @variable.builtin
78+ (#match? @variable.builtin "^(?i)(APPLICATION|ARGUMENTS|CGI|CLIENT|COOKIE|FORM|LOCAL|REQUEST|SERVER|SESSION|THIS|URL|VARIABLES)$"))
79+
80+; Properties
81+;-----------
82+(property_identifier) @property
83+
84+(shorthand_property_identifier) @property
85+
86+(shorthand_property_identifier_pattern) @property
87+
88+; Function and method definitions
89+;--------------------------------
90+(function_expression
91+ name: (identifier) @function) @definition.function
92+
93+(function_declaration
94+ name: (identifier) @function)
95+
96+(function_declaration
97+ (access_type) @keyword)
98+
99+(method_definition
100+ name: [
101+ (property_identifier)
102+ (private_property_identifier)
103+ ] @function.method)
104+
105+(method_definition
106+ name: (property_identifier) @constructor
107+ (#eq? @constructor "constructor"))
108+
109+(pair
110+ key: (property_identifier) @function.method
111+ value: (function_expression))
112+
113+(pair
114+ key: (property_identifier) @function.method
115+ value: (arrow_function))
116+
117+(array) @expression
118+
119+(cf_set_tag) @tag
120+
121+(assignment_expression
122+ left: (member_expression
123+ property: (property_identifier) @function.method)
124+ right: (arrow_function))
125+
126+(assignment_expression
127+ left: (member_expression
128+ property: (property_identifier) @function.method)
129+ right: (function_expression))
130+
131+(variable_declarator
132+ name: (identifier) @function
133+ value: (arrow_function))
134+
135+(variable_declarator
136+ name: (identifier) @function
137+ value: (function_expression))
138+
139+(assignment_expression
140+ left: (identifier) @function
141+ right: (arrow_function))
142+
143+(assignment_expression
144+ left: (identifier) @function
145+ right: (function_expression))
146+
147+; Function and method calls
148+;--------------------------
149+(call_expression
150+ function: (identifier) @function.builtin
151+ (#match? @function.builtin "^(?i)(abs|acos|addsoaprequestheader|addsoapresponseheader|aigetmetadata|aihas|ajaxlink|ajaxonload|applicationpathcacheclear|applicationstarttime|applicationstop|argon2checkhash|array|arrayappend|arrayavg|arrayclear|arraycontains|arraycontainsnocase|arraydelete|arraydeleteat|arraydeletenocase|arrayeach|arrayevery|arrayfilter|arrayfind|arrayfindall|arrayfindallnocase|arrayfindnocase|arrayfirst|arrayindexexists|arrayinsertat|arrayisdefined|arrayisempty|arraylast|arraylen|arraymap|arraymax|arraymedian|arraymerge|arraymid|arraymin|arraynew|arraypop|arrayprepend|arraypush|arrayreduce|arrayremoveduplicates|arrayresize|arrayreverse|arrayset|arrayshift|arrayslice|arraysome|arraysort|arraysplice|arraysum|arrayswap|arraytolist|arraytostruct|arrayunshift|asc|asin|astfrompath|astfromstring|atn|beat|binarydecode|binaryencode|bitand|bitmaskclear|bitmaskread|bitmaskset|bitnot|bitor|bitshln|bitshrn|bitxor|booleanformat|bundleinfo|cacheclear|cachecount|cachedelete|cacheget|cachegetall|cachegetallids|cachegetdefaultcachename|cachegetmetadata|cachegetproperties|cacheidexists|cachekeyexists|cacheput|cacheregionexists|cacheregionnew|cacheregionremove|cacheremove|cacheremoveall|cachesetproperties|callstackdump|callstackget|canonicalize|ceiling|cfusion_decrypt|cfusion_encrypt|charsetdecode|charsetencode|chr|cjustify|cleartimezone|collectioneach|collectionevery|collectionfilter|collectionmap|collectionreduce|collectionsome|compare|comparenocase|componentcacheclear|componentcachelist|componentinfo|componentlistpackage|compress|configimport|configtranslate|contractpath|cos|createaisession|createdate|createdatetime|createdynamicproxy|createguid|createobject|createodbcdate|createodbcdatetime|createodbctime|createtime|createtimespan|createulid|createuniqueid|createuuid|createwebsocketclient|csrfgeneratetoken|csrfverifytoken|ctcacheclear|ctcachelist|datasourceflushmetacache|dateadd|datecompare|dateconvert|datediff|dateformat|datepart|datetimeformat|day|dayofweek|dayofweekasstring|dayofweekshortasstring|dayofyear|daysinmonth|daysinyear|dbpoolclear|de|debugadd|decimalformat|decodeforhtml|decodefromurl|decrementvalue|decrypt|decryptbinary|deleteclientvariable|deserializejson|directorycopy|directorycreate|directorydelete|directoryexists|directoryinfo|directorylist|directoryrename|dollarformat|dump|duplicate|each|ec2describeinstances|echo|empty|encodeforcss|encodefordn|encodeforhtml|encodeforhtmlattribute|encodeforjavascript|encodeforldap|encodeforsql|encodeforurl|encodeforxml|encodeforxmlattribute|encodeforxpath|encrypt|encryptbinary|entitydelete|entityload|entityloadbyexample|entityloadbypk|entitymerge|entitynamearray|entitynamelist|entitynew|entityreload|entitysave|entitytoquery|esapidecode|esapiencode|evaluate|exp|expandpath|extensionexists|extensioninfo|extensionlist|extract|fileappend|fileclose|filecopy|filedelete|fileexists|filegetmimetype|fileinfo|fileiseof|filemodetosymbolic|filemove|fileopen|fileread|filereadbinary|filereadline|fileseek|filesetaccessmode|filesetattribute|filesetlastmodified|fileskipbytes|filetouch|fileupload|fileuploadall|filewrite|filewriteline|find|findlast|findlastnocase|findnocase|findoneof|firstdayofmonth|fix|floor|formatbasen|gatewayaction|gatewaystate|generate3deskey|generateargon2hash|generatepbkdfkey|generatersakeys|generatesecretkey|getapplicationmetadata|getapplicationsettings|getauthuser|getbasetagdata|getbasetaglist|getbasetemplatepath|getbuiltinfunction|getcanonicalpath|getclasspath|getclientvariableslist|getcomponentmetadata|getcomponentstaticscope|getcontextinfo|getcontextroot|getcpuusage|getcurrentcontext|getcurrenttemplatepath|getdirectoryfrompath|getencoding|getfilefrompath|getfileinfo|getfreespace|getfunctioncalledname|getfunctiondata|getfunctionkeywords|getfunctionlist|gethttprequestdata|gethttprequestheaders|gethttptimestring|getk2serverdoccount|getk2serverdoccountlimit|getlocale|getlocaledisplayname|getlocaleinfo|getlocalhostip|getluceeid|getmemoryusage|getmetadata|getmetricdata|getnumericdate|getpagecontext|getprinterinfo|getprinterlist|getprofilesections|getprofilestring|getpropertyfile|getpropertystring|getreadableimageformats|getsoaprequest|getsoaprequestheader|getsoapresponse|getsoapresponseheader|getsystemfreememory|getsystemmetrics|getsystemproporenvvar|getsystemtotalmemory|gettagdata|gettaglist|gettempdirectory|gettempfile|gettemplatepath|gettickcount|gettimezone|gettimezoneinfo|gettoken|gettotalspace|getuserroles|getvariable|getvfsmetadata|getwriteableimageformats|guarddecode|guardencode|hash|hash40|hmac|hour|htmlcodeformat|htmleditformat|htmlparse|iif|imageaddborder|imageblur|imagecaptcha|imageclearrect|imagecoderinfo|imagecopy|imagecrop|imagedrawarc|imagedrawbeveledrect|imagedrawcubiccurve|imagedrawimage|imagedrawline|imagedrawlines|imagedrawoval|imagedrawpoint|imagedrawquadraticcurve|imagedrawrect|imagedrawroundrect|imagedrawtext|imagefilter|imagefiltercolormap|imagefiltercurves|imagefilterkernel|imagefilterwarpgrid|imageflip|imagefonts|imageformats|imagegetblob|imagegetbufferedimage|imagegetexifmetadata|imagegetexiftag|imagegetheight|imagegetiptcmetadata|imagegetwidth|imagegrayscale|imageinfo|imagenegative|imagenew|imageoverlay|imagepaste|imageread|imagereadbase64|imageresize|imagerotate|imagerotatedrawingaxis|imagescaletofit|imagesetantialiasing|imagesetbackgroundcolor|imagesetdrawingalpha|imagesetdrawingcolor|imagesetdrawingstroke|imagesetdrawingtransparency|imagesharpen|imageshear|imagesheardrawingaxis|imagetranslate|imagetranslatedrawingaxis|imagewrite|imagewritebase64|imagewritetobrowser|imagexordrawingmode|incrementvalue|inputbasen|inquiryaisession|insert|inspecttemplates|int|internalrequest|interruptthread|invoke|isarray|isbinary|isboolean|isclosure|iscustomfunction|isdate|isdebugmode|isdefined|isempty|isfileobject|isflushed|isimage|isimagefile|isinstanceof|isinthread|isipinrange|isipv6|isjson|isleapyear|islocalhost|isnotmap|isnull|isnumeric|isnumericdate|isobject|ispdfobject|isquery|issimplevalue|issoaprequest|isstruct|isthreadinterrupted|isuserinanyrole|isuserinrole|isuserloggedin|isvalid|isvideofile|iswddx|iswithintransaction|isxml|isxmlattribute|isxmldoc|isxmlelem|isxmlnode|isxmlroot|iszipfile|javacast|jsstringformat|lcase|left|len|listappend|listavg|listchangedelims|listcompact|listcontains|listcontainsnocase|listdeleteat|listeach|listevery|listfilter|listfind|listfindnocase|listfirst|listgetat|listgetduplicates|listindexexists|listinsertat|listitemtrim|listlast|listlen|listmap|listprepend|listqualifiedtoarray|listqualify|listreduce|listremoveduplicates|listrest|listsetat|listsome|listsort|listtoarray|listtrim|listvaluecount|listvaluecountnocase|ljustify|loadaisession|location|log|log10|logallthreads|lscurrencyformat|lsdateformat|lsdatetimeformat|lsdayofweek|lseurocurrencyformat|lsiscurrency|lsisdate|lsisnumeric|lslcase|lsnumberformat|lsparsecurrency|lsparsedatetime|lsparseeurocurrency|lsparsenumber|lstimeformat|lsucase|lsweek|ltrim|luceeaigetmetadata|luceeaihas|luceecreateaisession|luceeinquiryaisession|manifestread|markdowntohtml|maveninfo|mavenload|max|metaphone|mid|millisecond|min|minute|month|monthasstring|monthshortasstring|newline|now|nowserver|nullvalue|numberformat|objectequals|objectload|objectsave|ormclearsession|ormcloseallsessions|ormclosesession|ormevictcollection|ormevictentity|ormevictqueries|ormexecutequery|ormflush|ormgetsession|ormgetsessionfactory|ormreload|pagepoolclear|pagepoollist|paragraphformat|parameterexists|parsedatetime|parsenumber|pi|precisionevaluate|preservesinglequotes|quarter|query|queryaddcolumn|queryaddrow|queryappend|queryclear|queryclose|querycolumnarray|querycolumncount|querycolumndata|querycolumnexists|querycolumnlist|queryconvertforgrid|querycurrentrow|querydeletecolumn|querydeleterow|queryeach|queryevery|queryexecute|queryfilter|querygetcell|querygetcellbyindex|querygetrow|queryinsertat|queryisempty|querykeyexists|querylazy|querymap|querynew|queryprepend|queryrecordcount|queryreduce|queryrenamecolumn|queryreverse|queryrowbyindex|queryrowdata|queryrowdatabyindex|queryrowswap|querysetcell|querysetrow|queryslice|querysome|querysort|querytostruct|quotedvaluelist|rand|randomize|randrange|rediscommand|rediscommandlowpriority|redisconnectionpoolinfo|reescape|refind|refindnocase|releasecomobject|rematch|rematchnocase|removechars|render|repeatstring|replace|replacelist|replacelistnocase|replacenocase|rereplace|rereplacenocase|restdeleteapplication|restinitapplication|restsetresponse|reverse|right|rjustify|round|rtrim|runasync|s3addacl|s3clearbucket|s3copy|s3createbucket|s3delete|s3deletebucket|s3download|s3exists|s3generatepresignedurl|s3generateuri|s3getacl|s3getmetadata|s3getversioninfo|s3listbucket|s3listbuckets|s3move|s3read|s3readbinary|s3setacl|s3setmetadata|s3upload|s3write|sanitize|sanitizehtml|second|secretproviderget|sendgatewaymessage|serialize|serializeaisession|serializejson|sessioncommit|sessionexists|sessioninvalidate|sessionrotate|sessionstarttime|setencoding|setlocale|setprofilestring|setpropertystring|settimezone|setvariable|sgn|sin|sizeof|sleep|soundex|spanexcluding|spanincluding|spreadsheetnew|sqr|sslcertificateinstall|sslcertificatelist|storeaddacl|storegetacl|storegetmetadata|storesetacl|storesetmetadata|stringeach|stringevery|stringfilter|stringlen|stringmap|stringreduce|stringsome|stringsort|stripcr|structappend|structclear|structcopy|structcount|structdelete|structeach|structevery|structfilter|structfind|structfindkey|structfindvalue|structget|structinsert|structisempty|structkeyarray|structkeyexists|structkeylist|structkeytranslate|structmap|structnew|structreduce|structsome|structsort|structtosorted|structupdate|structvaluearray|systemcacheclear|systemoutput|tan|threaddata|threadinterrupt|threadinterrupted|threadjoin|threadterminate|throw|timeformat|tobase64|tobinary|tonumeric|toscript|tostring|trace|transactioncommit|transactionrollback|transactionsetsavepoint|trim|trimwhitespace|truefalseformat|ucase|ucfirst|unserializejava|urldecode|urlencode|urlencodedformat|urlsessionformat|val|validatejson|valuearray|valuelist|valueref|verifyclient|webservicenew|websocketinfo|week|wrap|writedump|writelog|writeoutput|xmlchildpos|xmlelemnew|xmlformat|xmlgetnodetype|xmlnew|xmlparse|xmlsearch|xmltransform|xmlvalidate|year|yesnoformat)$"))
152+
153+(call_expression
154+ function: (identifier) @function.call)
155+
156+(call_expression
157+ function: (member_expression
158+ property: [
159+ (property_identifier)
160+ (private_property_identifier)
161+ ] @function.method.call))
162+
163+; Literals
164+;---------
165+((identifier) @variable.builtin
166+ (#eq? @variable.builtin "self"))
167+
168+(this) @variable.builtin
169+
170+(super) @variable.builtin
171+
172+(cf_var) @keyword
173+
174+[
175+ (true)
176+ (false)
177+] @boolean
178+
179+[
180+ (null)
181+ (undefined)
182+] @constant.builtin
183+
184+[
185+ (comment)
186+ (cf_comment)
187+] @comment @spell
188+
189+((comment) @comment.documentation
190+ (#match? @comment.documentation "^/[*][*][^*].*[*]/$"))
191+
192+((string_fragment) @keyword.directive
193+ (#eq? @keyword.directive "use strict"))
194+
195+(string) @string
196+
197+(text) @string
198+
199+(hash_empty) @punctuation.special
200+
201+(hash_single) @punctuation.special
202+
203+(regex_pattern) @string.regexp
204+
205+(regex_flags) @character.special
206+
207+(regex
208+ "/" @punctuation.bracket) ; Regex delimiters
209+
210+(number) @number
211+
212+(hash_expression
213+ "#" @punctuation.special)
214+
215+(unary_operator) @operator
216+(not_operator "!" @operator)
217+
218+; CFML's word operators. `@keyword.operator` falls back to `@keyword` where a
219+; theme lacks it. Scoped to their parents: the same tokens also spell a
220+; parameter name (`function f( array eq )`), inside an `identifier`.
221+(not_operator "not" @keyword.operator)
222+
223+(binary_expression
224+ operator: [
225+ "and"
226+ "or"
227+ "xor"
228+ "eqv"
229+ "imp"
230+ "mod"
231+ "eq"
232+ "equal"
233+ "is"
234+ "not"
235+ "neq"
236+ "not equal"
237+ "lt"
238+ "lte"
239+ "le"
240+ "less than"
241+ "less than or equal to"
242+ "gt"
243+ "gte"
244+ "ge"
245+ "greater than"
246+ "greater than or equal to"
247+ "contains"
248+ "ct"
249+ "does not contain"
250+ "nct"
251+ ] @keyword.operator)
252+
253+((identifier) @number
254+ (#any-of? @number "NaN" "Infinity"))
255+
256+(ordered_struct
257+ ["[" ":" "]"] @punctuation.bracket)
258+
259+; Types
260+;------
261+(parameter_type) @type
262+
263+; The parent capture above covers a built-in type name, which is a leaf. A
264+; custom type and a dotted path are not: they carry `identifier` children, and
265+; `(identifier) @variable` earlier in this file matches those over the very same
266+; range. Which of the two a given highlighter renders is not something this file
267+; should leave to chance, so the children are captured as `@type` explicitly,
268+; after the generic rule they need to beat.
269+(parameter_type (identifier) @type)
270+(parameter_type (path (identifier) @type))
271+
272+(catch_clause
273+ type: (catch_type) @type)
274+
275+; Imports
276+;--------
277+(import_path
278+ (identifier) @module)
279+
280+; Punctuation
281+;------------
282+[
283+ ";"
284+ "."
285+ ","
286+ ":"
287+ (optional_chain)
288+ (static_chain)
289+] @punctuation.delimiter
290+
291+(binary_expression
292+ "/" @operator)
293+
294+(ternary_expression
295+ [
296+ "?"
297+ ":"
298+ ] @keyword.conditional.ternary)
299+
300+(elvis_expression
301+ "?:" @keyword.conditional.ternary)
302+
303+[
304+ "-"
305+ "--"
306+ "-="
307+ "+"
308+ "++"
309+ "+="
310+ "*"
311+ "*="
312+ "**"
313+ "**="
314+ "/"
315+ "/="
316+ "\\"
317+ "%"
318+ "%="
319+ "<"
320+ "<<="
321+ "="
322+ "=="
323+ "==="
324+ "!"
325+ "!="
326+ "!=="
327+ "=>"
328+ "->"
329+ ">"
330+ ">>="
331+ ">>>="
332+ "~"
333+ "^"
334+ "&"
335+ "|"
336+ "^="
337+ "&="
338+ "|="
339+ "&&"
340+ (logical_or)
341+ "||"
342+ "??"
343+ "&&="
344+ "||="
345+ "??="
346+ "<="
347+ "<>"
348+ "<<"
349+ ">="
350+ ">>"
351+ ">>>"
352+] @operator
353+
354+[
355+ "var"
356+ "let"
357+ "const"
358+ "function"
359+ "new"
360+ "return"
361+ "if"
362+ "else"
363+ "for"
364+ "while"
365+ "do"
366+ "switch"
367+ "case"
368+ "default"
369+ "break"
370+ "continue"
371+ "try"
372+ "catch"
373+ "finally"
374+ "throw"
375+ "in"
376+ "of"
377+ "instanceof"
378+ "static"
379+ "with"
380+] @keyword
381+
382+[
383+ "("
384+ ")"
385+ "["
386+ "]"
387+ "{"
388+ "}"
389+ "<"
390+ ">"
391+ "</"
392+] @punctuation.bracket
393+
394+
395+; `User[] function getUsers()` — one token, so the anonymous "[" / "]"
396+; rule below cannot reach it.
397+(array_return_suffix) @punctuation.bracket
398+
399+; Lucee object selector, e.g. `new java:java.io.File(...)`
400+(type_prefix) @keyword
crates/fold-tui/queries/cfquery.scmnew file+383
@@ -0,0 +1,383 @@
1+; CF tags
2+(erroneous_cf_end_tag_name) @tag.error
3+
4+(cf_attribute_name) @attribute
5+
6+(attribute_value) @string
7+
8+(cf_selfclose_tag) @tag
9+
10+(cf_start_tag_with_selfclose) @tag
11+
12+(cf_set_tag) @tag
13+
14+(cf_if_tag) @tag
15+
16+(cf_else_tag) @tag
17+
18+(cf_elseif_tag) @tag
19+
20+(cf_start_tag) @tag
21+
22+(cf_end_tag) @tag
23+
24+(cf_tag) @tag
25+
26+(cf_output_tag) @tag
27+
28+(cf_return_tag) @tag
29+
30+(cf_tag_name) @tag
31+
32+; Variables
33+(identifier) @variable
34+
35+; CFML scopes
36+((identifier) @variable.builtin
37+ (#match? @variable.builtin "^(?i)(APPLICATION|ARGUMENTS|CGI|CLIENT|COOKIE|FORM|LOCAL|REQUEST|SERVER|SESSION|THIS|URL|VARIABLES)$"))
38+
39+; Properties
40+(property_identifier) @property
41+
42+(shorthand_property_identifier) @property
43+
44+(shorthand_property_identifier_pattern) @property
45+
46+(private_property_identifier) @property
47+
48+; Function and method definitions
49+(function_expression
50+ name: (identifier) @function)
51+
52+(function_declaration
53+ name: (identifier) @function)
54+
55+(function_declaration
56+ (access_type) @keyword)
57+
58+(method_definition
59+ name: [
60+ (property_identifier)
61+ (private_property_identifier)
62+ ] @function.method)
63+
64+(method_definition
65+ name: (property_identifier) @constructor
66+ (#eq? @constructor "constructor"))
67+
68+(pair
69+ key: (property_identifier) @function.method
70+ value: [(function_expression) (arrow_function)])
71+
72+(assignment_expression
73+ left: (member_expression
74+ property: (property_identifier) @function.method)
75+ right: [(function_expression) (arrow_function)])
76+
77+(variable_declarator
78+ name: (identifier) @function
79+ value: [(function_expression) (arrow_function)])
80+
81+(assignment_expression
82+ left: (identifier) @function
83+ right: [(function_expression) (arrow_function)])
84+
85+; Function and method calls
86+; Lucee built-in functions - highlight as builtin
87+(call_expression
88+ function: (identifier) @function.builtin
89+ (#match? @function.builtin "^(?i)(abs|acos|addsoaprequestheader|addsoapresponseheader|aigetmetadata|aihas|ajaxlink|ajaxonload|applicationpathcacheclear|applicationstarttime|applicationstop|argon2checkhash|array|arrayappend|arrayavg|arrayclear|arraycontains|arraycontainsnocase|arraydelete|arraydeleteat|arraydeletenocase|arrayeach|arrayevery|arrayfilter|arrayfind|arrayfindall|arrayfindallnocase|arrayfindnocase|arrayfirst|arrayindexexists|arrayinsertat|arrayisdefined|arrayisempty|arraylast|arraylen|arraymap|arraymax|arraymedian|arraymerge|arraymid|arraymin|arraynew|arraypop|arrayprepend|arraypush|arrayreduce|arrayremoveduplicates|arrayresize|arrayreverse|arrayset|arrayshift|arrayslice|arraysome|arraysort|arraysplice|arraysum|arrayswap|arraytolist|arraytostruct|arrayunshift|asc|asin|astfrompath|astfromstring|atn|beat|binarydecode|binaryencode|bitand|bitmaskclear|bitmaskread|bitmaskset|bitnot|bitor|bitshln|bitshrn|bitxor|booleanformat|bundleinfo|cacheclear|cachecount|cachedelete|cacheget|cachegetall|cachegetallids|cachegetdefaultcachename|cachegetmetadata|cachegetproperties|cacheidexists|cachekeyexists|cacheput|cacheregionexists|cacheregionnew|cacheregionremove|cacheremove|cacheremoveall|cachesetproperties|callstackdump|callstackget|canonicalize|ceiling|cfusion_decrypt|cfusion_encrypt|charsetdecode|charsetencode|chr|cjustify|cleartimezone|collectioneach|collectionevery|collectionfilter|collectionmap|collectionreduce|collectionsome|compare|comparenocase|componentcacheclear|componentcachelist|componentinfo|componentlistpackage|compress|configimport|configtranslate|contractpath|cos|createaisession|createdate|createdatetime|createdynamicproxy|createguid|createobject|createodbcdate|createodbcdatetime|createodbctime|createtime|createtimespan|createulid|createuniqueid|createuuid|createwebsocketclient|csrfgeneratetoken|csrfverifytoken|ctcacheclear|ctcachelist|datasourceflushmetacache|dateadd|datecompare|dateconvert|datediff|dateformat|datepart|datetimeformat|day|dayofweek|dayofweekasstring|dayofweekshortasstring|dayofyear|daysinmonth|daysinyear|dbpoolclear|de|debugadd|decimalformat|decodeforhtml|decodefromurl|decrementvalue|decrypt|decryptbinary|deleteclientvariable|deserializejson|directorycopy|directorycreate|directorydelete|directoryexists|directoryinfo|directorylist|directoryrename|dollarformat|dump|duplicate|each|ec2describeinstances|echo|empty|encodeforcss|encodefordn|encodeforhtml|encodeforhtmlattribute|encodeforjavascript|encodeforldap|encodeforsql|encodeforurl|encodeforxml|encodeforxmlattribute|encodeforxpath|encrypt|encryptbinary|entitydelete|entityload|entityloadbyexample|entityloadbypk|entitymerge|entitynamearray|entitynamelist|entitynew|entityreload|entitysave|entitytoquery|esapidecode|esapiencode|evaluate|exp|expandpath|extensionexists|extensioninfo|extensionlist|extract|fileappend|fileclose|filecopy|filedelete|fileexists|filegetmimetype|fileinfo|fileiseof|filemodetosymbolic|filemove|fileopen|fileread|filereadbinary|filereadline|fileseek|filesetaccessmode|filesetattribute|filesetlastmodified|fileskipbytes|filetouch|fileupload|fileuploadall|filewrite|filewriteline|find|findlast|findlastnocase|findnocase|findoneof|firstdayofmonth|fix|floor|formatbasen|gatewayaction|gatewaystate|generate3deskey|generateargon2hash|generatepbkdfkey|generatersakeys|generatesecretkey|getapplicationmetadata|getapplicationsettings|getauthuser|getbasetagdata|getbasetaglist|getbasetemplatepath|getbuiltinfunction|getcanonicalpath|getclasspath|getclientvariableslist|getcomponentmetadata|getcomponentstaticscope|getcontextinfo|getcontextroot|getcpuusage|getcurrentcontext|getcurrenttemplatepath|getdirectoryfrompath|getencoding|getfilefrompath|getfileinfo|getfreespace|getfunctioncalledname|getfunctiondata|getfunctionkeywords|getfunctionlist|gethttprequestdata|gethttprequestheaders|gethttptimestring|getk2serverdoccount|getk2serverdoccountlimit|getlocale|getlocaledisplayname|getlocaleinfo|getlocalhostip|getluceeid|getmemoryusage|getmetadata|getmetricdata|getnumericdate|getpagecontext|getprinterinfo|getprinterlist|getprofilesections|getprofilestring|getpropertyfile|getpropertystring|getreadableimageformats|getsoaprequest|getsoaprequestheader|getsoapresponse|getsoapresponseheader|getsystemfreememory|getsystemmetrics|getsystemproporenvvar|getsystemtotalmemory|gettagdata|gettaglist|gettempdirectory|gettempfile|gettemplatepath|gettickcount|gettimezone|gettimezoneinfo|gettoken|gettotalspace|getuserroles|getvariable|getvfsmetadata|getwriteableimageformats|guarddecode|guardencode|hash|hash40|hmac|hour|htmlcodeformat|htmleditformat|htmlparse|iif|imageaddborder|imageblur|imagecaptcha|imageclearrect|imagecoderinfo|imagecopy|imagecrop|imagedrawarc|imagedrawbeveledrect|imagedrawcubiccurve|imagedrawimage|imagedrawline|imagedrawlines|imagedrawoval|imagedrawpoint|imagedrawquadraticcurve|imagedrawrect|imagedrawroundrect|imagedrawtext|imagefilter|imagefiltercolormap|imagefiltercurves|imagefilterkernel|imagefilterwarpgrid|imageflip|imagefonts|imageformats|imagegetblob|imagegetbufferedimage|imagegetexifmetadata|imagegetexiftag|imagegetheight|imagegetiptcmetadata|imagegetwidth|imagegrayscale|imageinfo|imagenegative|imagenew|imageoverlay|imagepaste|imageread|imagereadbase64|imageresize|imagerotate|imagerotatedrawingaxis|imagescaletofit|imagesetantialiasing|imagesetbackgroundcolor|imagesetdrawingalpha|imagesetdrawingcolor|imagesetdrawingstroke|imagesetdrawingtransparency|imagesharpen|imageshear|imagesheardrawingaxis|imagetranslate|imagetranslatedrawingaxis|imagewrite|imagewritebase64|imagewritetobrowser|imagexordrawingmode|incrementvalue|inputbasen|inquiryaisession|insert|inspecttemplates|int|internalrequest|interruptthread|invoke|isarray|isbinary|isboolean|isclosure|iscustomfunction|isdate|isdebugmode|isdefined|isempty|isfileobject|isflushed|isimage|isimagefile|isinstanceof|isinthread|isipinrange|isipv6|isjson|isleapyear|islocalhost|isnotmap|isnull|isnumeric|isnumericdate|isobject|ispdfobject|isquery|issimplevalue|issoaprequest|isstruct|isthreadinterrupted|isuserinanyrole|isuserinrole|isuserloggedin|isvalid|isvideofile|iswddx|iswithintransaction|isxml|isxmlattribute|isxmldoc|isxmlelem|isxmlnode|isxmlroot|iszipfile|javacast|jsstringformat|lcase|left|len|listappend|listavg|listchangedelims|listcompact|listcontains|listcontainsnocase|listdeleteat|listeach|listevery|listfilter|listfind|listfindnocase|listfirst|listgetat|listgetduplicates|listindexexists|listinsertat|listitemtrim|listlast|listlen|listmap|listprepend|listqualifiedtoarray|listqualify|listreduce|listremoveduplicates|listrest|listsetat|listsome|listsort|listtoarray|listtrim|listvaluecount|listvaluecountnocase|ljustify|loadaisession|location|log|log10|logallthreads|lscurrencyformat|lsdateformat|lsdatetimeformat|lsdayofweek|lseurocurrencyformat|lsiscurrency|lsisdate|lsisnumeric|lslcase|lsnumberformat|lsparsecurrency|lsparsedatetime|lsparseeurocurrency|lsparsenumber|lstimeformat|lsucase|lsweek|ltrim|luceeaigetmetadata|luceeaihas|luceecreateaisession|luceeinquiryaisession|manifestread|markdowntohtml|maveninfo|mavenload|max|metaphone|mid|millisecond|min|minute|month|monthasstring|monthshortasstring|newline|now|nowserver|nullvalue|numberformat|objectequals|objectload|objectsave|ormclearsession|ormcloseallsessions|ormclosesession|ormevictcollection|ormevictentity|ormevictqueries|ormexecutequery|ormflush|ormgetsession|ormgetsessionfactory|ormreload|pagepoolclear|pagepoollist|paragraphformat|parameterexists|parsedatetime|parsenumber|pi|precisionevaluate|preservesinglequotes|quarter|query|queryaddcolumn|queryaddrow|queryappend|queryclear|queryclose|querycolumnarray|querycolumncount|querycolumndata|querycolumnexists|querycolumnlist|queryconvertforgrid|querycurrentrow|querydeletecolumn|querydeleterow|queryeach|queryevery|queryexecute|queryfilter|querygetcell|querygetcellbyindex|querygetrow|queryinsertat|queryisempty|querykeyexists|querylazy|querymap|querynew|queryprepend|queryrecordcount|queryreduce|queryrenamecolumn|queryreverse|queryrowbyindex|queryrowdata|queryrowdatabyindex|queryrowswap|querysetcell|querysetrow|queryslice|querysome|querysort|querytostruct|quotedvaluelist|rand|randomize|randrange|rediscommand|rediscommandlowpriority|redisconnectionpoolinfo|reescape|refind|refindnocase|releasecomobject|rematch|rematchnocase|removechars|render|repeatstring|replace|replacelist|replacelistnocase|replacenocase|rereplace|rereplacenocase|restdeleteapplication|restinitapplication|restsetresponse|reverse|right|rjustify|round|rtrim|runasync|s3addacl|s3clearbucket|s3copy|s3createbucket|s3delete|s3deletebucket|s3download|s3exists|s3generatepresignedurl|s3generateuri|s3getacl|s3getmetadata|s3getversioninfo|s3listbucket|s3listbuckets|s3move|s3read|s3readbinary|s3setacl|s3setmetadata|s3upload|s3write|sanitize|sanitizehtml|second|secretproviderget|sendgatewaymessage|serialize|serializeaisession|serializejson|sessioncommit|sessionexists|sessioninvalidate|sessionrotate|sessionstarttime|setencoding|setlocale|setprofilestring|setpropertystring|settimezone|setvariable|sgn|sin|sizeof|sleep|soundex|spanexcluding|spanincluding|spreadsheetnew|sqr|sslcertificateinstall|sslcertificatelist|storeaddacl|storegetacl|storegetmetadata|storesetacl|storesetmetadata|stringeach|stringevery|stringfilter|stringlen|stringmap|stringreduce|stringsome|stringsort|stripcr|structappend|structclear|structcopy|structcount|structdelete|structeach|structevery|structfilter|structfind|structfindkey|structfindvalue|structget|structinsert|structisempty|structkeyarray|structkeyexists|structkeylist|structkeytranslate|structmap|structnew|structreduce|structsome|structsort|structtosorted|structupdate|structvaluearray|systemcacheclear|systemoutput|tan|threaddata|threadinterrupt|threadinterrupted|threadjoin|threadterminate|throw|timeformat|tobase64|tobinary|tonumeric|toscript|tostring|trace|transactioncommit|transactionrollback|transactionsetsavepoint|trim|trimwhitespace|truefalseformat|ucase|ucfirst|unserializejava|urldecode|urlencode|urlencodedformat|urlsessionformat|val|validatejson|valuearray|valuelist|valueref|verifyclient|webservicenew|websocketinfo|week|wrap|writedump|writelog|writeoutput|xmlchildpos|xmlelemnew|xmlformat|xmlgetnodetype|xmlnew|xmlparse|xmlsearch|xmltransform|xmlvalidate|year|yesnoformat)$"))
90+
91+; Function and method calls
92+(call_expression
93+ function: (identifier) @function.call)
94+
95+(call_expression
96+ function: (member_expression
97+ property: [
98+ (property_identifier)
99+ (private_property_identifier)
100+ ] @function.method.call))
101+
102+; Literals
103+((identifier) @variable.builtin
104+ (#eq? @variable.builtin "self"))
105+
106+(this) @variable.builtin
107+
108+(super) @variable.builtin
109+
110+(cf_var) @keyword
111+
112+[
113+ (true)
114+ (false)
115+] @boolean
116+
117+[
118+ (null)
119+ (undefined)
120+] @constant.builtin
121+
122+[
123+ (comment)
124+ (cf_comment)
125+] @comment @spell
126+
127+((comment) @comment.documentation
128+ (#match? @comment.documentation "^/[*][*][^*].*[*]/$"))
129+
130+(string) @string
131+
132+(hash_empty) @punctuation.special
133+
134+(regex_pattern) @string.regexp
135+
136+(regex_flags) @character.special
137+
138+(regex
139+ "/" @punctuation.bracket)
140+
141+(number) @number
142+
143+(hash_expression
144+ "#" @punctuation.special)
145+
146+(unary_operator) @operator
147+(not_operator "!" @operator)
148+
149+; CFML's word operators. `@keyword.operator` falls back to `@keyword` where a
150+; theme lacks it. Scoped to their parents: the same tokens also spell a
151+; parameter name (`function f( array eq )`), inside an `identifier`.
152+(not_operator "not" @keyword.operator)
153+
154+(binary_expression
155+ operator: [
156+ "and"
157+ "or"
158+ "xor"
159+ "eqv"
160+ "imp"
161+ "mod"
162+ "eq"
163+ "equal"
164+ "is"
165+ "not"
166+ "neq"
167+ "not equal"
168+ "lt"
169+ "lte"
170+ "le"
171+ "less than"
172+ "less than or equal to"
173+ "gt"
174+ "gte"
175+ "ge"
176+ "greater than"
177+ "greater than or equal to"
178+ "contains"
179+ "ct"
180+ "does not contain"
181+ "nct"
182+ ] @keyword.operator)
183+
184+(spread_element
185+ "..." @operator)
186+
187+((identifier) @number
188+ (#any-of? @number "NaN" "Infinity"))
189+
190+; Punctuation
191+[
192+ ";"
193+ "."
194+ ","
195+ ":"
196+ (optional_chain)
197+ (static_chain)
198+] @punctuation.delimiter
199+
200+(binary_expression
201+ "/" @operator)
202+
203+(ternary_expression
204+ [
205+ "?"
206+ ":"
207+ ] @keyword.conditional.ternary)
208+
209+(elvis_expression
210+ "?:" @keyword.conditional.ternary)
211+
212+[
213+ "-"
214+ "--"
215+ "-="
216+ "+"
217+ "++"
218+ "+="
219+ "*"
220+ "*="
221+ "**"
222+ "**="
223+ "/"
224+ "/="
225+ "\\"
226+ "%"
227+ "%="
228+ "<"
229+ "<<="
230+ "="
231+ "=="
232+ "==="
233+ "!"
234+ "!="
235+ "!=="
236+ "=>"
237+ "->"
238+ ">"
239+ ">>="
240+ ">>>="
241+ "~"
242+ "^"
243+ "&"
244+ "|"
245+ "^="
246+ "&="
247+ "|="
248+ "&&"
249+ (logical_or)
250+ "||"
251+ "??"
252+ "&&="
253+ "||="
254+ "??="
255+ "<="
256+ "<>"
257+ "<<"
258+ ">="
259+ ">>"
260+ ">>>"
261+] @operator
262+
263+[
264+ "var"
265+ "let"
266+ "const"
267+ "function"
268+ "new"
269+ "return"
270+ "if"
271+ "else"
272+ "for"
273+ "while"
274+ "do"
275+ "switch"
276+ "case"
277+ "break"
278+ "continue"
279+ "try"
280+ "catch"
281+ "finally"
282+ "throw"
283+ "of"
284+ "instanceof"
285+ "static"
286+ "with"
287+ "default"
288+ "in"
289+] @keyword
290+
291+[
292+ "("
293+ ")"
294+ "["
295+ "]"
296+ "{"
297+ "}"
298+ "</"
299+] @punctuation.bracket
300+
301+; SQL keywords and identifiers
302+(query_keyword) @keyword
303+
304+(query_function
305+ name: (query_function_name) @function.call)
306+
307+(query_function_name) @variable
308+
309+(query_identifier) @variable
310+
311+(query_alias
312+ right: _ @variable)
313+
314+(query_star
315+ (star) @operator)
316+
317+(query_number
318+ (number) @number)
319+
320+(query_math_expression
321+ operator: _ @operator)
322+
323+(query_comparison_expression
324+ operator: _ @operator)
325+
326+; Quoted values: capture the whole node so the delimiters are styled too
327+[
328+ (quoted_query_value)
329+ (double_quoted_query_value)
330+] @string
331+
332+; Backticks and brackets quote an identifier, not a string literal
333+(backtick_quoted_query_value
334+ (query_value) @variable)
335+
336+(backtick_quoted_query_value
337+ "`" @punctuation.bracket)
338+
339+(query_comma) @punctuation.delimiter
340+
341+(query_semicolon) @punctuation.delimiter
342+
343+(bracketed_query_value
344+ (query_value) @variable)
345+
346+(bracketed_query_value
347+ ["[" "]"] @punctuation.bracket)
348+
349+(parenthesized_query_node
350+ ["(" ")"] @punctuation.bracket)
351+
352+(query_assignment_expression
353+ "=" @operator)
354+
355+(query_operator) @operator
356+
357+(query_open_paren) @punctuation.bracket
358+
359+(query_close_paren) @punctuation.bracket
360+
361+(quoted_query_value
362+ (query_value) @string)
363+
364+(double_quoted_query_value
365+ (query_value) @string)
366+
367+; Reachable inside `#...#` through a `function(...)` expression or a typed
368+; arrow-function parameter, even though a `<cfscript>` block is not.
369+(parameter_type) @type
370+
371+; The parent capture above covers a built-in type name, which is a leaf. A
372+; custom type and a dotted path are not: they carry `identifier` children, and
373+; `(identifier) @variable` earlier in this file matches those over the very same
374+; range. Which of the two a given highlighter renders is not something this file
375+; should leave to chance, so the children are captured as `@type` explicitly,
376+; after the generic rule they need to beat.
377+(parameter_type (identifier) @type)
378+(parameter_type (path (identifier) @type))
379+; `User[] v` - one token, so the anonymous "[" / "]" rule cannot reach it.
380+(array_return_suffix) @punctuation.bracket
381+
382+; Lucee object selector, e.g. `new java:java.io.File(...)`
383+(type_prefix) @keyword
crates/fold-tui/queries/cfscript.scmnew file+408
@@ -0,0 +1,408 @@
1+; Variables
2+;----------
3+(identifier) @variable
4+
5+; CFML scopes
6+;-------------
7+((identifier) @variable.builtin
8+ (#match? @variable.builtin "^(?i)(APPLICATION|ARGUMENTS|CGI|CLIENT|COOKIE|FORM|LOCAL|REQUEST|SERVER|SESSION|THIS|URL|VARIABLES)$"))
9+
10+; Properties
11+;-----------
12+(property_identifier) @property
13+
14+(shorthand_property_identifier) @property
15+
16+(shorthand_property_identifier_pattern) @property
17+
18+(private_property_identifier) @property
19+
20+; Component and property declarations
21+;-------------------------------------
22+(component_attribute
23+ (attribute_label) @attribute)
24+
25+; Namespaced attributes, e.g. `component test:displayLabel="..."`
26+(component_attribute
27+ ":" @punctuation.delimiter)
28+
29+(property_declaration
30+ name: (identifier) @property)
31+
32+(spread_element
33+ "..." @operator)
34+
35+; Function and method definitions
36+;--------------------------------
37+(function_expression
38+ name: (identifier) @function)
39+
40+(function_declaration
41+ name: (identifier) @function)
42+
43+(function_declaration
44+ (access_type) @keyword)
45+
46+(method_definition
47+ name: (property_identifier) @function.method)
48+
49+(pair
50+ key: (property_identifier) @function.method
51+ value: [(function_expression) (arrow_function)])
52+
53+(assignment_expression
54+ left: (member_expression
55+ property: (property_identifier) @function.method)
56+ right: [(function_expression) (arrow_function)])
57+
58+(variable_declarator
59+ name: (identifier) @function
60+ value: [(function_expression) (arrow_function)])
61+
62+(assignment_expression
63+ left: (identifier) @function
64+ right: [(function_expression) (arrow_function)])
65+
66+; Function and method calls
67+;--------------------------
68+
69+; Lucee built-in functions (from lucee-docs 03.reference.01.functions) - highlight as builtin
70+(call_expression
71+ function: (identifier) @function.builtin
72+ (#match? @function.builtin "^(?i)(abs|acos|addsoaprequestheader|addsoapresponseheader|aigetmetadata|aihas|ajaxlink|ajaxonload|applicationpathcacheclear|applicationstarttime|applicationstop|argon2checkhash|array|arrayappend|arrayavg|arrayclear|arraycontains|arraycontainsnocase|arraydelete|arraydeleteat|arraydeletenocase|arrayeach|arrayevery|arrayfilter|arrayfind|arrayfindall|arrayfindallnocase|arrayfindnocase|arrayfirst|arrayindexexists|arrayinsertat|arrayisdefined|arrayisempty|arraylast|arraylen|arraymap|arraymax|arraymedian|arraymerge|arraymid|arraymin|arraynew|arraypop|arrayprepend|arraypush|arrayreduce|arrayremoveduplicates|arrayresize|arrayreverse|arrayset|arrayshift|arrayslice|arraysome|arraysort|arraysplice|arraysum|arrayswap|arraytolist|arraytostruct|arrayunshift|asc|asin|astfrompath|astfromstring|atn|beat|binarydecode|binaryencode|bitand|bitmaskclear|bitmaskread|bitmaskset|bitnot|bitor|bitshln|bitshrn|bitxor|booleanformat|bundleinfo|cacheclear|cachecount|cachedelete|cacheget|cachegetall|cachegetallids|cachegetdefaultcachename|cachegetmetadata|cachegetproperties|cacheidexists|cachekeyexists|cacheput|cacheregionexists|cacheregionnew|cacheregionremove|cacheremove|cacheremoveall|cachesetproperties|callstackdump|callstackget|canonicalize|ceiling|cfusion_decrypt|cfusion_encrypt|charsetdecode|charsetencode|chr|cjustify|cleartimezone|collectioneach|collectionevery|collectionfilter|collectionmap|collectionreduce|collectionsome|compare|comparenocase|componentcacheclear|componentcachelist|componentinfo|componentlistpackage|compress|configimport|configtranslate|contractpath|cos|createaisession|createdate|createdatetime|createdynamicproxy|createguid|createobject|createodbcdate|createodbcdatetime|createodbctime|createtime|createtimespan|createulid|createuniqueid|createuuid|createwebsocketclient|csrfgeneratetoken|csrfverifytoken|ctcacheclear|ctcachelist|datasourceflushmetacache|dateadd|datecompare|dateconvert|datediff|dateformat|datepart|datetimeformat|day|dayofweek|dayofweekasstring|dayofweekshortasstring|dayofyear|daysinmonth|daysinyear|dbpoolclear|de|debugadd|decimalformat|decodeforhtml|decodefromurl|decrementvalue|decrypt|decryptbinary|deleteclientvariable|deserializejson|directorycopy|directorycreate|directorydelete|directoryexists|directoryinfo|directorylist|directoryrename|dollarformat|dump|duplicate|each|ec2describeinstances|echo|empty|encodeforcss|encodefordn|encodeforhtml|encodeforhtmlattribute|encodeforjavascript|encodeforldap|encodeforsql|encodeforurl|encodeforxml|encodeforxmlattribute|encodeforxpath|encrypt|encryptbinary|entitydelete|entityload|entityloadbyexample|entityloadbypk|entitymerge|entitynamearray|entitynamelist|entitynew|entityreload|entitysave|entitytoquery|esapidecode|esapiencode|evaluate|exp|expandpath|extensionexists|extensioninfo|extensionlist|extract|fileappend|fileclose|filecopy|filedelete|fileexists|filegetmimetype|fileinfo|fileiseof|filemodetosymbolic|filemove|fileopen|fileread|filereadbinary|filereadline|fileseek|filesetaccessmode|filesetattribute|filesetlastmodified|fileskipbytes|filetouch|fileupload|fileuploadall|filewrite|filewriteline|find|findlast|findlastnocase|findnocase|findoneof|firstdayofmonth|fix|floor|formatbasen|gatewayaction|gatewaystate|generate3deskey|generateargon2hash|generatepbkdfkey|generatersakeys|generatesecretkey|getapplicationmetadata|getapplicationsettings|getauthuser|getbasetagdata|getbasetaglist|getbasetemplatepath|getbuiltinfunction|getcanonicalpath|getclasspath|getclientvariableslist|getcomponentmetadata|getcomponentstaticscope|getcontextinfo|getcontextroot|getcpuusage|getcurrentcontext|getcurrenttemplatepath|getdirectoryfrompath|getencoding|getfilefrompath|getfileinfo|getfreespace|getfunctioncalledname|getfunctiondata|getfunctionkeywords|getfunctionlist|gethttprequestdata|gethttprequestheaders|gethttptimestring|getk2serverdoccount|getk2serverdoccountlimit|getlocale|getlocaledisplayname|getlocaleinfo|getlocalhostip|getluceeid|getmemoryusage|getmetadata|getmetricdata|getnumericdate|getpagecontext|getprinterinfo|getprinterlist|getprofilesections|getprofilestring|getpropertyfile|getpropertystring|getreadableimageformats|getsoaprequest|getsoaprequestheader|getsoapresponse|getsoapresponseheader|getsystemfreememory|getsystemmetrics|getsystemproporenvvar|getsystemtotalmemory|gettagdata|gettaglist|gettempdirectory|gettempfile|gettemplatepath|gettickcount|gettimezone|gettimezoneinfo|gettoken|gettotalspace|getuserroles|getvariable|getvfsmetadata|getwriteableimageformats|guarddecode|guardencode|hash|hash40|hmac|hour|htmlcodeformat|htmleditformat|htmlparse|iif|imageaddborder|imageblur|imagecaptcha|imageclearrect|imagecoderinfo|imagecopy|imagecrop|imagedrawarc|imagedrawbeveledrect|imagedrawcubiccurve|imagedrawimage|imagedrawline|imagedrawlines|imagedrawoval|imagedrawpoint|imagedrawquadraticcurve|imagedrawrect|imagedrawroundrect|imagedrawtext|imagefilter|imagefiltercolormap|imagefiltercurves|imagefilterkernel|imagefilterwarpgrid|imageflip|imagefonts|imageformats|imagegetblob|imagegetbufferedimage|imagegetexifmetadata|imagegetexiftag|imagegetheight|imagegetiptcmetadata|imagegetwidth|imagegrayscale|imageinfo|imagenegative|imagenew|imageoverlay|imagepaste|imageread|imagereadbase64|imageresize|imagerotate|imagerotatedrawingaxis|imagescaletofit|imagesetantialiasing|imagesetbackgroundcolor|imagesetdrawingalpha|imagesetdrawingcolor|imagesetdrawingstroke|imagesetdrawingtransparency|imagesharpen|imageshear|imagesheardrawingaxis|imagetranslate|imagetranslatedrawingaxis|imagewrite|imagewritebase64|imagewritetobrowser|imagexordrawingmode|incrementvalue|inputbasen|inquiryaisession|insert|inspecttemplates|int|internalrequest|interruptthread|invoke|isarray|isbinary|isboolean|isclosure|iscustomfunction|isdate|isdebugmode|isdefined|isempty|isfileobject|isflushed|isimage|isimagefile|isinstanceof|isinthread|isipinrange|isipv6|isjson|isleapyear|islocalhost|isnotmap|isnull|isnumeric|isnumericdate|isobject|ispdfobject|isquery|issimplevalue|issoaprequest|isstruct|isthreadinterrupted|isuserinanyrole|isuserinrole|isuserloggedin|isvalid|isvideofile|iswddx|iswithintransaction|isxml|isxmlattribute|isxmldoc|isxmlelem|isxmlnode|isxmlroot|iszipfile|javacast|jsstringformat|lcase|left|len|listappend|listavg|listchangedelims|listcompact|listcontains|listcontainsnocase|listdeleteat|listeach|listevery|listfilter|listfind|listfindnocase|listfirst|listgetat|listgetduplicates|listindexexists|listinsertat|listitemtrim|listlast|listlen|listmap|listprepend|listqualifiedtoarray|listqualify|listreduce|listremoveduplicates|listrest|listsetat|listsome|listsort|listtoarray|listtrim|listvaluecount|listvaluecountnocase|ljustify|loadaisession|location|log|log10|logallthreads|lscurrencyformat|lsdateformat|lsdatetimeformat|lsdayofweek|lseurocurrencyformat|lsiscurrency|lsisdate|lsisnumeric|lslcase|lsnumberformat|lsparsecurrency|lsparsedatetime|lsparseeurocurrency|lsparsenumber|lstimeformat|lsucase|lsweek|ltrim|luceeaigetmetadata|luceeaihas|luceecreateaisession|luceeinquiryaisession|manifestread|markdowntohtml|maveninfo|mavenload|max|metaphone|mid|millisecond|min|minute|month|monthasstring|monthshortasstring|newline|now|nowserver|nullvalue|numberformat|objectequals|objectload|objectsave|ormclearsession|ormcloseallsessions|ormclosesession|ormevictcollection|ormevictentity|ormevictqueries|ormexecutequery|ormflush|ormgetsession|ormgetsessionfactory|ormreload|pagepoolclear|pagepoollist|paragraphformat|parameterexists|parsedatetime|parsenumber|pi|precisionevaluate|preservesinglequotes|quarter|query|queryaddcolumn|queryaddrow|queryappend|queryclear|queryclose|querycolumnarray|querycolumncount|querycolumndata|querycolumnexists|querycolumnlist|queryconvertforgrid|querycurrentrow|querydeletecolumn|querydeleterow|queryeach|queryevery|queryexecute|queryfilter|querygetcell|querygetcellbyindex|querygetrow|queryinsertat|queryisempty|querykeyexists|querylazy|querymap|querynew|queryprepend|queryrecordcount|queryreduce|queryrenamecolumn|queryreverse|queryrowbyindex|queryrowdata|queryrowdatabyindex|queryrowswap|querysetcell|querysetrow|queryslice|querysome|querysort|querytostruct|quotedvaluelist|rand|randomize|randrange|rediscommand|rediscommandlowpriority|redisconnectionpoolinfo|reescape|refind|refindnocase|releasecomobject|rematch|rematchnocase|removechars|render|repeatstring|replace|replacelist|replacelistnocase|replacenocase|rereplace|rereplacenocase|restdeleteapplication|restinitapplication|restsetresponse|reverse|right|rjustify|round|rtrim|runasync|s3addacl|s3clearbucket|s3copy|s3createbucket|s3delete|s3deletebucket|s3download|s3exists|s3generatepresignedurl|s3generateuri|s3getacl|s3getmetadata|s3getversioninfo|s3listbucket|s3listbuckets|s3move|s3read|s3readbinary|s3setacl|s3setmetadata|s3upload|s3write|sanitize|sanitizehtml|second|secretproviderget|sendgatewaymessage|serialize|serializeaisession|serializejson|sessioncommit|sessionexists|sessioninvalidate|sessionrotate|sessionstarttime|setencoding|setlocale|setprofilestring|setpropertystring|settimezone|setvariable|sgn|sin|sizeof|sleep|soundex|spanexcluding|spanincluding|spreadsheetnew|sqr|sslcertificateinstall|sslcertificatelist|storeaddacl|storegetacl|storegetmetadata|storesetacl|storesetmetadata|stringeach|stringevery|stringfilter|stringlen|stringmap|stringreduce|stringsome|stringsort|stripcr|structappend|structclear|structcopy|structcount|structdelete|structeach|structevery|structfilter|structfind|structfindkey|structfindvalue|structget|structinsert|structisempty|structkeyarray|structkeyexists|structkeylist|structkeytranslate|structmap|structnew|structreduce|structsome|structsort|structtosorted|structupdate|structvaluearray|systemcacheclear|systemoutput|tan|threaddata|threadinterrupt|threadinterrupted|threadjoin|threadterminate|throw|timeformat|tobase64|tobinary|tonumeric|toscript|tostring|trace|transactioncommit|transactionrollback|transactionsetsavepoint|trim|trimwhitespace|truefalseformat|ucase|ucfirst|unserializejava|urldecode|urlencode|urlencodedformat|urlsessionformat|val|validatejson|valuearray|valuelist|valueref|verifyclient|webservicenew|websocketinfo|week|wrap|writedump|writelog|writeoutput|xmlchildpos|xmlelemnew|xmlformat|xmlgetnodetype|xmlnew|xmlparse|xmlsearch|xmltransform|xmlvalidate|year|yesnoformat)$"))
73+
74+(call_expression
75+ function: (identifier) @function)
76+
77+(call_expression
78+ function: (member_expression
79+ property: (property_identifier) @function.method))
80+
81+; Special identifiers
82+;--------------------
83+((identifier) @constructor
84+ (#match? @constructor "^[A-Z]"))
85+
86+([
87+ (identifier)
88+ (shorthand_property_identifier)
89+ (shorthand_property_identifier_pattern)
90+ ] @constant
91+ (#match? @constant "^[A-Z_][A-Z\\d_]+$"))
92+
93+((identifier) @variable.builtin
94+ (#match? @variable.builtin "^(arguments|module|console|window|document)$")
95+ (#is-not? local))
96+
97+((identifier) @function.builtin
98+ (#eq? @function.builtin "require")
99+ (#is-not? local))
100+
101+; Literals
102+;---------
103+(this) @variable.builtin
104+
105+(super) @variable.builtin
106+
107+(undefined) @constant.builtin
108+
109+[
110+ (true)
111+ (false)
112+ (null)
113+ (undefined)
114+] @constant.builtin
115+
116+(comment) @comment
117+
118+(cf_comment) @comment
119+
120+((comment) @comment.documentation
121+ (#match? @comment.documentation "^/[*][*][^*].*[*]/$"))
122+
123+[
124+ (string)
125+ (template_string)
126+] @string
127+
128+(hash_expression
129+ "#" @punctuation.special)
130+
131+(hash_empty) @punctuation.special
132+
133+(regex_pattern) @string.regexp
134+
135+(regex_flags) @character.special
136+
137+(regex
138+ "/" @punctuation.bracket) ; Regex delimiters
139+
140+(number) @number
141+
142+; Tokens
143+;-------
144+[
145+ ";"
146+ (optional_chain)
147+ (static_chain)
148+ "."
149+ ","
150+] @punctuation.delimiter
151+
152+(ordered_struct
153+ ["[" ":" "]"] @punctuation.bracket)
154+
155+(pair
156+ ":" @punctuation.delimiter)
157+
158+(pair_pattern
159+ ":" @punctuation.delimiter)
160+
161+(switch_case
162+ ":" @punctuation.delimiter)
163+
164+(switch_default
165+ ":" @punctuation.delimiter)
166+
167+(labeled_statement
168+ ":" @punctuation.delimiter)
169+
170+(slice_expression
171+ ":" @punctuation.delimiter)
172+
173+(cfml_template
174+ "```" @punctuation.delimiter)
175+
176+(cfml_template_content) @embedded
177+
178+(ternary_expression
179+ [
180+ "?"
181+ ":"
182+ ] @keyword.conditional.ternary)
183+
184+(elvis_expression
185+ "?:" @keyword.conditional.ternary)
186+
187+; Types
188+;------
189+(parameter_type) @type
190+
191+; The parent capture above covers a built-in type name, which is a leaf. A
192+; custom type and a dotted path are not: they carry `identifier` children, and
193+; `(identifier) @variable` at the top of this file matches those over the very
194+; same range — a capitalised one picks up `@constructor` as well. Which of the
195+; three a given highlighter renders is not something this file should leave to
196+; chance, so the children are captured as `@type` explicitly, after the generic
197+; rules they need to beat.
198+(parameter_type (identifier) @type)
199+(parameter_type (path (identifier) @type))
200+
201+(catch_clause
202+ type: (catch_type) @type)
203+
204+(property_declaration
205+ type: [(identifier) (path)] @type)
206+
207+; Tag statements
208+;---------------
209+(tag_statement
210+ tag: (identifier) @keyword)
211+
212+(query_tag
213+ "query" @keyword)
214+
215+; Inline queries
216+;---------------
217+
218+; Unparented so the keyword stays highlighted mid-typing, while the string is still
219+; unterminated and the whole call sits inside an ERROR node.
220+"queryExecute" @function.builtin
221+
222+(query_expression
223+ ["\"" "'"] @punctuation.delimiter)
224+
225+(query_text) @embedded
226+
227+; Imports
228+;--------
229+(import_path
230+ (identifier) @module)
231+
232+[
233+ "-"
234+ "--"
235+ "-="
236+ "+"
237+ "++"
238+ "+="
239+ "*"
240+ "*="
241+ "**"
242+ "**="
243+ "/"
244+ "/="
245+ "\\"
246+ "%"
247+ "%="
248+ "<"
249+ "<="
250+ "<<="
251+ "="
252+ "=="
253+ "==="
254+ "!="
255+ "!=="
256+ "=>"
257+ "->"
258+ ">"
259+ ">="
260+ ">>="
261+ ">>>="
262+ "^"
263+ "&"
264+ "|"
265+ "^="
266+ "&="
267+ "|="
268+ "&&"
269+ (logical_or)
270+ "||"
271+ "??"
272+ "&&="
273+ "||="
274+ "??="
275+ "<>"
276+ "<<"
277+ ">>"
278+ ">>>"
279+] @operator
280+
281+(unary_operator) @operator
282+(not_operator "!" @operator)
283+
284+; CFML's word operators. `@keyword.operator` falls back to `@keyword` where a
285+; theme lacks it. Scoped to their parents: the same tokens also spell a
286+; parameter name (`function f( array eq )`), inside an `identifier`.
287+(not_operator "not" @keyword.operator)
288+
289+(binary_expression
290+ operator: [
291+ "and"
292+ "or"
293+ "xor"
294+ "eqv"
295+ "imp"
296+ "mod"
297+ "eq"
298+ "equal"
299+ "is"
300+ "not"
301+ "neq"
302+ "not equal"
303+ "lt"
304+ "lte"
305+ "le"
306+ "less than"
307+ "less than or equal to"
308+ "gt"
309+ "gte"
310+ "ge"
311+ "greater than"
312+ "greater than or equal to"
313+ "contains"
314+ "ct"
315+ "does not contain"
316+ "nct"
317+ ] @keyword.operator)
318+
319+[
320+ "("
321+ ")"
322+ "["
323+ "]"
324+ "{"
325+ "}"
326+] @punctuation.bracket
327+
328+(template_substitution
329+ "${" @punctuation.special
330+ "}" @punctuation.special) @embedded
331+
332+[
333+ "as"
334+ "break"
335+ "case"
336+ "catch"
337+ "component"
338+ "const"
339+ "continue"
340+ "debugger"
341+ "default"
342+ "do"
343+ "else"
344+ "elseif"
345+ "export"
346+ "finally"
347+ "for"
348+ "from"
349+ "function"
350+ "get"
351+ "if"
352+ "import"
353+ "in"
354+ "include"
355+ "instanceof"
356+ "let"
357+ "new"
358+ "of"
359+ "query"
360+ "return"
361+ "set"
362+ "static"
363+ "switch"
364+ "throw"
365+ "try"
366+ "var"
367+ "while"
368+ "with"
369+ "abstract"
370+ "final"
371+ "interface"
372+ "property"
373+ "required"
374+] @keyword
375+
376+(regex) @string.special
377+
378+; `User[] function getUsers()` — one token, so the anonymous "[" / "]"
379+; rule below cannot reach it.
380+(array_return_suffix) @punctuation.bracket
381+
382+; Lucee object selector, e.g. `new java:java.io.File(...)`
383+(type_prefix) @keyword
384+
385+; `cfparam (name:"x" default:"y")` — a colon-separated script tag call attribute
386+; is an assignment_expression whose operator is `:` rather than `=`.
387+(assignment_expression
388+ ":" @operator)
389+
390+; `foo: bar;`
391+(statement_identifier) @label
392+
393+; Unparented: `public final MEMBER = "v"` puts access_type on a
394+; variable_declaration, not just a function_declaration.
395+(access_type) @keyword
396+
397+; Inline Lucee java block, `a = java { ... }` — injected as Java, @embedded is
398+; the fallback if that layer does not load.
399+(java_class_content) @embedded
400+
401+; `msSQL.class: 'value';` — a dotted colon assignment is its own node, not an
402+; assignment_expression, so the rule above does not reach it.
403+(colon_assignment_statement
404+ ":" @operator)
405+
406+; `mySuccess():function(result, error) { … }` — the listener callback separator.
407+(function_listener_expression
408+ ":" @operator)
crates/fold-tui/queries/d.scmnew file+259
@@ -0,0 +1,259 @@
1+; highlights.scm
2+;
3+; Highlighting queries for D code for use by Tree-Sitter.
4+;
5+; Copyright 2024 Garrett D'Amore
6+;
7+; Distributed under the MIT License.
8+; (See accompanying file LICENSE.txt or https://opensource.org/licenses/MIT)
9+; SPDX-License-Identifier: MIT
10+
11+(string_literal) @string
12+(int_literal) @number
13+(float_literal) @number
14+(char_literal) @number
15+(identifier) @variable
16+(at_attribute) @property
17+(htmlentity) @string.special
18+(escape_sequence) @string.escape
19+
20+[
21+ (lazy)
22+ (align)
23+ (extern)
24+ (static)
25+ (abstract)
26+ (final)
27+ (override)
28+ (synchronized)
29+ (auto)
30+ (scope)
31+ (gshared)
32+ (ref)
33+ (deprecated)
34+ (nothrow)
35+ (pure)
36+ (type_ctor)
37+] @keyword.storage
38+
39+(parameter_attribute (return) @keyword.storage)
40+(parameter_attribute (in) @keyword.storage)
41+(parameter_attribute (out) @keyword.storage)
42+
43+(function_declaration (identifier) @function)
44+
45+(call_expression (identifier) @function)
46+(call_expression (type (template_instance (identifier) @function)))
47+(template_arguments (identifier) @variable.parameter)
48+
49+(named_argument (identifier) @variable.parameter)
50+
51+[
52+ (abstract)
53+ (alias)
54+ (align)
55+ (asm)
56+ (assert)
57+ (auto)
58+ (cast)
59+ (class)
60+ (const)
61+ (debug)
62+ (delegate)
63+ (delete)
64+ (deprecated)
65+ (enum)
66+ (export)
67+ (extern)
68+ (final)
69+ (function)
70+ (immutable)
71+ (import)
72+ (in)
73+ (inout)
74+ (interface)
75+ (invariant)
76+ (is)
77+ (lazy)
78+ ; "macro" - obsolete
79+ (mixin)
80+ (module)
81+ (new)
82+ (nothrow)
83+ (out)
84+ (override)
85+ (package)
86+ (pragma)
87+ (private)
88+ (protected)
89+ (public)
90+ (pure)
91+ (ref)
92+ (scope)
93+ (shared)
94+ (static)
95+ (struct)
96+ (super)
97+ (synchronized)
98+ (template)
99+ (this)
100+ (throw)
101+ (typeid)
102+ (typeof)
103+ (union)
104+ (unittest)
105+ (version)
106+ (with)
107+ (gshared)
108+ (traits)
109+ (vector)
110+ (parameters_)
111+] @keyword
112+
113+[
114+ (break)
115+ (case)
116+ (catch)
117+ (continue)
118+ (do)
119+ (default)
120+ (finally)
121+ (else)
122+ (for)
123+ (foreach)
124+ (foreach_reverse)
125+ (goto)
126+ (if)
127+ (switch)
128+ (try)
129+ (return)
130+ (while)
131+] @keyword.control
132+
133+[
134+ (not_in)
135+ (not_is)
136+ "/="
137+ "/"
138+ ".."
139+ "..."
140+ "&"
141+ "&="
142+ "&&"
143+ "|"
144+ "|="
145+ "||"
146+ "-"
147+ "-="
148+ "--"
149+ "+"
150+ "+="
151+ "++"
152+ "<"
153+ "<="
154+ "<<"
155+ "<<="
156+ ">"
157+ ">="
158+ ">>="
159+ ">>>="
160+ ">>"
161+ ">>>"
162+ "!"
163+ "!="
164+ "?"
165+ "$"
166+ "="
167+ "=="
168+ "*"
169+ "*="
170+ "%"
171+ "%="
172+ "^"
173+ "^="
174+ "^^"
175+ "^^="
176+ "~"
177+ "~="
178+ "@"
179+ "=>"
180+] @operator
181+
182+[
183+ ";"
184+ "."
185+ ":"
186+ ","
187+] @punctuation.delimiter
188+
189+[
190+ "("
191+ ")"
192+ "["
193+ "["
194+ "{"
195+ "}"
196+] @punctuation.bracket
197+
198+[
199+ (null)
200+ (true)
201+ (false)
202+] @constant.language
203+
204+(special_keyword) @constant.language
205+
206+(directive) @keyword.directive
207+(shebang) @keyword.directive
208+
209+(comment) @comment
210+
211+[
212+ (void)
213+ (bool)
214+ (byte)
215+ (ubyte)
216+ (char)
217+ (short)
218+ (ushort)
219+ (wchar)
220+ (dchar)
221+ (int)
222+ (uint)
223+ (long)
224+ (ulong)
225+ (real)
226+ (double)
227+ (float)
228+ (size_t)
229+ (ptrdiff_t)
230+ (string)
231+ (cstring)
232+ (wstring)
233+ (noreturn)
234+] @type.builtin
235+
236+[
237+ (cent)
238+ (ucent)
239+ (ireal)
240+ (idouble)
241+ (ifloat)
242+ (creal)
243+ (double)
244+ (cfloat)
245+] @type.deprecated
246+
247+(label (identifier) @label)
248+(goto_statement (goto) @keyword.control (identifier) @label)
249+
250+; this covers other cases where the identifier can only
251+; be a type (such as in an is-expression on a constraint)
252+(type (identifier) @type)
253+
254+; these are listed last, because they override keyword queries
255+(identity_expression (in) @operator)
256+(identity_expression (is) @operator)
257+
258+; everything after __EOF_ is plain text
259+(end_file) @text
crates/fold-tui/queries/dafny.scmnew file+99
@@ -0,0 +1,99 @@
1+; Dafny syntax highlighting queries for tree-sitter
2+
3+; ── Comments ──────────────────────────────────────────────────
4+
5+(line_comment) @comment
6+(block_comment) @comment
7+
8+; ── Keywords ──────────────────────────────────────────────────
9+
10+[
11+ "module" "import" "export" "class" "trait" "datatype" "codatatype"
12+ "newtype" "type" "iterator" "method" "lemma" "constructor"
13+ "function" "predicate" "ghost" "static" "opaque" "twostate"
14+ "least" "greatest" "abstract" "extends" "refines" "provides"
15+ "reveals" "opened" "const" "var"
16+ "if" "then" "else" "while" "for" "match" "case"
17+ "return" "yield" "break" "continue" "label"
18+ "requires" "ensures" "modifies" "reads" "decreases"
19+ "invariant" "witness" "by"
20+ "assert" "assume" "expect" "reveal" "hide"
21+ "forall" "exists" "calc"
22+ "new" "as" "is" "in" "old" "fresh" "unchanged" "print"
23+ "to" "downto"
24+] @keyword
25+
26+; ── Operators ─────────────────────────────────────────────────
27+
28+(rel_op) @operator
29+
30+[
31+ ":=" ":|" ":-"
32+ "+" "-" "*" "/" "%"
33+ "!" "~"
34+ "==" "!="
35+ "!!" "!in"
36+ ".."
37+ "::"
38+ "=>"
39+ "->" "~>" "-->"
40+ "returns" "yields"
41+] @operator
42+
43+; ── Punctuation ───────────────────────────────────────────────
44+
45+["(" ")" "[" "]" "{" "}"] @punctuation.bracket
46+["," ";" ":" "."] @punctuation.delimiter
47+
48+; ── Types ─────────────────────────────────────────────────────
49+
50+[
51+ (int_type) (nat_type) (real_type) (bool_type) (char_type)
52+ (string_type) (object_type) (bitvector_type) (float_type)
53+ (ordinal_type)
54+] @type.builtin
55+
56+["set" "iset" "multiset" "seq" "map" "imap"] @type.builtin
57+
58+(array_type) @type.builtin
59+
60+(named_type (qualified_name (identifier) @type))
61+(type_parameter (identifier) @type)
62+
63+; ── Declaration names ─────────────────────────────────────────
64+
65+(method_decl name: (identifier) @function)
66+(function_decl name: (identifier) @function)
67+(constructor_decl name: (identifier) @function)
68+(iterator_decl name: (identifier) @function)
69+
70+(class_decl name: (identifier) @type)
71+(trait_decl name: (identifier) @type)
72+(datatype_decl name: (identifier) @type)
73+(newtype_decl name: (identifier) @type)
74+(synonym_type_decl name: (identifier) @type)
75+
76+(datatype_ctor name: (identifier) @constructor)
77+
78+; ── Variables ─────────────────────────────────────────────────
79+
80+(formal name: (identifier) @variable.parameter)
81+(local_var_decl name: (identifier) @variable)
82+(field_decl name: (identifier) @variable.member)
83+(constant_field_decl name: (identifier) @variable.member)
84+(quantifier_var (identifier) @variable.parameter)
85+(this_expression) @variable.builtin
86+
87+; ── Literals (after keywords so they take precedence) ─────────
88+
89+(integer_literal) @number
90+(real_literal) @number.float
91+(boolean_literal) @constant.builtin
92+(null_literal) @constant.builtin
93+(char_literal) @character
94+(string_literal) @string
95+
96+; ── Attributes ────────────────────────────────────────────────
97+
98+(attribute) @attribute
99+(attribute "}" @attribute)
crates/fold-tui/queries/dm.scmnew file+147
@@ -0,0 +1,147 @@
1+(comment) @comment
2+(identifier) @variable
3+((identifier) @constant
4+ (#match? @constant "^[A-Z][A-Z\\d_]*$"))
5+
6+(pair
7+ key: (expression (literal (identifier) @member)))
8+
9+"break" @keyword
10+"continue" @keyword
11+"else" @keyword
12+"for" @keyword
13+"if" @keyword
14+"goto" @keyword
15+"in" @keyword
16+"return" @keyword
17+"static" @keyword
18+"switch" @keyword
19+"while" @keyword
20+"do" @keyword
21+"set" @keyword
22+
23+"#define" @keyword
24+"#undef" @keyword
25+"#elif" @keyword
26+"#else" @keyword
27+"#endif" @keyword
28+"#if" @keyword
29+"#ifdef" @keyword
30+"#ifndef" @keyword
31+"#include" @keyword
32+"#warn" @keyword
33+"#error" @keyword
34+"spawn" @keyword
35+
36+"new" @keyword
37+
38+(preproc_message) @string
39+
40+(preproc_ifdef
41+ name: (identifier) @keyword)
42+
43+(preproc_def
44+ name: (identifier) @keyword)
45+
46+(preproc_undef
47+ name: (identifier) @keyword)
48+
49+(preproc_defproc
50+ name: (identifier) @keyword)
51+
52+(preproc_call_expression
53+ directive: (identifier) @function.special)
54+
55+(interpolation
56+ "[" @punctuation.special
57+ "]" @punctuation.special) @embedded
58+
59+[
60+ "="
61+ "-"
62+ "*"
63+ "/"
64+ "+"
65+ "%"
66+ "%%"
67+ "|"
68+ "&"
69+ "^"
70+ "<<"
71+ ">>"
72+ "<"
73+ "<="
74+ ">="
75+ ">"
76+ "=="
77+ "<>"
78+ "~="
79+ "~!"
80+ ":="
81+ "!="
82+ "!"
83+ "&&"
84+ "||"
85+ "-="
86+ "+="
87+ "*="
88+ "/="
89+ "%="
90+ "|="
91+ "&="
92+ "^="
93+ ">>="
94+ "<<="
95+ "--"
96+ "++"
97+ "&&="
98+ "||="
99+ "%%="
100+] @operator
101+
102+"?." @delimiter
103+"." @delimiter
104+
105+[
106+ (string_start)
107+ (string_content)
108+ (string_end)
109+] @string
110+
111+(file_literal) @string
112+(null) @keyword
113+(number_literal) @number
114+(builtin_const) @keyword
115+(builtin_macro) @keyword
116+
117+
118+(primitive_type
119+ (identifier) @type)
120+
121+(primitive_type) @type
122+(var_keyword) @keyword
123+(proc_keyword) @keyword
124+
125+(var_definition
126+ name: (identifier) @variable)
127+
128+(proc_definition
129+ name: (identifier) @function)
130+
131+(proc_override
132+ name: (identifier) @function)
133+
134+(proc_parameter
135+ name: (identifier) @variable)
136+
137+(call_expression
138+ name: (identifier) @function)
139+
140+(field_proc_expression
141+ proc: (identifier) @function)
142+
143+(field_expression
144+ field: (identifier) @property)
145+
146+(type_proc_override
147+ name: (identifier) @function)
crates/fold-tui/queries/fsharp-signature.scmnew file+298
@@ -0,0 +1,298 @@
1+;; Highlights for the fsharp_signature grammar (.fsi files).
2+;; Derived from queries/highlights.scm, restricted to nodes the signature
3+;; grammar actually produces (it narrows the expression layer and declares
4+;; its own supertypes, so `_type`/`_pattern`/expression nodes are absent).
5+
6+;; ----------------------------------------------------------------------------
7+;; Literals and comments
8+
9+;; `@spell` first: the colour capture, listed last, is the one that wins.
10+[
11+ (line_comment)
12+ (xml_doc)
13+ (block_comment)
14+] @spell @comment
15+
16+(xml_doc) @spell @comment.documentation
17+
18+(const
19+ [
20+ (_) @constant
21+ (unit) @constant.builtin
22+ ])
23+
24+(primary_constr_args (_) @variable.parameter)
25+
26+(class_as_reference
27+ (_) @variable.parameter.builtin)
28+
29+((argument_patterns (long_identifier (identifier) @character.special))
30+ (#match? @character.special "^_"))
31+
32+;; ----------------------------------------------------------------------------
33+;; Types
34+
35+(type_name type_name: (_) @type.definition)
36+(exception_definition exception_name: (_) @type.definition)
37+
38+[
39+ (atomic_type)
40+ (simple_type)
41+ (generic_type)
42+ (function_type)
43+ (compound_type)
44+ (postfix_type)
45+ (list_type)
46+ (static_type)
47+ (constrained_type)
48+ (flexible_type)
49+ (byref_type)
50+ (paren_type)
51+ (struct_type)
52+] @type
53+
54+(member_signature
55+ .
56+ (identifier) @function.member)
57+
58+(member_signature
59+ (curried_spec
60+ (arguments_spec
61+ "*"* @operator
62+ (argument_spec
63+ (argument_name_spec
64+ "?"? @character.special
65+ name: (_) @variable.parameter)))))
66+
67+(union_type_case (identifier) @constant)
68+
69+(wildcard_pattern) @character.special
70+
71+(identifier_pattern
72+ .
73+ (_) @constant
74+ .
75+ (_) @variable)
76+
77+(optional_pattern
78+ "?" @character.special)
79+
80+(fsi_directive_decl . (string) @module)
81+
82+(import_decl . (_) @module)
83+(named_module
84+ name: (_) @module)
85+(namespace
86+ name: (_) @module)
87+(module_defn
88+ .
89+ (_) @module)
90+
91+(record_fields
92+ (record_field
93+ .
94+ (identifier) @property))
95+
96+(value_declaration_left . (_) @variable)
97+
98+(function_declaration_left
99+ . (_) @function)
100+
101+(argument_patterns) @variable.parameter
102+(typed_pattern
103+ . (_) @variable.parameter)
104+
105+(member_defn
106+ (method_or_prop_defn
107+ (property_or_ident . (identifier) @function .)
108+ args: (_)* @variable.parameter))
109+
110+(member_defn
111+ (method_or_prop_defn
112+ (property_or_ident
113+ instance: (identifier) @variable.parameter.builtin
114+ method: (identifier) @function.method)
115+ args: (_)* @variable.parameter))
116+
117+[
118+ (xint)
119+ (int)
120+ (int16)
121+ (uint16)
122+ (int32)
123+ (uint32)
124+ (int64)
125+ (uint64)
126+ (nativeint)
127+ (unativeint)
128+] @number
129+
130+[
131+ (ieee32)
132+ (ieee64)
133+ (float)
134+ (decimal)
135+] @number.float
136+
137+(bool) @boolean
138+
139+([
140+ (string)
141+ (triple_quoted_string)
142+ (verbatim_string)
143+ (char)
144+ (format_string)
145+ (format_triple_quoted_string)
146+] @spell @string)
147+
148+(compiler_directive_decl) @keyword.directive
149+
150+(preproc_line
151+ "#line" @keyword.directive)
152+
153+(attribute
154+ target: (identifier)? @keyword
155+ (simple_type) @attribute)
156+
157+[
158+ "("
159+ ")"
160+ "{"
161+ "}"
162+ "["
163+ "]"
164+ "[|"
165+ "|]"
166+ "{|"
167+ "|}"
168+] @punctuation.bracket
169+
170+[
171+ "[<"
172+ ">]"
173+] @punctuation.special
174+
175+[
176+ ","
177+ ":"
178+ "."
179+] @punctuation.delimiter
180+
181+[
182+ "|"
183+ "="
184+ "->"
185+ "*"
186+ (op_identifier)
187+] @operator
188+
189+(generic_type
190+ [
191+ "<"
192+ ">"
193+ ] @punctuation.bracket)
194+
195+[
196+ "when"
197+ "then"
198+] @keyword.conditional
199+
200+[
201+ "and"
202+ "or"
203+ "not"
204+] @keyword.operator
205+
206+[
207+ "open"
208+ "#r"
209+ "#load"
210+] @keyword.import
211+
212+[
213+ "abstract"
214+ "delegate"
215+ "extern"
216+ "static"
217+ "inline"
218+ "mutable"
219+ "override"
220+ "rec"
221+ "global"
222+ (access_modifier)
223+] @keyword.modifier
224+
225+[
226+ "let"
227+ "member"
228+] @keyword.function
229+
230+[
231+ "enum"
232+ "type"
233+ "exception"
234+ "inherit"
235+ "interface"
236+ "and"
237+ "class"
238+ "struct"
239+] @keyword.type
240+
241+[
242+ "as"
243+ "begin"
244+ "end"
245+ "default"
246+ "do"
247+ "get"
248+ "set"
249+ "new"
250+ "of"
251+ "struct"
252+ "val"
253+ "module"
254+ "namespace"
255+ "with"
256+] @keyword
257+
258+[
259+ "null"
260+] @constant.builtin
261+
262+
263+(preproc_if
264+ [
265+ "#if" @keyword.directive
266+ "#endif" @keyword.directive
267+ ]
268+ condition: (_)? @keyword.directive)
269+
270+(preproc_else
271+ "#else" @keyword.directive)
272+
273+(preproc_inactive) @comment
274+
275+((long_identifier
276+ (identifier)+ @variable.member
277+ .
278+ (identifier)))
279+
280+;; Every segment of a module path (`namespace Company.Product`,
281+;; `open System.IO`), a type path or an attribute path is part of that name,
282+;; not a member access; re-capture the segments the rule above marked as
283+;; members (the last capture of a node wins). @type.builtin follows so it
284+;; still wins over the plain @type.
285+(namespace name: (long_identifier (identifier) @module))
286+(named_module name: (long_identifier (identifier) @module))
287+(import_decl (long_identifier (identifier) @module))
288+(module_abbrev (long_identifier (identifier) @module))
289+(simple_type (long_identifier (identifier) @type))
290+(attribute (simple_type (long_identifier (identifier) @attribute)))
291+
292+((simple_type
293+ (long_identifier
294+ (identifier) @type.builtin))
295+ (#any-of? @type.builtin "bool" "byte" "sbyte" "int16" "uint16" "int" "uint" "int64" "uint64" "nativeint" "unativeint" "decimal" "float" "double" "float32" "single" "char" "string" "unit"))
296+
297+((identifier) @module.builtin
298+ (#any-of? @module.builtin "Array" "Async" "Directory" "File" "List" "Option" "Path" "Map" "Set" "Lazy" "Seq" "Task" "String" "Result" ))
crates/fold-tui/queries/gomod.scmnew file+20
@@ -0,0 +1,20 @@
1+[
2+ "require"
3+ "replace"
4+ "go"
5+ "toolchain"
6+ "exclude"
7+ "retract"
8+ "module"
9+ "ignore"
10+ "godebug"
11+] @keyword
12+
13+"=>" @operator
14+
15+(comment) @comment
16+
17+[
18+(version)
19+(go_version)
20+] @string
crates/fold-tui/queries/gwbasic.scmnew file+12
@@ -0,0 +1,12 @@
1+(line_number) @constant.numeric
2+(integer_literal) @constant.numeric
3+(float_literal) @constant.numeric
4+(hex_literal) @constant.numeric
5+(octal_literal) @constant.numeric
6+(string_literal) @string
7+(comment) @comment
8+(apostrophe_comment) @comment
9+(identifier) @variable
10+(type_sigil) @punctuation.special
11+(builtin_function) @function.builtin
12+(user_function) @function
crates/fold-tui/queries/ink.scmnew file+30
@@ -0,0 +1,30 @@
1+((identifier) @variable.builtin (#any-of? @variable.builtin "END" "DONE") ) @variable.builtin
2+((identifier) @constant.builtin (#any-of? @constant.builtin "true" "false") ) @constant.builtin.boolean
3+
4+(gather label: _ @label)
5+(choice label: _ @label)
6+
7+(blockComment) @comment
8+(choiceBullets) @keyword.control
9+(functionCall) @function
10+(gatherBullets) @keyword.control
11+(identifier) @identifier
12+(includePath) @string
13+(knotHeader (identifier)) @namespace
14+(knotHeader) @namespace
15+(lineComment) @comment
16+(number) @constant.numeric
17+(stitchHeader (identifier)) @namespace
18+(stitchHeader) @namespace
19+(string) @string
20+(tag) @tag
21+(todoComment) @info
22+
23+["(" ")" "{" "}"] @punctuation
24+["->" "->" "<-" "else"] @keyword.control
25+["~"] @keyword.operator
26+["?" ">" "<" ">=" "<=" "==" "!=" "-" "+" "*" "/" "and" "&&" "or" "||" "!" "not" "=" "+=" "-=" "++" "--"] @operator
27+["CONST" "VAR" "temp" "LIST"] @keyword.storage
28+["EXTERNAL" "function"] @keyword.function
29+["INCLUDE"] @keyword.include
30+["return"] @keyword.control.return
crates/fold-tui/queries/integerbasic.scmnew file+117
@@ -0,0 +1,117 @@
1+(linenum) @tag
2+(op_error) @operator
3+(statement (statement_gosub) (integer) @tag)
4+(statement (statement_goto) (integer) @tag)
5+(comment_text) @comment
6+(string) @string
7+(integer) @number
8+(str_name) @variable
9+(int_name) @variable
10+(sep_statement) @punctuation.delimiter
11+(com_load) @keyword.builtin
12+(com_save) @keyword.builtin
13+(com_con) @keyword.builtin
14+(com_run_line) @keyword.builtin
15+(com_run) @keyword.builtin
16+(com_del) @keyword.builtin
17+(sep_del) @punctuation.delimiter
18+(com_new) @keyword.builtin
19+(com_clr) @keyword.builtin
20+(com_auto) @keyword.builtin
21+(sep_auto) @punctuation.delimiter
22+(com_man) @keyword.builtin
23+(com_himem) @keyword.builtin
24+(com_lomem) @keyword.builtin
25+(op_plus) @operator
26+(op_minus) @operator
27+(op_times) @operator
28+(op_div) @operator
29+(op_aeq) @operator
30+(op_aneq) @operator
31+(op_gtreq) @operator
32+(op_gtr) @operator
33+(op_lesseq) @operator
34+(op_neq) @operator
35+(op_less) @operator
36+(op_and) @operator
37+(op_or) @operator
38+(op_mod) @operator
39+(op_pow) @operator
40+(sep_slice) @punctuation.delimiter
41+(statement_then_line) @keyword.builtin
42+(statement_then) @keyword.builtin
43+(sep_input_str) @punctuation.delimiter
44+(sep_input_int) @punctuation.delimiter
45+(fcall_peek) @function.builtin
46+(fcall_rnd) @function.builtin
47+(fcall_sgn) @function.builtin
48+(fcall_abs) @function.builtin
49+(fcall_pdl) @function.builtin
50+(op_unary_plus) @operator
51+(op_unary_minus) @operator
52+(op_not) @operator
53+(op_seq) @operator
54+(op_sneq) @operator
55+(fcall_lenp) @function.builtin
56+(fcall_ascp) @function.builtin
57+(fcall_scrnp) @function.builtin
58+(sep_scrn) @punctuation.delimiter
59+(sep_dim_str) @punctuation.delimiter
60+(sep_dim_int) @punctuation.delimiter
61+(sep_print_str) @punctuation.delimiter
62+(sep_print_int) @punctuation.delimiter
63+(sep_print_null) @punctuation.delimiter
64+(sep_tab_str) @punctuation.delimiter
65+(sep_tab_int) @punctuation.delimiter
66+(sep_tab_null) @punctuation.delimiter
67+(statement_text) @keyword.builtin
68+(statement_gr) @keyword.builtin
69+(statement_call) @keyword.builtin
70+(statement_dim_str) @keyword.builtin
71+(statement_dim_int) @keyword.builtin
72+(statement_tab) @keyword.builtin
73+(statement_end) @keyword.builtin
74+(statement_input_str) @keyword.builtin
75+(statement_input_prompt) @keyword.builtin
76+(statement_input_int) @keyword.builtin
77+(statement_for) @keyword.builtin
78+(op_eq_for) @operator
79+(op_to) @operator
80+(op_step) @operator
81+(statement_next) @keyword.builtin
82+(sep_next) @punctuation.delimiter
83+(statement_return) @keyword.builtin
84+(statement_gosub) @keyword.builtin
85+(statement_rem) @keyword.builtin
86+(statement_let) @keyword.builtin
87+(statement_goto) @keyword.builtin
88+(statement_if) @keyword.builtin
89+(statement_print_str) @keyword.builtin
90+(statement_print_int) @keyword.builtin
91+(statement_print_null) @keyword.builtin
92+(statement_poke) @keyword.builtin
93+(sep_poke) @punctuation.delimiter
94+(statement_coloreq) @keyword.builtin
95+(statement_plot) @keyword.builtin
96+(sep_plot) @punctuation.delimiter
97+(statement_hlin) @keyword.builtin
98+(sep_hlin) @punctuation.delimiter
99+(op_hlin_at) @operator
100+(statement_vlin) @keyword.builtin
101+(sep_vlin) @punctuation.delimiter
102+(op_vlin_at) @operator
103+(statement_vtab) @keyword.builtin
104+(op_eq_assign_str) @operator
105+(op_eq_assign_int) @operator
106+(statement_list_line) @keyword.builtin
107+(sep_list) @punctuation.delimiter
108+(statement_list) @keyword.builtin
109+(statement_pop) @keyword.builtin
110+(statement_nodsp_str) @keyword.builtin
111+(statement_nodsp_int) @keyword.builtin
112+(statement_notrace) @keyword.builtin
113+(statement_dsp_str) @keyword.builtin
114+(statement_dsp_int) @keyword.builtin
115+(statement_trace) @keyword.builtin
116+(statement_prn) @keyword.builtin
117+(statement_inn) @keyword.builtin
crates/fold-tui/queries/julia.scmnew file+325
@@ -0,0 +1,325 @@
1+; Identifiers
2+(identifier) @variable
3+
4+(field_expression
5+ (identifier) @variable.member .)
6+
7+; Symbols
8+(quote_expression
9+ ":" @string.special.symbol
10+ [
11+ (identifier)
12+ (operator)
13+ ] @string.special.symbol)
14+
15+; Function calls
16+(call_expression
17+ (identifier) @function.call)
18+
19+(call_expression
20+ (field_expression
21+ (identifier) @function.call .))
22+
23+(broadcast_call_expression
24+ (identifier) @function.call)
25+
26+(broadcast_call_expression
27+ (field_expression
28+ (identifier) @function.call .))
29+
30+; Macros
31+(macro_identifier) @function.macro
32+
33+(macro_definition
34+ (signature
35+ (call_expression
36+ .
37+ (identifier) @function.macro)))
38+
39+; Built-in functions
40+; filter(name -> Base.eval(Core, name) isa Core.Builtin, names(Core))
41+((identifier) @function.builtin
42+ (#any-of? @function.builtin
43+ "applicable" "fieldtype" "getfield" "getglobal" "invoke" "isa" "isdefined" "modifyfield!"
44+ "modifyglobal!" "nfields" "replacefield!" "replaceglobal!" "setfield!" "setfieldonce!"
45+ "setglobal!" "setglobalonce!" "swapfield!" "swapglobal!" "throw" "tuple" "typeassert" "typeof"))
46+
47+; Type definitions
48+(type_head (_) @type.definition)
49+
50+; Type annotations
51+(parametrized_type_expression
52+ [
53+ (identifier) @type
54+ (field_expression
55+ (identifier) @type .)
56+ ]
57+ (curly_expression
58+ (_) @type))
59+
60+(typed_expression
61+ (identifier) @type .)
62+
63+(unary_typed_expression
64+ (identifier) @type .)
65+
66+(where_expression
67+ (_) @type .)
68+
69+(binary_expression
70+ (_) @type
71+ (operator) @operator
72+ (_) @type
73+ (#any-of? @operator "<:" ">:"))
74+
75+; Built-in types
76+; filter(name -> typeof(Base.eval(Core, name)) in [DataType, UnionAll], names(Core))
77+((identifier) @type.builtin
78+ (#any-of? @type.builtin
79+ "AbstractArray" "AbstractChar" "AbstractFloat" "AbstractString" "Any" "ArgumentError" "Array"
80+ "AssertionError" "Bool" "BoundsError" "Char" "ConcurrencyViolationError" "Cvoid" "DataType"
81+ "DenseArray" "DivideError" "DomainError" "ErrorException" "Exception" "Expr" "Float16" "Float32"
82+ "Float64" "Function" "GlobalRef" "IO" "InexactError" "InitError" "Int" "Int128" "Int16" "Int32"
83+ "Int64" "Int8" "Integer" "InterruptException" "LineNumberNode" "LoadError" "Method"
84+ "MethodError" "Module" "NTuple" "NamedTuple" "Nothing" "Number" "OutOfMemoryError"
85+ "OverflowError" "Pair" "Ptr" "QuoteNode" "ReadOnlyMemoryError" "Real" "Ref" "SegmentationFault"
86+ "Signed" "StackOverflowError" "String" "Symbol" "Task" "Tuple" "Type" "TypeError" "TypeVar"
87+ "UInt" "UInt128" "UInt16" "UInt32" "UInt64" "UInt8" "UndefInitializer" "UndefKeywordError"
88+ "UndefRefError" "UndefVarError" "Union" "UnionAll" "Unsigned" "VecElement" "WeakRef"))
89+
90+; Keywords
91+[
92+ "const"
93+ "global"
94+ "local"
95+] @keyword
96+
97+(compound_statement
98+ [
99+ "begin"
100+ "end"
101+ ] @keyword)
102+
103+(quote_statement
104+ [
105+ "quote"
106+ "end"
107+ ] @keyword)
108+
109+(let_statement
110+ [
111+ "let"
112+ "end"
113+ ] @keyword)
114+
115+(if_statement
116+ [
117+ "if"
118+ "end"
119+ ] @keyword.conditional)
120+
121+(elseif_clause
122+ "elseif" @keyword.conditional)
123+
124+(else_clause
125+ "else" @keyword.conditional)
126+
127+(ternary_expression
128+ [
129+ "?"
130+ ":"
131+ ] @keyword.conditional.ternary)
132+
133+(try_statement
134+ [
135+ "try"
136+ "end"
137+ ] @keyword.exception)
138+
139+(catch_clause
140+ "catch" @keyword.exception)
141+
142+(finally_clause
143+ "finally" @keyword.exception)
144+
145+(for_statement
146+ [
147+ "for"
148+ "end"
149+ ] @keyword.repeat)
150+
151+(for_binding
152+ "outer" @keyword.repeat)
153+
154+; comprehensions
155+(for_clause
156+ "for" @keyword.repeat)
157+
158+(if_clause
159+ "if" @keyword.conditional)
160+
161+(while_statement
162+ [
163+ "while"
164+ "end"
165+ ] @keyword.repeat)
166+
167+[
168+ (break_statement)
169+ (continue_statement)
170+] @keyword.repeat
171+
172+(function_definition
173+ [
174+ "function"
175+ "end"
176+ ] @keyword.function)
177+
178+(do_clause
179+ [
180+ "do"
181+ "end"
182+ ] @keyword.function)
183+
184+(macro_definition
185+ [
186+ "macro"
187+ "end"
188+ ] @keyword)
189+
190+(return_statement
191+ "return" @keyword.return)
192+
193+(module_definition
194+ [
195+ "module"
196+ "baremodule"
197+ "end"
198+ ] @keyword.import)
199+
200+(export_statement
201+ "export" @keyword.import)
202+
203+(public_statement
204+ "public" @keyword.import)
205+
206+(import_statement
207+ "import" @keyword.import)
208+
209+(using_statement
210+ "using" @keyword.import)
211+
212+(import_alias
213+ "as" @keyword.import)
214+
215+(selected_import
216+ ":" @punctuation.delimiter)
217+
218+(struct_definition
219+ [
220+ "mutable"
221+ "struct"
222+ "end"
223+ ] @keyword.type)
224+
225+(abstract_definition
226+ [
227+ "abstract"
228+ "type"
229+ "end"
230+ ] @keyword.type)
231+
232+(primitive_definition
233+ [
234+ "primitive"
235+ "type"
236+ "end"
237+ ] @keyword.type)
238+
239+; Operators & Punctuation
240+(operator) @operator
241+
242+(adjoint_expression
243+ "'" @operator)
244+
245+(range_expression
246+ ":" @operator)
247+
248+(arrow_function_expression
249+ "->" @operator)
250+
251+[
252+ "."
253+ "..."
254+ "::"
255+] @punctuation.special
256+
257+[
258+ ","
259+ ";"
260+] @punctuation.delimiter
261+
262+[
263+ "("
264+ ")"
265+ "["
266+ "]"
267+ "{"
268+ "}"
269+] @punctuation.bracket
270+
271+; Keyword operators
272+((operator) @keyword.operator
273+ (#any-of? @keyword.operator "in" "isa"))
274+
275+(where_expression
276+ "where" @keyword.operator)
277+
278+; Built-in constants
279+((identifier) @constant.builtin
280+ (#any-of? @constant.builtin "nothing" "missing"))
281+
282+((identifier) @variable.builtin
283+ (#any-of? @variable.builtin "begin" "end")
284+ (#has-ancestor? @variable.builtin index_expression))
285+
286+; Literals
287+(boolean_literal) @boolean
288+
289+(integer_literal) @number
290+
291+(float_literal) @number.float
292+
293+((identifier) @number.float
294+ (#any-of? @number.float "NaN" "NaN16" "NaN32" "Inf" "Inf16" "Inf32"))
295+
296+(character_literal) @character
297+
298+(escape_sequence) @string.escape
299+
300+(string_literal) @string
301+
302+(prefixed_string_literal
303+ prefix: (identifier) @function.macro) @string
304+
305+(command_literal) @string.special
306+
307+(prefixed_command_literal
308+ prefix: (identifier) @function.macro) @string.special
309+
310+((string_literal) @string.documentation
311+ .
312+ [
313+ (abstract_definition)
314+ (assignment)
315+ (const_statement)
316+ (function_definition)
317+ (macro_definition)
318+ (module_definition)
319+ (struct_definition)
320+ ])
321+
322+[
323+ (line_comment)
324+ (block_comment)
325+] @comment
crates/fold-tui/queries/matlab.scmnew file+157
@@ -0,0 +1,157 @@
1+; Includes
2+
3+((command_name) @include
4+ (#eq? @include "import"))
5+
6+; Keywords
7+
8+[
9+ "arguments"
10+ "classdef"
11+ "end"
12+ "enumeration"
13+ "events"
14+ "global"
15+ "methods"
16+ "persistent"
17+ "properties"
18+] @keyword
19+
20+; Conditionals
21+
22+(if_statement [ "if" "end" ] @conditional)
23+(elseif_clause "elseif" @conditional)
24+(else_clause "else" @conditional)
25+(switch_statement [ "switch" "end" ] @conditional)
26+(case_clause "case" @conditional)
27+(otherwise_clause "otherwise" @conditional)
28+(break_statement) @conditional
29+
30+; Repeats
31+
32+(for_statement [ "for" "parfor" "end" ] @repeat)
33+(while_statement [ "while" "end" ] @repeat)
34+(continue_statement) @repeat
35+
36+; Exceptions
37+
38+(try_statement [ "try" "end" ] @exception)
39+(catch_clause "catch" @exception)
40+
41+; Variables
42+
43+(identifier) @variable
44+
45+; Constants
46+
47+(events (identifier) @constant)
48+(attribute (identifier) @constant)
49+
50+"~" @constant.builtin
51+
52+; Fields/Properties
53+
54+(field_expression field: (identifier) @field)
55+
56+(superclass "." (identifier) @property)
57+
58+(property_name "." (identifier) @property)
59+
60+(property name: (identifier) @property)
61+
62+; Types
63+
64+(class_definition name: (identifier) @type)
65+
66+(attributes (identifier) @constant)
67+
68+(enum . (identifier) @type)
69+
70+((identifier) @type
71+ (#lua-match? @type "^_*[A-Z][a-zA-Z0-9_]+$"))
72+
73+; Functions
74+
75+(function_definition
76+ "function" @keyword.function
77+ name: (identifier) @function
78+ [ "end" "endfunction" ]? @keyword.function)
79+
80+(function_signature name: (identifier) @function)
81+
82+(function_call
83+ name: (identifier) @function.call)
84+
85+(handle_operator (identifier) @function)
86+
87+(validation_functions (identifier) @function)
88+
89+(command (command_name) @function.call)
90+(command_argument) @parameter
91+
92+(return_statement) @keyword.return
93+
94+; Parameters
95+
96+(function_arguments (identifier) @parameter)
97+
98+; Punctuation
99+
100+[ ";" "," "." ] @punctuation.delimiter
101+
102+[ "(" ")" "[" "]" "{" "}" ] @punctuation.bracket
103+
104+; Operators
105+
106+[
107+ "+"
108+ ".+"
109+ "-"
110+ ".*"
111+ "*"
112+ ".*"
113+ "/"
114+ "./"
115+ "\\"
116+ ".\\"
117+ "^"
118+ ".^"
119+ "'"
120+ ".'"
121+ "|"
122+ "&"
123+ "?"
124+ "@"
125+ "<"
126+ "<="
127+ ">"
128+ ">="
129+ "=="
130+ "~="
131+ "="
132+ "&&"
133+ "||"
134+ ":"
135+] @operator
136+
137+; Literals
138+
139+(string) @string
140+
141+(escape_sequence) @string.escape
142+(formatting_sequence) @string.special
143+
144+(number) @number
145+
146+((identifier) @boolean
147+ (#eq? @boolean "true"))
148+((identifier) @boolean
149+ (#eq? @boolean "false"))
150+
151+; Comments
152+
153+[ (comment) (line_continuation) ] @comment @spell
154+
155+; Errors
156+
157+(ERROR) @error
crates/fold-tui/queries/merlin6502.scmnew file+184
@@ -0,0 +1,184 @@
1+(macro_def) @function
2+(macro_ref) @function
3+(label_def (global_label)) @type
4+(label_ref (global_label)) @type
5+(current_addr) @type
6+(local_label) @variable.parameter
7+(var_label) @variable.builtin
8+(var_mac) @variable.builtin
9+(var_cnt) @variable.builtin
10+(num) @number
11+(hex_data) @number
12+(dstring) @string
13+(arg_literal) @string
14+(pchar) @string
15+(nchar) @string
16+(literal) @string
17+(filename) @string
18+(trailing) @string
19+(heading) @comment
20+(comment) @comment
21+(eop_plus) @operator
22+(eop_minus) @operator
23+(eop_times) @operator
24+(eop_div) @operator
25+(eop_or) @operator
26+(eop_and) @operator
27+(eop_xor) @operator
28+(mode) @keyword
29+(imm_prefix) @keyword
30+(addr_prefix) @keyword
31+(data_prefix) @keyword
32+(num_str_prefix) @keyword
33+(ERROR) @error
34+(op_adc) @keyword
35+(op_and) @keyword
36+(op_asl) @keyword
37+(op_bcc) @keyword
38+(op_bcs) @keyword
39+(op_beq) @keyword
40+(op_bit) @keyword
41+(op_bmi) @keyword
42+(op_bne) @keyword
43+(op_bpl) @keyword
44+(op_bra) @keyword
45+(op_brk) @keyword
46+(op_brl) @keyword
47+(op_bvc) @keyword
48+(op_bvs) @keyword
49+(op_clc) @keyword
50+(op_cld) @keyword
51+(op_cli) @keyword
52+(op_clv) @keyword
53+(op_cmp) @keyword
54+(op_cop) @keyword
55+(op_cpx) @keyword
56+(op_cpy) @keyword
57+(op_dec) @keyword
58+(op_dex) @keyword
59+(op_dey) @keyword
60+(op_eor) @keyword
61+(op_inc) @keyword
62+(op_inx) @keyword
63+(op_iny) @keyword
64+(op_jml) @keyword
65+(op_jmp) @keyword
66+(op_jsl) @keyword
67+(op_jsr) @keyword
68+(op_lda) @keyword
69+(op_ldx) @keyword
70+(op_ldy) @keyword
71+(op_lsr) @keyword
72+(op_mvn) @keyword
73+(op_mvp) @keyword
74+(op_nop) @keyword
75+(op_ora) @keyword
76+(op_pea) @keyword
77+(op_pei) @keyword
78+(op_per) @keyword
79+(op_pha) @keyword
80+(op_phb) @keyword
81+(op_phd) @keyword
82+(op_phk) @keyword
83+(op_php) @keyword
84+(op_phx) @keyword
85+(op_phy) @keyword
86+(op_pla) @keyword
87+(op_plb) @keyword
88+(op_pld) @keyword
89+(op_plp) @keyword
90+(op_plx) @keyword
91+(op_ply) @keyword
92+(op_rep) @keyword
93+(op_rol) @keyword
94+(op_ror) @keyword
95+(op_rti) @keyword
96+(op_rtl) @keyword
97+(op_rts) @keyword
98+(op_sbc) @keyword
99+(op_sec) @keyword
100+(op_sed) @keyword
101+(op_sei) @keyword
102+(op_sep) @keyword
103+(op_sta) @keyword
104+(op_stp) @keyword
105+(op_stx) @keyword
106+(op_sty) @keyword
107+(op_stz) @keyword
108+(op_tax) @keyword
109+(op_tay) @keyword
110+(op_tcd) @keyword
111+(op_tcs) @keyword
112+(op_tdc) @keyword
113+(op_trb) @keyword
114+(op_tsb) @keyword
115+(op_tsc) @keyword
116+(op_tsx) @keyword
117+(op_txa) @keyword
118+(op_txs) @keyword
119+(op_txy) @keyword
120+(op_tya) @keyword
121+(op_tyx) @keyword
122+(op_wai) @keyword
123+(op_wdm) @keyword
124+(op_xba) @keyword
125+(op_xce) @keyword
126+(psop_end_lup) @function.builtin
127+(psop_adr) @function.builtin
128+(psop_adrl) @function.builtin
129+(psop_asc) @function.builtin
130+(psop_ast) @function.builtin
131+(psop_cas) @function.builtin
132+(psop_chk) @function.builtin
133+(psop_cyc) @function.builtin
134+(psop_da) @function.builtin
135+(psop_dat) @function.builtin
136+(psop_dci) @function.builtin
137+(psop_ddb) @function.builtin
138+(psop_dend) @function.builtin
139+(psop_dfb) @function.builtin
140+(psop_do) @function.builtin
141+(psop_ds) @function.builtin
142+(psop_dsk) @function.builtin
143+(psop_dum) @function.builtin
144+(psop_else) @function.builtin
145+(psop_end) @function.builtin
146+(psop_ent) @function.builtin
147+(psop_eom) @function.builtin
148+(psop_equ) @function.builtin
149+(psop_err) @function.builtin
150+(psop_exd) @function.builtin
151+(psop_exp) @function.builtin
152+(psop_ext) @function.builtin
153+(psop_fin) @function.builtin
154+(psop_flo) @function.builtin
155+(psop_fls) @function.builtin
156+(psop_hex) @function.builtin
157+(psop_if) @function.builtin
158+(psop_inv) @function.builtin
159+(psop_kbd) @function.builtin
160+(psop_lst) @function.builtin
161+(psop_lstdo) @function.builtin
162+(psop_lup) @function.builtin
163+(psop_mac) @function.builtin
164+(psop_mx) @function.builtin
165+(psop_obj) @function.builtin
166+(psop_org) @function.builtin
167+(psop_pag) @function.builtin
168+(psop_pau) @function.builtin
169+(psop_pmc) @function.builtin
170+(psop_put) @function.builtin
171+(psop_rel) @function.builtin
172+(psop_rev) @function.builtin
173+(psop_sav) @function.builtin
174+(psop_skp) @function.builtin
175+(psop_str) @function.builtin
176+(psop_strl) @function.builtin
177+(psop_sw) @function.builtin
178+(psop_tr) @function.builtin
179+(psop_ttl) @function.builtin
180+(psop_typ) @function.builtin
181+(psop_use) @function.builtin
182+(psop_usr) @function.builtin
183+(psop_var) @function.builtin
184+(psop_xc) @function.builtin
crates/fold-tui/queries/msbasic2.scmnew file+11
@@ -0,0 +1,11 @@
1+(line_number) @constant.numeric
2+(integer_literal) @constant.numeric
3+(float_literal) @constant.numeric
4+(hex_literal) @constant.numeric
5+(octal_literal) @constant.numeric
6+(string_literal) @string
7+(comment) @comment
8+(identifier) @variable
9+(type_sigil) @punctuation.special
10+(builtin_function) @function.builtin
11+(user_function) @function
crates/fold-tui/queries/newick.scmnew file+8
@@ -0,0 +1,8 @@
1+"(" @punctuation.bracket
2+")" @punctuation.bracket
3+"[&&NHX" @punctuation.bracket
4+"]" @punctuation.bracket
5+
6+(name) @function
7+(length) @number
8+(nhx_entry key: (nhx_val) @keyword value: (nhx_val) @string.special)
crates/fold-tui/queries/nginx.scmnew file+59
@@ -0,0 +1,59 @@
1+(comment) @comment @spell
2+
3+(value) @variable
4+
5+(attribute (keyword) @attribute)
6+
7+[
8+ (location_modifier)
9+ "="
10+] @operator
11+
12+[
13+ (keyword)
14+ "location"
15+] @keyword
16+
17+[
18+ "if"
19+ "map"
20+] @keyword.conditional
21+
22+(directive (keyword) @constant)
23+
24+(boolean) @boolean
25+
26+[
27+ (auto)
28+ (constant)
29+ (level)
30+ (connection_method)
31+ (var)
32+ condition: (condition)
33+] @variable.builtin
34+
35+[
36+ (string_literal)
37+ (quoted_string_literal)
38+ (file)
39+ (mask)
40+] @string
41+
42+(directive (variable) @variable.parameter)
43+
44+(directive (variable (keyword) @variable.parameter))
45+
46+(location_route) @string.special
47+";" @punctuation.delimiter
48+
49+[
50+ (numeric_literal)
51+ (time)
52+ (size)
53+ (cpumask)
54+] @number
55+
56+[
57+ "{"
58+ "}"
59+] @punctuation.bracket
crates/fold-tui/queries/pascal.scmnew file+345
@@ -0,0 +1,345 @@
1+; -- Keywords
2+[
3+ (kProgram)
4+ (kLibrary)
5+ (kUnit)
6+ (kUses)
7+
8+ (kBegin)
9+ (kEnd)
10+ (kAsm)
11+
12+ (kVar)
13+ (kThreadvar)
14+ (kConst)
15+ (kResourcestring)
16+ (kConstref)
17+ (kOut)
18+ (kType)
19+ (kLabel)
20+ (kExports)
21+
22+ (kAbsolute)
23+
24+ (kProperty)
25+ (kRead)
26+ (kWrite)
27+ (kImplements)
28+ (kDefault)
29+ (kNodefault)
30+ (kStored)
31+ (kIndex)
32+ (kDispId)
33+
34+ (kClass)
35+ (kInterface)
36+ (kDispInterface)
37+ (kObject)
38+ (kRecord)
39+ (kObjcclass)
40+ (kObjccategory)
41+ (kObjcprotocol)
42+ (kArray)
43+ (kFile)
44+ (kString)
45+ (kSet)
46+ (kOf)
47+ (kHelper)
48+ (kPacked)
49+
50+ (kGeneric)
51+ (kSpecialize)
52+
53+ (kFunction)
54+ (kProcedure)
55+ (kConstructor)
56+ (kDestructor)
57+ (kOperator)
58+ (kReference)
59+
60+ (kInterface)
61+ (kImplementation)
62+ (kInitialization)
63+ (kFinalization)
64+
65+ (kPublished)
66+ (kPublic)
67+ (kProtected)
68+ (kPrivate)
69+ (kStrict)
70+ (kRequired)
71+ (kOptional)
72+
73+ (kForward)
74+
75+ (kStatic)
76+ (kVirtual)
77+ (kAbstract)
78+ (kSealed)
79+ (kDynamic)
80+ (kOverride)
81+ (kOverload)
82+ (kReintroduce)
83+ (kInherited)
84+ (kInline)
85+
86+ (kStdcall)
87+ (kCdecl)
88+ (kCppdecl)
89+ (kPascal)
90+ (kRegister)
91+ (kMwpascal)
92+ (kExternal)
93+ (kName)
94+ (kMessage)
95+ (kDeprecated)
96+ (kExperimental)
97+ (kPlatform)
98+ (kUnimplemented)
99+ (kCvar)
100+ (kExport)
101+ (kFar)
102+ (kNear)
103+ (kSafecall)
104+ (kAssembler)
105+ (kNostackframe)
106+ (kInterrupt)
107+ (kNoreturn)
108+ (kIocheck)
109+ (kLocal)
110+ (kHardfloat)
111+ (kSoftfloat)
112+ (kMs_abi_default)
113+ (kMs_abi_cdecl)
114+ (kSaveregisters)
115+ (kSysv_abi_default)
116+ (kSysv_abi_cdecl)
117+ (kVectorcall)
118+ (kVarargs)
119+ (kWinapi)
120+ (kAlias)
121+ (kDelayed)
122+
123+ (kFor)
124+ (kTo)
125+ (kDownto)
126+ (kIf)
127+ (kThen)
128+ (kElse)
129+ (kDo)
130+ (kWhile)
131+ (kRepeat)
132+ (kUntil)
133+ (kTry)
134+ (kExcept)
135+ (kFinally)
136+ (kRaise)
137+ (kOn)
138+ (kCase)
139+ (kWith)
140+ (kGoto)
141+] @keyword
142+
143+; -- Punctuation & operators
144+
145+[
146+ "("
147+ ")"
148+ "["
149+ "]"
150+] @punctuation.bracket
151+
152+[
153+ ";"
154+ ","
155+ ":"
156+ ".."
157+ (kEndDot)
158+] @punctuation.delimiter
159+
160+[
161+ (kDot)
162+ (kAdd)
163+ (kSub)
164+ (kMul)
165+ (kFdiv)
166+ (kAssign)
167+ (kAssignAdd)
168+ (kAssignSub)
169+ (kAssignMul)
170+ (kAssignDiv)
171+ (kEq)
172+ (kLt)
173+ (kLte)
174+ (kGt)
175+ (kGte)
176+ (kNeq)
177+ (kAt)
178+ (kHat)
179+] @operator
180+
181+; technically operators, but better to render as reserved words
182+[
183+ (kOr)
184+ (kXor)
185+ (kDiv)
186+ (kMod)
187+ (kAnd)
188+ (kShl)
189+ (kShr)
190+ (kNot)
191+ (kIs)
192+ (kAs)
193+ (kIn)
194+] @keyword
195+
196+; -- Builtin constants
197+
198+[
199+ (kTrue)
200+ (kFalse)
201+] @constant;
202+
203+; arguably a constant, but we highlight it as a keyword
204+[
205+ (kNil)
206+] @keyword
207+
208+; -- Literals
209+
210+(literalNumber) @number
211+(literalString) @string
212+
213+; -- Comments
214+(comment) @comment
215+(pp) @keyword
216+
217+; -- Type declaration
218+
219+(declType name: (identifier) @type)
220+(declType name: (genericTpl entity: (identifier) @type))
221+
222+; -- Procedure & function declarations
223+
224+; foobar
225+(declProc name: (identifier) @function)
226+; foobar<t>
227+(declProc name: (genericTpl entity: (identifier) @function))
228+; foo.bar
229+(declProc name: (genericDot rhs: (identifier) @function))
230+; foo.bar<t>
231+(declProc name: (genericDot rhs: (genericTpl entity: (identifier) @function)))
232+
233+; Treat property declarations like functions
234+
235+(declProp name: (identifier) @function)
236+
237+; -- Function parameters
238+
239+(declArg name: (identifier) @variable.parameter)
240+
241+; -- Template parameters
242+
243+(genericArg name: (identifier) @type.parameter)
244+(genericArg type: (typeref) @type)
245+
246+(genericDot (identifier) @type)
247+(genericDot (genericTpl entity: (identifier) @type))
248+
249+; -- Exception parameters
250+(exceptionHandler variable: (identifier) @variable.parameter)
251+
252+; -- Type usage
253+
254+(typeref) @type
255+
256+; -- Constant usage
257+
258+[
259+ (caseLabel)
260+ (label)
261+] @constant;
262+
263+
264+;;; ---------------------------------------------- ;;;
265+;;; EVERYTHING BELOW THIS IS OF QUESTIONABLE VALUE ;;;
266+;;; ---------------------------------------------- ;;;
267+
268+; -- Break, Continue & Exit
269+; (Not ideal: ideally, there would be a way to check if these special
270+; identifiers are shadowed by a local variable)
271+(statement ((identifier) @keyword
272+ (#match? @keyword "^[eE][xX][iI][tT]$")))
273+(statement (exprCall entity: ((identifier) @keyword
274+ (#match? @keyword "^[eE][xX][iI][tT]$"))))
275+(statement ((identifier) @keyword
276+ (#match? @keyword "^[bB][rR][eE][aA][kK]$")))
277+(statement ((identifier) @keyword
278+ (#match? @keyword "^[cC][oO][nN][tT][iI][nN][uU][eE]$")))
279+
280+; -- Procedure name in calls with parentheses
281+; (Pascal doesn't require parentheses for procedure calls, so this will not
282+; detect all calls)
283+
284+; foobar
285+(exprCall entity: (identifier) @function)
286+; foobar<t>
287+(exprCall entity: (exprTpl entity: (identifier) @function))
288+; foo.bar
289+(exprCall entity: (exprDot rhs: (identifier) @function))
290+; foo.bar<t>
291+(exprCall entity: (exprDot rhs: (exprTpl entity: (identifier) @function)))
292+
293+; -- Heuristic for procedure/function calls without parentheses
294+; (If a statement consists only of an identifier, assume it's a procedure)
295+; (This will still not match all procedure calls, and also may produce false
296+; positives in rare cases, but only for nonsensical code)
297+
298+(statement (identifier) @function)
299+(statement (exprDot rhs: (identifier) @function))
300+(statement (exprTpl entity: (identifier) @function))
301+(statement (exprDot rhs: (exprTpl entity: (identifier) @function)))
302+
303+; -- Variable & constant declarations
304+; (This is only questionable because we cannot detect types of identifiers
305+; declared in other units, so the results will be inconsistent)
306+
307+(declVar name: (identifier) @variable)
308+(declField name: (identifier) @variable)
309+(declConst name: (identifier) @constant)
310+(declEnumValue name: (identifier) @constant)
311+
312+; -- Identifier type inferrence
313+
314+; vERY QUESTIONABLE: Highlighting of identifiers based on spelling
315+(exprBinary ((identifier) @constant
316+ (#match? @constant "^[A-Z][A-Z0-9_]+$|^[a-z]{2}[A-Z].+$")))
317+(exprUnary ((identifier) @constant
318+ (#match? @constant "^[A-Z][A-Z0-9_]+$|^[a-z]{2}[A-Z].+$")))
319+(assignment rhs: ((identifier) @constant
320+ (#match? @constant "^[A-Z][A-Z0-9_]+$|^[a-z]{2}[A-Z].+$")))
321+(exprBrackets ((identifier) @constant
322+ (#match? @constant "^[A-Z][A-Z0-9_]+$|^[a-z]{2}[A-Z].+$")))
323+(exprParens ((identifier) @constant
324+ (#match? @constant "^[A-Z][A-Z0-9_]+$|^[a-z]{2}[A-Z].+$")))
325+;(exprDot rhs: ((identifier) @constant
326+; (#match? @constant "^[A-Z][A-Z0-9_]+$|^[a-z]{1,2}[A-Z].+$")))
327+(exprTpl args: ((identifier) @constant
328+ (#match? @constant "^[A-Z][A-Z0-9_]+$|^[a-z]{2}[A-Z].+$")))
329+(exprArgs ((identifier) @constant
330+ (#match? @constant "^[A-Z][A-Z0-9_]+$|^[a-z]{2}[A-Z].+$")))
331+;(declEnumValue ((identifier) @constant
332+; (#match? @constant "^[A-Z][A-Z0-9_]+$|^[a-z]{1,2}[A-Z].+$")))
333+;(defaultValue ((identifier) @constant
334+; (#match? @constant "^[A-Z][A-Z0-9_]+$|^[a-z]{1,2}[A-Z].+$")))
335+
336+; -- Use scoping information for additional highlighting. THIS NEED TO BE LAST.
337+; FIXME: Right now this is buggy, because in case of something like this:
338+; procedure (x: integer);
339+; begin
340+; a.x;
341+; end;
342+; The x in a.x would be highlighted as a parameter. Not what we want! We have to
343+; come up with a more specific rule. Only the left-most identifier should be
344+; matched.
345+(identifier) @identifier
crates/fold-tui/queries/pgn.scmnew file+29
@@ -0,0 +1,29 @@
1+; highlights.scm
2+
3+[
4+ (annotation)
5+ (inline_comment)
6+ (rest_of_line_comment)
7+ (old_style_twic_section_comment)
8+] @comment
9+
10+(command) @number
11+
12+(tagpair_delimiter_open) @punctuation.bracket
13+(tagpair_delimiter_close) @punctuation.bracket
14+(tagpair_key) @type
15+(tagpair tagpair_value_delimiter: (double_quote) @string)
16+(tagpair_value_contents) @string
17+
18+(movetext (move_number) @function)
19+(movetext (san_move) @function)
20+(movetext (lan_move) @function)
21+
22+(variation_delimiter_open) @operator
23+(variation_delimiter_close) @operator
24+(variation_movetext variation_san_move: (san_move) @operator)
25+(variation_movetext variation_move_number: (move_number) @operator)
26+
27+(result_code) @variable
28+
29+(ERROR) @property
crates/fold-tui/queries/plpgsql.scmnew file+153
@@ -0,0 +1,153 @@
1+; highlights.scm — tree-sitter-plpgsql syntax highlighting queries
2+;
3+; Note: SQL expressions are opaque (captured by external scanner).
4+; Only PL/pgSQL structural tokens are highlighted here. SQL fragments
5+; get their highlighting via language injection into the postgres grammar.
6+
7+; ── Comments ──────────────────────────────────────────────────────────────────
8+
9+(comment) @comment
10+
11+; ── Literals ──────────────────────────────────────────────────────────────────
12+
13+(integer_literal) @number
14+(string_literal) @string
15+
16+(kw_null) @constant.builtin
17+
18+; ── Identifiers ───────────────────────────────────────────────────────────────
19+
20+(identifier) @variable
21+
22+; ── Labels ────────────────────────────────────────────────────────────────────
23+
24+(block_label (identifier) @label)
25+(loop_label (identifier) @label)
26+(end_label) @label
27+
28+; ── Operators ─────────────────────────────────────────────────────────────────
29+
30+[":=" "=" ".."] @operator
31+
32+; ── Punctuation ───────────────────────────────────────────────────────────────
33+
34+["(" ")"] @punctuation.bracket
35+["[" "]"] @punctuation.bracket
36+["<<" ">>"] @punctuation.bracket
37+"," @punctuation.delimiter
38+"." @punctuation.delimiter
39+";" @punctuation.delimiter
40+
41+; ── Block structure keywords ──────────────────────────────────────────────────
42+
43+[
44+ (kw_begin)
45+ (kw_end)
46+ (kw_declare)
47+] @keyword
48+
49+; ── Control flow keywords ────────────────────────────────────────────────────
50+
51+[
52+ (kw_if)
53+ (kw_then)
54+ (kw_elsif)
55+ (kw_else)
56+ (kw_case)
57+ (kw_when)
58+] @keyword
59+
60+; ── Loop keywords ────────────────────────────────────────────────────────────
61+
62+[
63+ (kw_loop)
64+ (kw_while)
65+ (kw_for)
66+ (kw_foreach)
67+ (kw_in)
68+ (kw_reverse)
69+ (kw_by)
70+ (kw_slice)
71+ (kw_array)
72+ (kw_exit)
73+ (kw_continue)
74+] @keyword
75+
76+; ── Statement keywords ───────────────────────────────────────────────────────
77+
78+[
79+ (kw_return)
80+ (kw_perform)
81+ (kw_execute)
82+ (kw_call)
83+ (kw_do)
84+ (kw_raise)
85+ (kw_assert)
86+ (kw_get)
87+ (kw_diagnostics)
88+ (kw_open)
89+ (kw_fetch)
90+ (kw_move)
91+ (kw_close)
92+ (kw_into)
93+ (kw_using)
94+ (kw_strict)
95+ (kw_next)
96+ (kw_query)
97+ (kw_from)
98+] @keyword
99+
100+; ── Declaration keywords ─────────────────────────────────────────────────────
101+
102+[
103+ (kw_constant)
104+ (kw_alias)
105+ (kw_cursor)
106+ (kw_scroll)
107+ (kw_no)
108+ (kw_is)
109+ (kw_not)
110+ (kw_default)
111+ (kw_collate)
112+ (kw_type)
113+ (kw_rowtype)
114+] @keyword
115+
116+; ── Exception keywords ───────────────────────────────────────────────────────
117+
118+[
119+ (kw_exception)
120+ (kw_or)
121+ (kw_sqlstate)
122+] @keyword
123+
124+; ── Transaction keywords ─────────────────────────────────────────────────────
125+
126+[
127+ (kw_commit)
128+ (kw_rollback)
129+ (kw_chain)
130+ (kw_and)
131+] @keyword
132+
133+; ── RAISE level keywords ─────────────────────────────────────────────────────
134+
135+(raise_level) @keyword
136+
137+; ── RAISE option keywords ────────────────────────────────────────────────────
138+
139+(raise_option
140+ [
141+ (kw_message)
142+ (kw_detail)
143+ (kw_hint)
144+ (kw_errcode)
145+ ] @keyword)
146+
147+; ── GET DIAGNOSTICS items ────────────────────────────────────────────────────
148+
149+(getdiag_item) @keyword
150+
151+; ── Fetch direction keywords ─────────────────────────────────────────────────
152+
153+(fetch_direction) @keyword
crates/fold-tui/queries/postgres.scmnew file+358
@@ -0,0 +1,358 @@
1+; highlights.scm — tree-sitter-postgres syntax highlighting queries
2+
3+; ── Comments ──────────────────────────────────────────────────────────────────
4+
5+(comment) @comment
6+
7+; ── Literals ──────────────────────────────────────────────────────────────────
8+
9+(integer_literal) @number
10+(float_literal) @number.float
11+(string_literal) @string
12+(bit_string_literal) @string
13+(hex_string_literal) @string
14+
15+(kw_true) @boolean
16+(kw_false) @boolean
17+(kw_null) @constant.builtin
18+
19+(param) @variable.parameter
20+
21+; ── Identifiers ───────────────────────────────────────────────────────────────
22+
23+(identifier) @variable
24+
25+(columnref
26+ (ColId) @variable)
27+
28+; ── Types ─────────────────────────────────────────────────────────────────────
29+
30+[
31+ (Numeric)
32+ (Bit)
33+ (ConstBit)
34+ (Character)
35+ (ConstCharacter)
36+ (ConstDatetime)
37+ (ConstInterval)
38+ (JsonType)
39+] @type.builtin
40+
41+; User-defined, extension, and schema-qualified types all arrive through
42+; GenericType. Examples: TEAM_ROLE, main.USER_ROLE, citext, vector.
43+; Capture the leaf identifier instead of the whole GenericType so child
44+; identifier captures do not override the type highlight in editors.
45+(Typename
46+ (SimpleTypename
47+ (GenericType
48+ (type_function_name
49+ (identifier) @type) .)))
50+
51+(Typename
52+ (SimpleTypename
53+ (GenericType
54+ (type_function_name
55+ (identifier) @type)
56+ (opt_type_modifiers))))
57+
58+(Typename
59+ (SimpleTypename
60+ (GenericType
61+ (attrs
62+ (attr_name
63+ (ColLabel
64+ (identifier) @type))))))
65+
66+; Type names being defined by CREATE TYPE. For schema-qualified names, capture
67+; the final segment as the type and leave the schema as a normal identifier.
68+(DefineStmt
69+ (kw_create)
70+ (kw_type)
71+ (any_name
72+ (attrs
73+ (attr_name
74+ (ColLabel
75+ (identifier) @type)))))
76+
77+(DefineStmt
78+ (kw_create)
79+ (kw_type)
80+ (any_name
81+ (ColId
82+ (identifier) @type) .))
83+
84+; ── Functions ─────────────────────────────────────────────────────────────────
85+
86+(func_application
87+ (func_name) @function.call)
88+
89+(func_expr_common_subexpr) @function.call
90+
91+; ── Operators ─────────────────────────────────────────────────────────────────
92+
93+(operator) @operator
94+
95+[
96+ "+"
97+ "-"
98+ "*"
99+ "/"
100+ "%"
101+ "^"
102+ "<"
103+ ">"
104+ "="
105+] @operator
106+
107+; ── Punctuation ───────────────────────────────────────────────────────────────
108+
109+["(" ")"] @punctuation.bracket
110+["[" "]"] @punctuation.bracket
111+"," @punctuation.delimiter
112+"." @punctuation.delimiter
113+";" @punctuation.delimiter
114+
115+; ── Statement keywords ────────────────────────────────────────────────────────
116+
117+[
118+ (kw_select)
119+ (kw_from)
120+ (kw_where)
121+ (kw_insert)
122+ (kw_into)
123+ (kw_update)
124+ (kw_delete)
125+ (kw_create)
126+ (kw_alter)
127+ (kw_drop)
128+ (kw_table)
129+ (kw_index)
130+ (kw_view)
131+ (kw_with)
132+ (kw_as)
133+ (kw_set)
134+ (kw_values)
135+ (kw_returning)
136+ (kw_explain)
137+ (kw_analyze)
138+ (kw_vacuum)
139+ (kw_truncate)
140+ (kw_copy)
141+ (kw_grant)
142+ (kw_revoke)
143+] @keyword
144+
145+; ── Clause keywords ───────────────────────────────────────────────────────────
146+
147+[
148+ (kw_distinct)
149+ (kw_all)
150+ (kw_group)
151+ (kw_order)
152+ (kw_by)
153+ (kw_having)
154+ (kw_limit)
155+ (kw_offset)
156+ (kw_fetch)
157+ (kw_for)
158+ (kw_on)
159+ (kw_using)
160+ (kw_asc)
161+ (kw_desc)
162+ (kw_nulls)
163+ (kw_first)
164+ (kw_last)
165+ (kw_only)
166+ (kw_recursive)
167+ (kw_cascade)
168+ (kw_restrict)
169+ (kw_if)
170+ (kw_exists)
171+] @keyword
172+
173+; ── Join keywords ─────────────────────────────────────────────────────────────
174+
175+[
176+ (kw_join)
177+ (kw_inner)
178+ (kw_left)
179+ (kw_right)
180+ (kw_full)
181+ (kw_cross)
182+ (kw_natural)
183+ (kw_lateral)
184+] @keyword
185+
186+; ── Logical / boolean keywords ────────────────────────────────────────────────
187+
188+[
189+ (kw_and)
190+ (kw_or)
191+ (kw_not)
192+ (kw_in)
193+ (kw_between)
194+ (kw_like)
195+ (kw_ilike)
196+ (kw_similar)
197+ (kw_is)
198+ (kw_isnull)
199+ (kw_notnull)
200+ (kw_escape)
201+] @keyword.operator
202+
203+; ── Set operation keywords ────────────────────────────────────────────────────
204+
205+[
206+ (kw_union)
207+ (kw_intersect)
208+ (kw_except)
209+] @keyword
210+
211+; ── Conditional keywords ──────────────────────────────────────────────────────
212+
213+[
214+ (kw_case)
215+ (kw_when)
216+ (kw_then)
217+ (kw_else)
218+ (kw_end)
219+] @keyword
220+
221+; ── Transaction keywords ──────────────────────────────────────────────────────
222+
223+[
224+ (kw_begin)
225+ (kw_commit)
226+ (kw_rollback)
227+ (kw_savepoint)
228+ (kw_release)
229+ (kw_abort)
230+ (kw_start)
231+] @keyword
232+
233+; ── Type keywords ─────────────────────────────────────────────────────────────
234+
235+[
236+ (kw_int)
237+ (kw_integer)
238+ (kw_smallint)
239+ (kw_bigint)
240+ (kw_decimal)
241+ (kw_numeric)
242+ (kw_float)
243+ (kw_real)
244+ (kw_double)
245+ (kw_char)
246+ (kw_character)
247+ (kw_varchar)
248+ (kw_text)
249+ (kw_boolean)
250+ (kw_bit)
251+ (kw_time)
252+ (kw_timestamp)
253+ (kw_interval)
254+ (kw_array)
255+ (kw_json)
256+ (kw_xml)
257+] @type.builtin
258+
259+; PostgreSQL has many built-in types and aliases that are not lexer keywords.
260+; They parse as identifiers inside a GenericType, so they cannot be matched as
261+; kw_* nodes.
262+((Typename
263+ (SimpleTypename
264+ (GenericType
265+ (type_function_name
266+ (identifier) @type.builtin))))
267+ (#match? @type.builtin "(?i)^(bigserial|bool|inet|jsonb|timestamptz|uuid|void)$"))
268+
269+; ── Constraint / DDL keywords ─────────────────────────────────────────────────
270+
271+[
272+ (kw_primary)
273+ (kw_key)
274+ (kw_unique)
275+ (kw_check)
276+ (kw_foreign)
277+ (kw_references)
278+ (kw_constraint)
279+ (kw_default)
280+ (kw_collate)
281+ (kw_not)
282+] @keyword
283+
284+; ── Aggregate / window keywords ───────────────────────────────────────────────
285+
286+[
287+ (kw_over)
288+ (kw_partition)
289+ (kw_rows)
290+ (kw_range)
291+ (kw_groups)
292+ (kw_preceding)
293+ (kw_following)
294+ (kw_unbounded)
295+ (kw_current)
296+] @keyword
297+
298+; ── Other common keywords (catch-all) ─────────────────────────────────────────
299+
300+[
301+ (kw_to)
302+ (kw_of)
303+ (kw_cast)
304+ (kw_do)
305+ (kw_function)
306+ (kw_procedure)
307+ (kw_trigger)
308+ (kw_temporary)
309+ (kw_temp)
310+ (kw_unlogged)
311+ (kw_materialized)
312+ (kw_schema)
313+ (kw_database)
314+ (kw_extension)
315+ (kw_sequence)
316+ (kw_domain)
317+ (kw_type)
318+ (kw_role)
319+ (kw_user)
320+ (kw_owner)
321+ (kw_language)
322+ (kw_replace)
323+ (kw_returns)
324+ (kw_security)
325+ (kw_row)
326+ (kw_column)
327+ (kw_add)
328+ (kw_rename)
329+ (kw_no)
330+ (kw_cycle)
331+ (kw_increment)
332+ (kw_maxvalue)
333+ (kw_minvalue)
334+ (kw_cache)
335+ (kw_owned)
336+ (kw_local)
337+ (kw_global)
338+ (kw_execute)
339+ (kw_prepare)
340+ (kw_deallocate)
341+ (kw_listen)
342+ (kw_notify)
343+ (kw_load)
344+ (kw_lock)
345+ (kw_move)
346+ (kw_cluster)
347+ (kw_reindex)
348+ (kw_reset)
349+ (kw_show)
350+ (kw_enable)
351+ (kw_disable)
352+ (kw_refresh)
353+ (kw_concurrently)
354+ (kw_import)
355+ (kw_policy)
356+ (kw_publication)
357+ (kw_subscription)
358+] @keyword
crates/fold-tui/queries/prisma.scmnew file+39
@@ -0,0 +1,39 @@
1+[
2+ "datasource"
3+ "enum"
4+ "generator"
5+ "model"
6+ "view"
7+] @keyword
8+
9+(comment) @comment
10+(developer_comment) @comment
11+
12+(number) @number
13+(string) @string
14+(false) @boolean
15+(true) @boolean
16+(arguments) @property
17+(maybe) @punctuation
18+(call_expression (identifier) @function)
19+(enumeral) @constant
20+(identifier) @variable
21+
22+(column_declaration (identifier) (column_type (identifier) @type))
23+(attribute (identifier) @label)
24+(attribute (call_expression (identifier) @label))
25+(attribute (call_expression (member_expression (identifier) @label)))
26+(block_attribute_declaration (identifier) @label)
27+(block_attribute_declaration (call_expression (identifier) @label))
28+(type_expression (identifier) @property)
29+
30+
31+"(" @punctuation.bracket
32+")" @punctuation.bracket
33+"[" @punctuation.bracket
34+"]" @punctuation.bracket
35+"{" @punctuation.bracket
36+"}" @punctuation.bracket
37+"=" @operator
38+"@" @label
39+"@@" @label
crates/fold-tui/queries/proto.scmnew file+190
@@ -0,0 +1,190 @@
1+(package
2+ (full_ident
3+ (identifier) @module))
4+
5+(extend
6+ (full_ident
7+ (identifier) @type))
8+
9+(constant
10+ (full_ident
11+ (identifier) @constant))
12+
13+(field
14+ (identifier) @property)
15+
16+(map_field
17+ (identifier) @property)
18+
19+(oneof
20+ (identifier) @type)
21+
22+(oneof_field
23+ (identifier) @property)
24+
25+(field_option
26+ (identifier) @property)
27+
28+(enum_value_option
29+ (identifier) @property)
30+
31+(block_lit
32+ (identifier) @property)
33+
34+; Extension names and Any type URLs in aggregate option values,
35+; e.g. { [foo.bar]: 1 } and { [type.googleapis.com/foo.Bar]: {} }
36+(extension_name
37+ name: (full_ident
38+ (identifier) @variable))
39+
40+(extension_name
41+ type: (full_ident
42+ (identifier) @type))
43+
44+; Extension option names, e.g. option (foo.bar) = ...
45+; Also matches field/enum-value options, e.g. [(foo.bar) = ...]
46+[
47+ (option
48+ (full_ident
49+ (identifier) @variable))
50+ (field_option
51+ (full_ident
52+ (identifier) @variable))
53+ (enum_value_option
54+ (full_ident
55+ (identifier) @variable))
56+]
57+
58+[
59+ (option
60+ (full_ident
61+ (identifier)
62+ (identifier) @variable.member))
63+ (field_option
64+ (full_ident
65+ (identifier)
66+ (identifier) @variable.member))
67+ (enum_value_option
68+ (full_ident
69+ (identifier)
70+ (identifier) @variable.member))
71+]
72+
73+; Bare option names, e.g. option java_package = ...
74+; Also matches the trailing segments of a parenthesized name,
75+; e.g. option (foo.bar).baz = ...
76+; Matches the @property treatment of bare field_option/enum_value_option
77+; names below, since these all name a field on a proto *Options message.
78+(option
79+ (identifier) @property)
80+
81+[
82+ "option"
83+ "syntax"
84+ "edition"
85+] @keyword.directive
86+
87+[
88+ "reserved"
89+ "to"
90+ "max"
91+] @keyword
92+
93+[
94+ "enum"
95+ "extend"
96+ "extensions"
97+ "group"
98+ "message"
99+ "map"
100+ "oneof"
101+ "service"
102+] @keyword.type
103+
104+"rpc" @keyword.function
105+
106+"returns" @keyword.return
107+
108+[
109+ "export"
110+ "local"
111+ "optional"
112+ "repeated"
113+ "required"
114+ "stream"
115+ "weak"
116+ "public"
117+] @keyword.modifier
118+
119+[
120+ "package"
121+ "import"
122+] @keyword.import
123+
124+[
125+ (key_type)
126+ (type)
127+] @type.builtin
128+
129+[
130+ (message_name)
131+ (enum_name)
132+ (service_name)
133+ (message_or_enum_type)
134+] @type
135+
136+(rpc_name) @function.method
137+
138+(enum_field
139+ (identifier) @constant)
140+
141+(string) @string
142+
143+; reserved names are their own node type rather than (string), so they need
144+; their own rule - without it they are the only unhighlighted literal.
145+(reserved_identifier) @string
146+
147+(import
148+ path: (string) @string.special.path)
149+
150+(syntax
151+ version: (string) @string.special.symbol)
152+
153+(escape_sequence) @string.escape
154+
155+(int_lit) @number
156+
157+(float_lit) @number.float
158+
159+[
160+ (true)
161+ (false)
162+] @boolean
163+
164+(comment) @spell
165+
166+(comment) @comment
167+
168+[
169+ "("
170+ ")"
171+ "["
172+ "]"
173+ "{"
174+ "}"
175+ "<"
176+ ">"
177+] @punctuation.bracket
178+
179+[
180+ ";"
181+ ","
182+ "."
183+ ":"
184+] @punctuation.delimiter
185+
186+[
187+ "="
188+ "-"
189+ "+"
190+] @operator
crates/fold-tui/queries/qbasic.scmnew file+19
@@ -0,0 +1,19 @@
1+(line_number) @constant.numeric
2+(integer_literal) @constant.numeric
3+(float_literal) @constant.numeric
4+(hex_literal) @constant.numeric
5+(octal_literal) @constant.numeric
6+(string_literal) @string
7+(comment) @comment
8+(apostrophe_comment) @comment
9+(metacommand) @keyword.directive
10+(identifier) @variable
11+(type_sigil) @punctuation.special
12+(builtin_function) @function.builtin
13+(user_function) @function
14+(label) @label
15+(sub_definition name: (identifier) @function.definition)
16+(function_definition name: (identifier) @function.definition)
17+(type_definition name: (identifier) @type.definition)
18+(type_name) @type
19+(parameter) @variable.parameter
crates/fold-tui/queries/systemverilog.scmnew file+325
@@ -0,0 +1,325 @@
1+;; Comments
2+(one_line_comment) @comment
3+(block_comment) @comment
4+
5+
6+;; Strings
7+(string_literal) @string
8+(quoted_string) @string ; `include strings
9+(system_lib_string) @string
10+
11+
12+;; Keywords
13+(["begin" "end" "this"]) @keyword
14+(["input" "output" "inout" "ref"]) @keyword
15+(["alias" "and" "assert" "assign" "assume" "before" "bind" "binsof" "break"
16+ "case" "checker" "class" "class" "clocking" "config" "const" "constraint"
17+ "cover" "covergroup" "coverpoint" "cross" "default" "defparam" "disable"
18+ "do" "else" "endcase" "endchecker" "endclass" "endclocking" "endconfig"
19+ "endfunction" "endgenerate" "endgroup" "endinterface" "endmodule"
20+ "endpackage" "endprogram" "endproperty" "endsequence" "endtask" "enum"
21+ "extends" "extern" "final" "first_match" "for" "force" "foreach" "forever"
22+ "fork" "forkjoin" "function" "generate" "genvar" "if" "iff" "illegal_bins"
23+ "implements" "import" "initial" "inside" "interconnect" "interface"
24+ "intersect" "join" "join_any" "join_none" "local" "localparam" "matches"
25+ "modport" "new" "null" "option" "or" "package" "packed" "parameter"
26+ "program" "property" "pure" "randcase" "randomize" "release" "repeat"
27+ "return" "sequence" "showcancelled" "soft" "solve" "struct" "super" "tagged"
28+ "task" "timeprecision" "timeunit" "type" "typedef" "union" "unique"
29+ "virtual" "wait" "while" "with"
30+ (always_keyword) ; always, always_comb, always_latch, always_ff
31+ (bins_keyword) ; bins, illegal_bins, ignore_bins
32+ (case_keyword) ; case, casez, casex
33+ (class_item_qualifier) ; static, protected, local
34+ (edge_identifier) ; posedge, negedge, edge
35+ (lifetime) ; static, automatic
36+ (module_keyword) ; module, macromodule
37+ (random_qualifier) ; rand, randc
38+ (unique_priority)]) @keyword ; unique, unique0, priority
39+
40+
41+;; Preprocessor directives and macro usage
42+(["`include" "`define" "`ifdef" "`ifndef" "`timescale" "`default_nettype"
43+ "`elsif" "`undef" (resetall_compiler_directive) (undefineall_compiler_directive)
44+ "`endif" "`else" "`unconnected_drive" (celldefine_compiler_directive)
45+ (endcelldefine_compiler_directive) (endkeywords_directive) "`line"
46+ "`begin_keywords" "`pragma" "`__FILE__" "`__LINE__"]) @string.special
47+(text_macro_usage
48+ (simple_identifier) @string.special)
49+
50+
51+;; Delimiters, operators
52+([";" ":" "," "::"
53+ "=" "?" "|=" "&=" "^="
54+ "|->" "|=>" "->"
55+ ":=" ":/" "-:" "+:"]) @punctuation.delimiter
56+(["(" ")"]) @punctuation.bracket
57+(["[" "]"]) @punctuation.bracket
58+(["{" "}" "'{"]) @punctuation.bracket
59+
60+(["."] @operator)
61+(["+" "-" "*" "/" "%" "**"]) @operator
62+(["<" "<=" ">" ">="]) @operator
63+(["===" "!==" "==" "!="]) @operator
64+(["&&" "||" "!"]) @operator
65+(["~" "&" "~&" "|" "~|" "^" "~^"]) @operator
66+(["<<" ">>" "<<<" ">>>"]) @operator
67+
68+(["@" "#" "##"]) @operator
69+(assignment_operator) @operator
70+(unary_operator) @operator
71+(inc_or_dec_operator) @operator
72+(stream_operator) @operator
73+(event_trigger) @operator
74+(["->" "->>"]) @operator
75+
76+
77+;; Declarations
78+;; Module/interface/program/package/class/checker
79+(module_nonansi_header
80+ name: (simple_identifier) @function)
81+(module_ansi_header
82+ name: (simple_identifier) @function)
83+(interface_nonansi_header
84+ name: (simple_identifier) @function)
85+(interface_ansi_header
86+ name: (simple_identifier) @function)
87+(program_nonansi_header
88+ name: (simple_identifier) @function)
89+(program_ansi_header
90+ name: (simple_identifier) @function)
91+(package_declaration
92+ name: (simple_identifier) @function)
93+(class_declaration
94+ name: (simple_identifier) @function)
95+(interface_class_declaration
96+ name: (simple_identifier) @function)
97+(checker_declaration
98+ name: (simple_identifier) @function)
99+(class_declaration
100+ (class_type
101+ (simple_identifier) @type)) ; Parent class
102+;; Function/task/methods
103+(function_body_declaration
104+ name: (simple_identifier) @function)
105+(task_body_declaration
106+ name: (simple_identifier) @function)
107+(function_prototype
108+ (data_type_or_void)
109+ name: (simple_identifier) @function)
110+(task_prototype
111+ name: (simple_identifier) @function)
112+(class_scope ; Definition of extern defined methods
113+ (class_type
114+ (simple_identifier)) @function)
115+
116+
117+;; Types
118+[(integer_vector_type) ; bit, logic, reg
119+ (integer_atom_type) ; byte, shortint, int, longint, integer, time
120+ (non_integer_type) ; shortreal, real, realtime
121+ (net_type) ; supply0, supply1, tri, triand, trior, trireg, tri0, tri1, uwire, wire, wand, wor
122+ ["string" "event" "signed" "unsigned" "chandle"]] @type
123+(data_type_or_implicit
124+ (data_type
125+ (simple_identifier)) @type)
126+(data_type
127+ (class_type
128+ (simple_identifier) @type
129+ (parameter_value_assignment)))
130+(data_type
131+ (class_type
132+ (simple_identifier) @operator
133+ (simple_identifier) @type))
134+(net_port_header
135+ (net_port_type
136+ (simple_identifier) @type))
137+(variable_port_header
138+ (variable_port_type
139+ (data_type
140+ (simple_identifier) @type)))
141+(["void'" (data_type_or_void)]) @type ; void cast of task called as a function
142+(interface_port_header ; Interfaces with modports
143+ interface_name: (simple_identifier) @type
144+ modport_name: (simple_identifier) @type)
145+(type_assignment
146+ name: (simple_identifier) @type)
147+(net_declaration ; User type variable declaration
148+ (simple_identifier) @type)
149+(enum_base_type ; Enum base type with user type
150+ (simple_identifier) @type)
151+
152+
153+;; Instances
154+;; Module names
155+(module_instantiation
156+ instance_type: (simple_identifier) @module)
157+(interface_instantiation
158+ instance_type: (simple_identifier) @module)
159+(program_instantiation
160+ instance_type: (simple_identifier) @module)
161+(checker_instantiation
162+ instance_type: (simple_identifier) @module)
163+(udp_instantiation
164+ instance_type: (simple_identifier) @module)
165+(gate_instantiation
166+ [(cmos_switchtype)
167+ (mos_switchtype)
168+ (enable_gatetype)
169+ (n_input_gatetype)
170+ (n_output_gatetype)
171+ (pass_en_switchtype)
172+ (pass_switchtype)
173+ "pulldown" "pullup"]
174+ @module)
175+;; Instance names
176+(name_of_instance
177+ instance_name: (simple_identifier) @constant)
178+;; Instance parameters
179+(module_instantiation
180+ (parameter_value_assignment
181+ (list_of_parameter_value_assignments
182+ (named_parameter_assignment
183+ (simple_identifier) @constant))))
184+(module_instantiation
185+ (parameter_value_assignment
186+ (list_of_parameter_value_assignments
187+ (ordered_parameter_assignment
188+ (param_expression
189+ (data_type
190+ (simple_identifier) @constant))))))
191+;; Port names
192+(named_port_connection
193+ port_name: (simple_identifier) @constant)
194+(named_parameter_assignment
195+ (simple_identifier) @constant)
196+(named_checker_port_connection
197+ port_name: (simple_identifier) @constant)
198+;; Bind statements
199+(bind_directive
200+ (bind_target_scope
201+ (simple_identifier) @constant))
202+
203+
204+;; Numbers
205+(hex_number
206+ size: (unsigned_number) @number
207+ base: (hex_base) @punctuation.delimiter)
208+(decimal_number
209+ size: (unsigned_number) @number
210+ base: (decimal_base) @punctuation.delimiter)
211+(octal_number
212+ size: (unsigned_number) @number
213+ base: (octal_base) @punctuation.delimiter)
214+(binary_number
215+ size: (unsigned_number) @number
216+ base: (binary_base) @punctuation.delimiter)
217+;; Same as before but without the width (width extension)
218+(hex_number
219+ base: (hex_base) @punctuation.delimiter)
220+(decimal_number
221+ base: (decimal_base) @punctuation.delimiter)
222+(octal_number
223+ base: (octal_base) @punctuation.delimiter)
224+(binary_number
225+ base: (binary_base) @punctuation.delimiter)
226+
227+
228+;; Arrays
229+(unpacked_dimension
230+ [(constant_expression) (constant_range)] @number)
231+(packed_dimension
232+ (constant_range) @number)
233+(select
234+ (constant_range) @number)
235+(constant_select
236+ (constant_range
237+ (constant_expression) @number))
238+(constant_bit_select
239+ (constant_expression) @number)
240+(bit_select
241+ (expression) @number)
242+(indexed_range
243+ (expression) @number
244+ (constant_expression) @number)
245+(constant_indexed_range
246+ (constant_expression) @number)
247+(value_range ; inside {[min_range:max_range]}, place here to apply override
248+ (expression) @constant)
249+(dynamic_array_new
250+ (expression) @constant)
251+
252+
253+;; Misc
254+;; Timeunit
255+((time_unit) @constant.builtin)
256+;; Enum labels
257+(enum_name_declaration
258+ (simple_identifier) @constant.builtin)
259+;; Case item label (not radix)
260+(case_item_expression
261+ (expression
262+ (primary
263+ (hierarchical_identifier
264+ (simple_identifier) @constant.builtin))))
265+;; Hierarchical references, interface signals, class members, package scope
266+(hierarchical_identifier
267+ (simple_identifier) @punctuation.delimiter
268+ "."
269+ (simple_identifier))
270+(method_call
271+ (primary) @punctuation.delimiter
272+ (["." "::"])
273+ (method_call_body))
274+(package_scope
275+ (simple_identifier) @punctuation.delimiter)
276+(method_call
277+ (primary
278+ (select
279+ (simple_identifier) @punctuation.delimiter))
280+ (method_call_body))
281+;; Attributes
282+(["(*" "*)"] @constant)
283+(attribute_instance
284+ (attr_spec (simple_identifier) @attribute))
285+;; Typedefs
286+(type_declaration
287+ (class_type (simple_identifier) @type)
288+ type_name: (simple_identifier) @constant)
289+(type_declaration
290+ type_name: (simple_identifier) @constant)
291+("typedef" "class" (simple_identifier) @constant)
292+;; Coverpoint & cross labels
293+(cover_point
294+ name: (simple_identifier) @constant)
295+(cover_cross
296+ name: (simple_identifier) @constant)
297+;; Loop variables (foreach[i])
298+(loop_variables
299+ (simple_identifier) @constant)
300+;; Bins values
301+(bins_or_options
302+ (expression
303+ (primary
304+ (concatenation
305+ (expression) @constant))))
306+;; Bins ranges
307+(covergroup_value_range
308+ (expression) @constant)
309+;; Queue dimension
310+(("$") @punctuation.special)
311+;; Parameterized classes (e.g: uvm_config_db #(axi_stream_agent_config))
312+(class_type
313+ (parameter_value_assignment
314+ (list_of_parameter_value_assignments) @punctuation.delimiter))
315+
316+
317+;; System-tf
318+([(system_tf_identifier) ; System task/function
319+ "$fatal" "$error" "$warning" "$info" ; (severity_system_task)
320+ "$stop" "$finish" "$exit"]) ; (simulation_control_task)
321+@function.builtin
322+
323+
324+;; Errors
325+(ERROR) @error
crates/fold-tui/queries/templ.scmnew file+51
@@ -0,0 +1,51 @@
1+; inherits: go
2+(component_declaration
3+ name: (component_identifier) @function)
4+
5+[
6+ (tag_start)
7+ (tag_end)
8+ (self_closing_tag)
9+ (style_tag_start)
10+ (style_tag_end)
11+ (self_closing_style_tag)
12+] @tag
13+
14+(attribute
15+ name: (attribute_name) @tag.attribute)
16+
17+(attribute
18+ value: (quoted_attribute_value) @string)
19+
20+[
21+ (element_text)
22+ (style_element_text)
23+] @string.special
24+
25+(css_identifier) @function
26+
27+(css_property
28+ name: (css_property_name) @property)
29+
30+(css_property
31+ value: (css_property_value) @string)
32+
33+[
34+ (expression)
35+ (dynamic_class_attribute_value)
36+] @function.method
37+
38+(component_import
39+ name: (component_identifier) @function)
40+
41+(component_render) @function.call
42+
43+(element_comment) @comment @spell
44+
45+"@" @operator
46+
47+[
48+ "templ"
49+ "css"
50+ "script"
51+] @keyword
crates/fold-tui/queries/vue.scmnew file+162
@@ -0,0 +1,162 @@
1+(tag_name) @tag @nospell
2+
3+; (erroneous_end_tag_name) @error ; we do not lint syntax errors
4+(comment) @comment @spell
5+
6+(attribute_name) @tag.attribute @nospell
7+
8+(attribute_value) @nospell
9+
10+((attribute
11+ (quoted_attribute_value) @string)
12+ (#set! priority 99))
13+
14+(text) @none @spell
15+
16+((element
17+ (start_tag
18+ (tag_name) @_tag)
19+ (text) @markup.heading)
20+ (#eq? @_tag "title"))
21+
22+((element
23+ (start_tag
24+ (tag_name) @_tag)
25+ (text) @markup.heading.1)
26+ (#eq? @_tag "h1"))
27+
28+((element
29+ (start_tag
30+ (tag_name) @_tag)
31+ (text) @markup.heading.2)
32+ (#eq? @_tag "h2"))
33+
34+((element
35+ (start_tag
36+ (tag_name) @_tag)
37+ (text) @markup.heading.3)
38+ (#eq? @_tag "h3"))
39+
40+((element
41+ (start_tag
42+ (tag_name) @_tag)
43+ (text) @markup.heading.4)
44+ (#eq? @_tag "h4"))
45+
46+((element
47+ (start_tag
48+ (tag_name) @_tag)
49+ (text) @markup.heading.5)
50+ (#eq? @_tag "h5"))
51+
52+((element
53+ (start_tag
54+ (tag_name) @_tag)
55+ (text) @markup.heading.6)
56+ (#eq? @_tag "h6"))
57+
58+((element
59+ (start_tag
60+ (tag_name) @_tag)
61+ (text) @markup.strong)
62+ (#any-of? @_tag "strong" "b"))
63+
64+((element
65+ (start_tag
66+ (tag_name) @_tag)
67+ (text) @markup.italic)
68+ (#any-of? @_tag "em" "i"))
69+
70+((element
71+ (start_tag
72+ (tag_name) @_tag)
73+ (text) @markup.strikethrough)
74+ (#any-of? @_tag "s" "del"))
75+
76+((element
77+ (start_tag
78+ (tag_name) @_tag)
79+ (text) @markup.underline)
80+ (#eq? @_tag "u"))
81+
82+((element
83+ (start_tag
84+ (tag_name) @_tag)
85+ (text) @markup.raw)
86+ (#any-of? @_tag "code" "kbd"))
87+
88+((element
89+ (start_tag
90+ (tag_name) @_tag)
91+ (text) @markup.link.label)
92+ (#eq? @_tag "a"))
93+
94+((attribute
95+ (attribute_name) @_attr
96+ (quoted_attribute_value
97+ (attribute_value) @string.special.url))
98+ (#any-of? @_attr "href" "src"))
99+
100+[
101+ "<"
102+ ">"
103+ "</"
104+ "/>"
105+] @tag.delimiter
106+
107+"=" @operator
108+
109+; inherits: html_tags
110+
111+[
112+ "["
113+ "]"
114+] @punctuation.bracket
115+
116+[
117+ ":"
118+ "."
119+] @character.special
120+
121+[
122+ (interpolation)
123+ "@"
124+] @punctuation.special
125+
126+(interpolation
127+ (raw_text) @none)
128+
129+(dynamic_directive_inner_value) @variable
130+
131+(directive_name) @tag.attribute
132+
133+; Accessing a component object's field
134+(":"
135+ .
136+ (directive_value) @variable.member)
137+
138+("."
139+ .
140+ (directive_value) @property)
141+
142+; @click is like onclick for HTML
143+("@"
144+ .
145+ (directive_value) @function.method)
146+
147+; Used in v-slot, declaring position the element should be put in
148+("#"
149+ .
150+ (directive_value) @variable)
151+
152+(directive_attribute
153+ (quoted_attribute_value) @punctuation.special)
154+
155+(directive_attribute
156+ (quoted_attribute_value
157+ (attribute_value) @none))
158+
159+(directive_modifier) @function.method
160+
161+((template_element) @_template
162+ (#set! @_template bo.commentstring "<!-- %s -->"))
crates/fold-tui/src/app.rs+1
@@ -21,6 +21,7 @@ use std::path::Path;
2121use std::time::{Duration, Instant};
2222
2323mod action;
24+mod grammars;
2425mod highlight;
2526mod markdown;
2627mod mouse;
crates/fold-tui/src/app/grammars.rsnew file+154
@@ -0,0 +1,154 @@
1+// @generated from the crates.io survey of tree-sitter grammars (see highlight.rs).
2+// One entry per language: its id, the names a fence may use, its parser and highlights query.
3+
4+use tree_sitter::Language;
5+
6+pub struct Grammar {
7+ pub id: &'static str,
8+ pub aliases: &'static [&'static str],
9+ pub language: fn() -> Language,
10+ pub highlights: fn() -> String,
11+}
12+
13+pub const GRAMMARS: &[Grammar] = &[
14+ Grammar { id: "ada", aliases: &["adb", "ads"], language: || tree_sitter_ada::LANGUAGE.into(), highlights: || include_str!("../../queries/ada.scm").into() },
15+ Grammar { id: "agda", aliases: &[], language: || tree_sitter_agda::LANGUAGE.into(), highlights: || tree_sitter_agda::HIGHLIGHTS_QUERY.into() },
16+ Grammar { id: "al", aliases: &[], language: || tree_sitter_al::LANGUAGE.into(), highlights: || tree_sitter_al::HIGHLIGHTS_QUERY.into() },
17+ Grammar { id: "applesoft", aliases: &[], language: || tree_sitter_applesoft::LANGUAGE.into(), highlights: || include_str!("../../queries/applesoft.scm").into() },
18+ Grammar { id: "arduino", aliases: &["ino"], language: || tree_sitter_arduino::LANGUAGE.into(), highlights: || tree_sitter_arduino::HIGHLIGHTS_QUERY.into() },
19+ Grammar { id: "arkts", aliases: &["ets"], language: || tree_sitter_arkts::LANGUAGE.into(), highlights: || tree_sitter_arkts::HIGHLIGHTS_QUERY.into() },
20+ Grammar { id: "asm", aliases: &["assembly", "nasm", "gas", "s"], language: || tree_sitter_asm::LANGUAGE.into(), highlights: || tree_sitter_asm::HIGHLIGHTS_QUERY.into() },
21+ Grammar { id: "astro", aliases: &[], language: || tree_sitter_astro_next::LANGUAGE.into(), highlights: || tree_sitter_astro_next::HIGHLIGHTS_QUERY.into() },
22+ Grammar { id: "autohotkey", aliases: &["ahk"], language: || tree_sitter_autohotkey::LANGUAGE.into(), highlights: || tree_sitter_autohotkey::HIGHLIGHTS_QUERY.into() },
23+ Grammar { id: "bash", aliases: &["sh", "shell", "console", "shellsession", "ksh"], language: || tree_sitter_bash::LANGUAGE.into(), highlights: || tree_sitter_bash::HIGHLIGHT_QUERY.into() },
24+ Grammar { id: "batch", aliases: &["bat", "cmd", "dosbatch"], language: || tree_sitter_batch::LANGUAGE.into(), highlights: || tree_sitter_batch::HIGHLIGHTS_QUERY.into() },
25+ Grammar { id: "bicep", aliases: &[], language: || tree_sitter_bicep::LANGUAGE.into(), highlights: || tree_sitter_bicep::HIGHLIGHTS_QUERY.into() },
26+ Grammar { id: "c", aliases: &["h"], language: || tree_sitter_c::LANGUAGE.into(), highlights: || tree_sitter_c::HIGHLIGHT_QUERY.into() },
27+ Grammar { id: "csharp", aliases: &["cs", "c#"], language: || tree_sitter_c_sharp::LANGUAGE.into(), highlights: || tree_sitter_c_sharp::HIGHLIGHTS_QUERY.into() },
28+ Grammar { id: "caddy", aliases: &["caddyfile"], language: || tree_sitter_caddy::LANGUAGE.into(), highlights: || include_str!("../../queries/caddy.scm").into() },
29+ Grammar { id: "cfml", aliases: &["cfm"], language: || tree_sitter_cfml::LANGUAGE_CFML.into(), highlights: || include_str!("../../queries/cfml.scm").into() },
30+ Grammar { id: "cfscript", aliases: &["cfc"], language: || tree_sitter_cfml::LANGUAGE_CFSCRIPT.into(), highlights: || include_str!("../../queries/cfscript.scm").into() },
31+ Grammar { id: "cfquery", aliases: &[], language: || tree_sitter_cfml::LANGUAGE_CFQUERY.into(), highlights: || include_str!("../../queries/cfquery.scm").into() },
32+ Grammar { id: "clojure", aliases: &["clj", "cljs", "cljc", "edn"], language: || tree_sitter_clojure_orchard::LANGUAGE.into(), highlights: || tree_sitter_clojure_orchard::HIGHLIGHTS_QUERY.into() },
33+ Grammar { id: "cmake", aliases: &[], language: || tree_sitter_cmake::LANGUAGE.into(), highlights: || tree_sitter_cmake::HIGHLIGHTS_QUERY.into() },
34+ Grammar { id: "dockerfile", aliases: &["docker", "containerfile"], language: || tree_sitter_containerfile::LANGUAGE.into(), highlights: || tree_sitter_containerfile::HIGHLIGHTS_QUERY.into() },
35+ Grammar { id: "cpp", aliases: &["c++", "cc", "cxx", "hpp", "hh", "hxx", "h++"], language: || tree_sitter_cpp::LANGUAGE.into(), highlights: || tree_sitter_cpp::HIGHLIGHT_QUERY.into() },
36+ Grammar { id: "css", aliases: &[], language: || tree_sitter_css::LANGUAGE.into(), highlights: || tree_sitter_css::HIGHLIGHTS_QUERY.into() },
37+ Grammar { id: "cuda", aliases: &["cu"], language: || tree_sitter_cuda::LANGUAGE.into(), highlights: || tree_sitter_cuda::HIGHLIGHTS_QUERY.into() },
38+ Grammar { id: "cypher", aliases: &["cql"], language: || tree_sitter_cypher::LANGUAGE.into(), highlights: || tree_sitter_cypher::HIGHLIGHTS_QUERY.into() },
39+ Grammar { id: "d", aliases: &["dlang"], language: || tree_sitter_d::LANGUAGE.into(), highlights: || include_str!("../../queries/d.scm").into() },
40+ Grammar { id: "dafny", aliases: &["dfy"], language: || tree_sitter_dafny::LANGUAGE.into(), highlights: || include_str!("../../queries/dafny.scm").into() },
41+ Grammar { id: "dart", aliases: &[], language: || tree_sitter_dart::LANGUAGE.into(), highlights: || tree_sitter_dart::HIGHLIGHTS_QUERY.into() },
42+ Grammar { id: "devicetree", aliases: &["dts", "dtsi"], language: || tree_sitter_devicetree::LANGUAGE.into(), highlights: || tree_sitter_devicetree::HIGHLIGHTS_QUERY.into() },
43+ Grammar { id: "diff", aliases: &["patch", "udiff"], language: || tree_sitter_diff::LANGUAGE.into(), highlights: || tree_sitter_diff::HIGHLIGHTS_QUERY.into() },
44+ Grammar { id: "dm", aliases: &["dreammaker", "byond"], language: || tree_sitter_dm::LANGUAGE.into(), highlights: || include_str!("../../queries/dm.scm").into() },
45+ Grammar { id: "elisp", aliases: &["emacs-lisp", "el"], language: || tree_sitter_elisp::LANGUAGE.into(), highlights: || tree_sitter_elisp::HIGHLIGHTS_QUERY.into() },
46+ Grammar { id: "elixir", aliases: &["ex", "exs"], language: || tree_sitter_elixir::LANGUAGE.into(), highlights: || tree_sitter_elixir::HIGHLIGHTS_QUERY.into() },
47+ Grammar { id: "elm", aliases: &[], language: || tree_sitter_elm::LANGUAGE.into(), highlights: || tree_sitter_elm::HIGHLIGHTS_QUERY.into() },
48+ Grammar { id: "erb", aliases: &["ejs", "eex"], language: || tree_sitter_embedded_template::LANGUAGE.into(), highlights: || tree_sitter_embedded_template::HIGHLIGHTS_QUERY.into() },
49+ Grammar { id: "erlang", aliases: &["erl", "hrl"], language: || tree_sitter_erlang::LANGUAGE.into(), highlights: || tree_sitter_erlang::HIGHLIGHTS_QUERY.into() },
50+ Grammar { id: "fortran", aliases: &["f90", "f95", "f03", "f08", "for"], language: || tree_sitter_fortran::LANGUAGE.into(), highlights: || tree_sitter_fortran::HIGHLIGHTS_QUERY.into() },
51+ Grammar { id: "fsharp", aliases: &["fs", "f#", "fsx"], language: || tree_sitter_fsharp::LANGUAGE_FSHARP.into(), highlights: || tree_sitter_fsharp::HIGHLIGHTS_QUERY.into() },
52+ Grammar { id: "fsharp-signature", aliases: &["fsi"], language: || tree_sitter_fsharp::LANGUAGE_SIGNATURE.into(), highlights: || include_str!("../../queries/fsharp-signature.scm").into() },
53+ Grammar { id: "gdshader", aliases: &["gdshaderinc"], language: || tree_sitter_gdshader::LANGUAGE.into(), highlights: || tree_sitter_gdshader::HIGHLIGHTS_QUERY.into() },
54+ Grammar { id: "gitcommit", aliases: &["git-commit", "commit"], language: || tree_sitter_gitcommit::LANGUAGE.into(), highlights: || tree_sitter_gitcommit::HIGHLIGHTS_QUERY.into() },
55+ Grammar { id: "gleam", aliases: &[], language: || tree_sitter_gleam::LANGUAGE.into(), highlights: || tree_sitter_gleam::HIGHLIGHT_QUERY.into() },
56+ Grammar { id: "glsl", aliases: &["vert", "frag"], language: || tree_sitter_glsl::LANGUAGE_GLSL.into(), highlights: || tree_sitter_glsl::HIGHLIGHTS_QUERY.into() },
57+ Grammar { id: "go", aliases: &["golang"], language: || tree_sitter_go::LANGUAGE.into(), highlights: || tree_sitter_go::HIGHLIGHTS_QUERY.into() },
58+ Grammar { id: "gomod", aliases: &["go.mod"], language: || tree_sitter_gomod_orchard::LANGUAGE.into(), highlights: || include_str!("../../queries/gomod.scm").into() },
59+ Grammar { id: "gosum", aliases: &["go.sum"], language: || tree_sitter_gosum_orchard::LANGUAGE.into(), highlights: || tree_sitter_gosum_orchard::HIGHLIGHTS_QUERY.into() },
60+ Grammar { id: "gwbasic", aliases: &[], language: || tree_sitter_gwbasic::LANGUAGE.into(), highlights: || include_str!("../../queries/gwbasic.scm").into() },
61+ Grammar { id: "handlebars", aliases: &["hbs", "mustache"], language: || tree_sitter_handlebars::LANGUAGE.into(), highlights: || tree_sitter_handlebars::HIGHLIGHTS_QUERY.into() },
62+ Grammar { id: "harn", aliases: &[], language: || tree_sitter_harn::LANGUAGE.into(), highlights: || tree_sitter_harn::HIGHLIGHTS_QUERY.into() },
63+ Grammar { id: "haskell", aliases: &["hs"], language: || tree_sitter_haskell::LANGUAGE.into(), highlights: || tree_sitter_haskell::HIGHLIGHTS_QUERY.into() },
64+ Grammar { id: "heex", aliases: &[], language: || tree_sitter_heex::LANGUAGE.into(), highlights: || tree_sitter_heex::HIGHLIGHTS_QUERY.into() },
65+ Grammar { id: "html", aliases: &["htm", "xhtml"], language: || tree_sitter_html::LANGUAGE.into(), highlights: || tree_sitter_html::HIGHLIGHTS_QUERY.into() },
66+ Grammar { id: "ini", aliases: &["cfg", "conf", "dosini", "editorconfig"], language: || tree_sitter_ini::LANGUAGE.into(), highlights: || tree_sitter_ini::HIGHLIGHTS_QUERY.into() },
67+ Grammar { id: "ink", aliases: &[], language: || tree_sitter_ink_lbz::LANGUAGE.into(), highlights: || include_str!("../../queries/ink.scm").into() },
68+ Grammar { id: "integerbasic", aliases: &[], language: || tree_sitter_integerbasic::LANGUAGE.into(), highlights: || include_str!("../../queries/integerbasic.scm").into() },
69+ Grammar { id: "irules", aliases: &["tcl-irules"], language: || tree_sitter_irules::LANGUAGE.into(), highlights: || tree_sitter_irules::HIGHLIGHTS_QUERY.into() },
70+ Grammar { id: "java", aliases: &[], language: || tree_sitter_java::LANGUAGE.into(), highlights: || tree_sitter_java::HIGHLIGHTS_QUERY.into() },
71+ Grammar { id: "javadoc", aliases: &[], language: || tree_sitter_javadoc::LANGUAGE.into(), highlights: || tree_sitter_javadoc::HIGHLIGHTS_QUERY.into() },
72+ Grammar { id: "javascript", aliases: &["js", "jsx", "mjs", "cjs", "node"], language: || tree_sitter_javascript::LANGUAGE.into(), highlights: || format!("{}\n{}", tree_sitter_javascript::HIGHLIGHT_QUERY, tree_sitter_javascript::JSX_HIGHLIGHT_QUERY) },
73+ Grammar { id: "jinja2", aliases: &["jinja", "j2", "twig"], language: || tree_sitter_jinja2::LANGUAGE.into(), highlights: || tree_sitter_jinja2::HIGHLIGHTS_QUERY.into() },
74+ Grammar { id: "jsdoc", aliases: &[], language: || tree_sitter_jsdoc::LANGUAGE.into(), highlights: || tree_sitter_jsdoc::HIGHLIGHTS_QUERY.into() },
75+ Grammar { id: "json", aliases: &["jsonc", "json5", "geojson"], language: || tree_sitter_json::LANGUAGE.into(), highlights: || tree_sitter_json::HIGHLIGHTS_QUERY.into() },
76+ Grammar { id: "jsonnet", aliases: &["libsonnet"], language: || tree_sitter_jsonnet::LANGUAGE.into(), highlights: || tree_sitter_jsonnet::HIGHLIGHTS_QUERY.into() },
77+ Grammar { id: "julia", aliases: &["jl"], language: || tree_sitter_julia::LANGUAGE.into(), highlights: || include_str!("../../queries/julia.scm").into() },
78+ Grammar { id: "kconfig", aliases: &[], language: || tree_sitter_kconfig::LANGUAGE.into(), highlights: || tree_sitter_kconfig::HIGHLIGHTS_QUERY.into() },
79+ Grammar { id: "kotlin", aliases: &["kt", "kts"], language: || tree_sitter_kotlin_sg::LANGUAGE.into(), highlights: || tree_sitter_kotlin_sg::HIGHLIGHTS_QUERY.into() },
80+ Grammar { id: "lambdamoo", aliases: &["moo"], language: || tree_sitter_lambdamoo::LANGUAGE.into(), highlights: || tree_sitter_lambdamoo::HIGHLIGHTS_QUERY.into() },
81+ Grammar { id: "llvm", aliases: &["ll"], language: || tree_sitter_llvm::LANGUAGE.into(), highlights: || tree_sitter_llvm::HIGHLIGHTS_QUERY.into() },
82+ Grammar { id: "lua", aliases: &[], language: || tree_sitter_lua::LANGUAGE.into(), highlights: || tree_sitter_lua::HIGHLIGHTS_QUERY.into() },
83+ Grammar { id: "luau", aliases: &[], language: || tree_sitter_luau::LANGUAGE.into(), highlights: || tree_sitter_luau::HIGHLIGHTS_QUERY.into() },
84+ Grammar { id: "make", aliases: &["makefile", "mk", "gnumake"], language: || tree_sitter_make::LANGUAGE.into(), highlights: || tree_sitter_make::HIGHLIGHTS_QUERY.into() },
85+ Grammar { id: "matlab", aliases: &[], language: || tree_sitter_matlab::LANGUAGE.into(), highlights: || include_str!("../../queries/matlab.scm").into() },
86+ Grammar { id: "merlin6502", aliases: &[], language: || tree_sitter_merlin6502::LANGUAGE.into(), highlights: || include_str!("../../queries/merlin6502.scm").into() },
87+ Grammar { id: "mlir", aliases: &[], language: || tree_sitter_mlir::LANGUAGE.into(), highlights: || tree_sitter_mlir::HIGHLIGHTS_QUERY.into() },
88+ Grammar { id: "msbasic2", aliases: &[], language: || tree_sitter_msbasic2::LANGUAGE.into(), highlights: || include_str!("../../queries/msbasic2.scm").into() },
89+ Grammar { id: "newick", aliases: &["nwk"], language: || tree_sitter_newick::LANGUAGE.into(), highlights: || include_str!("../../queries/newick.scm").into() },
90+ Grammar { id: "nginx", aliases: &[], language: || tree_sitter_nginx::LANGUAGE.into(), highlights: || include_str!("../../queries/nginx.scm").into() },
91+ Grammar { id: "nix", aliases: &[], language: || tree_sitter_nix::LANGUAGE.into(), highlights: || tree_sitter_nix::HIGHLIGHTS_QUERY.into() },
92+ Grammar { id: "objc", aliases: &["objective-c", "objectivec", "obj-c"], language: || tree_sitter_objc::LANGUAGE.into(), highlights: || tree_sitter_objc::HIGHLIGHTS_QUERY.into() },
93+ Grammar { id: "ocaml", aliases: &["ml"], language: || tree_sitter_ocaml::LANGUAGE_OCAML.into(), highlights: || tree_sitter_ocaml::HIGHLIGHTS_QUERY.into() },
94+ Grammar { id: "ocaml-interface", aliases: &["mli"], language: || tree_sitter_ocaml::LANGUAGE_OCAML_INTERFACE.into(), highlights: || tree_sitter_ocaml::HIGHLIGHTS_QUERY.into() },
95+ Grammar { id: "ocamllex", aliases: &["mll"], language: || tree_sitter_ocamllex::LANGUAGE.into(), highlights: || tree_sitter_ocamllex::HIGHLIGHTS_QUERY.into() },
96+ Grammar { id: "odin", aliases: &[], language: || tree_sitter_odin::LANGUAGE.into(), highlights: || tree_sitter_odin::HIGHLIGHTS_QUERY.into() },
97+ Grammar { id: "openscad", aliases: &["scad"], language: || tree_sitter_openscad::LANGUAGE.into(), highlights: || tree_sitter_openscad::HIGHLIGHTS_QUERY.into() },
98+ Grammar { id: "pascal", aliases: &["pas", "delphi", "objectpascal"], language: || tree_sitter_pascal::LANGUAGE.into(), highlights: || include_str!("../../queries/pascal.scm").into() },
99+ Grammar { id: "pgn", aliases: &[], language: || tree_sitter_pgn::LANGUAGE.into(), highlights: || include_str!("../../queries/pgn.scm").into() },
100+ Grammar { id: "php", aliases: &[], language: || tree_sitter_php::LANGUAGE_PHP.into(), highlights: || tree_sitter_php::HIGHLIGHTS_QUERY.into() },
101+ Grammar { id: "postgres", aliases: &["postgresql", "pgsql"], language: || tree_sitter_postgres::LANGUAGE.into(), highlights: || include_str!("../../queries/postgres.scm").into() },
102+ Grammar { id: "plpgsql", aliases: &[], language: || tree_sitter_postgres::LANGUAGE_PLPGSQL.into(), highlights: || include_str!("../../queries/plpgsql.scm").into() },
103+ Grammar { id: "powershell", aliases: &["ps1", "psm1", "pwsh", "posh"], language: || tree_sitter_powershell::LANGUAGE.into(), highlights: || tree_sitter_powershell::HIGHLIGHTS_QUERY.into() },
104+ Grammar { id: "printf", aliases: &[], language: || tree_sitter_printf::LANGUAGE.into(), highlights: || tree_sitter_printf::HIGHLIGHTS_QUERY.into() },
105+ Grammar { id: "prisma", aliases: &[], language: || tree_sitter_prisma_io::LANGUAGE.into(), highlights: || include_str!("../../queries/prisma.scm").into() },
106+ Grammar { id: "prolog", aliases: &[], language: || tree_sitter_prolog::LANGUAGE.into(), highlights: || tree_sitter_prolog::HIGHLIGHTS_QUERY.into() },
107+ Grammar { id: "properties", aliases: &["java-properties"], language: || tree_sitter_properties::LANGUAGE.into(), highlights: || tree_sitter_properties::HIGHLIGHTS_QUERY.into() },
108+ Grammar { id: "proto", aliases: &["protobuf"], language: || tree_sitter_proto::LANGUAGE.into(), highlights: || include_str!("../../queries/proto.scm").into() },
109+ Grammar { id: "puppet", aliases: &["pp"], language: || tree_sitter_puppet::LANGUAGE.into(), highlights: || tree_sitter_puppet::HIGHLIGHTS_QUERY.into() },
110+ Grammar { id: "python", aliases: &["py", "python3", "py3", "gyp"], language: || tree_sitter_python::LANGUAGE.into(), highlights: || tree_sitter_python::HIGHLIGHTS_QUERY.into() },
111+ Grammar { id: "qbasic", aliases: &["quickbasic"], language: || tree_sitter_qbasic::LANGUAGE.into(), highlights: || include_str!("../../queries/qbasic.scm").into() },
112+ Grammar { id: "ql", aliases: &["codeql"], language: || tree_sitter_ql::LANGUAGE.into(), highlights: || tree_sitter_ql::HIGHLIGHTS_QUERY.into() },
113+ Grammar { id: "qmljs", aliases: &["qml"], language: || tree_sitter_qmljs::LANGUAGE.into(), highlights: || tree_sitter_qmljs::HIGHLIGHTS_QUERY.into() },
114+ Grammar { id: "qsharp", aliases: &["qs", "q#"], language: || tree_sitter_qsharp::LANGUAGE.into(), highlights: || tree_sitter_qsharp::HIGHLIGHTS_QUERY.into() },
115+ Grammar { id: "r", aliases: &["rscript"], language: || tree_sitter_r::LANGUAGE.into(), highlights: || tree_sitter_r::HIGHLIGHTS_QUERY.into() },
116+ Grammar { id: "racket", aliases: &["rkt"], language: || tree_sitter_racket::LANGUAGE.into(), highlights: || tree_sitter_racket::HIGHLIGHTS_QUERY.into() },
117+ Grammar { id: "regex", aliases: &["regexp"], language: || tree_sitter_regex::LANGUAGE.into(), highlights: || tree_sitter_regex::HIGHLIGHTS_QUERY.into() },
118+ Grammar { id: "requirements", aliases: &["requirements.txt", "pip"], language: || tree_sitter_requirements::LANGUAGE.into(), highlights: || tree_sitter_requirements::HIGHLIGHTS_QUERY.into() },
119+ Grammar { id: "riscv", aliases: &[], language: || tree_sitter_riscv::LANGUAGE.into(), highlights: || tree_sitter_riscv::HIGHLIGHTS_QUERY.into() },
120+ Grammar { id: "ruby", aliases: &["rb", "gemspec", "podspec", "rake"], language: || tree_sitter_ruby::LANGUAGE.into(), highlights: || tree_sitter_ruby::HIGHLIGHTS_QUERY.into() },
121+ Grammar { id: "rush", aliases: &[], language: || tree_sitter_rush::LANGUAGE.into(), highlights: || tree_sitter_rush::HIGHLIGHTS_QUERY.into() },
122+ Grammar { id: "rust", aliases: &["rs"], language: || tree_sitter_rust::LANGUAGE.into(), highlights: || tree_sitter_rust::HIGHLIGHTS_QUERY.into() },
123+ Grammar { id: "sas", aliases: &[], language: || tree_sitter_sas::LANGUAGE.into(), highlights: || tree_sitter_sas::HIGHLIGHTS_QUERY.into() },
124+ Grammar { id: "scala", aliases: &["sc"], language: || tree_sitter_scala::LANGUAGE.into(), highlights: || tree_sitter_scala::HIGHLIGHTS_QUERY.into() },
125+ Grammar { id: "scheme", aliases: &["scm"], language: || tree_sitter_scheme::LANGUAGE.into(), highlights: || tree_sitter_scheme::HIGHLIGHTS_QUERY.into() },
126+ Grammar { id: "sdml", aliases: &[], language: || tree_sitter_sdml::LANGUAGE.into(), highlights: || tree_sitter_sdml::HIGHLIGHTS_QUERY.into() },
127+ Grammar { id: "sql", aliases: &["mysql", "sqlite", "psql", "plsql"], language: || tree_sitter_sequel::LANGUAGE.into(), highlights: || tree_sitter_sequel::HIGHLIGHTS_QUERY.into() },
128+ Grammar { id: "tsql", aliases: &["mssql", "t-sql"], language: || tree_sitter_sequel_tsql::LANGUAGE.into(), highlights: || tree_sitter_sequel_tsql::HIGHLIGHTS_QUERY.into() },
129+ Grammar { id: "apex", aliases: &["cls", "trigger"], language: || tree_sitter_sfapex::apex::LANGUAGE.into(), highlights: || tree_sitter_sfapex::apex::HIGHLIGHTS_QUERY.into() },
130+ Grammar { id: "soql", aliases: &[], language: || tree_sitter_sfapex::soql::LANGUAGE.into(), highlights: || tree_sitter_sfapex::soql::HIGHLIGHTS_QUERY.into() },
131+ Grammar { id: "sosl", aliases: &[], language: || tree_sitter_sfapex::sosl::LANGUAGE.into(), highlights: || tree_sitter_sfapex::sosl::HIGHLIGHTS_QUERY.into() },
132+ Grammar { id: "sflog", aliases: &[], language: || tree_sitter_sfapex::sflog::LANGUAGE.into(), highlights: || tree_sitter_sfapex::sflog::HIGHLIGHTS_QUERY.into() },
133+ Grammar { id: "starlark", aliases: &["bzl", "bazel", "star", "build"], language: || tree_sitter_starlark::LANGUAGE.into(), highlights: || tree_sitter_starlark::HIGHLIGHTS_QUERY.into() },
134+ Grammar { id: "svelte", aliases: &[], language: || tree_sitter_svelte_ng::LANGUAGE.into(), highlights: || tree_sitter_svelte_ng::HIGHLIGHTS_QUERY.into() },
135+ Grammar { id: "svg", aliases: &[], language: || tree_sitter_svg::LANGUAGE.into(), highlights: || tree_sitter_svg::HIGHLIGHTS_QUERY.into() },
136+ Grammar { id: "swift", aliases: &[], language: || tree_sitter_swift::LANGUAGE.into(), highlights: || tree_sitter_swift::HIGHLIGHTS_QUERY.into() },
137+ Grammar { id: "sysml", aliases: &[], language: || tree_sitter_sysml::LANGUAGE.into(), highlights: || tree_sitter_sysml::HIGHLIGHTS_QUERY.into() },
138+ Grammar { id: "systemverilog", aliases: &["sv", "verilog", "v"], language: || tree_sitter_systemverilog::LANGUAGE.into(), highlights: || include_str!("../../queries/systemverilog.scm").into() },
139+ Grammar { id: "templ", aliases: &[], language: || tree_sitter_templ::LANGUAGE.into(), highlights: || include_str!("../../queries/templ.scm").into() },
140+ Grammar { id: "tlaplus", aliases: &["tla"], language: || tree_sitter_tlaplus::LANGUAGE.into(), highlights: || tree_sitter_tlaplus::HIGHLIGHT_QUERY.into() },
141+ Grammar { id: "tmux", aliases: &[], language: || tree_sitter_tmux::LANGUAGE.into(), highlights: || tree_sitter_tmux::HIGHLIGHTS_QUERY.into() },
142+ Grammar { id: "toml", aliases: &[], language: || tree_sitter_toml_ng::LANGUAGE.into(), highlights: || tree_sitter_toml_ng::HIGHLIGHTS_QUERY.into() },
143+ Grammar { id: "tsquery", aliases: &["query", "scm-query"], language: || tree_sitter_tsquery::LANGUAGE.into(), highlights: || tree_sitter_tsquery::HIGHLIGHTS_QUERY.into() },
144+ Grammar { id: "typescript", aliases: &["ts", "mts", "cts"], language: || tree_sitter_typescript::LANGUAGE_TYPESCRIPT.into(), highlights: || format!("{}\n{}", tree_sitter_typescript::HIGHLIGHTS_QUERY, tree_sitter_javascript::HIGHLIGHT_QUERY) },
145+ Grammar { id: "tsx", aliases: &[], language: || tree_sitter_typescript::LANGUAGE_TSX.into(), highlights: || format!("{}\n{}\n{}", tree_sitter_typescript::HIGHLIGHTS_QUERY, tree_sitter_javascript::HIGHLIGHT_QUERY, tree_sitter_javascript::JSX_HIGHLIGHT_QUERY) },
146+ Grammar { id: "varlink", aliases: &[], language: || tree_sitter_varlink::LANGUAGE.into(), highlights: || tree_sitter_varlink::HIGHLIGHTS_QUERY.into() },
147+ Grammar { id: "vhdl", aliases: &["vhd"], language: || tree_sitter_vhdl::LANGUAGE.into(), highlights: || tree_sitter_vhdl::HIGHLIGHTS_QUERY.into() },
148+ Grammar { id: "vue", aliases: &[], language: || tree_sitter_vue_next::LANGUAGE.into(), highlights: || include_str!("../../queries/vue.scm").into() },
149+ Grammar { id: "xml", aliases: &["xsd", "xsl", "xslt", "plist", "rss", "atom"], language: || tree_sitter_xml::LANGUAGE_XML.into(), highlights: || tree_sitter_xml::XML_HIGHLIGHT_QUERY.into() },
150+ Grammar { id: "dtd", aliases: &[], language: || tree_sitter_xml::LANGUAGE_DTD.into(), highlights: || tree_sitter_xml::DTD_HIGHLIGHT_QUERY.into() },
151+ Grammar { id: "yaml", aliases: &["yml"], language: || tree_sitter_yaml::LANGUAGE.into(), highlights: || tree_sitter_yaml::HIGHLIGHTS_QUERY.into() },
152+ Grammar { id: "zig", aliases: &[], language: || tree_sitter_zig::LANGUAGE.into(), highlights: || tree_sitter_zig::HIGHLIGHTS_QUERY.into() },
153+ Grammar { id: "zsh", aliases: &[], language: || tree_sitter_zsh::LANGUAGE.into(), highlights: || tree_sitter_zsh::HIGHLIGHT_QUERY.into() },
154+];
crates/fold-tui/src/app/highlight.rs+79−116
@@ -1,46 +1,30 @@
11//! Syntax highlighting of fenced code in the reading pane (§10.9), with
2−//! tree-sitter grammars compiled into the binary. A fence's info string picks
3−//! the language; anything unknown stays plain.
2+//! tree-sitter grammars compiled into the binary: every grammar published on
3+//! crates.io that builds against tree-sitter 0.27 and has a highlights query
4+//! (the table is `grammars.rs`). A fence's info string picks the language;
5+//! anything unknown stays plain.
46
57use super::ui::theme;
68use ratatui::style::{Color, Modifier, Style};
79use ratatui::text::Span;
810use std::collections::HashMap;
911use std::sync::OnceLock;
12+use super::grammars::GRAMMARS;
1013use tree_sitter_highlight::{HighlightConfiguration, HighlightEvent, Highlighter};
1114
12−/// Capture names the grammars' queries use, in the order styles are looked up.
15+/// Capture names to recognise. A query's capture maps to the longest of
16+/// these that is a dot-separated prefix of it (`keyword.control.return` →
17+/// `keyword`), so the roots cover every grammar's naming; the longer names
18+/// are the ones styled differently from their root.
1319const NAMES: &[&str] = &[
14− "attribute",
15− "comment",
16− "constant",
17− "constant.builtin",
18− "constructor",
19− "embedded",
20− "escape",
21− "function",
22− "function.builtin",
23− "function.macro",
24− "function.method",
25− "keyword",
26− "label",
27− "module",
28− "number",
29− "operator",
30− "property",
31− "punctuation",
32− "punctuation.bracket",
33− "punctuation.delimiter",
34− "punctuation.special",
35− "string",
36− "string.escape",
37− "string.special",
38− "tag",
39− "type",
40− "type.builtin",
41− "variable",
42− "variable.builtin",
43− "variable.parameter",
20+ "attribute", "boolean", "character", "comment", "conditional", "constant", "constant.builtin",
21+ "constructor", "define", "delimiter", "embedded", "error", "escape", "exception", "field", "float",
22+ "function", "function.builtin", "function.macro", "include", "keyword", "label", "macro", "markup",
23+ "markup.heading", "markup.italic", "markup.link", "markup.raw", "markup.strong", "method", "module",
24+ "namespace", "number", "operator", "parameter", "preproc", "property", "punctuation", "repeat", "special",
25+ "storageclass", "string", "string.escape", "string.regex", "string.regexp", "string.special", "structure",
26+ "symbol", "tag", "text", "text.literal", "text.title", "text.uri", "title", "type", "type.builtin", "uri",
27+ "variable", "variable.builtin", "variable.member", "variable.parameter",
4428];
4529
4630fn style_for(name: &str) -> Style {
@@ -48,94 +32,63 @@ fn style_for(name: &str) -> Style {
4832 let s = Style::default();
4933 match (root, name) {
5034 ("comment", _) => s.fg(theme::DIM).add_modifier(Modifier::ITALIC),
51− ("keyword", _) => s.fg(Color::Magenta),
52− ("function", _) | ("constructor", _) => s.fg(Color::LightBlue),
53− ("type", _) | ("module", _) => s.fg(Color::Yellow),
5435 (_, "string.escape") | ("escape", _) => s.fg(Color::Cyan),
55− ("string", _) => s.fg(Color::Green),
56− ("number", _) | ("constant", _) => s.fg(Color::Indexed(209)),
57− ("property", _) | ("attribute", _) | ("label", _) => s.fg(Color::Cyan),
36+ (_, "string.regex") | (_, "string.regexp") => s.fg(Color::LightGreen),
37+ ("string", _) | ("character", _) | (_, "text.literal") | (_, "markup.raw") => s.fg(Color::Green),
38+ ("keyword", _) | ("conditional", _) | ("repeat", _) | ("exception", _) | ("include", _)
39+ | ("storageclass", _) | ("define", _) | ("preproc", _) => s.fg(Color::Magenta),
40+ (_, "function.macro") | ("macro", _) => s.fg(Color::LightMagenta),
41+ ("function", _) | ("method", _) | ("constructor", _) => s.fg(Color::LightBlue),
42+ ("type", _) | ("module", _) | ("namespace", _) | ("structure", _) => s.fg(Color::Yellow),
43+ ("number", _) | ("float", _) | ("boolean", _) | ("constant", _) | ("symbol", _) => s.fg(Color::Indexed(209)),
44+ ("property", _) | ("field", _) | (_, "variable.member") | ("attribute", _) | ("label", _) => s.fg(Color::Cyan),
5845 ("tag", _) => s.fg(Color::LightRed),
5946 (_, "variable.builtin") => s.fg(Color::LightRed),
60− ("operator", _) | ("punctuation", _) => s.fg(Color::Gray),
47+ (_, "markup.heading") | ("title", _) | (_, "text.title") => s.fg(Color::Cyan).add_modifier(Modifier::BOLD),
48+ (_, "markup.strong") => s.add_modifier(Modifier::BOLD),
49+ (_, "markup.italic") => s.add_modifier(Modifier::ITALIC),
50+ (_, "markup.link") | ("uri", _) | (_, "text.uri") => s.fg(Color::LightCyan).add_modifier(Modifier::UNDERLINED),
51+ ("error", _) => s.fg(Color::LightRed),
52+ ("operator", _) | ("punctuation", _) | ("delimiter", _) => s.fg(Color::Gray),
6153 _ => s,
6254 }
6355}
6456
65−/// The languages, by the names a fence's info string may use.
66−fn language(name: &str) -> Option<&'static str> {
67− Some(match name.to_ascii_lowercase().as_str() {
68− "rust" | "rs" => "rust",
69− "python" | "py" | "python3" => "python",
70− "javascript" | "js" | "jsx" | "mjs" | "cjs" => "javascript",
71− "typescript" | "ts" => "typescript",
72− "tsx" => "tsx",
73− "bash" | "sh" | "shell" | "zsh" | "console" => "bash",
74− "json" | "jsonc" => "json",
75− "toml" => "toml",
76− "yaml" | "yml" => "yaml",
77− "go" | "golang" => "go",
78− "c" | "h" => "c",
79− "nix" => "nix",
80− "html" | "htm" => "html",
81− "css" => "css",
82− _ => return None,
57+/// Index into `GRAMMARS` by every name a fence may use (ids and aliases,
58+/// lower-case).
59+fn by_name() -> &'static HashMap<String, usize> {
60+ static MAP: OnceLock<HashMap<String, usize>> = OnceLock::new();
61+ MAP.get_or_init(|| {
62+ let mut m = HashMap::new();
63+ for (i, g) in GRAMMARS.iter().enumerate() {
64+ m.insert(g.id.to_string(), i);
65+ for a in g.aliases {
66+ m.entry(a.to_string()).or_insert(i);
67+ }
68+ }
69+ m
8370 })
8471}
8572
86−fn build(lang: &'static str) -> Option<HighlightConfiguration> {
87− use tree_sitter::Language;
88− let (language, highlights): (Language, String) = match lang {
89− "rust" => (tree_sitter_rust::LANGUAGE.into(), tree_sitter_rust::HIGHLIGHTS_QUERY.into()),
90− "python" => (tree_sitter_python::LANGUAGE.into(), tree_sitter_python::HIGHLIGHTS_QUERY.into()),
91− "javascript" => (
92− tree_sitter_javascript::LANGUAGE.into(),
93− format!("{}\n{}", tree_sitter_javascript::HIGHLIGHT_QUERY, tree_sitter_javascript::JSX_HIGHLIGHT_QUERY),
94− ),
95− // TypeScript's query extends JavaScript's
96− "typescript" => (
97− tree_sitter_typescript::LANGUAGE_TYPESCRIPT.into(),
98− format!("{}\n{}", tree_sitter_typescript::HIGHLIGHTS_QUERY, tree_sitter_javascript::HIGHLIGHT_QUERY),
99− ),
100− "tsx" => (
101− tree_sitter_typescript::LANGUAGE_TSX.into(),
102− format!(
103− "{}\n{}\n{}",
104− tree_sitter_typescript::HIGHLIGHTS_QUERY,
105− tree_sitter_javascript::HIGHLIGHT_QUERY,
106− tree_sitter_javascript::JSX_HIGHLIGHT_QUERY
107− ),
108− ),
109− "bash" => (tree_sitter_bash::LANGUAGE.into(), tree_sitter_bash::HIGHLIGHT_QUERY.into()),
110− "json" => (tree_sitter_json::LANGUAGE.into(), tree_sitter_json::HIGHLIGHTS_QUERY.into()),
111− "toml" => (tree_sitter_toml_ng::LANGUAGE.into(), tree_sitter_toml_ng::HIGHLIGHTS_QUERY.into()),
112− "yaml" => (tree_sitter_yaml::LANGUAGE.into(), tree_sitter_yaml::HIGHLIGHTS_QUERY.into()),
113− "go" => (tree_sitter_go::LANGUAGE.into(), tree_sitter_go::HIGHLIGHTS_QUERY.into()),
114− "c" => (tree_sitter_c::LANGUAGE.into(), tree_sitter_c::HIGHLIGHT_QUERY.into()),
115− "nix" => (tree_sitter_nix::LANGUAGE.into(), tree_sitter_nix::HIGHLIGHTS_QUERY.into()),
116− "html" => (tree_sitter_html::LANGUAGE.into(), tree_sitter_html::HIGHLIGHTS_QUERY.into()),
117− "css" => (tree_sitter_css::LANGUAGE.into(), tree_sitter_css::HIGHLIGHTS_QUERY.into()),
118− _ => return None,
119− };
120− let mut config = HighlightConfiguration::new(language, lang, &highlights, "", "").ok()?;
121− config.configure(NAMES);
122− Some(config)
73+/// A language's configuration, compiled on first use (a query costs a few
74+/// milliseconds; most vaults use a handful of languages).
75+fn config(i: usize) -> Option<&'static HighlightConfiguration> {
76+ static CONFIGS: OnceLock<Vec<OnceLock<Option<HighlightConfiguration>>>> = OnceLock::new();
77+ let all = CONFIGS.get_or_init(|| GRAMMARS.iter().map(|_| OnceLock::new()).collect());
78+ all.get(i)?
79+ .get_or_init(|| {
80+ let g = &GRAMMARS[i];
81+ let mut c = HighlightConfiguration::new((g.language)(), g.id, &(g.highlights)(), "", "").ok()?;
82+ c.configure(NAMES);
83+ Some(c)
84+ })
85+ .as_ref()
12386}
12487
125−/// Each language's configuration, compiled on first use (a query costs a few
126−/// milliseconds; most vaults use two or three languages).
127−fn config(lang: &'static str) -> Option<&'static HighlightConfiguration> {
128− static CONFIGS: OnceLock<HashMap<&'static str, OnceLock<Option<HighlightConfiguration>>>> = OnceLock::new();
129− let all = CONFIGS.get_or_init(|| {
130− [
131− "rust", "python", "javascript", "typescript", "tsx", "bash", "json", "toml", "yaml", "go", "c", "nix",
132− "html", "css",
133− ]
134− .into_iter()
135− .map(|l| (l, OnceLock::new()))
136− .collect()
137− });
138− all.get(lang)?.get_or_init(|| build(lang)).as_ref()
88+/// The ids of every language that can be highlighted.
89+#[cfg(test)]
90+fn languages() -> impl Iterator<Item = &'static str> {
91+ GRAMMARS.iter().map(|g| g.id)
13992}
14093
14194/// Whether a fence's info string names a language we can highlight.
@@ -143,14 +96,14 @@ pub fn supported(info: &str) -> bool {
14396 info_language(info).is_some()
14497}
14598
146−fn info_language(info: &str) -> Option<&'static str> {
99+fn info_language(info: &str) -> Option<usize> {
147100 // `rust`, `rust,ignore`, `{.python}`, `py title="x"`: the first word
148101 let word = info
149102 .trim()
150103 .trim_start_matches(['{', '.'])
151104 .split(|c: char| c.is_whitespace() || c == ',' || c == '}')
152105 .next()?;
153− language(word)
106+ by_name().get(&word.to_ascii_lowercase()).copied()
154107}
155108
156109/// Highlight a code block: one list of spans per line of `code`, or `None`
@@ -194,11 +147,21 @@ mod tests {
194147
195148 #[test]
196149 fn every_grammar_compiles_its_query() {
197− for lang in [
198− "rust", "python", "javascript", "typescript", "tsx", "bash", "json", "toml", "yaml", "go", "c", "nix",
199− "html", "css",
200− ] {
201− assert!(config(lang).is_some(), "{} does not compile", lang);
150+ let failed: Vec<&str> = (0..GRAMMARS.len()).filter(|&i| config(i).is_none()).map(|i| GRAMMARS[i].id).collect();
151+ assert!(failed.is_empty(), "queries that do not compile: {:?}", failed);
152+ assert!(GRAMMARS.len() >= 140);
153+ }
154+
155+ #[test]
156+ fn names_are_unique_and_common_fences_resolve() {
157+ let mut ids: Vec<&str> = languages().collect();
158+ ids.sort();
159+ ids.dedup();
160+ assert_eq!(ids.len(), GRAMMARS.len());
161+ for fence in ["rust", "py", "js", "ts", "tsx", "sh", "zsh", "json", "toml", "yaml", "go", "c", "c++", "c#",
162+ "java", "kotlin", "swift", "ruby", "php", "lua", "haskell", "ocaml", "elixir", "sql", "html", "css",
163+ "xml", "nix", "dockerfile", "makefile", "diff", "zig", "scala", "dart", "r", "julia"] {
164+ assert!(supported(fence), "{} should be highlighted", fence);
202165 }
203166 }
204167