DhanushNehru / DhanushNehru/codeskeleton
Add C++ language support
- Dominant language
- Rust
- Stars
- 15
- Forks
- 4
- PR merge metrics
- No merged PRs in 30d
Description
codeskeleton currently supports 7 languages but not C++. Since we already support C via tree-sitter, adding C++ should be straightforward.
### What needs to change:
- Add tree-sitter-cpp to Cargo.toml
- Add Cpp variant to SupportedLanguage in src/languages.rs
- Add a CPP_SPEC constant with C++ AST node types (class_specifier, function_definition, using_declaration, call_expression)
- Map .cpp, .hpp, .cc, .cxx extensions in from_extension()
- Add extract_cpp_import() in src/extract.rs for #include and using statements
- Add "cpp" and related extensions to CODE_EXTENSIONS in src/detect.rs
### Helpful context:
- Look at how C is implemented in src/languages.rs (C_SPEC) — C++ is very similar
- tree-sitter-cpp grammar docs: https://github.com/tree-sitter/tree-sitter-cpp
- The LanguageSpec struct is documented in src/languages.rs
Contributor guide
Assessment
This issue has not been assessed yet.