Instructions and guidelines for AI agents working in the C/C++ Pro codebase.
C/C++ Pro is a high-performance C/C++ extension for Visual Studio Code. It integrates LLVM Clangd, compiler discovery, static build system analysis, and native debugging.
src/substrate/: Manages theclangdlanguage server process, status bar, and communication protocols.src/prober/: Discovers system compilers (MSVC, GCC, Clang) and external SDKs (Vulkan, raylib, CUDA, Boost, SDL).src/cmake/: Statically tokenizes and parsesCMakeLists.txtfiles without invoking external CMake binaries.src/solution/: Statically parses Visual Studio solutions (.sln,.slnx,.vcxproj) to generate compilation databases.src/config/: Manages multi-target profiles and Kconfig (.config) files.src/debugger/: Manages debug configurations, process attachment, and DAP sessions.src/intelligence/: Implements smart definition navigation, code actions, and documentation lookups.src/webview/: Provides the interactive configuration panel webview.
Execute commands in the workspace root directory:
- Build extension bundle:
npm run build
- Watch for incremental changes:
npm run watch
- Run TypeScript typecheck:
npm run check-types
- Run unit tests:
npm test - Package VSIX extension:
npm run package
The project enforces the strictest TypeScript compiler options in tsconfig.json:
- No Implicit Any: Specify explicit types for all variables, parameters, and return values.
- Strict Null Checks: Handle
nullandundefinedexplicitly. Do not use non-null assertions (!) carelessly. - No Unused Code: Do not leave unused imports, variables, or functions.
- Unused Parameters: Prefix intentionally unused callback parameters with an underscore (e.g.,
_token). - No Implicit Returns: Ensure all code paths in non-void functions return a value.
- No Fallthrough in Switch: End every non-empty case statement with
breakorreturn. - No Unreachable Code: Remove dead code paths and unused labels immediately.
- Explicit Overrides: Use the
overridekeyword when overriding base class methods. - Zero Type Errors: Always run
npm run check-typesbefore submitting any changes. - Strict No Emojis: Do not use emojis in code, comments, documentation, or commit messages unless absolutely necessary.
Adhere strictly to these constraints when modifying the codebase:
- Do not inject external SDK flags into projects that do not use them.
- Verify workspace usage via
ExternalSdkDetector.isSdkUsedInWorkspacebefore adding SDK include directories.
- Ensure all created test files and temporary artifacts clean up after execution.
- use
git statusandgit diffcommands to verify your changes. - If user asks for staging write clean commit messages that describe the changes.
- Never traverse, list, or search the
playground/directory:- Do not run
ls,dir,Get-ChildItem,find, or recursive glob searches targetingplayground/. - Do not read, edit, or commit files within
playground/unless the user explicitly targets a specific sub-path in a prompt. - Keep
playground/strictly isolated as an external manual verification sandbox to prevent context window saturation from third-party codebases. - The
playground/directory itself is tracked via.gitkeep, but all repository contents inside it are ignored by git.
- Do not run
- Do not use emojis in source code, user-facing UI messages, diagnostics, comments, documentation, commit messages, or agent communication unless absolutely necessary. Maintain a clean, professional, and technical tone throughout.
Complete these steps for every change before committing:
- Run
npm run check-typesand verify 0 type errors. - Run
npm testand verify all unit tests pass. - Verify
git statusshows no unintended or untracked files.