swls-wasm
v0.3.1
Published
WASM bindings for the semantic web language server.
Readme
SWLS-Web
WASM bindings for the semantic web language server.
As SWLS is not yet published, this package expects SWLS to be present in the parent directory.
🚴 Usage
🛠️ Build with wasm-pack build
wasm-pack build🔬 Test in Headless Browsers with wasm-pack test
wasm-pack test --headless --firefox🎁 Publish to NPM with wasm-pack publish
wasm-pack publishCustom LSP Requests
The WASM LSP server sends custom requests from server to client that the host must handle. All requests use params: { url: string }.
If a handler is not implemented, the server falls back to a sensible default.
custom/readFile
Reads the contents of a file.
params: { url: string }
result: { content: string } | { error: string }custom/readDir
Lists the entries of a directory.
params: { url: string }
result: Array<{ name: string; path: string; is_dir: boolean }>
// fallback: returns null/error → treated as emptycustom/isFile
Returns whether the given URL refers to a file.
params: { url: string }
result: boolean
// fallback: true when URL does not end with '/'custom/isDir
Returns whether the given URL refers to a directory.
params: { url: string }
result: boolean
// fallback: true when URL ends with '/'custom/canonicalize
Resolves a URL to its canonical form.
params: { url: string }
result: { url: string }
// fallback: returns the input URL unchangedLicense
- MIT license (LICENSE or http://opensource.org/licenses/MIT)
