Skip to content

Commit 84762a3

Browse files
authored
Merge pull request #26 from Wes2000ley/feat/cpp-hardening-pass2
Harden C++ support after #24: header auto-detection, symbol accounting, and coverage expansion
2 parents 4d67c30 + 87be09d commit 84762a3

18 files changed

Lines changed: 1036 additions & 247 deletions

LANGUAGE_SUPPORT.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,10 @@
1313
| PHP | `.php` | tree-sitter-php | function, class, method, type (interface/trait/enum), constant | `#[Attribute]` | `/** */` PHPDoc | PHP 8+ attributes supported; language-file `<?php` tag required |
1414
| Dart | `.dart` | tree-sitter-dart | function, class (class/mixin/extension), method, type (enum/typedef) | `@annotation` | `///` doc comments | Constructors and top-level constants are not indexed |
1515
| C# | `.cs` | tree-sitter-csharp | class (class/record), method (method/constructor), type (interface/enum/struct/delegate) | `[Attribute]` | `/// <summary>` XML doc comments | Properties and `const` fields not indexed |
16-
| C | `.c`, `.h` | tree-sitter-c | function, type (struct/enum/union), constant || `/* */` and `//` comments | `#define` macros extracted as constants; no class/method hierarchy |
17-
| C++ | `.cpp`, `.hpp`, `.cc`, `.hh`, `.cxx`, `.hxx` | tree-sitter-cpp | function, class, method, type (struct/enum/union), constant || `/* */` and `//` comments | Templates unwrapped to inner declaration; namespace contents extracted as top-level |
16+
| C | `.c` | tree-sitter-c | function, type (struct/enum/union), constant || `/* */` and `//` comments | `#define` macros extracted as constants; no class/method hierarchy |
17+
| C++ | `.cpp`, `.cc`, `.cxx`, `.hpp`, `.hh`, `.hxx`, `.h`* | tree-sitter-cpp | function, class, method, type (struct/enum/union/alias), constant || `/* */` and `//` comments | Namespace symbols are used for qualification but not emitted as standalone symbols |
18+
19+
\* `.h` uses C++ parsing first, then falls back to C when no C++ symbols are extracted.
1820

1921
---
2022

README.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -295,8 +295,10 @@ Every tool response includes a `_meta` envelope with timing, token savings, and
295295
| PHP | `.php` | function, class, method, type, constant |
296296
| Dart | `.dart` | function, class, method, type |
297297
| C# | `.cs` | class, method, type, record |
298-
| C | `.c`, `.h` | function, type, constant |
299-
| C++ | `.cpp`, `.hpp`, `.cc`, `.hh`, `.cxx`, `.hxx` | function, class, method, type, constant |
298+
| C | `.c` | function, type, constant |
299+
| C++ | `.cpp`, `.cc`, `.cxx`, `.hpp`, `.hh`, `.hxx`, `.h`* | function, class, method, type, constant |
300+
301+
\* `.h` is parsed as C++ first, then falls back to C when no C++ symbols are extracted.
300302

301303
See LANGUAGE_SUPPORT.md for full semantics.
302304

SPEC.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@ class Symbol:
166166
name: str # Symbol name
167167
qualified_name: str # Dot-separated with parent context
168168
kind: str # function | class | method | constant | type
169-
language: str # python | javascript | typescript | go | rust | java | php | c
169+
language: str # python | javascript | typescript | go | rust | java | php | dart | csharp | c | cpp
170170
signature: str # Full signature line(s)
171171
content_hash: str = "" # SHA-256 of source bytes (drift detection)
172172
docstring: str = ""
@@ -212,7 +212,7 @@ Recursive directory walk with the full security pipeline.
212212

213213
### Filtering Pipeline (Both Paths)
214214

215-
1. **Extension filter** — must be in `LANGUAGE_EXTENSIONS` (.py, .js, .jsx, .ts, .tsx, .go, .rs, .java, .php, .c, .h)
215+
1. **Extension filter** — must be in `LANGUAGE_EXTENSIONS` (.py, .js, .jsx, .ts, .tsx, .go, .rs, .java, .php, .c, .h, .cpp, .cc, .cxx, .hpp, .hh, .hxx)
216216
2. **Skip patterns**`node_modules/`, `vendor/`, `.git/`, `build/`, `dist/`, lock files, minified files, etc.
217217
3. **`.gitignore`** — respected via the `pathspec` library
218218
4. **Secret detection**`.env`, `*.pem`, `*.key`, `*.p12`, credentials files excluded

USER_GUIDE.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -244,7 +244,7 @@ To disable, set `JCODEMUNCH_SHARE_SAVINGS=0` in your MCP server env:
244244
Check the URL format (`owner/repo` or full GitHub URL). For private repositories, set `GITHUB_TOKEN`.
245245

246246
**"No source files found"**
247-
The repository may not contain supported language files (`.py`, `.js`, `.ts`, `.go`, `.rs`, `.java`, `.c`, `.h`), or files may be excluded by skip patterns.
247+
The repository may not contain supported language files (`.py`, `.js`, `.ts`, `.go`, `.rs`, `.java`, `.c`, `.h`, `.cpp`, `.cc`, `.cxx`, `.hpp`, `.hh`, `.hxx`), or files may be excluded by skip patterns.
248248

249249
**Rate limiting**
250250
Set `GITHUB_TOKEN` to increase GitHub API limits (5,000 requests/hour vs 60 unauthenticated).

0 commit comments

Comments
 (0)