تخطَّ إلى المحتوى
TakoAPI
العودة إلى المهارات

clangd-lsp

بواسطة bowen31337

Coding Agents & IDEs
854التنزيلات وفق ما يذكره clawskills.sh
0المشاهدات
لا إعجاباتسجّل الدخول للإعجاب بهذه المهارة
—لم يُقيَّم بعد
تقييمك

موجز

C/C++ language server (clangd) providing code intelligence, diagnostics, and formatting for .c, .h, .cpp, .cc.

الوصف

ما الذي تفعله هذه المهارة

C/C++ language server integration using clangd, part of the LLVM project. Provides autocomplete, go-to-definition, find references, real-time diagnostics, and refactoring for C and C++ files. Works with any LSP-compatible editor.

clangd uses the same compiler frontend as Clang, so its diagnostics and code understanding are more accurate than generic IDE plugins that parse code independently.

متى تستخدمها

  • Navigating a large C++ codebase with go-to-definition
  • Catching compilation errors in real time while editing
  • Formatting C++ source files with clang-format
  • Renaming a symbol across an entire C project
  • Running static analysis on C++ code before committing

مثال على سير العمل

الإدخال

User asks: set up C++ code intelligence for my cmake project

الوكيل
  1. 1

    Generate compile_commands.json by running cmake with -DCMAKE_EXPORT_COMPILE_COMMANDS=ON

  2. 2

    Create a .clangd config file in the project root with compiler flags and diagnostic settings

  3. 3

    Verify clangd picks up the project by checking that go-to-definition resolves across files

  4. 4

    Run clang-tidy to surface static analysis warnings

  5. 5

    Run clang-format to auto-format modified source files

الإخراج

C++ project has full code intelligence with accurate diagnostics, autocomplete, and formatting integrated into the editor

المتطلبات

  • clangd installed (via LLVM: brew install llvm, apt install clangd, dnf install clang-tools-extra, or winget install LLVM.LLVM)

التثبيت

clawhub install bowen31337/clangd-lsp

شغّل أمر واجهة سطر الأوامر، أو الصق النص في Claude Code أو Cursor أو Codex أو أي وكيل برمجة تستخدمه.

الروابط