Browser-ready WebAssembly build of the Rune language server, plus a small TypeScript wrapper (@runels-wasm/browser) and a React demo. This lets you run the Rune LSP fully in the browser (no native binaries) and wire it to editors like CodeMirror.
The Demo is available at Cloudflare Pages: https://rune-ls-wasm-demo.pages.dev/.
- No full support for every standard library features, some packages (e.g,
http,processandsignal) are not ported since their implementations are not possible to port to WebAssembly and I can't find a trivial method to separate the LSP context from actual code execution. - Hard to integrate with third-party binds since it requires customize the
rune-languageservercrate to support the bind and may faces same problems as the non-portable standard library features.
Prerequisites: Nix with flakes enabled.
- Build the WebAssembly language server artifact:
nix build .#rune-languageserverOutputs:
-
result/lib/rune_languageserver.js -
result/lib/rune_languageserver.wasm -
Build the demo site (static assets):
nix build .#demoThe built site will be in result/. Serve it with headers that include COOP/COEP Since we are using SharedArrayBuffer for PThreads support in Emscripten. Example (Caddy):
caddy file-server --root ./result --listen :5173 \
--header "Cross-Origin-Opener-Policy: same-origin" \
--header "Cross-Origin-Embedder-Policy: require-corp"packages/browser/: TypeScript wrapper exposingRuneLanguageServerfor the browser.packages/demo/: React + Vite demo wired to CodeMirror and the in-browser LSP.crates/rune-languageserver/: The Rune Language Server crate withwasm32-unknown-emscriptentarget support.
This project is licensed under the MIT license. See LICENSE for details.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.