feat: expand node types with parameter, property, constant kinds#270
feat: expand node types with parameter, property, constant kinds#270carlos-alm merged 5 commits intomainfrom
Conversation
Greptile SummaryThis PR adds 3 new sub-declaration node kinds ( Key changes:
Impact: Confidence Score: 5/5
Important Files Changed
Flowchart%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[Source Code] --> B[Tree-sitter Parse]
B --> C[Extractor Functions]
C --> D{Extract Definitions}
D --> E[Parent Nodes<br/>function, class, etc.]
D --> F[Child Nodes<br/>parameter, property, constant]
E --> G[insertNode with parent_id=null]
F --> H[insertNode with parent_id=parent.id]
G --> I[(SQLite nodes table)]
H --> I
I --> J[Query Layer]
J --> K[childrenData/children]
J --> L[contextData includes children]
K --> M[CLI: codegraph children]
L --> N[CLI: codegraph context]
K --> O[MCP: symbol_children tool]
Last reviewed commit: 6d07a0e |
|
Claude finished @carlos-alm's task —— View job PR Review CompleteReviewing PR #270: "feat: expand node types with parameter, property, constant kinds" Todo List
Root Cause AnalysisProblem Being Solved: Enables structural queries like "which functions take a Why This Approach: Uses a logical parent-child relationship via new Risk Assessment: Low risk. The schema migration (v11) is properly designed, and the implementation maintains backward compatibility while adding substantial new functionality. Configuration Change Detection ✅No High-Risk Changes Found: No modifications to biome.json, vitest.config.js, or other configuration files that could hide underlying issues or relax quality gates. Test Integrity ✅Comprehensive Test Coverage:
Bug Fix Identified: C# Code Quality Assessment ✅Schema Design:
Security:
Backward Compatibility:
Implementation Quality:
Performance Considerations:
Minor Observations
Final AssessmentRoot Cause AnalysisProblem Being Solved: Enables fine-grained structural queries without source code access - a valuable capability for AI coding assistants and code analysis tools. Critical ConcernsNone identified. This is a well-implemented feature addition with appropriate safeguards. Final Recommendation
|
|
Claude finished @carlos-alm's task —— View job Claude finished @carlos-alm's task —— View job PR Review CompleteReviewing PR #270: "feat: expand node types with parameter, property, constant kinds" Todo List
Root Cause AnalysisProblem Being Solved: Enables structural queries like "which functions take a Why This Approach: Uses a logical parent-child relationship via new Risk Assessment: Low risk. The schema migration (v11) is properly designed, and the implementation maintains backward compatibility while adding substantial new functionality. Configuration Change Detection ✅No High-Risk Changes Found: No modifications to biome.json, vitest.config.js, or other configuration files that could hide underlying issues or relax quality gates. Test Integrity ✅Comprehensive Test Coverage:
Bug Fix Identified: C# Code Quality Assessment ✅Schema Design:
Security:
Backward Compatibility:
Implementation Quality:
Performance Considerations:
Minor Observations
Final AssessmentRoot Cause AnalysisProblem Being Solved: Enables fine-grained structural queries without source code access - a valuable capability for AI coding assistants and code analysis tools. Critical ConcernsNone identified. This is a well-implemented feature addition with appropriate safeguards. Final Recommendation
|
…se 1) Add sub-declaration node extraction to all 9 WASM language extractors, enabling structural queries like "which functions take a Request param?" or "which classes have a userId field?" without reading source code. Schema: migration v11 adds nullable parent_id column with indexes. Builder: insertNode links children to parent via parent_id FK. Extractors: JS/TS, Python, Go, Rust, Java, C#, Ruby, PHP, HCL now emit children arrays for parameters, properties, and constants. Queries: new childrenData() function, children in contextData output. CLI: new `children` command, EVERY_SYMBOL_KIND validation on --kind. MCP: new `symbol_children` tool, extended kind enum on all kind fields. Constants: CORE_SYMBOL_KINDS (10), EXTENDED_SYMBOL_KINDS (3), EVERY_SYMBOL_KIND (13). ALL_SYMBOL_KINDS preserved for backward compat. Native Rust engine: Definition struct gains children field but actual extraction is deferred to Phase 2 — WASM fallback handles new kinds. Impact: 63 functions changed, 62 affected
…se 2) Build file→definition and parent→child contains edges, parameter_of inverse edges, and receiver edges for method-call dispatch. Add CORE_EDGE_KINDS, STRUCTURAL_EDGE_KINDS, EVERY_EDGE_KIND constants. Exclude structural edges from moduleMapData coupling counts. Scope directory contains-edge cleanup to preserve symbol-level edges. Impact: 3 functions changed, 22 affected
The Definition struct gained a children field but no extractor was updated to include it, causing 50 compilation errors. Add children: None to every Definition initializer across all 9 language extractors. Also fix unused variable warnings in parser_registry.rs and parallel.rs. Impact: 13 functions changed, 10 affected
218a0d6 to
4b0fd8a
Compare
…portsData imports Impact: 24 functions changed, 40 affected
|
Claude finished @carlos-alm's task —— View job Claude finished @carlos-alm's task —— View job PR Review CompleteReviewing PR #270: "feat: expand node types with parameter, property, constant kinds" Todo List
Root Cause AnalysisProblem Being Solved: Enables structural queries like "which functions take a Why This Approach: Uses a logical parent-child relationship via new Risk Assessment: Low risk. The schema migration (v11) is properly designed, and the implementation maintains backward compatibility while adding substantial new functionality. Configuration Change Detection ✅No High-Risk Changes Found: No modifications to biome.json, vitest.config.js, or other configuration files that could hide underlying issues or relax quality gates. Test Integrity ✅Comprehensive Test Coverage:
Bug Fix Identified: C# Code Quality Assessment ✅Schema Design:
Security:
Backward Compatibility:
Implementation Quality:
Performance Considerations:
Minor Observations
Final AssessmentRoot Cause AnalysisProblem Being Solved: Enables fine-grained structural queries without source code access - a valuable capability for AI coding assistants and code analysis tools. Critical ConcernsNone identified. This is a well-implemented feature addition with appropriate safeguards. Final Recommendation
|
Summary
parameter,property,constant) to all 9 WASM language extractors, linked to parent symbols via a newparent_idcolumnRequestparam?" or "which classes have auserIdfield?" without reading source codechildrencommand and MCPsymbol_childrentool for querying sub-declaration nodesChanges
Schema & Builder
parent_id INTEGER REFERENCES nodes(id)+ indexesinsertNodelinks children to parent after inserting the parent definitionExtractors (all 9 languages)
constconstants, TS enum members__init__properties, UPPER_CASE constantsconstdeclarationsconstitems, enum variantsproperty_declarationkind fix), enum membersConstants & API
CORE_SYMBOL_KINDS(10 original),EXTENDED_SYMBOL_KINDS(3 new),EVERY_SYMBOL_KIND(13 total)ALL_SYMBOL_KINDSpreserved as alias for backward compatkindIcon()gains cases:parameter→p,property→.,constant→CQueries
childrenData()/children()functionscontextData()includes children in output when present--kindvalidation usesEVERY_SYMBOL_KINDacross all 11 commandsMCP
symbol_childrentoolEVERY_SYMBOL_KINDNative Engine (deferred)
Definitionstruct gainschildren: Option<Vec<Definition>>fieldTest plan
tests/parsers/extended-kinds.test.js— 27 tests across 8 languages verifying parameter, property, constant extractiontests/unit/mcp.test.js—symbol_childrenin tool list,childrenDatamock in all dispatch teststests/parsers/csharp.test.js— property_declaration kindmethod→propertytests/integration/build-parity.test.js— filters extended kinds from native/WASM comparisonnpm test— 1178 tests pass, 0 failuresnpm run lint— 0 errors (1 pre-existing warning)codegraph build . --engine wasm→ 2547 nodes (up from 1006), 1107 parameters, 93 properties, 11 constantscodegraph children buildGraph→ showsrootDirandoptsparameterscodegraph context initSchema→ shows "Children (1)" section withdbparameter