{"id":13599844,"url":"https://github.com/silvanshade/tower-lsp-web-demo","last_synced_at":"2025-12-30T01:32:47.069Z","repository":{"id":37181008,"uuid":"497713537","full_name":"silvanshade/tower-lsp-web-demo","owner":"silvanshade","description":"A minimal wasm demo with an in-browser editor and language server built with tower-lsp","archived":false,"fork":false,"pushed_at":"2024-02-03T17:27:55.000Z","size":1650,"stargazers_count":32,"open_issues_count":1,"forks_count":6,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-08-02T17:39:20.862Z","etag":null,"topics":["browser","jsonrpc","lsp-server","rust","wasm","webassembly"],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/silvanshade.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2022-05-29T21:28:04.000Z","updated_at":"2024-07-21T21:42:53.000Z","dependencies_parsed_at":"2022-06-24T03:21:30.562Z","dependency_job_id":null,"html_url":"https://github.com/silvanshade/tower-lsp-web-demo","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/silvanshade%2Ftower-lsp-web-demo","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/silvanshade%2Ftower-lsp-web-demo/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/silvanshade%2Ftower-lsp-web-demo/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/silvanshade%2Ftower-lsp-web-demo/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/silvanshade","download_url":"https://codeload.github.com/silvanshade/tower-lsp-web-demo/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":223442699,"owners_count":17145821,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["browser","jsonrpc","lsp-server","rust","wasm","webassembly"],"created_at":"2024-08-01T17:01:13.592Z","updated_at":"2025-12-30T01:32:47.043Z","avatar_url":"https://github.com/silvanshade.png","language":"Rust","funding_links":[],"categories":["Rust"],"sub_categories":[],"readme":"\u003cdiv align=\"center\"\u003e\n  \u003ch1\u003e\u003ccode\u003etower-lsp-web-demo\u003c/code\u003e\u003c/h1\u003e\n  \u003cp\u003e\n    \u003cstrong\u003eA minimal browser-hosted WASM demo for tower-lsp\u003c/strong\u003e\n  \u003c/p\u003e\n\u003c/div\u003e\n\n## Demo\n\nYou can experiment with a live demo of the example server integrated with an in-browser editor here:\n\nhttps://silvanshade.github.io/tower-lsp-web-demo/\n\n## Building\n\n```sh\ncargo install cargo-make\ncargo make deps\ncargo make build\n```\n\n## Running\n\n```sh\ncargo make run\n```\n\n## Project Structure\n\nThe server implementation:\n\n```\ncrates\n├── browser                   -- entry-point for launching the server in the browser\n│   └── src\n│       └── lib.rs\n├── language                  -- handles definitions for working with tree-sitter javascript grammar\n│   └── src\n│       ├── language.rs       -- handles loading the pre-compiled tree-sitter-javascript.wasm blob\n│       ├── lib.rs\n│       └── parser.rs         -- creates tree-sitter parsers from the loaded grammar blob\n└── server\n    └── src\n        ├── core\n        │   ├── document.rs   -- definitions for working with document related data\n        │   ├── error.rs\n        │   ├── session.rs    -- definitions for lsp session and related state\n        │   ├── syntax.rs     -- definitions for updating syntax text area in browser\n        │   └── text.rs       -- definitions for handling text and edits\n        ├── core.rs\n        ├── handler.rs        -- definitions for various feature handlers\n        ├── lib.rs\n        └── server.rs         -- definitions for the lsp server and impl of tower-lsp trait\n```\n\nThe webapp and client implementation for wiring up the Monaco editor to  communicate with the server:\n\n```\npackages\n└── app\n    └── src\n        ├── app.ts            -- the browser app which launches the client and server and displays the user interface\n        ├── client.ts         -- definitions for the lsp client\n        ├── codec             -- definitions for encoding and decoding/demuxing messages between the client and server\n        │   ├── bytes.ts      -- utilities for working with Uint8Array\n        │   ├── demuxer.ts    -- demuxer for splitting output from server into streams of notifications, requests, and responses\n        │   ├── headers.ts    -- utilities for working with http headers\n        │   ├── map.ts        -- map for storing responses from server yet to be processed (fed by demuxer)\n        │   └── queue.ts      -- promise based queue used for storing notifications and requests\n        ├── index.ts\n        ├── language.ts       -- definition for the javascript language (e.g., language id, extensions, mime, etc.)\n        ├── queue.ts          -- promise based queue structure\n        ├── server.ts         -- prepares client-\u003eserver and client\u003c-server web streams and launches tower-lsp server\n        └── tracer.ts         -- utilities for tracing JSON-RPC messages and displaying in browser interface\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsilvanshade%2Ftower-lsp-web-demo","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsilvanshade%2Ftower-lsp-web-demo","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsilvanshade%2Ftower-lsp-web-demo/lists"}