feat(qml/qt): add comprehensive QML extractor and Qt framework resolver (#759) - #2215
Open
hospitaler17 wants to merge 2 commits into
Open
hospitaler17 wants to merge 2 commits into
hospitaler17 wants to merge 2 commits into
Conversation
This commit introduces full support for Qt C++ and QML in CodeGraph, enabling seamless code intelligence across the C++/QML boundary. Key additions and improvements: - QML Extractor: Implemented a structured line-by-line parser for QML that correctly handles component hierarchies, property declarations, signal handlers, inline JavaScript functions, and inline components. - Qt C++ Framework Resolver: Added qt.ts to identify and resolve Qt-specific patterns such as Q_PROPERTY, Q_INVOKABLE, QML_NAMED_ELEMENT, and signals/slots definitions, linking them across the graph. - C++ Code Masking: Enhanced the C/C++ parser compatibility by strategically masking Qt annotations (_API exports, Q_INVOKABLE, Q_PROPERTY) with spaces. This prevents tree-sitter from dropping into error recovery while perfectly preserving line and column offsets. - Signal Dispatch: Traced Qt signal dispatch, correctly identifying emit connections and mapping them to slot handlers. - Documentation & Tests: Added extensive test suites for QML extraction and Qt signal synthesis. Updated CHANGELOG.md, README.md, and language support documentation.
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
This PR expands parsing and graph resolution support for Qt C++ and QML based on review feedback, allowing CodeGraph to seamlessly bridge complex C++/QML boundaries.
Changes
qml-extractor.tsto registerobjectNameproperties as identifiers for cross-language resolution. Addedqmldir-extractor.tsto parse and resolve QML module structures fromqmldirfiles.qt.ts): Implemented new extraction passes for modern Qt 6 macros (QML_ELEMENT,QML_SINGLETON). Added extraction forroleNamesinQAbstractItemModelto expose C++ properties to QML as JS strings. Added metadata marking (isQEnum: true) forQ_ENUMstructures to ensure proper context without polluting the graph.callback-synthesizer.ts): Added a new synthesis pass (qtImplicitConnectionsEdges) to bridge implicit dynamic connections created viafindChild()andinvokeMethod()across the C++/QML boundary.README.mdto document the newqmldirsupport and specific Qt/QML features (QML_ELEMENT, roleNames, Q_ENUM, implicit connections).Related Issues
Closes #759 (QML / Qt C++ support)