Frontmatter
| id | 8426 |
| title | Clean up SourceParser and use Class Hierarchy |
| state | Closed |
| labels | airefactoring |
| assignees | tobiu |
| createdAt | Jan 8, 2026, 2:50 PM |
| updatedAt | Jan 8, 2026, 2:53 PM |
| githubUrl | https://github.com/neomjs/neo/issues/8426 |
| author | tobiu |
| commentsCount | 1 |
| parentIssue | null |
| subIssues | [] |
| subIssuesCompleted | 0 |
| subIssuesTotal | 0 |
| blockedBy | [] |
| blocking | [] |
| closedAt | Jan 8, 2026, 2:53 PM |
Clean up SourceParser and use Class Hierarchy
tobiu assigned to @tobiu on Jan 8, 2026, 2:51 PM

tobiu
Jan 8, 2026, 2:52 PM
Input from Gemini 3 Pro:
✦ I have refactored
SourceParserandApiSourceto implement a clean, authoritative inheritance resolution.Changes:
SourceParser.mjs: Removed the flawed import-mapping and heuristicsuperClassresolution logic. It now accepts an optionalhierarchyobject and performs a simple O(1) lookup:superClass = hierarchy[className].ApiSource.mjs: Now loadsdocs/output/class-hierarchy.jsonat the beginning of the extraction process and passes it toSourceParser.parse(). It includes a warning if the hierarchy file is missing (to avoid silent failures).This ensures that the vector metadata (
extends) matches the authoritative JSDoc-generated hierarchy, removing all hallucinated or guessed relationships.
tobiu closed this issue on Jan 8, 2026, 2:53 PM
Now that
docs/output/class-hierarchy.jsonis the single source of truth for the class hierarchy, theSourceParserlogic can be simplified and improved.Issues:
SourceParserstill contains the heuristic logic for resolvingsuperClass(imports map + path resolution + heuristic app naming) which was deemed "messed up". This should be removed.superClassfrom imports,SourceParser(or ratherApiSourcecalling it) should look up theextendsproperty from the authoritativeclass-hierarchy.json.Plan:
SourceParser.mjs:superClass.hierarchyobject in theparse()method arguments.hierarchyis provided, look up theextendsvalue using the extractedclassName.extendsempty or null (better than guessing wrong).ApiSource.mjs:docs/output/class-hierarchy.jsonat the start ofextract().SourceParser.parse().Goal: Ensure vector metadata (
classNameandextends) is populated using the authoritative hierarchy data, removing all "hallucinated" heuristics.