File tree Expand file tree Collapse file tree 2 files changed +16
-15
lines changed
Expand file tree Collapse file tree 2 files changed +16
-15
lines changed Original file line number Diff line number Diff line change @@ -23,7 +23,14 @@ new EditorView({
2323
2424## Full support (diagnostics + autocomplete + hover)
2525
26- Requires WASM files — build or download from a release.
26+ Requires WASM files served from your app. The easiest way is to grab them from the ` @gnata-sqlite/react ` package:
27+
28+ ``` bash
29+ npm install @gnata-sqlite/react
30+ npx @gnata-sqlite/react setup ./public
31+ ```
32+
33+ This copies ` gnata-lsp.wasm ` and ` lsp-wasm_exec.js ` into your public directory. Then:
2734
2835``` typescript
2936import { EditorView , basicSetup } from " codemirror"
@@ -37,11 +44,7 @@ new EditorView({
3744})
3845```
3946
40- ## Build the WASM files
41-
42- ``` bash
43- make wasm
44- ```
47+ Alternatively, build from source with ` make wasm ` (requires [ TinyGo] ( https://tinygo.org/getting-started/install/ ) ).
4548
4649## Tooltip styling
4750
Original file line number Diff line number Diff line change @@ -18,7 +18,6 @@ The WASM module is 380 KB (145 KB gzipped).
1818
1919- ** Node.js 18+** and a package manager
2020- A frontend project that can import ES modules
21- - For full features: ` gnata-lsp.wasm ` and ` lsp-wasm_exec.js ` (covered in Step 3)
2221
2322## Step 1 — Install
2423
@@ -46,12 +45,11 @@ Type `Account.Order.Product.Price` — tokens highlight immediately.
4645
4746## Step 3 — Full setup with WASM LSP
4847
49- Place the WASM files where the app can serve them (e.g. ` public/ ` in Vite) :
48+ The WASM files are bundled with ` @gnata-sqlite/react ` . Copy them into your public directory :
5049
51- ```
52- public/
53- gnata-lsp.wasm
54- lsp-wasm_exec.js
50+ ``` bash
51+ npm install @gnata-sqlite/react
52+ npx @gnata-sqlite/react setup ./public
5553```
5654
5755Use ` jsonataFull ` instead of ` jsonata ` :
@@ -106,15 +104,15 @@ new EditorView({
106104
107105Type ` Account. ` → suggests ` Name ` , ` Order ` . Type ` Account.Order.Product. ` → suggests ` Price ` , ` Quantity ` .
108106
109- ## Step 5 — Build WASM from source
107+ ## Step 5 — Build WASM from source (optional)
110108
111- Requires [ TinyGo] ( https://tinygo.org/getting-started/install/ ) . See [ Why TinyGo? ] ( /docs/explanation/tinygo-wasm ) for background.
109+ If you need to build from source instead of using the bundled files, install [ TinyGo] ( https://tinygo.org/getting-started/install/ ) and run:
112110
113111``` bash
114112make wasm
115113```
116114
117- Produces ` gnata-lsp.wasm ` ( ~ 380 KB, 145 KB gzipped) and ` lsp-wasm_exec.js ` . Copy both to the static assets directory .
115+ See [ Why TinyGo? ] ( /docs/explanation/tinygo-wasm ) for background on the build pipeline .
118116
119117## Try it live
120118
You can’t perform that action at this time.
0 commit comments