Skip to content

Latest commit

 

History

1 Commit

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 

Repository files navigation

codegraphcontext-cpp

C++ language plugin for CodeGraphContext.

Provides tree-sitter-based C++ parsing and node-type query tools as a codegraphcontext.language entry-point plugin.


Installation

pip install codegraphcontext-cpp

Or in editable mode alongside a local CGC checkout:

pip install -e /path/to/codegraphcontext-cpp

After installation, cgc info languages should list cpp. The plugin claims extensions .cpp, .hpp, .hh, and .h.


Plugin-contributed MCP tools

When this package is installed, the following MCP tools are auto-registered by the CGC server at startup via the AnalysisDescriptor mechanism. They appear alongside the core CGC tools in any MCP-connected IDE.

All tools take no required parameters. Each returns a list of node records under the key results, with at minimum name, path, and line_number fields plus the type-specific fields listed below.

Tool Node type queried Extra return fields
find_cpp_functions Function docstring
find_cpp_classes Class docstring
find_cpp_imports File -[:IMPORTS]-> Module file_name, module_name, full_import_name, alias
find_cpp_structs Struct fields
find_cpp_enums Enum values
find_cpp_unions Union members
find_cpp_macros Macro value
find_cpp_variables Variable value, context

Graph nodes populated by this plugin

Indexing a C++ repository populates the following node/relationship types beyond the common File, Function, Class, Module schema:

Node Key properties Description
Struct name, path, line_number, fields struct declarations
Enum name, path, line_number, values enum / enum class declarations
Union name, path, line_number, members union declarations
Macro name, path, line_number, value #define macro definitions
Variable name, path, line_number, value, context Global/namespace-scope variable declarations

The C++ plugin is in the c_family compatibility family, meaning call-resolution links are built across C and C++ files within the same project.


Development

git clone <this-repo>
pip install -e ".[dev]"
python -m pytest tests/

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages