zed-extensions/zed-grainpublic Fork
⑂ 0ca90cf
Commits
⬇ Clone ▾
git clone https://git.rickub.com/zed-extensions/zed-grain.git
git clone ssh://git@rickub.com/zed-extensions/zed-grain.git

Host key fingerprint (ed25519): SHA256:iycHnxEyq0Q7uyVpB7JlznP0G7JrTPXLYRcAU5CSLhc — verify it before your first connect.

Download ZIP

🛟 Updated.

k33g committed 2026-11-29T09:34:28+01:00 Browse files
0ca90cf
added .gitignore +3 -0
new file mode 100644
@@ -0,0 +1,3 @@
1+target/
2+grammars/
3+*.wasm
new file mode 100644
@@ -0,0 +1,3 @@
1+target/
2+grammars/
3+*.wasm
added .vscode/extensions.json +9 -0
new file mode 100644
@@ -0,0 +1,9 @@
1+{
2+ "recommendations": [
3+ "ms-azuretools.vscode-docker",
4+ "pkief.material-icon-theme",
5+ "pkief.material-product-icons",
6+ "aaron-bond.better-comments",
7+ "bierner.markdown-mermaid",
8+ ]
9+}
\ No newline at end of file
new file mode 100644
@@ -0,0 +1,9 @@
1+{
2+ "recommendations": [
3+ "ms-azuretools.vscode-docker",
4+ "pkief.material-icon-theme",
5+ "pkief.material-product-icons",
6+ "aaron-bond.better-comments",
7+ "bierner.markdown-mermaid",
8+ ]
9+}
\ No newline at end of file\ No newline at end of file
added .vscode/settings.json +63 -0
new file mode 100644
@@ -0,0 +1,63 @@
1+{
2+ "workbench.iconTheme": "material-icon-theme",
3+ "workbench.colorTheme": "Light Modern",
4+ "editor.fontSize": 14,
5+ "terminal.integrated.fontSize": 14,
6+ "editor.insertSpaces": true,
7+ "editor.tabSize": 4,
8+ "editor.detectIndentation": true,
9+ "files.autoSave": "afterDelay",
10+ "files.autoSaveDelay": 1000,
11+ // "editor.defaultFormatter": "esbenp.prettier-vscode",
12+ "editor.formatOnSave": true,
13+ "workbench.tree.indent": 20,
14+ //"workbench.activityBar.location": "top",
15+ "workbench.editor.showTabs": "multiple",
16+ "window.zoomLevel": 0.0,
17+ "[markdown]": {
18+ "editor.unicodeHighlight.ambiguousCharacters": false,
19+ "editor.unicodeHighlight.invisibleCharacters": false,
20+ "diffEditor.ignoreTrimWhitespace": false,
21+ "editor.fontWeight": "normal",
22+ "editor.fontFamily": "'Droid Sans Mono', 'monospace', monospace",
23+ "editor.fontSize": 14,
24+ "editor.wordWrap": "on",
25+ "editor.quickSuggestions": {
26+ "comments": "off",
27+ "strings": "off",
28+ "other": "off"
29+ }
30+ },
31+ "markdown.preview.fontSize": 14,
32+ // "workbench.editorAssociations": {
33+ // "*.md": "vscode.markdown.preview.editor"
34+ // },
35+ "markdown.marp.html": "all",
36+ "[dockerfile]": {
37+ "editor.fontSize": 14
38+ },
39+ "[dockercompose]": {
40+ "editor.fontSize": 14
41+ },
42+ "[json]": {
43+ "editor.fontSize": 14
44+ },
45+ "[yaml]": {
46+ "editor.fontSize": 14
47+ },
48+ "[go]": {
49+ "editor.fontSize": 14,
50+ "editor.codeActionsOnSave": {
51+ "source.organizeImports": "explicit"
52+ }
53+ },
54+ "go.lintTool": "golangci-lint",
55+ "go.lintOnSave": "package",
56+ "go.formatTool": "goimports",
57+ "go.useLanguageServer": true,
58+ "gopls": {
59+ "ui.semanticTokens": true,
60+ "ui.completion.usePlaceholders": true
61+ },
62+ "issuespec.groupBy": "milestone"
63+}
\ No newline at end of file
new file mode 100644
@@ -0,0 +1,63 @@
1+{
2+ "workbench.iconTheme": "material-icon-theme",
3+ "workbench.colorTheme": "Light Modern",
4+ "editor.fontSize": 14,
5+ "terminal.integrated.fontSize": 14,
6+ "editor.insertSpaces": true,
7+ "editor.tabSize": 4,
8+ "editor.detectIndentation": true,
9+ "files.autoSave": "afterDelay",
10+ "files.autoSaveDelay": 1000,
11+ // "editor.defaultFormatter": "esbenp.prettier-vscode",
12+ "editor.formatOnSave": true,
13+ "workbench.tree.indent": 20,
14+ //"workbench.activityBar.location": "top",
15+ "workbench.editor.showTabs": "multiple",
16+ "window.zoomLevel": 0.0,
17+ "[markdown]": {
18+ "editor.unicodeHighlight.ambiguousCharacters": false,
19+ "editor.unicodeHighlight.invisibleCharacters": false,
20+ "diffEditor.ignoreTrimWhitespace": false,
21+ "editor.fontWeight": "normal",
22+ "editor.fontFamily": "'Droid Sans Mono', 'monospace', monospace",
23+ "editor.fontSize": 14,
24+ "editor.wordWrap": "on",
25+ "editor.quickSuggestions": {
26+ "comments": "off",
27+ "strings": "off",
28+ "other": "off"
29+ }
30+ },
31+ "markdown.preview.fontSize": 14,
32+ // "workbench.editorAssociations": {
33+ // "*.md": "vscode.markdown.preview.editor"
34+ // },
35+ "markdown.marp.html": "all",
36+ "[dockerfile]": {
37+ "editor.fontSize": 14
38+ },
39+ "[dockercompose]": {
40+ "editor.fontSize": 14
41+ },
42+ "[json]": {
43+ "editor.fontSize": 14
44+ },
45+ "[yaml]": {
46+ "editor.fontSize": 14
47+ },
48+ "[go]": {
49+ "editor.fontSize": 14,
50+ "editor.codeActionsOnSave": {
51+ "source.organizeImports": "explicit"
52+ }
53+ },
54+ "go.lintTool": "golangci-lint",
55+ "go.lintOnSave": "package",
56+ "go.formatTool": "goimports",
57+ "go.useLanguageServer": true,
58+ "gopls": {
59+ "ui.semanticTokens": true,
60+ "ui.completion.usePlaceholders": true
61+ },
62+ "issuespec.groupBy": "milestone"
63+}
\ No newline at end of file\ No newline at end of file
added Cargo.lock +845 -0
new file mode 100644
@@ -0,0 +1,845 @@
1+# This file is automatically @generated by Cargo.
2+# It is not intended for manual editing.
3+version = 4
4+
5+[[package]]
6+name = "adler2"
7+version = "2.0.1"
8+source = "registry+https://github.com/rust-lang/crates.io-index"
9+checksum = "320119579fcad9c21884f5c4861d16174d0e06250625266f50fe6898340abefa"
10+
11+[[package]]
12+name = "anyhow"
13+version = "1.0.105"
14+source = "registry+https://github.com/rust-lang/crates.io-index"
15+checksum = "2cb931c189b85683d69a5cfad41d4d418671e1ac413dd209f3f2fc31e3cfd902"
16+
17+[[package]]
18+name = "auditable-serde"
19+version = "0.8.0"
20+source = "registry+https://github.com/rust-lang/crates.io-index"
21+checksum = "5c7bf8143dfc3c0258df908843e169b5cc5fcf76c7718bd66135ef4a9cd558c5"
22+dependencies = [
23+ "semver",
24+ "serde",
25+ "serde_json",
26+ "topological-sort",
27+]
28+
29+[[package]]
30+name = "bitflags"
31+version = "2.13.2"
32+source = "registry+https://github.com/rust-lang/crates.io-index"
33+checksum = "3ded4057c258ba199e2d26386d3af3780957ecaee6c4ef4041c6b4b8b97c0b06"
34+
35+[[package]]
36+name = "cfg-if"
37+version = "1.0.5"
38+source = "registry+https://github.com/rust-lang/crates.io-index"
39+checksum = "4e7648175b45a9a48536d676f68d918270699102aa8dab5496df06904c914600"
40+
41+[[package]]
42+name = "crc32fast"
43+version = "1.5.6"
44+source = "registry+https://github.com/rust-lang/crates.io-index"
45+checksum = "fd9ae8fcb3ea71b0b26338b4ffb13006bb175de8fd07921089a906ce7e5e6945"
46+dependencies = [
47+ "cfg-if",
48+]
49+
50+[[package]]
51+name = "displaydoc"
52+version = "0.2.7"
53+source = "registry+https://github.com/rust-lang/crates.io-index"
54+checksum = "c6232dd377dcc64799954cbd3a9bb882e9cdc1308ccd87b1c098f1fb2eaf82a8"
55+dependencies = [
56+ "proc-macro2",
57+ "quote",
58+ "syn 3.0.10",
59+]
60+
61+[[package]]
62+name = "equivalent"
63+version = "1.0.3"
64+source = "registry+https://github.com/rust-lang/crates.io-index"
65+checksum = "00d174d5400e5e8fd687ad1049e2f578285fa914201b1af7e8b112a4546bd826"
66+
67+[[package]]
68+name = "flate2"
69+version = "1.1.11"
70+source = "registry+https://github.com/rust-lang/crates.io-index"
71+checksum = "626d4928326b646e70f65ed36fc7cf9f206bdb68a0019ee7c6b4709da4e084c4"
72+dependencies = [
73+ "crc32fast",
74+ "miniz_oxide",
75+ "zlib-rs",
76+]
77+
78+[[package]]
79+name = "foldhash"
80+version = "0.1.5"
81+source = "registry+https://github.com/rust-lang/crates.io-index"
82+checksum = "d9c4f5dac5e15c24eb999c26181a6ca40b39fe946cbe4c263c7209467bc83af2"
83+
84+[[package]]
85+name = "form_urlencoded"
86+version = "1.2.3"
87+source = "registry+https://github.com/rust-lang/crates.io-index"
88+checksum = "afa489199eaffb1211795df1c6236ce1ad0d41a6fa45250add73e3b02420f06e"
89+dependencies = [
90+ "percent-encoding",
91+]
92+
93+[[package]]
94+name = "futures"
95+version = "0.3.34"
96+source = "registry+https://github.com/rust-lang/crates.io-index"
97+checksum = "9a31d2a3fbaaeb2af2368bbdd904aa8e812d3c04a1ee10d3171f52d556e5d0a3"
98+dependencies = [
99+ "futures-channel",
100+ "futures-core",
101+ "futures-executor",
102+ "futures-io",
103+ "futures-sink",
104+ "futures-task",
105+ "futures-util",
106+]
107+
108+[[package]]
109+name = "futures-channel"
110+version = "0.3.34"
111+source = "registry+https://github.com/rust-lang/crates.io-index"
112+checksum = "b1f9e3d69d39e4862ffed03ed071a76f9a13ba1d9109d355b0f0aa6b15e393c4"
113+dependencies = [
114+ "futures-core",
115+ "futures-sink",
116+]
117+
118+[[package]]
119+name = "futures-core"
120+version = "0.3.34"
121+source = "registry+https://github.com/rust-lang/crates.io-index"
122+checksum = "92d699e522242e69e3003b94ecc1f960f3a5e015aa7c5d7486e65ad01dd94f5e"
123+
124+[[package]]
125+name = "futures-executor"
126+version = "0.3.34"
127+source = "registry+https://github.com/rust-lang/crates.io-index"
128+checksum = "031b47cf1a3c6cc8bc2fc76cd437f521619387907d469316e7c0bc278f1f5432"
129+dependencies = [
130+ "futures-core",
131+ "futures-task",
132+ "futures-util",
133+]
134+
135+[[package]]
136+name = "futures-io"
137+version = "0.3.34"
138+source = "registry+https://github.com/rust-lang/crates.io-index"
139+checksum = "53c0fa8157de1303bfffdaa1cc2a673bfffb60102f76b0ef4441659124373fed"
140+
141+[[package]]
142+name = "futures-macro"
143+version = "0.3.34"
144+source = "registry+https://github.com/rust-lang/crates.io-index"
145+checksum = "9fb9654ba8355388abeb8dcb4fc62f511300867002afc858860463bdd9fe0c44"
146+dependencies = [
147+ "proc-macro2",
148+ "quote",
149+ "syn 3.0.10",
150+]
151+
152+[[package]]
153+name = "futures-sink"
154+version = "0.3.34"
155+source = "registry+https://github.com/rust-lang/crates.io-index"
156+checksum = "1944426bf7d03f1d14f708785e4b33efd750b36d48a157b836b3efc15ede8e1d"
157+
158+[[package]]
159+name = "futures-task"
160+version = "0.3.34"
161+source = "registry+https://github.com/rust-lang/crates.io-index"
162+checksum = "cd417de3d1d015fc3bfd2b1ea46dfc7bab72ef86f1cc7cc9c78e728b34a6d1fd"
163+
164+[[package]]
165+name = "futures-util"
166+version = "0.3.34"
167+source = "registry+https://github.com/rust-lang/crates.io-index"
168+checksum = "0d50a92467f8ba5dd6e3ee5d4bd04d73ab2e4e1c44474a0674821dfce14b79bc"
169+dependencies = [
170+ "futures-channel",
171+ "futures-core",
172+ "futures-io",
173+ "futures-macro",
174+ "futures-sink",
175+ "futures-task",
176+ "memchr",
177+ "pin-project-lite",
178+ "slab",
179+]
180+
181+[[package]]
182+name = "hashbrown"
183+version = "0.15.5"
184+source = "registry+https://github.com/rust-lang/crates.io-index"
185+checksum = "9229cfe53dfd69f0609a49f65461bd93001ea1ef889cd5529dd176593f5338a1"
186+dependencies = [
187+ "foldhash",
188+]
189+
190+[[package]]
191+name = "hashbrown"
192+version = "0.17.2"
193+source = "registry+https://github.com/rust-lang/crates.io-index"
194+checksum = "735eaa21a6a5ffb2e84362faaeb90c05ba8e19797ca30428478cb6ea3a4921bc"
195+
196+[[package]]
197+name = "heck"
198+version = "0.5.0"
199+source = "registry+https://github.com/rust-lang/crates.io-index"
200+checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea"
201+
202+[[package]]
203+name = "icu_collections"
204+version = "2.4.0"
205+source = "registry+https://github.com/rust-lang/crates.io-index"
206+checksum = "fe090a42a0d3140fed8c63263ed1fecc02422cb2f4bfe55cd8de2de1b8e105dd"
207+dependencies = [
208+ "displaydoc",
209+ "potential_utf",
210+ "utf8_iter",
211+ "yoke",
212+ "zerofrom",
213+ "zerovec",
214+]
215+
216+[[package]]
217+name = "icu_locale_core"
218+version = "2.4.0"
219+source = "registry+https://github.com/rust-lang/crates.io-index"
220+checksum = "25d29b57c17c6528d0dc4c2141cfa2d08200465acb537a3909c8b9b8a4a984c0"
221+dependencies = [
222+ "displaydoc",
223+ "litemap",
224+ "tinystr",
225+ "writeable",
226+ "zerovec",
227+]
228+
229+[[package]]
230+name = "icu_normalizer"
231+version = "2.4.0"
232+source = "registry+https://github.com/rust-lang/crates.io-index"
233+checksum = "404a3b8c486f205c87fe7f23ab6894d84a4ad76d6e4671ae1981ba7def87c599"
234+dependencies = [
235+ "icu_collections",
236+ "icu_normalizer_data",
237+ "icu_properties",
238+ "icu_provider",
239+ "smallvec",
240+ "zerovec",
241+]
242+
243+[[package]]
244+name = "icu_normalizer_data"
245+version = "2.4.0"
246+source = "registry+https://github.com/rust-lang/crates.io-index"
247+checksum = "20f0088bfb7441f7a37fa0c9e20cb1e9cba1cac6b9ce8cd2a6dc44294f8e8cbc"
248+
249+[[package]]
250+name = "icu_properties"
251+version = "2.4.0"
252+source = "registry+https://github.com/rust-lang/crates.io-index"
253+checksum = "2ea83d991c56158f7cf898bf86436c1dfe7c07ee82fe88951f2695c9f37a379f"
254+dependencies = [
255+ "displaydoc",
256+ "icu_collections",
257+ "icu_locale_core",
258+ "icu_properties_data",
259+ "icu_provider",
260+ "zerotrie",
261+ "zerovec",
262+]
263+
264+[[package]]
265+name = "icu_properties_data"
266+version = "2.4.0"
267+source = "registry+https://github.com/rust-lang/crates.io-index"
268+checksum = "b98f29af82d02b163fe50161388350e743bb3107cc8e8c2f7314cb505faddfcf"
269+
270+[[package]]
271+name = "icu_provider"
272+version = "2.4.0"
273+source = "registry+https://github.com/rust-lang/crates.io-index"
274+checksum = "413099315636c588ee8f011190b329b971a09a8fae9d157e01dcae8379468514"
275+dependencies = [
276+ "displaydoc",
277+ "icu_locale_core",
278+ "writeable",
279+ "yoke",
280+ "zerofrom",
281+ "zerotrie",
282+ "zerovec",
283+]
284+
285+[[package]]
286+name = "id-arena"
287+version = "2.3.0"
288+source = "registry+https://github.com/rust-lang/crates.io-index"
289+checksum = "3d3067d79b975e8844ca9eb072e16b31c3c1c36928edf9c6789548c524d0d954"
290+
291+[[package]]
292+name = "idna"
293+version = "1.1.0"
294+source = "registry+https://github.com/rust-lang/crates.io-index"
295+checksum = "3b0875f23caa03898994f6ddc501886a45c7d3d62d04d2d90788d47be1b1e4de"
296+dependencies = [
297+ "idna_adapter",
298+ "smallvec",
299+ "utf8_iter",
300+]
301+
302+[[package]]
303+name = "idna_adapter"
304+version = "1.2.2"
305+source = "registry+https://github.com/rust-lang/crates.io-index"
306+checksum = "cb68373c0d6620ef8105e855e7745e18b0d00d3bdb07fb532e434244cdb9a714"
307+dependencies = [
308+ "icu_normalizer",
309+ "icu_properties",
310+]
311+
312+[[package]]
313+name = "indexmap"
314+version = "2.14.2"
315+source = "registry+https://github.com/rust-lang/crates.io-index"
316+checksum = "cc4e190f5d26ca7051642629da2c52fc03bde85a03197c99408dcd291734c855"
317+dependencies = [
318+ "equivalent",
319+ "hashbrown 0.17.2",
320+ "serde",
321+ "serde_core",
322+]
323+
324+[[package]]
325+name = "itoa"
326+version = "1.0.19"
327+source = "registry+https://github.com/rust-lang/crates.io-index"
328+checksum = "3bd1574e617a9a6c1f8f8181bd7e841e1f20e4277607ef28945765188d6284d4"
329+
330+[[package]]
331+name = "leb128fmt"
332+version = "0.1.0"
333+source = "registry+https://github.com/rust-lang/crates.io-index"
334+checksum = "09edd9e8b54e49e587e4f6295a7d29c3ea94d469cb40ab8ca70b288248a81db2"
335+
336+[[package]]
337+name = "litemap"
338+version = "0.8.3"
339+source = "registry+https://github.com/rust-lang/crates.io-index"
340+checksum = "47d9d19d1d6efa0109d2f65ff4c85cddd50bd572e5a00127ab10987290bcefae"
341+
342+[[package]]
343+name = "log"
344+version = "0.4.35"
345+source = "registry+https://github.com/rust-lang/crates.io-index"
346+checksum = "5d15f86d12da44cd8d4ec3c73984537eb7f4cadcb9776a575a0a8a05ca11005c"
347+
348+[[package]]
349+name = "memchr"
350+version = "2.8.3"
351+source = "registry+https://github.com/rust-lang/crates.io-index"
352+checksum = "cf8baf1c55e62ffcace7a9f06f4bd9cd3f0c4beb022d3b367256b91b87513d98"
353+
354+[[package]]
355+name = "miniz_oxide"
356+version = "0.9.1"
357+source = "registry+https://github.com/rust-lang/crates.io-index"
358+checksum = "b63fbc4a50860e98e7b2aa7804ded1db5cbc3aff9193adaff57a6931bf7c4b4c"
359+dependencies = [
360+ "adler2",
361+ "simd-adler32",
362+]
363+
364+[[package]]
365+name = "once_cell"
366+version = "1.21.4"
367+source = "registry+https://github.com/rust-lang/crates.io-index"
368+checksum = "9f7c3e4beb33f85d45ae3e3a1792185706c8e16d043238c593331cc7cd313b50"
369+
370+[[package]]
371+name = "percent-encoding"
372+version = "2.3.2"
373+source = "registry+https://github.com/rust-lang/crates.io-index"
374+checksum = "9b4f627cb1b25917193a259e49bdad08f671f8d9708acfd5fe0a8c1455d87220"
375+
376+[[package]]
377+name = "pin-project-lite"
378+version = "0.2.18"
379+source = "registry+https://github.com/rust-lang/crates.io-index"
380+checksum = "c938015719552d665fd0553b90d96cd7ff58e83e4c061ca99e6bb78865a72752"
381+
382+[[package]]
383+name = "potential_utf"
384+version = "0.1.6"
385+source = "registry+https://github.com/rust-lang/crates.io-index"
386+checksum = "d83eb9bc6d8e5cf568e7a1101d60ee05e81ed50ea106026f3d18deeb046d7661"
387+dependencies = [
388+ "zerovec",
389+]
390+
391+[[package]]
392+name = "prettyplease"
393+version = "0.2.37"
394+source = "registry+https://github.com/rust-lang/crates.io-index"
395+checksum = "479ca8adacdd7ce8f1fb39ce9ecccbfe93a3f1344b3d0d97f20bc0196208f62b"
396+dependencies = [
397+ "proc-macro2",
398+ "syn 2.0.119",
399+]
400+
401+[[package]]
402+name = "proc-macro2"
403+version = "1.0.107"
404+source = "registry+https://github.com/rust-lang/crates.io-index"
405+checksum = "985e7ec9bb745e6ce6535b544d84d6cd6f7ad8bd711c398938ae983b91a766d9"
406+dependencies = [
407+ "unicode-ident",
408+]
409+
410+[[package]]
411+name = "quote"
412+version = "1.0.47"
413+source = "registry+https://github.com/rust-lang/crates.io-index"
414+checksum = "1fbf4db142a473a8d80c26bbf18454ed458bf8d26c8219c331daecfdbd079001"
415+dependencies = [
416+ "proc-macro2",
417+]
418+
419+[[package]]
420+name = "semver"
421+version = "1.0.28"
422+source = "registry+https://github.com/rust-lang/crates.io-index"
423+checksum = "8a7852d02fc848982e0c167ef163aaff9cd91dc640ba85e263cb1ce46fae51cd"
424+dependencies = [
425+ "serde",
426+ "serde_core",
427+]
428+
429+[[package]]
430+name = "serde"
431+version = "1.0.229"
432+source = "registry+https://github.com/rust-lang/crates.io-index"
433+checksum = "4148590afebada386688f18773da617792bf2ef03ffc1e4cbd2b1d45b023e0ba"
434+dependencies = [
435+ "serde_core",
436+ "serde_derive",
437+]
438+
439+[[package]]
440+name = "serde_core"
441+version = "1.0.229"
442+source = "registry+https://github.com/rust-lang/crates.io-index"
443+checksum = "67dca2c9c51e58a4791a4b1ed58308b39c64224d349a935ab5039aa360942a48"
444+dependencies = [
445+ "serde_derive",
446+]
447+
448+[[package]]
449+name = "serde_derive"
450+version = "1.0.229"
451+source = "registry+https://github.com/rust-lang/crates.io-index"
452+checksum = "e7a5d71263a5a7d47b41f6b3f06ba276f10cc18b0931f1799f710578e2309348"
453+dependencies = [
454+ "proc-macro2",
455+ "quote",
456+ "syn 3.0.10",
457+]
458+
459+[[package]]
460+name = "serde_json"
461+version = "1.0.154"
462+source = "registry+https://github.com/rust-lang/crates.io-index"
463+checksum = "e7e9cc8b1b85264074fbcc02a88680c4096b1e47df8f739dceb03bf482f04bd6"
464+dependencies = [
465+ "itoa",
466+ "memchr",
467+ "serde",
468+ "serde_core",
469+ "zmij",
470+]
471+
472+[[package]]
473+name = "simd-adler32"
474+version = "0.3.10"
475+source = "registry+https://github.com/rust-lang/crates.io-index"
476+checksum = "3a219298ac11a56ea9a6d2120044824d6f01aeb034955e7af7bc16858527deea"
477+
478+[[package]]
479+name = "slab"
480+version = "0.4.12"
481+source = "registry+https://github.com/rust-lang/crates.io-index"
482+checksum = "0c790de23124f9ab44544d7ac05d60440adc586479ce501c1d6d7da3cd8c9cf5"
483+
484+[[package]]
485+name = "smallvec"
486+version = "1.16.6"
487+source = "registry+https://github.com/rust-lang/crates.io-index"
488+checksum = "3244542535d5de959d90ec55d1b5ff0fd2bb7b1310223907d5f11932847f7b59"
489+
490+[[package]]
491+name = "spdx"
492+version = "0.10.9"
493+source = "registry+https://github.com/rust-lang/crates.io-index"
494+checksum = "c3e17e880bafaeb362a7b751ec46bdc5b61445a188f80e0606e68167cd540fa3"
495+dependencies = [
496+ "smallvec",
497+]
498+
499+[[package]]
500+name = "stable_deref_trait"
501+version = "1.2.1"
502+source = "registry+https://github.com/rust-lang/crates.io-index"
503+checksum = "6ce2be8dc25455e1f91df71bfa12ad37d7af1092ae736f3a6cd0e37bc7810596"
504+
505+[[package]]
506+name = "syn"
507+version = "2.0.119"
508+source = "registry+https://github.com/rust-lang/crates.io-index"
509+checksum = "872831b642d1a07999a962a351ed35b955ea2cfc8f3862091e2a240a84f17297"
510+dependencies = [
511+ "proc-macro2",
512+ "quote",
513+ "unicode-ident",
514+]
515+
516+[[package]]
517+name = "syn"
518+version = "3.0.10"
519+source = "registry+https://github.com/rust-lang/crates.io-index"
520+checksum = "4ae9ccbea3a7b0b09443036490c8f34a8b1b760fd345e5c0dae0aac718faea79"
521+dependencies = [
522+ "proc-macro2",
523+ "quote",
524+ "unicode-ident",
525+]
526+
527+[[package]]
528+name = "synstructure"
529+version = "0.14.0"
530+source = "registry+https://github.com/rust-lang/crates.io-index"
531+checksum = "901704edd0dfe137f1987838ee4f259e4e063c31371bdb423f7ae38ec6f77f02"
532+dependencies = [
533+ "proc-macro2",
534+ "quote",
535+ "syn 3.0.10",
536+]
537+
538+[[package]]
539+name = "tinystr"
540+version = "0.8.5"
541+source = "registry+https://github.com/rust-lang/crates.io-index"
542+checksum = "abc840c238154d58f9e86b2792261edfde565a17696e1cda1a449de27979801a"
543+dependencies = [
544+ "displaydoc",
545+ "zerovec",
546+]
547+
548+[[package]]
549+name = "topological-sort"
550+version = "0.2.2"
551+source = "registry+https://github.com/rust-lang/crates.io-index"
552+checksum = "ea68304e134ecd095ac6c3574494fc62b909f416c4fca77e440530221e549d3d"
553+
554+[[package]]
555+name = "unicode-ident"
556+version = "1.0.27"
557+source = "registry+https://github.com/rust-lang/crates.io-index"
558+checksum = "a2c754d6c33795a1c324727428e5a7dedb5b06195f9890bdbcba760d3e246563"
559+
560+[[package]]
561+name = "unicode-xid"
562+version = "0.2.6"
563+source = "registry+https://github.com/rust-lang/crates.io-index"
564+checksum = "ebc1c04c71510c7f702b52b7c350734c9ff1295c464a03335b00bb84fc54f853"
565+
566+[[package]]
567+name = "url"
568+version = "2.5.9"
569+source = "registry+https://github.com/rust-lang/crates.io-index"
570+checksum = "f00cd2407bb42c0ef17be88d4cf020f5cceffd121665bac9b8b9493a369b3b1a"
571+dependencies = [
572+ "form_urlencoded",
573+ "idna",
574+ "percent-encoding",
575+ "serde",
576+]
577+
578+[[package]]
579+name = "utf8_iter"
580+version = "1.1.0"
581+source = "registry+https://github.com/rust-lang/crates.io-index"
582+checksum = "af3bd9d3e571c26fcce9d033b87ea5ab061b8d2ffe9b7a5675d810d68f03edf0"
583+dependencies = [
584+ "utf_types",
585+]
586+
587+[[package]]
588+name = "utf_types"
589+version = "1.0.0"
590+source = "registry+https://github.com/rust-lang/crates.io-index"
591+checksum = "3a3b425286980a367278453f3b6d28cdcb134b574e5a35824a6ff5eebad50bb6"
592+
593+[[package]]
594+name = "wasm-encoder"
595+version = "0.227.1"
596+source = "registry+https://github.com/rust-lang/crates.io-index"
597+checksum = "80bb72f02e7fbf07183443b27b0f3d4144abf8c114189f2e088ed95b696a7822"
598+dependencies = [
599+ "leb128fmt",
600+ "wasmparser",
601+]
602+
603+[[package]]
604+name = "wasm-metadata"
605+version = "0.227.1"
606+source = "registry+https://github.com/rust-lang/crates.io-index"
607+checksum = "ce1ef0faabbbba6674e97a56bee857ccddf942785a336c8b47b42373c922a91d"
608+dependencies = [
609+ "anyhow",
610+ "auditable-serde",
611+ "flate2",
612+ "indexmap",
613+ "serde",
614+ "serde_derive",
615+ "serde_json",
616+ "spdx",
617+ "url",
618+ "wasm-encoder",
619+ "wasmparser",
620+]
621+
622+[[package]]
623+name = "wasmparser"
624+version = "0.227.1"
625+source = "registry+https://github.com/rust-lang/crates.io-index"
626+checksum = "0f51cad774fb3c9461ab9bccc9c62dfb7388397b5deda31bf40e8108ccd678b2"
627+dependencies = [
628+ "bitflags",
629+ "hashbrown 0.15.5",
630+ "indexmap",
631+ "semver",
632+]
633+
634+[[package]]
635+name = "wit-bindgen"
636+version = "0.41.0"
637+source = "registry+https://github.com/rust-lang/crates.io-index"
638+checksum = "10fb6648689b3929d56bbc7eb1acf70c9a42a29eb5358c67c10f54dbd5d695de"
639+dependencies = [
640+ "wit-bindgen-rt",
641+ "wit-bindgen-rust-macro",
642+]
643+
644+[[package]]
645+name = "wit-bindgen-core"
646+version = "0.41.0"
647+source = "registry+https://github.com/rust-lang/crates.io-index"
648+checksum = "92fa781d4f2ff6d3f27f3cc9b74a73327b31ca0dc4a3ef25a0ce2983e0e5af9b"
649+dependencies = [
650+ "anyhow",
651+ "heck",
652+ "wit-parser",
653+]
654+
655+[[package]]
656+name = "wit-bindgen-rt"
657+version = "0.41.0"
658+source = "registry+https://github.com/rust-lang/crates.io-index"
659+checksum = "c4db52a11d4dfb0a59f194c064055794ee6564eb1ced88c25da2cf76e50c5621"
660+dependencies = [
661+ "bitflags",
662+ "futures",
663+ "once_cell",
664+]
665+
666+[[package]]
667+name = "wit-bindgen-rust"
668+version = "0.41.0"
669+source = "registry+https://github.com/rust-lang/crates.io-index"
670+checksum = "9d0809dc5ba19e2e98661bf32fc0addc5a3ca5bf3a6a7083aa6ba484085ff3ce"
671+dependencies = [
672+ "anyhow",
673+ "heck",
674+ "indexmap",
675+ "prettyplease",
676+ "syn 2.0.119",
677+ "wasm-metadata",
678+ "wit-bindgen-core",
679+ "wit-component",
680+]
681+
682+[[package]]
683+name = "wit-bindgen-rust-macro"
684+version = "0.41.0"
685+source = "registry+https://github.com/rust-lang/crates.io-index"
686+checksum = "ad19eec017904e04c60719592a803ee5da76cb51c81e3f6fbf9457f59db49799"
687+dependencies = [
688+ "anyhow",
689+ "prettyplease",
690+ "proc-macro2",
691+ "quote",
692+ "syn 2.0.119",
693+ "wit-bindgen-core",
694+ "wit-bindgen-rust",
695+]
696+
697+[[package]]
698+name = "wit-component"
699+version = "0.227.1"
700+source = "registry+https://github.com/rust-lang/crates.io-index"
701+checksum = "635c3adc595422cbf2341a17fb73a319669cc8d33deed3a48368a841df86b676"
702+dependencies = [
703+ "anyhow",
704+ "bitflags",
705+ "indexmap",
706+ "log",
707+ "serde",
708+ "serde_derive",
709+ "serde_json",
710+ "wasm-encoder",
711+ "wasm-metadata",
712+ "wasmparser",
713+ "wit-parser",
714+]
715+
716+[[package]]
717+name = "wit-parser"
718+version = "0.227.1"
719+source = "registry+https://github.com/rust-lang/crates.io-index"
720+checksum = "ddf445ed5157046e4baf56f9138c124a0824d4d1657e7204d71886ad8ce2fc11"
721+dependencies = [
722+ "anyhow",
723+ "id-arena",
724+ "indexmap",
725+ "log",
726+ "semver",
727+ "serde",
728+ "serde_derive",
729+ "serde_json",
730+ "unicode-xid",
731+ "wasmparser",
732+]
733+
734+[[package]]
735+name = "writeable"
736+version = "0.6.4"
737+source = "registry+https://github.com/rust-lang/crates.io-index"
738+checksum = "3ad82d2a33cdc9674dc7465672f271e096168fcdbe0f799d9e6db8c5892679dc"
739+
740+[[package]]
741+name = "yoke"
742+version = "0.8.4"
743+source = "registry+https://github.com/rust-lang/crates.io-index"
744+checksum = "417ef3fcf6c300b7dbd25c85531a746931c02ad536f3cf4786ed1e88223340b3"
745+dependencies = [
746+ "stable_deref_trait",
747+ "yoke-derive",
748+ "zerofrom",
749+]
750+
751+[[package]]
752+name = "yoke-derive"
753+version = "0.8.4"
754+source = "registry+https://github.com/rust-lang/crates.io-index"
755+checksum = "ec8ebde2db3681e8c9980cc27822030e68752690ddfa9473e739aeb4dbde6d71"
756+dependencies = [
757+ "proc-macro2",
758+ "quote",
759+ "syn 3.0.10",
760+ "synstructure",
761+]
762+
763+[[package]]
764+name = "zed_extension_api"
765+version = "0.7.0"
766+source = "registry+https://github.com/rust-lang/crates.io-index"
767+checksum = "0729d50b4ca0a7e28e590bbe32e3ca0194d97ef654961451a424c661a366fca0"
768+dependencies = [
769+ "serde",
770+ "serde_json",
771+ "wit-bindgen",
772+]
773+
774+[[package]]
775+name = "zed_grain"
776+version = "0.1.0"
777+dependencies = [
778+ "zed_extension_api",
779+]
780+
781+[[package]]
782+name = "zerofrom"
783+version = "0.1.8"
784+source = "registry+https://github.com/rust-lang/crates.io-index"
785+checksum = "0ec05a11813ea801ff6d75110ad09cd0824ddba17dfe17128ea0d5f68e6c5272"
786+dependencies = [
787+ "zerofrom-derive",
788+]
789+
790+[[package]]
791+name = "zerofrom-derive"
792+version = "0.1.8"
793+source = "registry+https://github.com/rust-lang/crates.io-index"
794+checksum = "f75b4683f6c7f45248d4d64056a24298c6281e0993356d7d1b4a1a962ef10d4a"
795+dependencies = [
796+ "proc-macro2",
797+ "quote",
798+ "syn 3.0.10",
799+ "synstructure",
800+]
801+
802+[[package]]
803+name = "zerotrie"
804+version = "0.2.5"
805+source = "registry+https://github.com/rust-lang/crates.io-index"
806+checksum = "4ea269c3bd32f0a32c321907a2ae912ba6f4649bb0fc764a15627e99a7095a3f"
807+dependencies = [
808+ "displaydoc",
809+ "yoke",
810+ "zerofrom",
811+]
812+
813+[[package]]
814+name = "zerovec"
815+version = "0.11.9"
816+source = "registry+https://github.com/rust-lang/crates.io-index"
817+checksum = "f58a2799cfe9a1670c7ea8edbd52ef8edb93cb37a7f83bf31ba9e35d9dae6a40"
818+dependencies = [
819+ "yoke",
820+ "zerofrom",
821+ "zerovec-derive",
822+]
823+
824+[[package]]
825+name = "zerovec-derive"
826+version = "0.11.7"
827+source = "registry+https://github.com/rust-lang/crates.io-index"
828+checksum = "c3743ddbf47738d929cd1ae2e199d40d0162979dfe31aef8ae646d2bf00bf97a"
829+dependencies = [
830+ "proc-macro2",
831+ "quote",
832+ "syn 3.0.10",
833+]
834+
835+[[package]]
836+name = "zlib-rs"
837+version = "0.6.9"
838+source = "registry+https://github.com/rust-lang/crates.io-index"
839+checksum = "aa76918995d776d9dd34d371030be228d021137449771493d56e29f77e4148ac"
840+
841+[[package]]
842+name = "zmij"
843+version = "1.0.23"
844+source = "registry+https://github.com/rust-lang/crates.io-index"
845+checksum = "29666d0abbfad1e3dc4dcf6144730dd3a3ab225bbbdac83319345b1b44ccfc1b"
new file mode 100644
@@ -0,0 +1,845 @@
1+# This file is automatically @generated by Cargo.
2+# It is not intended for manual editing.
3+version = 4
4+
5+[[package]]
6+name = "adler2"
7+version = "2.0.1"
8+source = "registry+https://github.com/rust-lang/crates.io-index"
9+checksum = "320119579fcad9c21884f5c4861d16174d0e06250625266f50fe6898340abefa"
10+
11+[[package]]
12+name = "anyhow"
13+version = "1.0.105"
14+source = "registry+https://github.com/rust-lang/crates.io-index"
15+checksum = "2cb931c189b85683d69a5cfad41d4d418671e1ac413dd209f3f2fc31e3cfd902"
16+
17+[[package]]
18+name = "auditable-serde"
19+version = "0.8.0"
20+source = "registry+https://github.com/rust-lang/crates.io-index"
21+checksum = "5c7bf8143dfc3c0258df908843e169b5cc5fcf76c7718bd66135ef4a9cd558c5"
22+dependencies = [
23+ "semver",
24+ "serde",
25+ "serde_json",
26+ "topological-sort",
27+]
28+
29+[[package]]
30+name = "bitflags"
31+version = "2.13.2"
32+source = "registry+https://github.com/rust-lang/crates.io-index"
33+checksum = "3ded4057c258ba199e2d26386d3af3780957ecaee6c4ef4041c6b4b8b97c0b06"
34+
35+[[package]]
36+name = "cfg-if"
37+version = "1.0.5"
38+source = "registry+https://github.com/rust-lang/crates.io-index"
39+checksum = "4e7648175b45a9a48536d676f68d918270699102aa8dab5496df06904c914600"
40+
41+[[package]]
42+name = "crc32fast"
43+version = "1.5.6"
44+source = "registry+https://github.com/rust-lang/crates.io-index"
45+checksum = "fd9ae8fcb3ea71b0b26338b4ffb13006bb175de8fd07921089a906ce7e5e6945"
46+dependencies = [
47+ "cfg-if",
48+]
49+
50+[[package]]
51+name = "displaydoc"
52+version = "0.2.7"
53+source = "registry+https://github.com/rust-lang/crates.io-index"
54+checksum = "c6232dd377dcc64799954cbd3a9bb882e9cdc1308ccd87b1c098f1fb2eaf82a8"
55+dependencies = [
56+ "proc-macro2",
57+ "quote",
58+ "syn 3.0.10",
59+]
60+
61+[[package]]
62+name = "equivalent"
63+version = "1.0.3"
64+source = "registry+https://github.com/rust-lang/crates.io-index"
65+checksum = "00d174d5400e5e8fd687ad1049e2f578285fa914201b1af7e8b112a4546bd826"
66+
67+[[package]]
68+name = "flate2"
69+version = "1.1.11"
70+source = "registry+https://github.com/rust-lang/crates.io-index"
71+checksum = "626d4928326b646e70f65ed36fc7cf9f206bdb68a0019ee7c6b4709da4e084c4"
72+dependencies = [
73+ "crc32fast",
74+ "miniz_oxide",
75+ "zlib-rs",
76+]
77+
78+[[package]]
79+name = "foldhash"
80+version = "0.1.5"
81+source = "registry+https://github.com/rust-lang/crates.io-index"
82+checksum = "d9c4f5dac5e15c24eb999c26181a6ca40b39fe946cbe4c263c7209467bc83af2"
83+
84+[[package]]
85+name = "form_urlencoded"
86+version = "1.2.3"
87+source = "registry+https://github.com/rust-lang/crates.io-index"
88+checksum = "afa489199eaffb1211795df1c6236ce1ad0d41a6fa45250add73e3b02420f06e"
89+dependencies = [
90+ "percent-encoding",
91+]
92+
93+[[package]]
94+name = "futures"
95+version = "0.3.34"
96+source = "registry+https://github.com/rust-lang/crates.io-index"
97+checksum = "9a31d2a3fbaaeb2af2368bbdd904aa8e812d3c04a1ee10d3171f52d556e5d0a3"
98+dependencies = [
99+ "futures-channel",
100+ "futures-core",
101+ "futures-executor",
102+ "futures-io",
103+ "futures-sink",
104+ "futures-task",
105+ "futures-util",
106+]
107+
108+[[package]]
109+name = "futures-channel"
110+version = "0.3.34"
111+source = "registry+https://github.com/rust-lang/crates.io-index"
112+checksum = "b1f9e3d69d39e4862ffed03ed071a76f9a13ba1d9109d355b0f0aa6b15e393c4"
113+dependencies = [
114+ "futures-core",
115+ "futures-sink",
116+]
117+
118+[[package]]
119+name = "futures-core"
120+version = "0.3.34"
121+source = "registry+https://github.com/rust-lang/crates.io-index"
122+checksum = "92d699e522242e69e3003b94ecc1f960f3a5e015aa7c5d7486e65ad01dd94f5e"
123+
124+[[package]]
125+name = "futures-executor"
126+version = "0.3.34"
127+source = "registry+https://github.com/rust-lang/crates.io-index"
128+checksum = "031b47cf1a3c6cc8bc2fc76cd437f521619387907d469316e7c0bc278f1f5432"
129+dependencies = [
130+ "futures-core",
131+ "futures-task",
132+ "futures-util",
133+]
134+
135+[[package]]
136+name = "futures-io"
137+version = "0.3.34"
138+source = "registry+https://github.com/rust-lang/crates.io-index"
139+checksum = "53c0fa8157de1303bfffdaa1cc2a673bfffb60102f76b0ef4441659124373fed"
140+
141+[[package]]
142+name = "futures-macro"
143+version = "0.3.34"
144+source = "registry+https://github.com/rust-lang/crates.io-index"
145+checksum = "9fb9654ba8355388abeb8dcb4fc62f511300867002afc858860463bdd9fe0c44"
146+dependencies = [
147+ "proc-macro2",
148+ "quote",
149+ "syn 3.0.10",
150+]
151+
152+[[package]]
153+name = "futures-sink"
154+version = "0.3.34"
155+source = "registry+https://github.com/rust-lang/crates.io-index"
156+checksum = "1944426bf7d03f1d14f708785e4b33efd750b36d48a157b836b3efc15ede8e1d"
157+
158+[[package]]
159+name = "futures-task"
160+version = "0.3.34"
161+source = "registry+https://github.com/rust-lang/crates.io-index"
162+checksum = "cd417de3d1d015fc3bfd2b1ea46dfc7bab72ef86f1cc7cc9c78e728b34a6d1fd"
163+
164+[[package]]
165+name = "futures-util"
166+version = "0.3.34"
167+source = "registry+https://github.com/rust-lang/crates.io-index"
168+checksum = "0d50a92467f8ba5dd6e3ee5d4bd04d73ab2e4e1c44474a0674821dfce14b79bc"
169+dependencies = [
170+ "futures-channel",
171+ "futures-core",
172+ "futures-io",
173+ "futures-macro",
174+ "futures-sink",
175+ "futures-task",
176+ "memchr",
177+ "pin-project-lite",
178+ "slab",
179+]
180+
181+[[package]]
182+name = "hashbrown"
183+version = "0.15.5"
184+source = "registry+https://github.com/rust-lang/crates.io-index"
185+checksum = "9229cfe53dfd69f0609a49f65461bd93001ea1ef889cd5529dd176593f5338a1"
186+dependencies = [
187+ "foldhash",
188+]
189+
190+[[package]]
191+name = "hashbrown"
192+version = "0.17.2"
193+source = "registry+https://github.com/rust-lang/crates.io-index"
194+checksum = "735eaa21a6a5ffb2e84362faaeb90c05ba8e19797ca30428478cb6ea3a4921bc"
195+
196+[[package]]
197+name = "heck"
198+version = "0.5.0"
199+source = "registry+https://github.com/rust-lang/crates.io-index"
200+checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea"
201+
202+[[package]]
203+name = "icu_collections"
204+version = "2.4.0"
205+source = "registry+https://github.com/rust-lang/crates.io-index"
206+checksum = "fe090a42a0d3140fed8c63263ed1fecc02422cb2f4bfe55cd8de2de1b8e105dd"
207+dependencies = [
208+ "displaydoc",
209+ "potential_utf",
210+ "utf8_iter",
211+ "yoke",
212+ "zerofrom",
213+ "zerovec",
214+]
215+
216+[[package]]
217+name = "icu_locale_core"
218+version = "2.4.0"
219+source = "registry+https://github.com/rust-lang/crates.io-index"
220+checksum = "25d29b57c17c6528d0dc4c2141cfa2d08200465acb537a3909c8b9b8a4a984c0"
221+dependencies = [
222+ "displaydoc",
223+ "litemap",
224+ "tinystr",
225+ "writeable",
226+ "zerovec",
227+]
228+
229+[[package]]
230+name = "icu_normalizer"
231+version = "2.4.0"
232+source = "registry+https://github.com/rust-lang/crates.io-index"
233+checksum = "404a3b8c486f205c87fe7f23ab6894d84a4ad76d6e4671ae1981ba7def87c599"
234+dependencies = [
235+ "icu_collections",
236+ "icu_normalizer_data",
237+ "icu_properties",
238+ "icu_provider",
239+ "smallvec",
240+ "zerovec",
241+]
242+
243+[[package]]
244+name = "icu_normalizer_data"
245+version = "2.4.0"
246+source = "registry+https://github.com/rust-lang/crates.io-index"
247+checksum = "20f0088bfb7441f7a37fa0c9e20cb1e9cba1cac6b9ce8cd2a6dc44294f8e8cbc"
248+
249+[[package]]
250+name = "icu_properties"
251+version = "2.4.0"
252+source = "registry+https://github.com/rust-lang/crates.io-index"
253+checksum = "2ea83d991c56158f7cf898bf86436c1dfe7c07ee82fe88951f2695c9f37a379f"
254+dependencies = [
255+ "displaydoc",
256+ "icu_collections",
257+ "icu_locale_core",
258+ "icu_properties_data",
259+ "icu_provider",
260+ "zerotrie",
261+ "zerovec",
262+]
263+
264+[[package]]
265+name = "icu_properties_data"
266+version = "2.4.0"
267+source = "registry+https://github.com/rust-lang/crates.io-index"
268+checksum = "b98f29af82d02b163fe50161388350e743bb3107cc8e8c2f7314cb505faddfcf"
269+
270+[[package]]
271+name = "icu_provider"
272+version = "2.4.0"
273+source = "registry+https://github.com/rust-lang/crates.io-index"
274+checksum = "413099315636c588ee8f011190b329b971a09a8fae9d157e01dcae8379468514"
275+dependencies = [
276+ "displaydoc",
277+ "icu_locale_core",
278+ "writeable",
279+ "yoke",
280+ "zerofrom",
281+ "zerotrie",
282+ "zerovec",
283+]
284+
285+[[package]]
286+name = "id-arena"
287+version = "2.3.0"
288+source = "registry+https://github.com/rust-lang/crates.io-index"
289+checksum = "3d3067d79b975e8844ca9eb072e16b31c3c1c36928edf9c6789548c524d0d954"
290+
291+[[package]]
292+name = "idna"
293+version = "1.1.0"
294+source = "registry+https://github.com/rust-lang/crates.io-index"
295+checksum = "3b0875f23caa03898994f6ddc501886a45c7d3d62d04d2d90788d47be1b1e4de"
296+dependencies = [
297+ "idna_adapter",
298+ "smallvec",
299+ "utf8_iter",
300+]
301+
302+[[package]]
303+name = "idna_adapter"
304+version = "1.2.2"
305+source = "registry+https://github.com/rust-lang/crates.io-index"
306+checksum = "cb68373c0d6620ef8105e855e7745e18b0d00d3bdb07fb532e434244cdb9a714"
307+dependencies = [
308+ "icu_normalizer",
309+ "icu_properties",
310+]
311+
312+[[package]]
313+name = "indexmap"
314+version = "2.14.2"
315+source = "registry+https://github.com/rust-lang/crates.io-index"
316+checksum = "cc4e190f5d26ca7051642629da2c52fc03bde85a03197c99408dcd291734c855"
317+dependencies = [
318+ "equivalent",
319+ "hashbrown 0.17.2",
320+ "serde",
321+ "serde_core",
322+]
323+
324+[[package]]
325+name = "itoa"
326+version = "1.0.19"
327+source = "registry+https://github.com/rust-lang/crates.io-index"
328+checksum = "3bd1574e617a9a6c1f8f8181bd7e841e1f20e4277607ef28945765188d6284d4"
329+
330+[[package]]
331+name = "leb128fmt"
332+version = "0.1.0"
333+source = "registry+https://github.com/rust-lang/crates.io-index"
334+checksum = "09edd9e8b54e49e587e4f6295a7d29c3ea94d469cb40ab8ca70b288248a81db2"
335+
336+[[package]]
337+name = "litemap"
338+version = "0.8.3"
339+source = "registry+https://github.com/rust-lang/crates.io-index"
340+checksum = "47d9d19d1d6efa0109d2f65ff4c85cddd50bd572e5a00127ab10987290bcefae"
341+
342+[[package]]
343+name = "log"
344+version = "0.4.35"
345+source = "registry+https://github.com/rust-lang/crates.io-index"
346+checksum = "5d15f86d12da44cd8d4ec3c73984537eb7f4cadcb9776a575a0a8a05ca11005c"
347+
348+[[package]]
349+name = "memchr"
350+version = "2.8.3"
351+source = "registry+https://github.com/rust-lang/crates.io-index"
352+checksum = "cf8baf1c55e62ffcace7a9f06f4bd9cd3f0c4beb022d3b367256b91b87513d98"
353+
354+[[package]]
355+name = "miniz_oxide"
356+version = "0.9.1"
357+source = "registry+https://github.com/rust-lang/crates.io-index"
358+checksum = "b63fbc4a50860e98e7b2aa7804ded1db5cbc3aff9193adaff57a6931bf7c4b4c"
359+dependencies = [
360+ "adler2",
361+ "simd-adler32",
362+]
363+
364+[[package]]
365+name = "once_cell"
366+version = "1.21.4"
367+source = "registry+https://github.com/rust-lang/crates.io-index"
368+checksum = "9f7c3e4beb33f85d45ae3e3a1792185706c8e16d043238c593331cc7cd313b50"
369+
370+[[package]]
371+name = "percent-encoding"
372+version = "2.3.2"
373+source = "registry+https://github.com/rust-lang/crates.io-index"
374+checksum = "9b4f627cb1b25917193a259e49bdad08f671f8d9708acfd5fe0a8c1455d87220"
375+
376+[[package]]
377+name = "pin-project-lite"
378+version = "0.2.18"
379+source = "registry+https://github.com/rust-lang/crates.io-index"
380+checksum = "c938015719552d665fd0553b90d96cd7ff58e83e4c061ca99e6bb78865a72752"
381+
382+[[package]]
383+name = "potential_utf"
384+version = "0.1.6"
385+source = "registry+https://github.com/rust-lang/crates.io-index"
386+checksum = "d83eb9bc6d8e5cf568e7a1101d60ee05e81ed50ea106026f3d18deeb046d7661"
387+dependencies = [
388+ "zerovec",
389+]
390+
391+[[package]]
392+name = "prettyplease"
393+version = "0.2.37"
394+source = "registry+https://github.com/rust-lang/crates.io-index"
395+checksum = "479ca8adacdd7ce8f1fb39ce9ecccbfe93a3f1344b3d0d97f20bc0196208f62b"
396+dependencies = [
397+ "proc-macro2",
398+ "syn 2.0.119",
399+]
400+
401+[[package]]
402+name = "proc-macro2"
403+version = "1.0.107"
404+source = "registry+https://github.com/rust-lang/crates.io-index"
405+checksum = "985e7ec9bb745e6ce6535b544d84d6cd6f7ad8bd711c398938ae983b91a766d9"
406+dependencies = [
407+ "unicode-ident",
408+]
409+
410+[[package]]
411+name = "quote"
412+version = "1.0.47"
413+source = "registry+https://github.com/rust-lang/crates.io-index"
414+checksum = "1fbf4db142a473a8d80c26bbf18454ed458bf8d26c8219c331daecfdbd079001"
415+dependencies = [
416+ "proc-macro2",
417+]
418+
419+[[package]]
420+name = "semver"
421+version = "1.0.28"
422+source = "registry+https://github.com/rust-lang/crates.io-index"
423+checksum = "8a7852d02fc848982e0c167ef163aaff9cd91dc640ba85e263cb1ce46fae51cd"
424+dependencies = [
425+ "serde",
426+ "serde_core",
427+]
428+
429+[[package]]
430+name = "serde"
431+version = "1.0.229"
432+source = "registry+https://github.com/rust-lang/crates.io-index"
433+checksum = "4148590afebada386688f18773da617792bf2ef03ffc1e4cbd2b1d45b023e0ba"
434+dependencies = [
435+ "serde_core",
436+ "serde_derive",
437+]
438+
439+[[package]]
440+name = "serde_core"
441+version = "1.0.229"
442+source = "registry+https://github.com/rust-lang/crates.io-index"
443+checksum = "67dca2c9c51e58a4791a4b1ed58308b39c64224d349a935ab5039aa360942a48"
444+dependencies = [
445+ "serde_derive",
446+]
447+
448+[[package]]
449+name = "serde_derive"
450+version = "1.0.229"
451+source = "registry+https://github.com/rust-lang/crates.io-index"
452+checksum = "e7a5d71263a5a7d47b41f6b3f06ba276f10cc18b0931f1799f710578e2309348"
453+dependencies = [
454+ "proc-macro2",
455+ "quote",
456+ "syn 3.0.10",
457+]
458+
459+[[package]]
460+name = "serde_json"
461+version = "1.0.154"
462+source = "registry+https://github.com/rust-lang/crates.io-index"
463+checksum = "e7e9cc8b1b85264074fbcc02a88680c4096b1e47df8f739dceb03bf482f04bd6"
464+dependencies = [
465+ "itoa",
466+ "memchr",
467+ "serde",
468+ "serde_core",
469+ "zmij",
470+]
471+
472+[[package]]
473+name = "simd-adler32"
474+version = "0.3.10"
475+source = "registry+https://github.com/rust-lang/crates.io-index"
476+checksum = "3a219298ac11a56ea9a6d2120044824d6f01aeb034955e7af7bc16858527deea"
477+
478+[[package]]
479+name = "slab"
480+version = "0.4.12"
481+source = "registry+https://github.com/rust-lang/crates.io-index"
482+checksum = "0c790de23124f9ab44544d7ac05d60440adc586479ce501c1d6d7da3cd8c9cf5"
483+
484+[[package]]
485+name = "smallvec"
486+version = "1.16.6"
487+source = "registry+https://github.com/rust-lang/crates.io-index"
488+checksum = "3244542535d5de959d90ec55d1b5ff0fd2bb7b1310223907d5f11932847f7b59"
489+
490+[[package]]
491+name = "spdx"
492+version = "0.10.9"
493+source = "registry+https://github.com/rust-lang/crates.io-index"
494+checksum = "c3e17e880bafaeb362a7b751ec46bdc5b61445a188f80e0606e68167cd540fa3"
495+dependencies = [
496+ "smallvec",
497+]
498+
499+[[package]]
500+name = "stable_deref_trait"
501+version = "1.2.1"
502+source = "registry+https://github.com/rust-lang/crates.io-index"
503+checksum = "6ce2be8dc25455e1f91df71bfa12ad37d7af1092ae736f3a6cd0e37bc7810596"
504+
505+[[package]]
506+name = "syn"
507+version = "2.0.119"
508+source = "registry+https://github.com/rust-lang/crates.io-index"
509+checksum = "872831b642d1a07999a962a351ed35b955ea2cfc8f3862091e2a240a84f17297"
510+dependencies = [
511+ "proc-macro2",
512+ "quote",
513+ "unicode-ident",
514+]
515+
516+[[package]]
517+name = "syn"
518+version = "3.0.10"
519+source = "registry+https://github.com/rust-lang/crates.io-index"
520+checksum = "4ae9ccbea3a7b0b09443036490c8f34a8b1b760fd345e5c0dae0aac718faea79"
521+dependencies = [
522+ "proc-macro2",
523+ "quote",
524+ "unicode-ident",
525+]
526+
527+[[package]]
528+name = "synstructure"
529+version = "0.14.0"
530+source = "registry+https://github.com/rust-lang/crates.io-index"
531+checksum = "901704edd0dfe137f1987838ee4f259e4e063c31371bdb423f7ae38ec6f77f02"
532+dependencies = [
533+ "proc-macro2",
534+ "quote",
535+ "syn 3.0.10",
536+]
537+
538+[[package]]
539+name = "tinystr"
540+version = "0.8.5"
541+source = "registry+https://github.com/rust-lang/crates.io-index"
542+checksum = "abc840c238154d58f9e86b2792261edfde565a17696e1cda1a449de27979801a"
543+dependencies = [
544+ "displaydoc",
545+ "zerovec",
546+]
547+
548+[[package]]
549+name = "topological-sort"
550+version = "0.2.2"
551+source = "registry+https://github.com/rust-lang/crates.io-index"
552+checksum = "ea68304e134ecd095ac6c3574494fc62b909f416c4fca77e440530221e549d3d"
553+
554+[[package]]
555+name = "unicode-ident"
556+version = "1.0.27"
557+source = "registry+https://github.com/rust-lang/crates.io-index"
558+checksum = "a2c754d6c33795a1c324727428e5a7dedb5b06195f9890bdbcba760d3e246563"
559+
560+[[package]]
561+name = "unicode-xid"
562+version = "0.2.6"
563+source = "registry+https://github.com/rust-lang/crates.io-index"
564+checksum = "ebc1c04c71510c7f702b52b7c350734c9ff1295c464a03335b00bb84fc54f853"
565+
566+[[package]]
567+name = "url"
568+version = "2.5.9"
569+source = "registry+https://github.com/rust-lang/crates.io-index"
570+checksum = "f00cd2407bb42c0ef17be88d4cf020f5cceffd121665bac9b8b9493a369b3b1a"
571+dependencies = [
572+ "form_urlencoded",
573+ "idna",
574+ "percent-encoding",
575+ "serde",
576+]
577+
578+[[package]]
579+name = "utf8_iter"
580+version = "1.1.0"
581+source = "registry+https://github.com/rust-lang/crates.io-index"
582+checksum = "af3bd9d3e571c26fcce9d033b87ea5ab061b8d2ffe9b7a5675d810d68f03edf0"
583+dependencies = [
584+ "utf_types",
585+]
586+
587+[[package]]
588+name = "utf_types"
589+version = "1.0.0"
590+source = "registry+https://github.com/rust-lang/crates.io-index"
591+checksum = "3a3b425286980a367278453f3b6d28cdcb134b574e5a35824a6ff5eebad50bb6"
592+
593+[[package]]
594+name = "wasm-encoder"
595+version = "0.227.1"
596+source = "registry+https://github.com/rust-lang/crates.io-index"
597+checksum = "80bb72f02e7fbf07183443b27b0f3d4144abf8c114189f2e088ed95b696a7822"
598+dependencies = [
599+ "leb128fmt",
600+ "wasmparser",
601+]
602+
603+[[package]]
604+name = "wasm-metadata"
605+version = "0.227.1"
606+source = "registry+https://github.com/rust-lang/crates.io-index"
607+checksum = "ce1ef0faabbbba6674e97a56bee857ccddf942785a336c8b47b42373c922a91d"
608+dependencies = [
609+ "anyhow",
610+ "auditable-serde",
611+ "flate2",
612+ "indexmap",
613+ "serde",
614+ "serde_derive",
615+ "serde_json",
616+ "spdx",
617+ "url",
618+ "wasm-encoder",
619+ "wasmparser",
620+]
621+
622+[[package]]
623+name = "wasmparser"
624+version = "0.227.1"
625+source = "registry+https://github.com/rust-lang/crates.io-index"
626+checksum = "0f51cad774fb3c9461ab9bccc9c62dfb7388397b5deda31bf40e8108ccd678b2"
627+dependencies = [
628+ "bitflags",
629+ "hashbrown 0.15.5",
630+ "indexmap",
631+ "semver",
632+]
633+
634+[[package]]
635+name = "wit-bindgen"
636+version = "0.41.0"
637+source = "registry+https://github.com/rust-lang/crates.io-index"
638+checksum = "10fb6648689b3929d56bbc7eb1acf70c9a42a29eb5358c67c10f54dbd5d695de"
639+dependencies = [
640+ "wit-bindgen-rt",
641+ "wit-bindgen-rust-macro",
642+]
643+
644+[[package]]
645+name = "wit-bindgen-core"
646+version = "0.41.0"
647+source = "registry+https://github.com/rust-lang/crates.io-index"
648+checksum = "92fa781d4f2ff6d3f27f3cc9b74a73327b31ca0dc4a3ef25a0ce2983e0e5af9b"
649+dependencies = [
650+ "anyhow",
651+ "heck",
652+ "wit-parser",
653+]
654+
655+[[package]]
656+name = "wit-bindgen-rt"
657+version = "0.41.0"
658+source = "registry+https://github.com/rust-lang/crates.io-index"
659+checksum = "c4db52a11d4dfb0a59f194c064055794ee6564eb1ced88c25da2cf76e50c5621"
660+dependencies = [
661+ "bitflags",
662+ "futures",
663+ "once_cell",
664+]
665+
666+[[package]]
667+name = "wit-bindgen-rust"
668+version = "0.41.0"
669+source = "registry+https://github.com/rust-lang/crates.io-index"
670+checksum = "9d0809dc5ba19e2e98661bf32fc0addc5a3ca5bf3a6a7083aa6ba484085ff3ce"
671+dependencies = [
672+ "anyhow",
673+ "heck",
674+ "indexmap",
675+ "prettyplease",
676+ "syn 2.0.119",
677+ "wasm-metadata",
678+ "wit-bindgen-core",
679+ "wit-component",
680+]
681+
682+[[package]]
683+name = "wit-bindgen-rust-macro"
684+version = "0.41.0"
685+source = "registry+https://github.com/rust-lang/crates.io-index"
686+checksum = "ad19eec017904e04c60719592a803ee5da76cb51c81e3f6fbf9457f59db49799"
687+dependencies = [
688+ "anyhow",
689+ "prettyplease",
690+ "proc-macro2",
691+ "quote",
692+ "syn 2.0.119",
693+ "wit-bindgen-core",
694+ "wit-bindgen-rust",
695+]
696+
697+[[package]]
698+name = "wit-component"
699+version = "0.227.1"
700+source = "registry+https://github.com/rust-lang/crates.io-index"
701+checksum = "635c3adc595422cbf2341a17fb73a319669cc8d33deed3a48368a841df86b676"
702+dependencies = [
703+ "anyhow",
704+ "bitflags",
705+ "indexmap",
706+ "log",
707+ "serde",
708+ "serde_derive",
709+ "serde_json",
710+ "wasm-encoder",
711+ "wasm-metadata",
712+ "wasmparser",
713+ "wit-parser",
714+]
715+
716+[[package]]
717+name = "wit-parser"
718+version = "0.227.1"
719+source = "registry+https://github.com/rust-lang/crates.io-index"
720+checksum = "ddf445ed5157046e4baf56f9138c124a0824d4d1657e7204d71886ad8ce2fc11"
721+dependencies = [
722+ "anyhow",
723+ "id-arena",
724+ "indexmap",
725+ "log",
726+ "semver",
727+ "serde",
728+ "serde_derive",
729+ "serde_json",
730+ "unicode-xid",
731+ "wasmparser",
732+]
733+
734+[[package]]
735+name = "writeable"
736+version = "0.6.4"
737+source = "registry+https://github.com/rust-lang/crates.io-index"
738+checksum = "3ad82d2a33cdc9674dc7465672f271e096168fcdbe0f799d9e6db8c5892679dc"
739+
740+[[package]]
741+name = "yoke"
742+version = "0.8.4"
743+source = "registry+https://github.com/rust-lang/crates.io-index"
744+checksum = "417ef3fcf6c300b7dbd25c85531a746931c02ad536f3cf4786ed1e88223340b3"
745+dependencies = [
746+ "stable_deref_trait",
747+ "yoke-derive",
748+ "zerofrom",
749+]
750+
751+[[package]]
752+name = "yoke-derive"
753+version = "0.8.4"
754+source = "registry+https://github.com/rust-lang/crates.io-index"
755+checksum = "ec8ebde2db3681e8c9980cc27822030e68752690ddfa9473e739aeb4dbde6d71"
756+dependencies = [
757+ "proc-macro2",
758+ "quote",
759+ "syn 3.0.10",
760+ "synstructure",
761+]
762+
763+[[package]]
764+name = "zed_extension_api"
765+version = "0.7.0"
766+source = "registry+https://github.com/rust-lang/crates.io-index"
767+checksum = "0729d50b4ca0a7e28e590bbe32e3ca0194d97ef654961451a424c661a366fca0"
768+dependencies = [
769+ "serde",
770+ "serde_json",
771+ "wit-bindgen",
772+]
773+
774+[[package]]
775+name = "zed_grain"
776+version = "0.1.0"
777+dependencies = [
778+ "zed_extension_api",
779+]
780+
781+[[package]]
782+name = "zerofrom"
783+version = "0.1.8"
784+source = "registry+https://github.com/rust-lang/crates.io-index"
785+checksum = "0ec05a11813ea801ff6d75110ad09cd0824ddba17dfe17128ea0d5f68e6c5272"
786+dependencies = [
787+ "zerofrom-derive",
788+]
789+
790+[[package]]
791+name = "zerofrom-derive"
792+version = "0.1.8"
793+source = "registry+https://github.com/rust-lang/crates.io-index"
794+checksum = "f75b4683f6c7f45248d4d64056a24298c6281e0993356d7d1b4a1a962ef10d4a"
795+dependencies = [
796+ "proc-macro2",
797+ "quote",
798+ "syn 3.0.10",
799+ "synstructure",
800+]
801+
802+[[package]]
803+name = "zerotrie"
804+version = "0.2.5"
805+source = "registry+https://github.com/rust-lang/crates.io-index"
806+checksum = "4ea269c3bd32f0a32c321907a2ae912ba6f4649bb0fc764a15627e99a7095a3f"
807+dependencies = [
808+ "displaydoc",
809+ "yoke",
810+ "zerofrom",
811+]
812+
813+[[package]]
814+name = "zerovec"
815+version = "0.11.9"
816+source = "registry+https://github.com/rust-lang/crates.io-index"
817+checksum = "f58a2799cfe9a1670c7ea8edbd52ef8edb93cb37a7f83bf31ba9e35d9dae6a40"
818+dependencies = [
819+ "yoke",
820+ "zerofrom",
821+ "zerovec-derive",
822+]
823+
824+[[package]]
825+name = "zerovec-derive"
826+version = "0.11.7"
827+source = "registry+https://github.com/rust-lang/crates.io-index"
828+checksum = "c3743ddbf47738d929cd1ae2e199d40d0162979dfe31aef8ae646d2bf00bf97a"
829+dependencies = [
830+ "proc-macro2",
831+ "quote",
832+ "syn 3.0.10",
833+]
834+
835+[[package]]
836+name = "zlib-rs"
837+version = "0.6.9"
838+source = "registry+https://github.com/rust-lang/crates.io-index"
839+checksum = "aa76918995d776d9dd34d371030be228d021137449771493d56e29f77e4148ac"
840+
841+[[package]]
842+name = "zmij"
843+version = "1.0.23"
844+source = "registry+https://github.com/rust-lang/crates.io-index"
845+checksum = "29666d0abbfad1e3dc4dcf6144730dd3a3ab225bbbdac83319345b1b44ccfc1b"
added Cargo.toml +13 -0
new file mode 100644
@@ -0,0 +1,13 @@
1+[package]
2+name = "zed_grain"
3+version = "0.1.0"
4+edition = "2021"
5+publish = false
6+license = "MIT"
7+
8+[lib]
9+path = "src/grain.rs"
10+crate-type = ["cdylib"]
11+
12+[dependencies]
13+zed_extension_api = "0.7.0"
new file mode 100644
@@ -0,0 +1,13 @@
1+[package]
2+name = "zed_grain"
3+version = "0.1.0"
4+edition = "2021"
5+publish = false
6+license = "MIT"
7+
8+[lib]
9+path = "src/grain.rs"
10+crate-type = ["cdylib"]
11+
12+[dependencies]
13+zed_extension_api = "0.7.0"
added README.md +81 -0
new file mode 100644
@@ -0,0 +1,81 @@
1+# Grain for Zed
2+
3+[Zed](https://zed.dev) extension for the [Grain](https://grain-lang.org) language (`.gr` files).
4+
5+- Syntax highlighting, outline, bracket matching, indentation and text objects, using the
6+ [Kara-Zor-El/tree-sitter-grain](https://github.com/Kara-Zor-El/tree-sitter-grain) grammar
7+ (the highlight queries are adapted to Zed's capture names).
8+- Markdown injection in doc comments (`/** ... */`), with Grain for `@example`.
9+- Language server: `grain lsp` (diagnostics, hover, go to definition, formatting,
10+ document symbols, inlay type hints, code lenses).
11+- Tasks: `grain run`, `grain compile --release`, `grain format`.
12+
13+## Install (dev extension)
14+
15+Prerequisite: Rust installed with `rustup` (Zed compiles the extension itself).
16+
17+1. In Zed: `zed: install dev extension` (command palette) and pick this `zed-grain` folder.
18+2. Open a `.gr` file.
19+
20+## Grain binary used by the LSP
21+
22+The extension looks for `grain`, in this order:
23+
24+1. `lsp.grain-lsp.binary.path` in the Zed settings,
25+2. `grain` on the `PATH`,
26+3. otherwise it downloads the latest release from GitHub
27+ (`grain-{linux,mac,win}-{x64,arm64}.tar.gz`).
28+
29+```jsonc
30+// settings.json
31+{
32+ "lsp": {
33+ "grain-lsp": {
34+ "binary": {
35+ "path": "grain",
36+ "arguments": [
37+ "lsp"
38+ ]
39+ }
40+ }
41+ }
42+}
43+```
44+
45+### Grain inside a Docker sandbox (sbx)
46+
47+If `grain` only exists in an sbx sandbox (`grain-toolchain` kit), Zed on the host
48+starts the LSP through `sbx exec`. Put this in the project's `.zed/settings.json`:
49+
50+```jsonc
51+{
52+ "lsp": {
53+ "grain-lsp": {
54+ "binary": {
55+ "path": "sbx", // or the absolute path from `which sbx`
56+ "arguments": [
57+ "exec", "-i", // -i = stdin open; NO -t (a TTY corrupts JSON-RPC)
58+ "-w", "/path/to/the/project",
59+ "<sandbox-name>", // sbx ls
60+ "grain", "lsp"
61+ ]
62+ }
63+ }
64+ }
65+}
66+```
67+
68+- This works because in direct mode the workspace is mounted **at the same path** in the
69+ sandbox, so the `file://` URIs Zed sends are valid inside it.
70+- `sbx exec` starts the sandbox if it's stopped.
71+- Limitation: "go to definition" on the stdlib points to `/snapshot/grain/stdlib/...`,
72+ a path that only exists inside the `grain` binary.
73+
74+## Development
75+
76+```bash
77+cargo build --release --target wasm32-wasip2 # check that the extension compiles
78+```
79+
80+To update the grammar, change `rev` in `extension.toml` and compare
81+`languages/grain/highlights.scm` with the grammar's `queries/highlights.scm`.
new file mode 100644
@@ -0,0 +1,81 @@
1+# Grain for Zed
2+
3+[Zed](https://zed.dev) extension for the [Grain](https://grain-lang.org) language (`.gr` files).
4+
5+- Syntax highlighting, outline, bracket matching, indentation and text objects, using the
6+ [Kara-Zor-El/tree-sitter-grain](https://github.com/Kara-Zor-El/tree-sitter-grain) grammar
7+ (the highlight queries are adapted to Zed's capture names).
8+- Markdown injection in doc comments (`/** ... */`), with Grain for `@example`.
9+- Language server: `grain lsp` (diagnostics, hover, go to definition, formatting,
10+ document symbols, inlay type hints, code lenses).
11+- Tasks: `grain run`, `grain compile --release`, `grain format`.
12+
13+## Install (dev extension)
14+
15+Prerequisite: Rust installed with `rustup` (Zed compiles the extension itself).
16+
17+1. In Zed: `zed: install dev extension` (command palette) and pick this `zed-grain` folder.
18+2. Open a `.gr` file.
19+
20+## Grain binary used by the LSP
21+
22+The extension looks for `grain`, in this order:
23+
24+1. `lsp.grain-lsp.binary.path` in the Zed settings,
25+2. `grain` on the `PATH`,
26+3. otherwise it downloads the latest release from GitHub
27+ (`grain-{linux,mac,win}-{x64,arm64}.tar.gz`).
28+
29+```jsonc
30+// settings.json
31+{
32+ "lsp": {
33+ "grain-lsp": {
34+ "binary": {
35+ "path": "grain",
36+ "arguments": [
37+ "lsp"
38+ ]
39+ }
40+ }
41+ }
42+}
43+```
44+
45+### Grain inside a Docker sandbox (sbx)
46+
47+If `grain` only exists in an sbx sandbox (`grain-toolchain` kit), Zed on the host
48+starts the LSP through `sbx exec`. Put this in the project's `.zed/settings.json`:
49+
50+```jsonc
51+{
52+ "lsp": {
53+ "grain-lsp": {
54+ "binary": {
55+ "path": "sbx", // or the absolute path from `which sbx`
56+ "arguments": [
57+ "exec", "-i", // -i = stdin open; NO -t (a TTY corrupts JSON-RPC)
58+ "-w", "/path/to/the/project",
59+ "<sandbox-name>", // sbx ls
60+ "grain", "lsp"
61+ ]
62+ }
63+ }
64+ }
65+}
66+```
67+
68+- This works because in direct mode the workspace is mounted **at the same path** in the
69+ sandbox, so the `file://` URIs Zed sends are valid inside it.
70+- `sbx exec` starts the sandbox if it's stopped.
71+- Limitation: "go to definition" on the stdlib points to `/snapshot/grain/stdlib/...`,
72+ a path that only exists inside the `grain` binary.
73+
74+## Development
75+
76+```bash
77+cargo build --release --target wasm32-wasip2 # check that the extension compiles
78+```
79+
80+To update the grammar, change `rev` in `extension.toml` and compare
81+`languages/grain/highlights.scm` with the grammar's `queries/highlights.scm`.
added extension.toml +16 -0
new file mode 100644
@@ -0,0 +1,16 @@
1+id = "grain"
2+name = "Grain"
3+description = "Grain language support: tree-sitter syntax highlighting, outline, and the Grain language server (grain lsp)."
4+version = "0.1.0"
5+schema_version = 1
6+authors = ["k33g"]
7+repository = "https://github.com/k33g/zed-grain"
8+
9+[language_servers.grain-lsp]
10+name = "Grain LSP"
11+languages = ["Grain"]
12+
13+# Grammar maintained by Kara-Zor-El (also a Grain LSP contributor).
14+[grammars.grain]
15+repository = "https://github.com/Kara-Zor-El/tree-sitter-grain"
16+rev = "4fd53eb7a358b9cc04f447a75c4eaffbc83cc502"
new file mode 100644
@@ -0,0 +1,16 @@
1+id = "grain"
2+name = "Grain"
3+description = "Grain language support: tree-sitter syntax highlighting, outline, and the Grain language server (grain lsp)."
4+version = "0.1.0"
5+schema_version = 1
6+authors = ["k33g"]
7+repository = "https://github.com/k33g/zed-grain"
8+
9+[language_servers.grain-lsp]
10+name = "Grain LSP"
11+languages = ["Grain"]
12+
13+# Grammar maintained by Kara-Zor-El (also a Grain LSP contributor).
14+[grammars.grain]
15+repository = "https://github.com/Kara-Zor-El/tree-sitter-grain"
16+rev = "4fd53eb7a358b9cc04f447a75c4eaffbc83cc502"
added git.sh +136 -0
new file mode 100755
@@ -0,0 +1,136 @@
1+#!/bin/bash
2+message=""
3+case $1 in
4+
5+ # 🎨: art
6+ art)
7+ message="Improve structure / format of the code"
8+ emoji="🎨"
9+ ;;
10+
11+ # 🐛: bug
12+ bug|fix)
13+ message="Fix a bug"
14+ emoji="🐛"
15+ ;;
16+
17+ # 🤓: geek
18+ human|human-fixed)
19+ message="Human Fixed"
20+ emoji="🤓"
21+ ;;
22+
23+ # 🤖: robot
24+ ai|ai-generated)
25+ message="AI generated"
26+ emoji="🤖"
27+ ;;
28+
29+ # ✨: sparkles
30+ sparkles|feature)
31+ message="Introduce new feature(s)"
32+ emoji="✨"
33+ ;;
34+
35+ # 🧩: jigsaw
36+ jigsaw|example|examples|demo|demos)
37+ message="Introduce new example(s)"
38+ emoji="🧩"
39+ ;;
40+
41+
42+ # 📝: memo
43+ memo|doc|documentation)
44+ message="Add or update documentation"
45+ emoji="📝"
46+ ;;
47+
48+ # 🌸: cherry_blossom
49+ gardening|garden|clean|cleaning)
50+ message="Gardening"
51+ emoji="🌸"
52+ ;;
53+
54+ # 🚀: rocket
55+ rocket|deploy)
56+ message="Deploy stuff"
57+ emoji="🚀"
58+ ;;
59+
60+ # 🎉: tada
61+ tada|first)
62+ message="Begin a project"
63+ emoji="🎉"
64+ ;;
65+
66+ # 🚧: construction
67+ construction|wip)
68+ message="Work in progress"
69+ emoji="🚧"
70+ ;;
71+
72+ # 📦️: package
73+ package|build)
74+ message="Add or update compiled files or packages"
75+ emoji="📦️"
76+ ;;
77+
78+ # 📦️: package
79+ release)
80+ message="Create a release"
81+ emoji="📦️"
82+ ;;
83+
84+ # 👽️: alien
85+ alien|api)
86+ message="Update code due to external API changes"
87+ emoji="👽️"
88+ ;;
89+
90+ # 🐳: whale
91+ docker|container)
92+ message="Docker"
93+ emoji="🐳"
94+ ;;
95+
96+ # 🍊: tangerine
97+ gitpod|gitpodify)
98+ message="Gitpodify"
99+ emoji="🍊"
100+ ;;
101+
102+ # 🧪: test tube
103+ alembic|experiments|experiment|xp)
104+ message="Perform experiments"
105+ emoji="🧪"
106+ ;;
107+
108+ # ✅: check mark
109+ test|tests|testing)
110+ message="Add or update tests"
111+ emoji="✅"
112+ ;;
113+
114+ # 💾: floppy-disk
115+ save)
116+ message="Saved"
117+ emoji="💾"
118+ ;;
119+
120+ *)
121+ message="Updated"
122+ emoji="🛟"
123+ ;;
124+
125+esac
126+
127+find . -name '.DS_Store' -type f -delete
128+
129+if [ -z "$2" ]
130+then
131+ # empty
132+ git add .; git commit -m "$emoji $message."; git push
133+else
134+ # not empty
135+ git add .; git commit -m "$emoji $message: $2"; git push
136+fi
new file mode 100755
@@ -0,0 +1,136 @@
1+#!/bin/bash
2+message=""
3+case $1 in
4+
5+ # 🎨: art
6+ art)
7+ message="Improve structure / format of the code"
8+ emoji="🎨"
9+ ;;
10+
11+ # 🐛: bug
12+ bug|fix)
13+ message="Fix a bug"
14+ emoji="🐛"
15+ ;;
16+
17+ # 🤓: geek
18+ human|human-fixed)
19+ message="Human Fixed"
20+ emoji="🤓"
21+ ;;
22+
23+ # 🤖: robot
24+ ai|ai-generated)
25+ message="AI generated"
26+ emoji="🤖"
27+ ;;
28+
29+ # ✨: sparkles
30+ sparkles|feature)
31+ message="Introduce new feature(s)"
32+ emoji="✨"
33+ ;;
34+
35+ # 🧩: jigsaw
36+ jigsaw|example|examples|demo|demos)
37+ message="Introduce new example(s)"
38+ emoji="🧩"
39+ ;;
40+
41+
42+ # 📝: memo
43+ memo|doc|documentation)
44+ message="Add or update documentation"
45+ emoji="📝"
46+ ;;
47+
48+ # 🌸: cherry_blossom
49+ gardening|garden|clean|cleaning)
50+ message="Gardening"
51+ emoji="🌸"
52+ ;;
53+
54+ # 🚀: rocket
55+ rocket|deploy)
56+ message="Deploy stuff"
57+ emoji="🚀"
58+ ;;
59+
60+ # 🎉: tada
61+ tada|first)
62+ message="Begin a project"
63+ emoji="🎉"
64+ ;;
65+
66+ # 🚧: construction
67+ construction|wip)
68+ message="Work in progress"
69+ emoji="🚧"
70+ ;;
71+
72+ # 📦️: package
73+ package|build)
74+ message="Add or update compiled files or packages"
75+ emoji="📦️"
76+ ;;
77+
78+ # 📦️: package
79+ release)
80+ message="Create a release"
81+ emoji="📦️"
82+ ;;
83+
84+ # 👽️: alien
85+ alien|api)
86+ message="Update code due to external API changes"
87+ emoji="👽️"
88+ ;;
89+
90+ # 🐳: whale
91+ docker|container)
92+ message="Docker"
93+ emoji="🐳"
94+ ;;
95+
96+ # 🍊: tangerine
97+ gitpod|gitpodify)
98+ message="Gitpodify"
99+ emoji="🍊"
100+ ;;
101+
102+ # 🧪: test tube
103+ alembic|experiments|experiment|xp)
104+ message="Perform experiments"
105+ emoji="🧪"
106+ ;;
107+
108+ # ✅: check mark
109+ test|tests|testing)
110+ message="Add or update tests"
111+ emoji="✅"
112+ ;;
113+
114+ # 💾: floppy-disk
115+ save)
116+ message="Saved"
117+ emoji="💾"
118+ ;;
119+
120+ *)
121+ message="Updated"
122+ emoji="🛟"
123+ ;;
124+
125+esac
126+
127+find . -name '.DS_Store' -type f -delete
128+
129+if [ -z "$2" ]
130+then
131+ # empty
132+ git add .; git commit -m "$emoji $message."; git push
133+else
134+ # not empty
135+ git add .; git commit -m "$emoji $message: $2"; git push
136+fi
added languages/grain/brackets.scm +4 -0
new file mode 100644
@@ -0,0 +1,4 @@
1+("(" @open ")" @close)
2+("[" @open "]" @close)
3+("[>" @open "]" @close)
4+("{" @open "}" @close)
new file mode 100644
@@ -0,0 +1,4 @@
1+("(" @open ")" @close)
2+("[" @open "]" @close)
3+("[>" @open "]" @close)
4+("{" @open "}" @close)
added languages/grain/config.toml +13 -0
new file mode 100644
@@ -0,0 +1,13 @@
1+name = "Grain"
2+grammar = "grain"
3+path_suffixes = ["gr"]
4+line_comments = ["// "]
5+tab_size = 2
6+autoclose_before = ";:.,=}])>"
7+brackets = [
8+ { start = "{", end = "}", close = true, newline = true },
9+ { start = "[", end = "]", close = true, newline = true },
10+ { start = "(", end = ")", close = true, newline = true },
11+ { start = "\"", end = "\"", close = true, newline = false, not_in = ["string", "comment"] },
12+ { start = "/*", end = " */", close = true, newline = false, not_in = ["string", "comment"] },
13+]
new file mode 100644
@@ -0,0 +1,13 @@
1+name = "Grain"
2+grammar = "grain"
3+path_suffixes = ["gr"]
4+line_comments = ["// "]
5+tab_size = 2
6+autoclose_before = ";:.,=}])>"
7+brackets = [
8+ { start = "{", end = "}", close = true, newline = true },
9+ { start = "[", end = "]", close = true, newline = true },
10+ { start = "(", end = ")", close = true, newline = true },
11+ { start = "\"", end = "\"", close = true, newline = false, not_in = ["string", "comment"] },
12+ { start = "/*", end = " */", close = true, newline = false, not_in = ["string", "comment"] },
13+]
added languages/grain/highlights.scm +319 -0
new file mode 100644
@@ -0,0 +1,319 @@
1+; Highlights for Grain, adapted for Zed from
2+; https://github.com/Kara-Zor-El/tree-sitter-grain (queries/highlights.scm)
3+;
4+; Note: tree-sitter's query language reserves some names as node types, so
5+; tokens like "continue", "break", and "void" cannot be matched as anonymous
6+; terminals — use surrounding named nodes instead.
7+
8+
9+; Comments (`//` line, `/* */` block, `/** */` doc)
10+(line_comment) @comment
11+
12+(block_comment) @comment
13+
14+(doc_comment) @comment.doc
15+
16+(doc_comment_margin) @comment.doc
17+
18+; Structured block / doc comments: preamble + `doc_directive` (`@param`, `@since`, …)
19+
20+(doc_example
21+ "@example" @tag)
22+
23+(doc_since
24+ "@since" @tag)
25+
26+(doc_history
27+ "@history" @tag)
28+
29+(doc_param
30+ "@param" @tag)
31+
32+(doc_returns
33+ "@returns" @tag)
34+
35+(doc_throws
36+ "@throws" @tag)
37+
38+(doc_deprecated
39+ "@deprecated" @tag)
40+
41+(doc_unknown_tag
42+ "@" @punctuation.special)
43+
44+(doc_unknown_tag
45+ (doc_tag_name) @tag)
46+
47+(semver_valid) @number
48+
49+(semver_invalid) @comment
50+
51+; Attributes
52+(attribute
53+ "@" @punctuation.special)
54+
55+(attribute
56+ (identifier) @attribute)
57+
58+(attribute
59+ (special_identifier) @attribute)
60+
61+; Literals
62+[
63+ (number_literal)
64+ (int8_literal)
65+ (int16_literal)
66+ (int32_literal)
67+ (int64_literal)
68+ (uint8_literal)
69+ (uint16_literal)
70+ (uint32_literal)
71+ (uint64_literal)
72+ (wasmi32_literal)
73+ (wasmi64_literal)
74+ (bigint_literal)
75+] @number
76+
77+[
78+ (float_literal)
79+ (float32_literal)
80+ (float64_literal)
81+ (wasmf32_literal)
82+ (wasmf64_literal)
83+] @number.float
84+
85+(rational_literal) @number.float
86+
87+(boolean) @boolean
88+
89+(void) @constant.builtin
90+
91+[
92+ (string)
93+ (import_path_string)
94+] @string
95+(char) @string
96+(bytes) @string.special
97+
98+[
99+ (string
100+ (escape_sequence) @string.escape)
101+ (import_path_string
102+ (escape_sequence) @string.escape)
103+]
104+
105+(bytes
106+ (escape_sequence) @string.escape)
107+
108+(char
109+ (escape_sequence) @string.escape)
110+
111+(identifier) @variable
112+
113+(special_identifier) @variable
114+
115+; Operators
116+(prefix_operator) @operator
117+(assignment_operator) @operator
118+(custom_infix_operator) @operator
119+(infix_60_operator) @operator
120+(infix_70_operator) @operator
121+(infix_100_operator) @operator
122+
123+(unary_expression
124+ operator: (prefix_operator) @operator)
125+
126+; Import/export keywords
127+(include_declaration
128+ "from" @keyword.import)
129+
130+(foreign_declaration
131+ "from" @keyword)
132+
133+(provide_declaration
134+ "provide" @keyword.export)
135+
136+; Keywords (anonymous terminals — excludes query-reserved spellings:
137+; break, continue, void, await, import, …)
138+[
139+ "module"
140+ "let"
141+ "foreign"
142+ "wasm"
143+ "primitive"
144+ "exception"
145+ "abstract"
146+ "type"
147+ "enum"
148+ "record"
149+ "mut"
150+ "rec"
151+ "and"
152+ "true"
153+ "false"
154+ "is"
155+ "isnt"
156+] @keyword
157+
158+[
159+ "use"
160+ "include"
161+] @keyword.import
162+
163+[
164+ "throw"
165+ "assert"
166+ "fail"
167+] @keyword.exception
168+
169+[
170+ "if"
171+ "else"
172+ "match"
173+] @keyword.conditional
174+
175+[
176+ "while"
177+ "for"
178+] @keyword.repeat
179+
180+(continue_expression) @keyword.repeat
181+(break_expression) @keyword.repeat
182+
183+[
184+ "return"
185+] @keyword.return
186+
187+(alias_pattern
188+ "as" @keyword)
189+
190+(when_guard
191+ "when" @keyword.conditional)
192+
193+(lambda_expression
194+ "=>" @operator)
195+
196+(match_branch
197+ "=>" @operator)
198+
199+(any_pattern
200+ "_" @variable.special)
201+
202+(or_pattern
203+ "|" @punctuation.delimiter)
204+
205+(record_get_expression
206+ field: (_) @property)
207+
208+(non_punned_record_field
209+ (qualified_identifier) @property)
210+
211+(labeled_application_argument
212+ label: (_) @variable.parameter)
213+
214+(arrow_type
215+ (identifier) @variable.parameter)
216+
217+; Caps names
218+(upper_identifier) @type
219+
220+(qualified_identifier
221+ (upper_identifier) @type)
222+
223+(use_expression
224+ (upper_identifier) @type)
225+
226+(include_declaration
227+ module: (qualified_type_identifier
228+ (upper_identifier) @type))
229+
230+(include_declaration
231+ alias: (qualified_type_identifier
232+ (upper_identifier) @type))
233+
234+(module_header
235+ name: (upper_identifier) @type)
236+
237+(module_declaration
238+ name: (upper_identifier) @type)
239+
240+; Punctuation / delimiters
241+[
242+ "("
243+ ")"
244+ "["
245+ "]"
246+ "{"
247+ "}"
248+] @punctuation.bracket
249+
250+; "=>" is highlighted via (lambda_expression "=>") as @operator; match arms
251+; still look fine with that rule.
252+[
253+ ","
254+ ";"
255+ "."
256+ ":"
257+ "..."
258+ ":="
259+ "="
260+ "[>"
261+] @punctuation.delimiter
262+
263+(type_parameters
264+ [
265+ "<"
266+ ">"
267+ ] @punctuation.bracket)
268+
269+(constructor_type
270+ [
271+ "<"
272+ ">"
273+ ] @punctuation.bracket)
274+
275+; Binary operators
276+(binary_expression
277+ operator: [
278+ "||"
279+ "??"
280+ "&&"
281+ "|"
282+ "=="
283+ "!="
284+ "<"
285+ ">"
286+ "+"
287+ "-"
288+ "*"
289+ "/"
290+ "%"
291+ ] @operator)
292+
293+; --- Zed additions -----------------------------------------------------------
294+
295+; Function definitions: `let f = (...) => ...`
296+(value_binding
297+ pattern: (variable_pattern
298+ (identifier) @function)
299+ value: (lambda_expression))
300+
301+; Function calls: `f(x)`, `Module.f(x)`
302+(application_expression
303+ function: (identifier_expression
304+ (qualified_identifier
305+ (identifier) @function)))
306+
307+; Constructors and variants
308+(enum_variant
309+ name: (upper_identifier) @constructor)
310+
311+(constructor_expression
312+ constructor: (qualified_type_identifier
313+ (upper_identifier) @constructor))
314+
315+(exception_declaration
316+ name: (upper_identifier) @type)
317+
318+(record_field_declaration
319+ name: (_) @property)
new file mode 100644
@@ -0,0 +1,319 @@
1+; Highlights for Grain, adapted for Zed from
2+; https://github.com/Kara-Zor-El/tree-sitter-grain (queries/highlights.scm)
3+;
4+; Note: tree-sitter's query language reserves some names as node types, so
5+; tokens like "continue", "break", and "void" cannot be matched as anonymous
6+; terminals — use surrounding named nodes instead.
7+
8+
9+; Comments (`//` line, `/* */` block, `/** */` doc)
10+(line_comment) @comment
11+
12+(block_comment) @comment
13+
14+(doc_comment) @comment.doc
15+
16+(doc_comment_margin) @comment.doc
17+
18+; Structured block / doc comments: preamble + `doc_directive` (`@param`, `@since`, …)
19+
20+(doc_example
21+ "@example" @tag)
22+
23+(doc_since
24+ "@since" @tag)
25+
26+(doc_history
27+ "@history" @tag)
28+
29+(doc_param
30+ "@param" @tag)
31+
32+(doc_returns
33+ "@returns" @tag)
34+
35+(doc_throws
36+ "@throws" @tag)
37+
38+(doc_deprecated
39+ "@deprecated" @tag)
40+
41+(doc_unknown_tag
42+ "@" @punctuation.special)
43+
44+(doc_unknown_tag
45+ (doc_tag_name) @tag)
46+
47+(semver_valid) @number
48+
49+(semver_invalid) @comment
50+
51+; Attributes
52+(attribute
53+ "@" @punctuation.special)
54+
55+(attribute
56+ (identifier) @attribute)
57+
58+(attribute
59+ (special_identifier) @attribute)
60+
61+; Literals
62+[
63+ (number_literal)
64+ (int8_literal)
65+ (int16_literal)
66+ (int32_literal)
67+ (int64_literal)
68+ (uint8_literal)
69+ (uint16_literal)
70+ (uint32_literal)
71+ (uint64_literal)
72+ (wasmi32_literal)
73+ (wasmi64_literal)
74+ (bigint_literal)
75+] @number
76+
77+[
78+ (float_literal)
79+ (float32_literal)
80+ (float64_literal)
81+ (wasmf32_literal)
82+ (wasmf64_literal)
83+] @number.float
84+
85+(rational_literal) @number.float
86+
87+(boolean) @boolean
88+
89+(void) @constant.builtin
90+
91+[
92+ (string)
93+ (import_path_string)
94+] @string
95+(char) @string
96+(bytes) @string.special
97+
98+[
99+ (string
100+ (escape_sequence) @string.escape)
101+ (import_path_string
102+ (escape_sequence) @string.escape)
103+]
104+
105+(bytes
106+ (escape_sequence) @string.escape)
107+
108+(char
109+ (escape_sequence) @string.escape)
110+
111+(identifier) @variable
112+
113+(special_identifier) @variable
114+
115+; Operators
116+(prefix_operator) @operator
117+(assignment_operator) @operator
118+(custom_infix_operator) @operator
119+(infix_60_operator) @operator
120+(infix_70_operator) @operator
121+(infix_100_operator) @operator
122+
123+(unary_expression
124+ operator: (prefix_operator) @operator)
125+
126+; Import/export keywords
127+(include_declaration
128+ "from" @keyword.import)
129+
130+(foreign_declaration
131+ "from" @keyword)
132+
133+(provide_declaration
134+ "provide" @keyword.export)
135+
136+; Keywords (anonymous terminals — excludes query-reserved spellings:
137+; break, continue, void, await, import, …)
138+[
139+ "module"
140+ "let"
141+ "foreign"
142+ "wasm"
143+ "primitive"
144+ "exception"
145+ "abstract"
146+ "type"
147+ "enum"
148+ "record"
149+ "mut"
150+ "rec"
151+ "and"
152+ "true"
153+ "false"
154+ "is"
155+ "isnt"
156+] @keyword
157+
158+[
159+ "use"
160+ "include"
161+] @keyword.import
162+
163+[
164+ "throw"
165+ "assert"
166+ "fail"
167+] @keyword.exception
168+
169+[
170+ "if"
171+ "else"
172+ "match"
173+] @keyword.conditional
174+
175+[
176+ "while"
177+ "for"
178+] @keyword.repeat
179+
180+(continue_expression) @keyword.repeat
181+(break_expression) @keyword.repeat
182+
183+[
184+ "return"
185+] @keyword.return
186+
187+(alias_pattern
188+ "as" @keyword)
189+
190+(when_guard
191+ "when" @keyword.conditional)
192+
193+(lambda_expression
194+ "=>" @operator)
195+
196+(match_branch
197+ "=>" @operator)
198+
199+(any_pattern
200+ "_" @variable.special)
201+
202+(or_pattern
203+ "|" @punctuation.delimiter)
204+
205+(record_get_expression
206+ field: (_) @property)
207+
208+(non_punned_record_field
209+ (qualified_identifier) @property)
210+
211+(labeled_application_argument
212+ label: (_) @variable.parameter)
213+
214+(arrow_type
215+ (identifier) @variable.parameter)
216+
217+; Caps names
218+(upper_identifier) @type
219+
220+(qualified_identifier
221+ (upper_identifier) @type)
222+
223+(use_expression
224+ (upper_identifier) @type)
225+
226+(include_declaration
227+ module: (qualified_type_identifier
228+ (upper_identifier) @type))
229+
230+(include_declaration
231+ alias: (qualified_type_identifier
232+ (upper_identifier) @type))
233+
234+(module_header
235+ name: (upper_identifier) @type)
236+
237+(module_declaration
238+ name: (upper_identifier) @type)
239+
240+; Punctuation / delimiters
241+[
242+ "("
243+ ")"
244+ "["
245+ "]"
246+ "{"
247+ "}"
248+] @punctuation.bracket
249+
250+; "=>" is highlighted via (lambda_expression "=>") as @operator; match arms
251+; still look fine with that rule.
252+[
253+ ","
254+ ";"
255+ "."
256+ ":"
257+ "..."
258+ ":="
259+ "="
260+ "[>"
261+] @punctuation.delimiter
262+
263+(type_parameters
264+ [
265+ "<"
266+ ">"
267+ ] @punctuation.bracket)
268+
269+(constructor_type
270+ [
271+ "<"
272+ ">"
273+ ] @punctuation.bracket)
274+
275+; Binary operators
276+(binary_expression
277+ operator: [
278+ "||"
279+ "??"
280+ "&&"
281+ "|"
282+ "=="
283+ "!="
284+ "<"
285+ ">"
286+ "+"
287+ "-"
288+ "*"
289+ "/"
290+ "%"
291+ ] @operator)
292+
293+; --- Zed additions -----------------------------------------------------------
294+
295+; Function definitions: `let f = (...) => ...`
296+(value_binding
297+ pattern: (variable_pattern
298+ (identifier) @function)
299+ value: (lambda_expression))
300+
301+; Function calls: `f(x)`, `Module.f(x)`
302+(application_expression
303+ function: (identifier_expression
304+ (qualified_identifier
305+ (identifier) @function)))
306+
307+; Constructors and variants
308+(enum_variant
309+ name: (upper_identifier) @constructor)
310+
311+(constructor_expression
312+ constructor: (qualified_type_identifier
313+ (upper_identifier) @constructor))
314+
315+(exception_declaration
316+ name: (upper_identifier) @type)
317+
318+(record_field_declaration
319+ name: (_) @property)
added languages/grain/indents.scm +4 -0
new file mode 100644
@@ -0,0 +1,4 @@
1+(_ "{" "}" @end) @indent
2+(_ "[" "]" @end) @indent
3+(_ "[>" "]" @end) @indent
4+(_ "(" ")" @end) @indent
new file mode 100644
@@ -0,0 +1,4 @@
1+(_ "{" "}" @end) @indent
2+(_ "[" "]" @end) @indent
3+(_ "[>" "]" @end) @indent
4+(_ "(" ")" @end) @indent
added languages/grain/injections.scm +44 -0
new file mode 100644
@@ -0,0 +1,44 @@
1+; Markdown / Grain injections for doc comments.
2+
3+((doc_preamble
4+ (doc_content_text) @injection.content)
5+ (#set! injection.language "markdown"))
6+
7+((doc_param
8+ (doc_directive_body) @injection.content)
9+ (#set! injection.language "markdown"))
10+
11+((doc_returns
12+ (doc_directive_body) @injection.content)
13+ (#set! injection.language "markdown"))
14+
15+((doc_throws
16+ (doc_directive_body) @injection.content)
17+ (#set! injection.language "markdown"))
18+
19+((doc_deprecated
20+ (doc_directive_body) @injection.content)
21+ (#set! injection.language "markdown"))
22+
23+((doc_unknown_tag
24+ (doc_directive_body) @injection.content)
25+ (#set! injection.language "markdown"))
26+
27+((doc_since
28+ (doc_since_body) @injection.content)
29+ (#set! injection.language "markdown"))
30+
31+((doc_history
32+ (doc_history_body) @injection.content)
33+ (#set! injection.language "markdown"))
34+
35+((doc_example
36+ (doc_directive_body
37+ (doc_same_line_body) @injection.content))
38+ (#set! injection.language "grain"))
39+
40+((doc_example
41+ (doc_example_body
42+ (doc_example_body_line
43+ (doc_example_line_code) @injection.content)))
44+ (#set! injection.language "grain"))
new file mode 100644
@@ -0,0 +1,44 @@
1+; Markdown / Grain injections for doc comments.
2+
3+((doc_preamble
4+ (doc_content_text) @injection.content)
5+ (#set! injection.language "markdown"))
6+
7+((doc_param
8+ (doc_directive_body) @injection.content)
9+ (#set! injection.language "markdown"))
10+
11+((doc_returns
12+ (doc_directive_body) @injection.content)
13+ (#set! injection.language "markdown"))
14+
15+((doc_throws
16+ (doc_directive_body) @injection.content)
17+ (#set! injection.language "markdown"))
18+
19+((doc_deprecated
20+ (doc_directive_body) @injection.content)
21+ (#set! injection.language "markdown"))
22+
23+((doc_unknown_tag
24+ (doc_directive_body) @injection.content)
25+ (#set! injection.language "markdown"))
26+
27+((doc_since
28+ (doc_since_body) @injection.content)
29+ (#set! injection.language "markdown"))
30+
31+((doc_history
32+ (doc_history_body) @injection.content)
33+ (#set! injection.language "markdown"))
34+
35+((doc_example
36+ (doc_directive_body
37+ (doc_same_line_body) @injection.content))
38+ (#set! injection.language "grain"))
39+
40+((doc_example
41+ (doc_example_body
42+ (doc_example_body_line
43+ (doc_example_line_code) @injection.content)))
44+ (#set! injection.language "grain"))
added languages/grain/outline.scm +32 -0
new file mode 100644
@@ -0,0 +1,32 @@
1+(module_declaration
2+ "module" @context
3+ name: (_) @name) @item
4+
5+(let_declaration
6+ (value_bindings
7+ (value_binding
8+ pattern: (variable_pattern
9+ (identifier) @name)) @item))
10+
11+(provide_declaration
12+ "provide" @context
13+ (value_bindings
14+ (value_binding
15+ pattern: (variable_pattern
16+ (identifier) @name)) @item))
17+
18+(enum_declaration
19+ "enum" @context
20+ name: (_) @name) @item
21+
22+(record_type_declaration
23+ "record" @context
24+ name: (_) @name) @item
25+
26+(type_alias
27+ "type" @context
28+ name: (_) @name) @item
29+
30+(exception_declaration
31+ "exception" @context
32+ name: (_) @name) @item
new file mode 100644
@@ -0,0 +1,32 @@
1+(module_declaration
2+ "module" @context
3+ name: (_) @name) @item
4+
5+(let_declaration
6+ (value_bindings
7+ (value_binding
8+ pattern: (variable_pattern
9+ (identifier) @name)) @item))
10+
11+(provide_declaration
12+ "provide" @context
13+ (value_bindings
14+ (value_binding
15+ pattern: (variable_pattern
16+ (identifier) @name)) @item))
17+
18+(enum_declaration
19+ "enum" @context
20+ name: (_) @name) @item
21+
22+(record_type_declaration
23+ "record" @context
24+ name: (_) @name) @item
25+
26+(type_alias
27+ "type" @context
28+ name: (_) @name) @item
29+
30+(exception_declaration
31+ "exception" @context
32+ name: (_) @name) @item
added languages/grain/tasks.json +21 -0
new file mode 100644
@@ -0,0 +1,21 @@
1+[
2+ {
3+ "label": "grain run $ZED_FILENAME",
4+ "command": "grain",
5+ "args": ["$ZED_FILE"],
6+ "cwd": "$ZED_DIRNAME",
7+ "tags": ["grain-run"]
8+ },
9+ {
10+ "label": "grain compile --release $ZED_FILENAME",
11+ "command": "grain",
12+ "args": ["compile", "--release", "$ZED_FILE"],
13+ "cwd": "$ZED_DIRNAME"
14+ },
15+ {
16+ "label": "grain format --write $ZED_FILENAME",
17+ "command": "grain",
18+ "args": ["format", "$ZED_FILE", "-o", "$ZED_FILE"],
19+ "cwd": "$ZED_DIRNAME"
20+ }
21+]
new file mode 100644
@@ -0,0 +1,21 @@
1+[
2+ {
3+ "label": "grain run $ZED_FILENAME",
4+ "command": "grain",
5+ "args": ["$ZED_FILE"],
6+ "cwd": "$ZED_DIRNAME",
7+ "tags": ["grain-run"]
8+ },
9+ {
10+ "label": "grain compile --release $ZED_FILENAME",
11+ "command": "grain",
12+ "args": ["compile", "--release", "$ZED_FILE"],
13+ "cwd": "$ZED_DIRNAME"
14+ },
15+ {
16+ "label": "grain format --write $ZED_FILENAME",
17+ "command": "grain",
18+ "args": ["format", "$ZED_FILE", "-o", "$ZED_FILE"],
19+ "cwd": "$ZED_DIRNAME"
20+ }
21+]
added languages/grain/textobjects.scm +7 -0
new file mode 100644
@@ -0,0 +1,7 @@
1+(value_binding
2+ value: (lambda_expression
3+ body: (_) @function.inside)) @function.around
4+
5+(block_comment) @comment.around
6+(doc_comment) @comment.around
7+(line_comment) @comment.around
new file mode 100644
@@ -0,0 +1,7 @@
1+(value_binding
2+ value: (lambda_expression
3+ body: (_) @function.inside)) @function.around
4+
5+(block_comment) @comment.around
6+(doc_comment) @comment.around
7+(line_comment) @comment.around
added src/grain.rs +151 -0
new file mode 100644
@@ -0,0 +1,151 @@
1+use std::fs;
2+
3+use zed_extension_api::{self as zed, settings::LspSettings, LanguageServerId, Result};
4+
5+const SERVER_ID: &str = "grain-lsp";
6+const GITHUB_REPO: &str = "grain-lang/grain";
7+
8+struct GrainExtension {
9+ cached_binary_path: Option<String>,
10+}
11+
12+impl GrainExtension {
13+ /// Resolves the `grain` binary, in order:
14+ /// 1. `lsp.grain-lsp.binary.path` in Zed settings,
15+ /// 2. `grain` on the worktree's PATH,
16+ /// 3. the latest GitHub release, downloaded into the extension directory.
17+ fn grain_binary_path(
18+ &mut self,
19+ language_server_id: &LanguageServerId,
20+ worktree: &zed::Worktree,
21+ ) -> Result<String> {
22+ if let Some(path) = LspSettings::for_worktree(SERVER_ID, worktree)
23+ .ok()
24+ .and_then(|s| s.binary)
25+ .and_then(|b| b.path)
26+ {
27+ return Ok(path);
28+ }
29+
30+ if let Some(path) = worktree.which("grain") {
31+ return Ok(path);
32+ }
33+
34+ if let Some(path) = &self.cached_binary_path {
35+ if fs::metadata(path).is_ok_and(|stat| stat.is_file()) {
36+ return Ok(path.clone());
37+ }
38+ }
39+
40+ zed::set_language_server_installation_status(
41+ language_server_id,
42+ &zed::LanguageServerInstallationStatus::CheckingForUpdate,
43+ );
44+ let release = zed::latest_github_release(
45+ GITHUB_REPO,
46+ zed::GithubReleaseOptions {
47+ require_assets: true,
48+ pre_release: false,
49+ },
50+ )?;
51+
52+ // Release assets: grain-{linux,mac,win}-{x64,arm64}.tar.gz,
53+ // each holding a single `grain` executable.
54+ let (platform, arch) = zed::current_platform();
55+ let os = match platform {
56+ zed::Os::Mac => "mac",
57+ zed::Os::Linux => "linux",
58+ zed::Os::Windows => "win",
59+ };
60+ let arch = match arch {
61+ zed::Architecture::Aarch64 => "arm64",
62+ zed::Architecture::X8664 => "x64",
63+ zed::Architecture::X86 => return Err("Grain has no 32-bit x86 build".into()),
64+ };
65+ let asset_name = format!("grain-{os}-{arch}.tar.gz");
66+ let asset = release
67+ .assets
68+ .iter()
69+ .find(|asset| asset.name == asset_name)
70+ .ok_or_else(|| format!("no asset found matching {asset_name:?}"))?;
71+
72+ // Tags look like "grain-v0.7.3".
73+ let version_dir = release.version.clone();
74+ let exe = if platform == zed::Os::Windows {
75+ "grain.exe"
76+ } else {
77+ "grain"
78+ };
79+ let binary_path = format!("{version_dir}/{exe}");
80+
81+ if !fs::metadata(&binary_path).is_ok_and(|stat| stat.is_file()) {
82+ zed::set_language_server_installation_status(
83+ language_server_id,
84+ &zed::LanguageServerInstallationStatus::Downloading,
85+ );
86+ zed::download_file(
87+ &asset.download_url,
88+ &version_dir,
89+ zed::DownloadedFileType::GzipTar,
90+ )
91+ .map_err(|e| format!("failed to download {asset_name}: {e}"))?;
92+ zed::make_file_executable(&binary_path)?;
93+
94+ // Remove older downloaded versions.
95+ if let Ok(entries) = fs::read_dir(".") {
96+ for entry in entries.flatten() {
97+ if entry.file_name().to_str() != Some(&version_dir) {
98+ fs::remove_dir_all(entry.path()).ok();
99+ }
100+ }
101+ }
102+ }
103+
104+ self.cached_binary_path = Some(binary_path.clone());
105+ Ok(binary_path)
106+ }
107+}
108+
109+impl zed::Extension for GrainExtension {
110+ fn new() -> Self {
111+ Self {
112+ cached_binary_path: None,
113+ }
114+ }
115+
116+ fn language_server_command(
117+ &mut self,
118+ language_server_id: &LanguageServerId,
119+ worktree: &zed::Worktree,
120+ ) -> Result<zed::Command> {
121+ let binary = LspSettings::for_worktree(SERVER_ID, worktree)
122+ .ok()
123+ .and_then(|s| s.binary);
124+ let args = binary
125+ .as_ref()
126+ .and_then(|b| b.arguments.clone())
127+ .unwrap_or_else(|| vec!["lsp".to_string()]);
128+ let env = binary
129+ .and_then(|b| b.env)
130+ .map(|env| env.into_iter().collect())
131+ .unwrap_or_default();
132+
133+ Ok(zed::Command {
134+ command: self.grain_binary_path(language_server_id, worktree)?,
135+ args,
136+ env,
137+ })
138+ }
139+
140+ fn language_server_workspace_configuration(
141+ &mut self,
142+ _language_server_id: &LanguageServerId,
143+ worktree: &zed::Worktree,
144+ ) -> Result<Option<zed::serde_json::Value>> {
145+ Ok(LspSettings::for_worktree(SERVER_ID, worktree)
146+ .ok()
147+ .and_then(|s| s.settings))
148+ }
149+}
150+
151+zed::register_extension!(GrainExtension);
new file mode 100644
@@ -0,0 +1,151 @@
1+use std::fs;
2+
3+use zed_extension_api::{self as zed, settings::LspSettings, LanguageServerId, Result};
4+
5+const SERVER_ID: &str = "grain-lsp";
6+const GITHUB_REPO: &str = "grain-lang/grain";
7+
8+struct GrainExtension {
9+ cached_binary_path: Option<String>,
10+}
11+
12+impl GrainExtension {
13+ /// Resolves the `grain` binary, in order:
14+ /// 1. `lsp.grain-lsp.binary.path` in Zed settings,
15+ /// 2. `grain` on the worktree's PATH,
16+ /// 3. the latest GitHub release, downloaded into the extension directory.
17+ fn grain_binary_path(
18+ &mut self,
19+ language_server_id: &LanguageServerId,
20+ worktree: &zed::Worktree,
21+ ) -> Result<String> {
22+ if let Some(path) = LspSettings::for_worktree(SERVER_ID, worktree)
23+ .ok()
24+ .and_then(|s| s.binary)
25+ .and_then(|b| b.path)
26+ {
27+ return Ok(path);
28+ }
29+
30+ if let Some(path) = worktree.which("grain") {
31+ return Ok(path);
32+ }
33+
34+ if let Some(path) = &self.cached_binary_path {
35+ if fs::metadata(path).is_ok_and(|stat| stat.is_file()) {
36+ return Ok(path.clone());
37+ }
38+ }
39+
40+ zed::set_language_server_installation_status(
41+ language_server_id,
42+ &zed::LanguageServerInstallationStatus::CheckingForUpdate,
43+ );
44+ let release = zed::latest_github_release(
45+ GITHUB_REPO,
46+ zed::GithubReleaseOptions {
47+ require_assets: true,
48+ pre_release: false,
49+ },
50+ )?;
51+
52+ // Release assets: grain-{linux,mac,win}-{x64,arm64}.tar.gz,
53+ // each holding a single `grain` executable.
54+ let (platform, arch) = zed::current_platform();
55+ let os = match platform {
56+ zed::Os::Mac => "mac",
57+ zed::Os::Linux => "linux",
58+ zed::Os::Windows => "win",
59+ };
60+ let arch = match arch {
61+ zed::Architecture::Aarch64 => "arm64",
62+ zed::Architecture::X8664 => "x64",
63+ zed::Architecture::X86 => return Err("Grain has no 32-bit x86 build".into()),
64+ };
65+ let asset_name = format!("grain-{os}-{arch}.tar.gz");
66+ let asset = release
67+ .assets
68+ .iter()
69+ .find(|asset| asset.name == asset_name)
70+ .ok_or_else(|| format!("no asset found matching {asset_name:?}"))?;
71+
72+ // Tags look like "grain-v0.7.3".
73+ let version_dir = release.version.clone();
74+ let exe = if platform == zed::Os::Windows {
75+ "grain.exe"
76+ } else {
77+ "grain"
78+ };
79+ let binary_path = format!("{version_dir}/{exe}");
80+
81+ if !fs::metadata(&binary_path).is_ok_and(|stat| stat.is_file()) {
82+ zed::set_language_server_installation_status(
83+ language_server_id,
84+ &zed::LanguageServerInstallationStatus::Downloading,
85+ );
86+ zed::download_file(
87+ &asset.download_url,
88+ &version_dir,
89+ zed::DownloadedFileType::GzipTar,
90+ )
91+ .map_err(|e| format!("failed to download {asset_name}: {e}"))?;
92+ zed::make_file_executable(&binary_path)?;
93+
94+ // Remove older downloaded versions.
95+ if let Ok(entries) = fs::read_dir(".") {
96+ for entry in entries.flatten() {
97+ if entry.file_name().to_str() != Some(&version_dir) {
98+ fs::remove_dir_all(entry.path()).ok();
99+ }
100+ }
101+ }
102+ }
103+
104+ self.cached_binary_path = Some(binary_path.clone());
105+ Ok(binary_path)
106+ }
107+}
108+
109+impl zed::Extension for GrainExtension {
110+ fn new() -> Self {
111+ Self {
112+ cached_binary_path: None,
113+ }
114+ }
115+
116+ fn language_server_command(
117+ &mut self,
118+ language_server_id: &LanguageServerId,
119+ worktree: &zed::Worktree,
120+ ) -> Result<zed::Command> {
121+ let binary = LspSettings::for_worktree(SERVER_ID, worktree)
122+ .ok()
123+ .and_then(|s| s.binary);
124+ let args = binary
125+ .as_ref()
126+ .and_then(|b| b.arguments.clone())
127+ .unwrap_or_else(|| vec!["lsp".to_string()]);
128+ let env = binary
129+ .and_then(|b| b.env)
130+ .map(|env| env.into_iter().collect())
131+ .unwrap_or_default();
132+
133+ Ok(zed::Command {
134+ command: self.grain_binary_path(language_server_id, worktree)?,
135+ args,
136+ env,
137+ })
138+ }
139+
140+ fn language_server_workspace_configuration(
141+ &mut self,
142+ _language_server_id: &LanguageServerId,
143+ worktree: &zed::Worktree,
144+ ) -> Result<Option<zed::serde_json::Value>> {
145+ Ok(LspSettings::for_worktree(SERVER_ID, worktree)
146+ .ok()
147+ .and_then(|s| s.settings))
148+ }
149+}
150+
151+zed::register_extension!(GrainExtension);