A minimal wasm demo with an in-browser editor and language server built with tower-lsp
Find a file
2022-05-29 18:46:15 -06:00
app Use AsyncIterator for input; works in all browsers 2022-05-29 18:46:15 -06:00
server Use AsyncIterator for input; works in all browsers 2022-05-29 18:46:15 -06:00
.editorconfig Import project 2022-05-29 15:43:56 -06:00
.gitignore Add .gitignore 2022-05-28 20:45:32 -06:00
CODE_OF_CONDUCT.md Import project 2022-05-29 15:43:56 -06:00
LICENSE Import project 2022-05-29 15:43:56 -06:00
README.md Use AsyncIterator for input; works in all browsers 2022-05-29 18:46:15 -06:00

tower-lsp-wasm-example

A minimal WASM target example for tower-lsp

Building

cargo install wasm-bindgen-cli --version 0.2.80
cd server
RUSTFLAGS=--cfg=web_sys_unstable_apis cargo build --release --target wasm32-unknown-unknown
wasm-bindgen --out-dir ../app/dist --target web --typescript ./target/wasm32-unknown-unknown/release/server.wasm
cd ..
cd app
npm i
npm run build

Running

cd app
npm run app

After the browser window opens, you can try copying and pasting the listed messages into the stdin textarea and hitting the send button.