本文へ移動
cccskills
無料GitHub で公開

lsp

clangd LSP over HTTP for C++ syntax checks and symbol navigation in LuisaCompute sources.

インストール方法を見る

含まれるファイル(1)

  • SKILL.md3.0 KB

SKILL.md(原文)

インストールする前に、エージェントに与えられる指示の中身を確認できます。

C++ LSP

Provides clangd-powered syntax checks and symbol queries over an HTTP bridge.

Architecture

  • Server (scripts/cpp_lsp_server.py): FastAPI wrapper around clangd. Requires compile_commands.json.
  • Client (scripts/cpp_lsp_client.py): httpx CLI that talks to the server.

Workflow

  1. Start the server in the background before any C++ editing session:

    python scripts/cpp_lsp_server.py --project-root . --port 8000
    

    The server auto-discovers compile_commands.json in .vscode/, build/, or project root. If none is found, it falls back to the project root.

  2. Use the client to query information. Common commands:

Check Syntax

python scripts/cpp_lsp_client.py check src/foo.cpp -v
# Override content ad-hoc:
python scripts/cpp_lsp_client.py check src/foo.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/foo.cpp 10 5 --action definition

# Hover info
python scripts/cpp_lsp_client.py symbol src/foo.cpp 10 5 --action hover

# Document-level symbols
python scripts/cpp_lsp_client.py symbol src/foo.cpp --action documentSymbol

Available actions: definition, declaration, typeDefinition, implementation, references, hover, documentSymbol.

You can also override file content for symbol queries:

python scripts/cpp_lsp_client.py symbol src/foo.cpp 10 5 --action hover --content "int x = 0;"

Server Health

curl http://127.0.0.1:8000/health

Parameters

Client flagDefaultDescription
--serverhttp://127.0.0.1:8000Server base URL
--timeout3.0HTTP request timeout (s)
--lsp-timeout10.0Internal clangd timeout (s) passed to the server
Server flagDefaultDescription
--host / --port127.0.0.1:8000Bind address
--project-root.Where to search for compile_commands.json
--clangdclangdPath to clangd executable
--compile-commands-dirautoOverride compile_commands.json location
--verboseoffPrint LSP traffic

Exit Codes

  • check subcommand: 0 (no issues), 1 (errors found), 2 (connection/server error).
  • symbol subcommand: 0 (result returned), 1 (no result), 2 (connection/server error).

Requirements

  • clangd in PATH
  • compile_commands.json generated, e.g.:
    • XMake: xmake project -k compile_commands --lsp=clangd .vscode
    • CMake: -DCMAKE_EXPORT_COMPILE_COMMANDS=ON
  • Python packages: fastapi, uvicorn, httpx, pydantic

Notes

  • The server holds a single clangd process. Restart it if compile_commands.json changes.
  • line and character are 0-based, matching the LSP protocol and clangd's expectations.

レビュー

まだレビューはありません。使ってみた感想をお寄せください。

同じリポジトリのスキル

概要と使いどころ

ast

無料

Manual AST construction with FunctionBuilder for kernels and callables without DSL sugar.

日本語の概要は準備中です。原文の説明を表示しています。

LuisaGroup/LuisaCompute1,0532026年10月11日 更新

Backend plugin architecture, DeviceInterface, dynamic loading, and command encoding.

日本語の概要は準備中です。原文の説明を表示しています。

LuisaGroup/LuisaCompute1,0532026年10月11日 更新

cmake

無料

CMake build options, custom functions, and backend patterns for LuisaCompute.

日本語の概要は準備中です。原文の説明を表示しています。

LuisaGroup/LuisaCompute1,0532026年10月11日 更新

cpp-style

無料

C++ naming, formatting, static analysis, and RTTI rules for LuisaCompute.

日本語の概要は準備中です。原文の説明を表示しています。

LuisaGroup/LuisaCompute1,0532026年10月11日 更新

debug

無料

Debug crashes and test failures via stack-traces, host/device logging, and DSL buffer inspection.

日本語の概要は準備中です。原文の説明を表示しています。

LuisaGroup/LuisaCompute1,0532026年10月11日 更新

git

無料

Show uncommitted changes and commit history via git. Use when: (1) inspecting what changed in a file before committing, (2) checking diff of tracked/new/deleted files, (3) reviewing a specific commit's changes, (4) listing files changed in a commit.

日本語の概要は準備中です。原文の説明を表示しています。

LuisaGroup/LuisaCompute1,0532026年10月11日 更新

LuisaGroup のスキルをすべて見る

このスキルの問題を報告する