lsp
Skill1.1k starsChanged 35 days agoApache-2.0View on GitHub
clangd LSP over HTTP for C++ syntax checks and symbol navigation in LuisaCompute sources.
3 other projects use a version of this.
Trending
Quiet since July.thin dataabout the whole repository
Most recently taken up by
- Fahrnetic/engineering-agent-skill-workflowtheir own version, first seen Oct 15, 2026
- wjgoarxiv/litopencodetheir own version, first seen Oct 13, 2026
- atopile/atopiletheir own version, first seen Oct 8, 2026
Who's talking about LuisaGroup/LuisaCompute
- Stack Overflow“c++ error: ‘struct std::atomic_flag’ has no member named ‘test’”Stack Overflow · Dec 26, 2022 · 1 votes
- Tencent/ncnn“optimize multi-head attention (increased shared-memory tile size, add fused kernel)”GitHub · Jul 10, 2026
- bazelbuild/bazel-central-registry“wanted: [LuisaGroup/LuisaCompute]”GitHub · Nov 8, 2025
- MuGdxy/SymEigen“Try to add support for luisa-compute”GitHub · Sep 15, 2025
- LuisaGroup/LuisaRender“Remove `util/u64.h` and use `Var<ulong>` instead”GitHub · Jun 2, 2024
The biggest 5 of 5 mentions linking to the repository that our crawl found. Each line is their own headline.
Other versions3 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 3
- atopile/atopile★ 4ksame name
- Fahrnetic/engineering-agent-skill-workflow★ 2same name
- wjgoarxiv/litopencode★ 2same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository22 other files it gives its agents.
- .github/copilot-instructions.mdCopilot instructions
- astSkill
- backend-architectureSkill
- cmakeSkill
- cpp-styleSkill
- debugSkill
- gitSkill
- glslangSkill
- hlslSkill
- ir-pipelineSkill
- lc_apiSkill
- lc_native_shaderSkill
- lc_optimizeSkill
- llvm-spirvSkill
- project_structureSkill
- renderdocSkill
- spirv_codegenSkill
- spv-optSkill
- testSkill
- xir-passesSkill
- xmakeSkill
- yyjsonSkill
The file
We split this skill into the rules it gives an agent
2 rules. 0 are common, 1 is distinctive, and 1 is very specific to this project.
0
Common
Most of the 3 edited versions we read keep these.
1
Distinctive
This author's own choices. Worth a look.
1
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 20
Start the server in the background: before any C++ editing session (the command blocks until stopped — run it as a background job):
- Very specific: line 96
Every clangd call is serialized behind one asyncio.Lock, and each endpoint sleeps first (0.5 s before diagnostics, 0.3 s before a symbol …
“Common” is measured: kept by at least 6 in 10 of the 3 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
C++ LSP
Provides clangd-powered syntax checks and symbol queries over an HTTP bridge.
Architecture
- Server (
scripts/cpp_lsp_server.py): FastAPI + uvicorn wrapper around oneclangdsubprocess driven over raw JSON-RPC/stdio (nopygls). Requirescompile_commands.json.GET /health→{"status": "ok", "clangd_running": bool}POST /check_syntax→{file_path, content?, verbose, timeout}POST /symbol→{file_path, line, character, content?, action, timeout}
- Client (
scripts/cpp_lsp_client.py): httpx CLI withcheck/symbolsubcommands that talks to the server.
Workflow
- Start the server in the background before any C++ editing session (the command blocks until stopped — run it as a background job):
python scripts/cpp_lsp_server.py --project-root . --port 8000The server auto-discovers compile_commands.json in .vscode/, build/, or project root (first hit wins — .vscode/ is checked before build/), and unlike scripts/check_cpp_syntax.py it does not scan other build* directories. If none is found it falls back to the project root, i.e. clangd runs without per-TU flags.
- Use the client to query information. Common commands:
Check Syntax
python scripts/cpp_lsp_client.py check src/core/logging.cpp -v
# Override content ad-hoc:
python scripts/cpp_lsp_client.py check src/core/logging.cpp --content "int main() { return 0; }"Symbol Navigation
# Go to definition at line 10, character 5 (0-based)
python scripts/cpp_lsp_client.py symbol src/core/logging.cpp 10 5 --action definition
# Hover info
python scripts/cpp_lsp_client.py symbol src/core/logging.cpp 10 5 --action hover
# Document-level symbols
python scripts/cpp_lsp_client.py symbol src/core/logging.cpp --action documentSymbolAvailable actions: definition, declaration, typeDefinition, implementation, references, hover, documentSymbol.
--content exists only on check; the symbol subcommand has no --content flag (the /symbol endpoint accepts an optional content field, reachable only via a direct HTTP POST). symbol's line/character positionals are optional (default 0) and ignored by documentSymbol.
Server Health
curl http://127.0.0.1:8000/healthParameters
| Client flag | Scope | Default | Description |
--server | global | http://127.0.0.1:8000 | Server base URL |
--timeout | global | 3.0 | HTTP request timeout (s) |
--lsp-timeout | subcommand | 10.0 | clangd wait time (s), sent as the body timeout |
-v, --verbose | check | off | Also print Info/Hint diagnostics |
--content | check | unset | Check this text instead of the file on disk |
line character | symbol | 0 0 | 0-based position (optional; omit for documentSymbol) |
--action | symbol | definition | One of the 7 actions listed above |
--server/--timeout belong to the top-level parser and must come before the subcommand; --lsp-timeout, -v, --content, --action come after it.
| Server flag | Default | Description |
--host | 127.0.0.1 | Bind address |
--port | 8000 | Bind port |
--project-root | . | Where to search for compile_commands.json |
--clangd | clangd | Path to clangd executable (no pre-check, no settings.json lookup) |
--compile-commands-dir | auto | Directory containing compile_commands.json — a directory, not a file path |
--verbose | off | Print LSP traffic and raise uvicorn log level to info |
Exit Codes
checksubcommand:0(no errors — warnings alone still exit0),1(at least one error),2(connection/HTTP/server error: unreachable server, missing file without--content→ HTTP 404).symbolsubcommand:0(result returned),1(no result: clangd returnednullor the LSP call timed out),2(connection/server error). An action outside the 7 above is rejected by the client's argparse; a direct HTTP call gets 400.- Same 0/1/2 semantics as
scripts/check_cpp_syntax.py(0 clean, 1 errors, 2 tool failure).
Requirements
clangdresolvable through PATH. The server passes--clangdverbatim tosubprocess.Popen; it does not readclangd.pathfrom.vscode/settings.jsonthe wayscripts/check_cpp_syntax.pydoes, and does not verify the binary first — give--clangd <path>explicitly when clangd is not on PATH.compile_commands.jsongenerated, e.g.:- XMake:
xmake project -k compile_commands --lsp=clangd .vscode(.vscodeis the server's first search dir) - CMake: already forced by the root
CMakeLists.txt(set(CMAKE_EXPORT_COMPILE_COMMANDS ON)), so a normal CMake configure writesbuild/compile_commands.json
- XMake:
- Python packages:
fastapi,uvicorn,httpx,pydantic(the scripts' only third-party imports; not declared inpyproject.toml, install them separately)
Notes
- The server holds a single clangd process. Restart it if
compile_commands.jsonchanges — there is no idle timeout and no hot-reload; stop it with Ctrl+C (the lifespan hook sends LSPshutdown/exitand kills clangd after a 2 s grace). - Every clangd call is serialized behind one
asyncio.Lock, and each endpoint sleeps first (0.5 sbefore diagnostics,0.3 sbefore a symbol query), so concurrent client calls queue instead of running in parallel. - The server always starts clangd with
--clang-tidy=true(plus--log=error --completion-style=bundled --pch-storage=memory), unlikecheck_cpp_syntax.py, where clang-tidy is off unless--clang-tidy. lineandcharacterinsymbolrequests are 0-based, matching the LSP protocol; the diagnostic positionscheckprints are converted to 1-basedline/col.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

