clangd-lsp

C/C++ language server (clangd) providing code intelligence, diagnostics, and formatting for .c, .h, .cpp, .cc, .cxx, .hpp, .hxx files. Use when working with C or C++ code that needs autocomplete, go-to-definition, find references, error detection, or refactoring support.

Safety Notice

This listing is from the official public ClawHub registry. Review SKILL.md and referenced scripts before running.

Copy this and send it to your AI assistant to learn

Install skill "clangd-lsp" with this command: npx skills add bowen31337/clangd-lsp

clangd LSP

C/C++ language server integration providing comprehensive code intelligence through clangd (part of LLVM).

Capabilities

  • Code intelligence: Autocomplete, go-to-definition, find references
  • Error detection: Real-time diagnostics for compilation errors
  • Formatting: Code formatting with clang-format
  • Refactoring: Rename symbols, extract function
  • Supported extensions: .c, .h, .cpp, .cc, .cxx, .hpp, .hxx, .C, .H

Installation

Via Homebrew (macOS)

brew install llvm
# Add to PATH
export PATH="/opt/homebrew/opt/llvm/bin:$PATH"

Via package manager (Linux)

# Ubuntu/Debian
sudo apt install clangd

# Fedora
sudo dnf install clang-tools-extra

# Arch Linux
sudo pacman -S clang

Windows

winget install LLVM.LLVM

Or download from LLVM releases.

Verify installation:

clangd --version

Usage

The language server runs automatically in LSP-compatible editors. For manual operations:

Compile

gcc file.c -o output      # C
g++ file.cpp -o output    # C++
clang file.c -o output    # with clang

Format code

clang-format -i file.cpp

Static analysis

clang-tidy file.cpp -- -std=c++17

Configuration

Create .clangd in project root:

CompileFlags:
  Add: [-std=c++17, -Wall, -Wextra]
  Remove: [-W*]
Diagnostics:
  UnusedIncludes: Strict
  MissingIncludes: Strict

Or compile_commands.json for complex projects:

cmake -DCMAKE_EXPORT_COMPILE_COMMANDS=ON .
# or
bear -- make

Integration Pattern

When editing C/C++ code:

  1. clangd uses compile_commands.json for project understanding
  2. Run clang-format to format code
  3. Use clang-tidy for static analysis
  4. Compile with warnings enabled (-Wall -Wextra)

Common Flags

Compile flags:

  • -std=c++17 - C++17 standard
  • -Wall -Wextra - Enable warnings
  • -O2 - Optimization level
  • -g - Debug symbols
  • -I<path> - Include path
  • -L<path> - Library path

clang-tidy checks:

clang-tidy file.cpp --checks='*' --
clang-tidy file.cpp --fix --  # Auto-fix

More Information

Source Transparency

This detail page is rendered from real SKILL.md content. Trust labels are metadata-based hints, not a safety guarantee.

Related Skills

Related by shared tags or category signals.

Web3

Crypto Holdings Monitor

加密货币持仓监控工具。支持多钱包地址监控、实时价格查询、持仓统计。

Registry SourceRecently Updated
Web3

Asrai Crypto Analysis (x402)

Crypto market analysis using Asrai API. Covers technical analysis, screeners, sentiment, forecasting, smart money, Elliott Wave, cashflow, DEX data, and AI-p...

Registry SourceRecently Updated
Web3

research analyst

AI-powered stock & crypto research with 8-dimension analysis, portfolio tracking, and trend detection | AI 驱动的股票与加密货币研究工具,提供 8 维度分析、投资组合追踪和趋势检测

Registry SourceRecently Updated
08
Profile unavailable