{"id":14991168,"url":"https://github.com/guyutongxue/clangd-in-browser","last_synced_at":"2025-05-11T00:56:41.111Z","repository":{"id":219590668,"uuid":"749417218","full_name":"guyutongxue/clangd-in-browser","owner":"guyutongxue","description":"Port clangd language server to WASM, and run it in your browser.","archived":false,"fork":false,"pushed_at":"2024-10-20T06:33:11.000Z","size":74,"stargazers_count":54,"open_issues_count":2,"forks_count":12,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-05-09T21:46:38.376Z","etag":null,"topics":["clang","clangd","cpp","llvm","lsp","monaco-editor","wasm"],"latest_commit_sha":null,"homepage":"https://clangd.guyutongxue.site/","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/guyutongxue.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-01-28T14:28:01.000Z","updated_at":"2025-04-28T09:15:38.000Z","dependencies_parsed_at":"2024-02-14T04:31:51.427Z","dependency_job_id":"956b8ed3-b5c2-45d0-bca4-4f8b87006f88","html_url":"https://github.com/guyutongxue/clangd-in-browser","commit_stats":{"total_commits":35,"total_committers":4,"mean_commits":8.75,"dds":0.08571428571428574,"last_synced_commit":"d6109d97bc1ff39c76512a3d5632ea1c44de02e5"},"previous_names":["guyutongxue/clangd-in-browser"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/guyutongxue%2Fclangd-in-browser","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/guyutongxue%2Fclangd-in-browser/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/guyutongxue%2Fclangd-in-browser/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/guyutongxue%2Fclangd-in-browser/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/guyutongxue","download_url":"https://codeload.github.com/guyutongxue/clangd-in-browser/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253330928,"owners_count":21891848,"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":["clang","clangd","cpp","llvm","lsp","monaco-editor","wasm"],"created_at":"2024-09-24T14:21:37.510Z","updated_at":"2025-05-09T21:46:47.601Z","avatar_url":"https://github.com/guyutongxue.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# [Clangd](https://clangd.llvm.org) in Browser\n\nFinally, I made clangd work in browser. You can now get C++ IntelliSense directly without installing any native compiler or relying on a remote server.\n\nThis repo contains a build script for clangd on WebAssembly (TBD), and an example of using clangd WASM module together with [Monaco Editor](https://microsoft.github.io/monaco-editor) powered by it's Language Client port (thanks [TypeFox/monaco-languageclient](https://github.com/TypeFox/monaco-languageclient)).\n\n## How to build\n\nYou can take a look at `build.sh` for how to build clangd to WASM. Once `clangd.wasm` generated at `public/wasm`, you can build those frontend code using `pnpm install` and `pnpm build`.\n\n## About the example page\n\nI've publish a [GitHub Page](https://clangd.guyutongxue.site/) for demonstrating how clangd works in your browser.\n\nNotice that clangd is a multi-thread program, so we need `SharedArrayBuffer` -- and more over, a strict context called `crossOriginIsolated`. GitHub Pages do not send COOP/COEP headers for us to enabling that context, so I served this site through CloudFlare with a custom rule adding those headers. If you want to deploy this project by yourself, make sure correct COOP/COEP header is set on the server side, or you can use  [`coi-serviceworker`](https://github.com/gzuidhof/coi-serviceworker).\n\nYou can pass URL search parameters to control the initial state of this page ([see here](./docs/params.md)), or embed it in your website ([see here](./docs/embed.md), **your website needs to be cross-origin-isolated too**)\n\n## Acknowledgement\n\n- [soedirgo/llvm-wasm](https://github.com/soedirgo/llvm-wasm) provides a very detailed guide on how to build LLVM to wasm. Better than famous works like [binji/wasm-clang](https://github.com/binji/wasm-clang) or [tbfleming/cib](https://github.com/tbfleming/cib) (but also thank you guys :P);\n- [nokotan/vscode-clangd](https://github.com/nokotan/vscode-clangd) patch vscode's clangd extension with WASM binary to make it work on vscode-web. Some bugs but useful; no build scripts or further documentation;\n- [ConorBobbleHat/clangd-wasm](https://github.com/ConorBobbleHat/clangd-wasm) and [ConorBobbleHat/clangd-wasm-core](https://github.com/ConorBobbleHat/clangd-wasm-core); build scripts provided but lack examples on how to use them.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fguyutongxue%2Fclangd-in-browser","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fguyutongxue%2Fclangd-in-browser","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fguyutongxue%2Fclangd-in-browser/lists"}