gitnexus 1.6.5-rc.8 → 1.6.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/_shared/scope-resolution/finalize-algorithm.js +10 -2
- package/dist/_shared/scope-resolution/finalize-algorithm.js.map +1 -1
- package/dist/_shared/scope-resolution/method-dispatch-index.d.ts +26 -0
- package/dist/_shared/scope-resolution/method-dispatch-index.d.ts.map +1 -1
- package/dist/_shared/scope-resolution/method-dispatch-index.js +22 -3
- package/dist/_shared/scope-resolution/method-dispatch-index.js.map +1 -1
- package/dist/_shared/scope-resolution/registries/lookup-core.js +18 -1
- package/dist/_shared/scope-resolution/registries/lookup-core.js.map +1 -1
- package/dist/_shared/scope-resolution/symbol-definition.d.ts +2 -0
- package/dist/_shared/scope-resolution/symbol-definition.d.ts.map +1 -1
- package/dist/cli/ai-context.d.ts +1 -0
- package/dist/cli/ai-context.js +70 -16
- package/dist/cli/analyze.d.ts +30 -2
- package/dist/cli/analyze.js +45 -5
- package/dist/cli/index.js +8 -1
- package/dist/cli/setup.js +18 -0
- package/dist/cli/wiki.d.ts +2 -0
- package/dist/cli/wiki.js +11 -0
- package/dist/core/augmentation/engine.js +24 -4
- package/dist/core/embeddings/http-client.js +22 -6
- package/dist/core/incremental/shadow-candidates.d.ts +44 -0
- package/dist/core/incremental/shadow-candidates.js +74 -0
- package/dist/core/incremental/subgraph-extract.d.ts +64 -0
- package/dist/core/incremental/subgraph-extract.js +111 -0
- package/dist/core/ingestion/call-processor.d.ts +12 -1
- package/dist/core/ingestion/call-processor.js +183 -47
- package/dist/core/ingestion/class-extractors/configs/c-cpp.js +38 -0
- package/dist/core/ingestion/class-extractors/generic.js +8 -0
- package/dist/core/ingestion/class-types.d.ts +15 -0
- package/dist/core/ingestion/community-processor.js +18 -0
- package/dist/core/ingestion/import-resolvers/standard.d.ts +5 -0
- package/dist/core/ingestion/import-resolvers/standard.js +31 -1
- package/dist/core/ingestion/import-resolvers/utils.js +4 -0
- package/dist/core/ingestion/languages/c-cpp.js +20 -2
- package/dist/core/ingestion/languages/cpp/adl.d.ts +141 -0
- package/dist/core/ingestion/languages/cpp/adl.js +478 -0
- package/dist/core/ingestion/languages/cpp/arity-metadata.d.ts +18 -0
- package/dist/core/ingestion/languages/cpp/arity-metadata.js +170 -0
- package/dist/core/ingestion/languages/cpp/arity.d.ts +17 -0
- package/dist/core/ingestion/languages/cpp/arity.js +31 -0
- package/dist/core/ingestion/languages/cpp/captures.d.ts +2 -0
- package/dist/core/ingestion/languages/cpp/captures.js +1131 -0
- package/dist/core/ingestion/languages/cpp/conversion-rank.d.ts +31 -0
- package/dist/core/ingestion/languages/cpp/conversion-rank.js +47 -0
- package/dist/core/ingestion/languages/cpp/file-local-linkage.d.ts +118 -0
- package/dist/core/ingestion/languages/cpp/file-local-linkage.js +266 -0
- package/dist/core/ingestion/languages/cpp/header-scan.d.ts +8 -0
- package/dist/core/ingestion/languages/cpp/header-scan.js +50 -0
- package/dist/core/ingestion/languages/cpp/import-decomposer.d.ts +19 -0
- package/dist/core/ingestion/languages/cpp/import-decomposer.js +111 -0
- package/dist/core/ingestion/languages/cpp/import-target.d.ts +10 -0
- package/dist/core/ingestion/languages/cpp/import-target.js +13 -0
- package/dist/core/ingestion/languages/cpp/index.d.ts +11 -0
- package/dist/core/ingestion/languages/cpp/index.js +11 -0
- package/dist/core/ingestion/languages/cpp/inline-namespaces.d.ts +67 -0
- package/dist/core/ingestion/languages/cpp/inline-namespaces.js +176 -0
- package/dist/core/ingestion/languages/cpp/interpret.d.ts +35 -0
- package/dist/core/ingestion/languages/cpp/interpret.js +113 -0
- package/dist/core/ingestion/languages/cpp/merge-bindings.d.ts +13 -0
- package/dist/core/ingestion/languages/cpp/merge-bindings.js +29 -0
- package/dist/core/ingestion/languages/cpp/query.d.ts +3 -0
- package/dist/core/ingestion/languages/cpp/query.js +508 -0
- package/dist/core/ingestion/languages/cpp/range-bindings.d.ts +20 -0
- package/dist/core/ingestion/languages/cpp/range-bindings.js +212 -0
- package/dist/core/ingestion/languages/cpp/scope-resolver.d.ts +17 -0
- package/dist/core/ingestion/languages/cpp/scope-resolver.js +246 -0
- package/dist/core/ingestion/languages/cpp/simple-hooks.d.ts +24 -0
- package/dist/core/ingestion/languages/cpp/simple-hooks.js +62 -0
- package/dist/core/ingestion/languages/cpp/two-phase-lookup.d.ts +76 -0
- package/dist/core/ingestion/languages/cpp/two-phase-lookup.js +195 -0
- package/dist/core/ingestion/languages/java/arity-metadata.d.ts +18 -0
- package/dist/core/ingestion/languages/java/arity-metadata.js +40 -0
- package/dist/core/ingestion/languages/java/arity.d.ts +10 -0
- package/dist/core/ingestion/languages/java/arity.js +24 -0
- package/dist/core/ingestion/languages/java/cache-stats.d.ts +15 -0
- package/dist/core/ingestion/languages/java/cache-stats.js +26 -0
- package/dist/core/ingestion/languages/java/captures.d.ts +17 -0
- package/dist/core/ingestion/languages/java/captures.js +187 -0
- package/dist/core/ingestion/languages/java/import-decomposer.d.ts +18 -0
- package/dist/core/ingestion/languages/java/import-decomposer.js +85 -0
- package/dist/core/ingestion/languages/java/import-target.d.ts +17 -0
- package/dist/core/ingestion/languages/java/import-target.js +100 -0
- package/dist/core/ingestion/languages/java/index.d.ts +29 -0
- package/dist/core/ingestion/languages/java/index.js +29 -0
- package/dist/core/ingestion/languages/java/interpret.d.ts +13 -0
- package/dist/core/ingestion/languages/java/interpret.js +131 -0
- package/dist/core/ingestion/languages/java/merge-bindings.d.ts +12 -0
- package/dist/core/ingestion/languages/java/merge-bindings.js +40 -0
- package/dist/core/ingestion/languages/java/query.d.ts +30 -0
- package/dist/core/ingestion/languages/java/query.js +192 -0
- package/dist/core/ingestion/languages/java/receiver-binding.d.ts +11 -0
- package/dist/core/ingestion/languages/java/receiver-binding.js +95 -0
- package/dist/core/ingestion/languages/java/scope-resolver.d.ts +50 -0
- package/dist/core/ingestion/languages/java/scope-resolver.js +74 -0
- package/dist/core/ingestion/languages/java/simple-hooks.d.ts +13 -0
- package/dist/core/ingestion/languages/java/simple-hooks.js +34 -0
- package/dist/core/ingestion/languages/java.js +11 -0
- package/dist/core/ingestion/languages/php/arity-metadata.d.ts +28 -0
- package/dist/core/ingestion/languages/php/arity-metadata.js +63 -0
- package/dist/core/ingestion/languages/php/arity.d.ts +25 -0
- package/dist/core/ingestion/languages/php/arity.js +40 -0
- package/dist/core/ingestion/languages/php/cache-stats.d.ts +15 -0
- package/dist/core/ingestion/languages/php/cache-stats.js +26 -0
- package/dist/core/ingestion/languages/php/captures.d.ts +34 -0
- package/dist/core/ingestion/languages/php/captures.js +739 -0
- package/dist/core/ingestion/languages/php/import-decomposer.d.ts +28 -0
- package/dist/core/ingestion/languages/php/import-decomposer.js +265 -0
- package/dist/core/ingestion/languages/php/import-target.d.ts +47 -0
- package/dist/core/ingestion/languages/php/import-target.js +100 -0
- package/dist/core/ingestion/languages/php/index.d.ts +68 -0
- package/dist/core/ingestion/languages/php/index.js +72 -0
- package/dist/core/ingestion/languages/php/interpret.d.ts +36 -0
- package/dist/core/ingestion/languages/php/interpret.js +241 -0
- package/dist/core/ingestion/languages/php/merge-bindings.d.ts +19 -0
- package/dist/core/ingestion/languages/php/merge-bindings.js +47 -0
- package/dist/core/ingestion/languages/php/namespace-siblings.d.ts +51 -0
- package/dist/core/ingestion/languages/php/namespace-siblings.js +288 -0
- package/dist/core/ingestion/languages/php/query.d.ts +32 -0
- package/dist/core/ingestion/languages/php/query.js +326 -0
- package/dist/core/ingestion/languages/php/receiver-binding.d.ts +36 -0
- package/dist/core/ingestion/languages/php/receiver-binding.js +128 -0
- package/dist/core/ingestion/languages/php/scope-resolver.d.ts +23 -0
- package/dist/core/ingestion/languages/php/scope-resolver.js +358 -0
- package/dist/core/ingestion/languages/php/simple-hooks.d.ts +42 -0
- package/dist/core/ingestion/languages/php/simple-hooks.js +111 -0
- package/dist/core/ingestion/languages/php.d.ts +0 -7
- package/dist/core/ingestion/languages/php.js +15 -0
- package/dist/core/ingestion/markdown-processor.js +6 -1
- package/dist/core/ingestion/model/symbol-table.d.ts +1 -0
- package/dist/core/ingestion/model/symbol-table.js +3 -0
- package/dist/core/ingestion/parsing-processor.d.ts +22 -2
- package/dist/core/ingestion/parsing-processor.js +123 -50
- package/dist/core/ingestion/pipeline-phases/cross-file-impl.js +54 -2
- package/dist/core/ingestion/pipeline-phases/parse-impl.d.ts +5 -0
- package/dist/core/ingestion/pipeline-phases/parse-impl.js +119 -11
- package/dist/core/ingestion/pipeline-phases/parse.d.ts +14 -0
- package/dist/core/ingestion/pipeline.d.ts +13 -0
- package/dist/core/ingestion/registry-primary-flag.js +2 -0
- package/dist/core/ingestion/scope-extractor.js +4 -0
- package/dist/core/ingestion/scope-resolution/contract/scope-resolver.d.ts +167 -0
- package/dist/core/ingestion/scope-resolution/contract/scope-resolver.js +3 -0
- package/dist/core/ingestion/scope-resolution/graph-bridge/ids.d.ts +1 -0
- package/dist/core/ingestion/scope-resolution/graph-bridge/ids.js +12 -0
- package/dist/core/ingestion/scope-resolution/graph-bridge/method-dispatch.d.ts +1 -1
- package/dist/core/ingestion/scope-resolution/graph-bridge/method-dispatch.js +12 -2
- package/dist/core/ingestion/scope-resolution/graph-bridge/node-lookup.js +16 -0
- package/dist/core/ingestion/scope-resolution/passes/free-call-fallback.d.ts +36 -0
- package/dist/core/ingestion/scope-resolution/passes/free-call-fallback.js +204 -13
- package/dist/core/ingestion/scope-resolution/passes/imported-return-types.js +1 -1
- package/dist/core/ingestion/scope-resolution/passes/overload-narrowing.d.ts +55 -4
- package/dist/core/ingestion/scope-resolution/passes/overload-narrowing.js +186 -5
- package/dist/core/ingestion/scope-resolution/passes/receiver-bound-calls.d.ts +10 -1
- package/dist/core/ingestion/scope-resolution/passes/receiver-bound-calls.js +207 -9
- package/dist/core/ingestion/scope-resolution/pipeline/phase.js +13 -1
- package/dist/core/ingestion/scope-resolution/pipeline/registry.js +6 -0
- package/dist/core/ingestion/scope-resolution/pipeline/run.d.ts +17 -0
- package/dist/core/ingestion/scope-resolution/pipeline/run.js +86 -8
- package/dist/core/ingestion/scope-resolution/scope/walkers.d.ts +30 -0
- package/dist/core/ingestion/scope-resolution/scope/walkers.js +90 -8
- package/dist/core/ingestion/tree-sitter-queries.d.ts +2 -2
- package/dist/core/ingestion/tree-sitter-queries.js +23 -0
- package/dist/core/ingestion/utils/ast-helpers.js +6 -1
- package/dist/core/ingestion/utils/template-arguments.d.ts +11 -0
- package/dist/core/ingestion/utils/template-arguments.js +65 -0
- package/dist/core/ingestion/workers/parse-worker.d.ts +3 -0
- package/dist/core/ingestion/workers/parse-worker.js +42 -1
- package/dist/core/lbug/lbug-adapter.d.ts +39 -0
- package/dist/core/lbug/lbug-adapter.js +348 -48
- package/dist/core/run-analyze.d.ts +2 -0
- package/dist/core/run-analyze.js +323 -29
- package/dist/core/search/hybrid-search.d.ts +3 -0
- package/dist/core/search/hybrid-search.js +23 -6
- package/dist/core/wiki/generator.js +4 -3
- package/dist/core/wiki/html-viewer.js +2 -1
- package/dist/core/wiki/llm-client.d.ts +4 -0
- package/dist/core/wiki/llm-client.js +3 -3
- package/dist/core/wiki/mermaid-sanitizer.d.ts +2 -0
- package/dist/core/wiki/mermaid-sanitizer.js +100 -0
- package/dist/mcp/local/local-backend.js +20 -7
- package/dist/storage/file-hash.d.ts +47 -0
- package/dist/storage/file-hash.js +86 -0
- package/dist/storage/parse-cache.d.ts +73 -0
- package/dist/storage/parse-cache.js +253 -0
- package/dist/storage/repo-manager.d.ts +41 -1
- package/dist/storage/repo-manager.js +61 -6
- package/hooks/claude/gitnexus-hook.cjs +42 -4
- package/hooks/claude/hook-db-lock-probe.cjs +238 -0
- package/hooks/claude/hook-lock.cjs +119 -0
- package/hooks/claude/win-rm-list-json.ps1 +76 -0
- package/package.json +1 -1
- package/scripts/build.js +6 -2
- package/vendor/node_modules/node-addon-api/node_addon_api.target.mk +16 -16
- package/vendor/node_modules/node-addon-api/node_addon_api_except.target.mk +16 -16
- package/vendor/node_modules/node-addon-api/node_addon_api_except_all.target.mk +16 -16
- package/vendor/node_modules/node-addon-api/node_addon_api_maybe.target.mk +16 -16
- package/web/assets/{agent-BpHQleHE.js → agent-D2kLt6Dl.js} +91 -91
- package/web/assets/architecture-7EHR7CIX-6QZW5X65-BETj2x4g.js +1 -0
- package/web/assets/architectureDiagram-UL44E2DR-DvIkEGkp.js +36 -0
- package/web/assets/blockDiagram-7IZFK4PR-B4niSLvR.js +132 -0
- package/web/assets/{c4Diagram-DFAF54RM-DeJV1rCn.js → c4Diagram-Y2BXMSZH-DIzEXalR.js} +6 -6
- package/web/assets/chunk-2T2R6R2M-n6s9JZqv.js +4 -0
- package/web/assets/chunk-2UTLFMKG-CMBB1TMN.js +1 -0
- package/web/assets/{chunk-7RZVMHOQ-BdIU-RGO.js → chunk-3SSMPTDK-BzGeeheI.js} +1 -1
- package/web/assets/chunk-4R4BOZG6-mKhL59ul.js +159 -0
- package/web/assets/chunk-5IMINLNL-CnTLsXIV.js +1 -0
- package/web/assets/chunk-5VCL7Z4A-w1BCx98Z.js +1 -0
- package/web/assets/chunk-6764PJDD-ChwMM2z4.js +1 -0
- package/web/assets/chunk-67TQ5CYL-CChC2cAv.js +124 -0
- package/web/assets/chunk-7J6CGLKN-DT-b53FT.js +10 -0
- package/web/assets/chunk-7W6UQGC5-CgFyfZ6k.js +1 -0
- package/web/assets/chunk-AQ6EADP3-CCFje6lL.js +1 -0
- package/web/assets/{chunk-KSICW3F5-C2tZmXwv.js → chunk-AZZRMDJM-5E9ARdDQ.js} +1 -1
- package/web/assets/chunk-C62D2QBJ-CDAWj26E.js +1 -0
- package/web/assets/chunk-CEXFNPSA-D68Tk6ls.js +1 -0
- package/web/assets/chunk-INKRHTLW-ELpfuk9h.js +70 -0
- package/web/assets/chunk-J5EP6P6S-DxWW0yvu.js +1 -0
- package/web/assets/{chunk-AEOMTBSW-D7qjBMHW.js → chunk-JQRUD6KW-Dcq_Qnyy.js} +1 -1
- package/web/assets/chunk-KGFNY3KK-W-VR57xb.js +62 -0
- package/web/assets/chunk-KGYTTC2M-C6PHeuay.js +1 -0
- package/web/assets/chunk-KNLZD3CH-BuZBOcso.js +1 -0
- package/web/assets/chunk-KRXBNO2N-DH2NPM7I.js +1 -0
- package/web/assets/chunk-LCXTWHL2-CqJ0oo1x.js +231 -0
- package/web/assets/chunk-LII3EMHJ-3X33tCpU.js +1 -0
- package/web/assets/chunk-QA3QBVWF-D5Ha3GgB.js +2 -0
- package/web/assets/chunk-RERM46MO-DQNbXtfw.js +1 -0
- package/web/assets/chunk-RG4AUYOV-D0M6vdq9.js +206 -0
- package/web/assets/chunk-RKZBBQEN-BmTPLSyv.js +1 -0
- package/web/assets/chunk-RLI5ZMPA-DExu2DOK.js +1 -0
- package/web/assets/chunk-T2UQINTJ-kGYG7ppP.js +1 -0
- package/web/assets/chunk-T5OCTHI4--9wWpVws.js +1 -0
- package/web/assets/chunk-UP6H54XL-DsKdC6jC.js +1 -0
- package/web/assets/chunk-UXSXWOXI-DR81EqLr.js +1 -0
- package/web/assets/chunk-UY5QBCOK-Du-c56gs.js +1 -0
- package/web/assets/chunk-W44A43WB-lrCpuupA.js +1 -0
- package/web/assets/chunk-ZXARS5L4-CSZRiyOf.js +1 -0
- package/web/assets/classDiagram-KGZ6W3CR-BB-saqC1.js +1 -0
- package/web/assets/classDiagram-v2-72OJOZXJ-Bp2bAlS5.js +1 -0
- package/web/assets/cose-bilkent-UX7MHV2Q-BHv2bbtl.js +1 -0
- package/web/assets/dagre-ND4H6XIP-DsIr9MOv.js +4 -0
- package/web/assets/diagram-3NCE3AQN-BUxnDPOY.js +43 -0
- package/web/assets/diagram-GF46GFSD-BJTyqqvI.js +24 -0
- package/web/assets/diagram-HNR7UZ2L-fUWreZzx.js +3 -0
- package/web/assets/diagram-QXG6HAR7-DilMHamP.js +24 -0
- package/web/assets/diagram-WEQXMOUZ-8KUrarg1.js +10 -0
- package/web/assets/erDiagram-L5TCEMPS-Doj9mSiW.js +85 -0
- package/web/assets/eventmodeling-FCH6USID-MREXMVOE-B3myHUst.js +1 -0
- package/web/assets/{flowDiagram-OTCZ4VVT-aAZw4c_M.js → flowDiagram-H6V6AXG4-BOSR-i3p.js} +12 -12
- package/web/assets/ganttDiagram-JCBTUEKG-BHQssTz6.js +292 -0
- package/web/assets/gitGraph-WXDBUCRP-R675I2BI-DF3rtf4A.js +1 -0
- package/web/assets/gitGraphDiagram-S2ZK5IYY-CCwVLT__.js +106 -0
- package/web/assets/index-j4-NuleT.js +623 -0
- package/web/assets/info-J43DQDTF-KCYPFFUO-R4XV_akJ.js +1 -0
- package/web/assets/infoDiagram-3YFTVSEB-Ce_TvtaV.js +2 -0
- package/web/assets/{ishikawaDiagram-YMYX4NHK-BF8AtDaj.js → ishikawaDiagram-BNXS4ZKH-4MXIDCSF.js} +6 -6
- package/web/assets/journeyDiagram-M6C3CM3L-DNPYCpvq.js +139 -0
- package/web/assets/kanban-definition-75IXJCU3-yYdfm8Kk.js +89 -0
- package/web/assets/{katex-GD7MH7QM-CJiOjBBJ.js → katex-K3KEBU37-CrVLz8l7.js} +1 -1
- package/web/assets/mindmap-definition-2TDM6QVE-DFNEKM77.js +96 -0
- package/web/assets/packet-YPE3B663-LP52Z2RK-CgQPdNZa.js +1 -0
- package/web/assets/pie-LRSECV5Y-TCRJHUBD-BzWOwc_c.js +1 -0
- package/web/assets/pieDiagram-CU6KROY3-iZAqpvhd.js +30 -0
- package/web/assets/quadrantDiagram-VICAPDV7-bAm6Hi_5.js +7 -0
- package/web/assets/radar-GUYGQ44K-RDLRG3WG-B7KG0FN7.js +1 -0
- package/web/assets/requirementDiagram-JXO7QTGE-CtDijhnf.js +84 -0
- package/web/assets/sankeyDiagram-URQDO5SZ-LFJz53u5.js +40 -0
- package/web/assets/sequenceDiagram-VS2MUI6T-BdjvyCHM.js +162 -0
- package/web/assets/stateDiagram-7D4R322I-e5odN9fG.js +1 -0
- package/web/assets/stateDiagram-v2-36443NZ5-vPsvjR2D.js +1 -0
- package/web/assets/timeline-definition-O6YCAMPW-DPAksNQp.js +120 -0
- package/web/assets/treeView-BLDUP644-QA4HXRO3-CRSxEwLO.js +1 -0
- package/web/assets/treemap-LRROVOQU-LLAWBHMP-a0PfKoVn.js +1 -0
- package/web/assets/vennDiagram-MWXL3ELB-Dtlfdt7J.js +34 -0
- package/web/assets/wardley-L42UT6IY-5TKZOOLJ-BKQ6e5mC.js +1 -0
- package/web/assets/wardleyDiagram-CUQ6CDDI-B23uRMUC.js +78 -0
- package/web/assets/{xychartDiagram-ZHJ5623Y-DZ7fP1_3.js → xychartDiagram-N2JHSOCM-DxwHeksW.js} +6 -6
- package/web/index.html +13 -2
- package/web/assets/architecture-YZFGNWBL-S5CXDPWN-BUzkWgDl.js +0 -1
- package/web/assets/architectureDiagram-EMZXCZ2Q-CXbzok1G.js +0 -36
- package/web/assets/blockDiagram-IGV67L2C-DA1QJ4ZB.js +0 -132
- package/web/assets/chunk-3GS5O3IE-B8hpnia8.js +0 -231
- package/web/assets/chunk-3YCYZ6SJ-B-BVu21C.js +0 -1
- package/web/assets/chunk-6NTNNK5N-DW-jYSDr.js +0 -1
- package/web/assets/chunk-A34GCYZU-BbZl-IKy.js +0 -1
- package/web/assets/chunk-DJ7UZH7F-B5tMfF87.js +0 -1
- package/web/assets/chunk-DKKBVRCY-Djm-6K_e.js +0 -4
- package/web/assets/chunk-DU5LTGQ6-QPoynYcp.js +0 -1
- package/web/assets/chunk-FXACKDTF-jieSmbe2.js +0 -159
- package/web/assets/chunk-H3VCZNTA-8EMHZ3SV.js +0 -1
- package/web/assets/chunk-HN6EAY2L-CgE_agsD.js +0 -1
- package/web/assets/chunk-O5ABG6QK-DEZV1O19.js +0 -1
- package/web/assets/chunk-PK6DOVAG-BXv0JnsJ.js +0 -206
- package/web/assets/chunk-RNJOYNJ4-BiBkF9dN.js +0 -1
- package/web/assets/chunk-RWUO3TPN-DTWzAhQ1.js +0 -1
- package/web/assets/chunk-TBF5ZNIQ-BSl6s9lT.js +0 -1
- package/web/assets/chunk-TU3PZOEN-DE5Qhc0N.js +0 -1
- package/web/assets/chunk-TYMNRAUI-D1NDLIMG.js +0 -1
- package/web/assets/chunk-VELTKBKT-C9dVN39o.js +0 -1
- package/web/assets/chunk-W7ZLLLMY-Bu-cdLzs.js +0 -1
- package/web/assets/chunk-WSB5WSVC-Dor71SOz.js +0 -1
- package/web/assets/chunk-XGPFEOL4-CUonLRle.js +0 -1
- package/web/assets/classDiagram-PPOCWD7C-Cdd6UdVv.js +0 -1
- package/web/assets/classDiagram-v2-23LJLIIU-DNhxY2Ib.js +0 -1
- package/web/assets/cose-bilkent-PNC4W37J-DdZq7Qz_.js +0 -1
- package/web/assets/dagre-E77IOHMT-Cfj_6e17.js +0 -4
- package/web/assets/diagram-H7BISOXX-BNvpsrBv.js +0 -43
- package/web/assets/diagram-JC5VWROH-Cn0rtDbJ.js +0 -24
- package/web/assets/diagram-LXUTUG65-CHfoVKNm.js +0 -10
- package/web/assets/diagram-WEHSV5V5-BLxHksnu.js +0 -24
- package/web/assets/erDiagram-GCSMX5X6-DfdN6iqF.js +0 -85
- package/web/assets/ganttDiagram-MUNLMDZQ-BEfC_7Or.js +0 -292
- package/web/assets/gitGraph-7Q5UKJZL-54BCDZD5-B6ZeRLP0.js +0 -1
- package/web/assets/gitGraphDiagram-3HKGZ4G3-CG0kC8Q5.js +0 -106
- package/web/assets/index-3NUCUW2s.js +0 -886
- package/web/assets/info-OMHHGYJF-BF2H5H6G-BIOsZy0W.js +0 -1
- package/web/assets/infoDiagram-MN7RKWGX-DUoMH-pq.js +0 -2
- package/web/assets/journeyDiagram-SO5T7YLQ-BW8oKa3N.js +0 -139
- package/web/assets/kanban-definition-LJHFXRCJ-DzbOsR-2.js +0 -89
- package/web/assets/mindmap-definition-2EUWGEK5-BIXGQALq.js +0 -96
- package/web/assets/packet-4T2RLAQJ-EV4IVRXR-Bs7ysNMU.js +0 -1
- package/web/assets/pie-ZZUOXDRM-N23DN5KN-Csi8nnbH.js +0 -1
- package/web/assets/pieDiagram-3IATQBI2-QY-u7P6a.js +0 -30
- package/web/assets/quadrantDiagram-E256RVCF-Di4aNiU8.js +0 -7
- package/web/assets/radar-PYXPWWZC-P6TP7ZYP-DJlyXh2-.js +0 -1
- package/web/assets/requirementDiagram-M5DCFWZL-CzUUrhQD.js +0 -84
- package/web/assets/sankeyDiagram-L3NBLAOT-D2fbMiIU.js +0 -10
- package/web/assets/sequenceDiagram-ZOUHS735-BNdkqguh.js +0 -157
- package/web/assets/stateDiagram-MLPALWAM-51_Q2w2L.js +0 -1
- package/web/assets/stateDiagram-v2-B5LQ5ZB2-8nHs2aNE.js +0 -1
- package/web/assets/timeline-definition-5SPVSISX-DkMiGj4Z.js +0 -120
- package/web/assets/treeView-SZITEDCU-5DXDK3XO-Cy6P0_CZ.js +0 -1
- package/web/assets/treemap-W4RFUUIX-WYLRDWKO-C_pp1R7A.js +0 -1
- package/web/assets/vennDiagram-IE5QUKF5-BCxMmf9q.js +0 -34
- package/web/assets/wardley-RL74JXVD-BCRCBASE-CMStJhpn.js +0 -1
- package/web/assets/wardleyDiagram-XU3VSMPF-ijlLF77s.js +0 -20
- /package/web/assets/{context-builder-CqQNhRj1.js → context-builder-_HS0v2ma.js} +0 -0
|
@@ -0,0 +1,508 @@
|
|
|
1
|
+
import Parser from 'tree-sitter';
|
|
2
|
+
import CPP from 'tree-sitter-cpp';
|
|
3
|
+
const CPP_SCOPE_QUERY = `
|
|
4
|
+
;; ─── Scopes ──────────────────────────────────────────────────────────
|
|
5
|
+
(translation_unit) @scope.module
|
|
6
|
+
(namespace_definition) @scope.namespace
|
|
7
|
+
(class_specifier) @scope.class
|
|
8
|
+
(struct_specifier) @scope.class
|
|
9
|
+
(function_definition) @scope.function
|
|
10
|
+
(lambda_expression) @scope.function
|
|
11
|
+
(compound_statement) @scope.block
|
|
12
|
+
(if_statement) @scope.block
|
|
13
|
+
(for_statement) @scope.block
|
|
14
|
+
(for_range_loop) @scope.block
|
|
15
|
+
(while_statement) @scope.block
|
|
16
|
+
(do_statement) @scope.block
|
|
17
|
+
(switch_statement) @scope.block
|
|
18
|
+
(case_statement) @scope.block
|
|
19
|
+
(try_statement) @scope.block
|
|
20
|
+
(catch_clause) @scope.block
|
|
21
|
+
|
|
22
|
+
;; ─── Declarations — namespace ────────────────────────────────────────
|
|
23
|
+
(namespace_definition
|
|
24
|
+
name: (namespace_identifier) @declaration.name) @declaration.namespace
|
|
25
|
+
|
|
26
|
+
;; Anonymous namespace (no name child) — captured as scope only, names
|
|
27
|
+
;; inside are marked file-local by captures.ts.
|
|
28
|
+
|
|
29
|
+
;; ─── Declarations — class / struct (named) ───────────────────────────
|
|
30
|
+
(class_specifier
|
|
31
|
+
name: (type_identifier) @declaration.name
|
|
32
|
+
body: (field_declaration_list)) @declaration.class
|
|
33
|
+
|
|
34
|
+
(class_specifier
|
|
35
|
+
name: (template_type
|
|
36
|
+
(type_identifier) @declaration.name
|
|
37
|
+
(template_argument_list) @declaration.template-arguments)
|
|
38
|
+
body: (field_declaration_list)) @declaration.class
|
|
39
|
+
|
|
40
|
+
(struct_specifier
|
|
41
|
+
name: (type_identifier) @declaration.name
|
|
42
|
+
body: (field_declaration_list)) @declaration.struct
|
|
43
|
+
|
|
44
|
+
(struct_specifier
|
|
45
|
+
name: (template_type
|
|
46
|
+
(type_identifier) @declaration.name
|
|
47
|
+
(template_argument_list) @declaration.template-arguments)
|
|
48
|
+
body: (field_declaration_list)) @declaration.struct
|
|
49
|
+
|
|
50
|
+
;; ─── Declarations — class / struct inside template_declaration ───────
|
|
51
|
+
(template_declaration
|
|
52
|
+
(class_specifier
|
|
53
|
+
name: (type_identifier) @declaration.name
|
|
54
|
+
body: (field_declaration_list)) @declaration.class)
|
|
55
|
+
|
|
56
|
+
(template_declaration
|
|
57
|
+
(class_specifier
|
|
58
|
+
name: (template_type
|
|
59
|
+
(type_identifier) @declaration.name
|
|
60
|
+
(template_argument_list) @declaration.template-arguments)
|
|
61
|
+
body: (field_declaration_list)) @declaration.class)
|
|
62
|
+
|
|
63
|
+
(template_declaration
|
|
64
|
+
(struct_specifier
|
|
65
|
+
name: (type_identifier) @declaration.name
|
|
66
|
+
body: (field_declaration_list)) @declaration.struct)
|
|
67
|
+
|
|
68
|
+
(template_declaration
|
|
69
|
+
(struct_specifier
|
|
70
|
+
name: (template_type
|
|
71
|
+
(type_identifier) @declaration.name
|
|
72
|
+
(template_argument_list) @declaration.template-arguments)
|
|
73
|
+
body: (field_declaration_list)) @declaration.struct)
|
|
74
|
+
|
|
75
|
+
;; ─── Declarations — enum ─────────────────────────────────────────────
|
|
76
|
+
(enum_specifier
|
|
77
|
+
name: (type_identifier) @declaration.name) @declaration.enum
|
|
78
|
+
|
|
79
|
+
;; ─── Declarations — enum constants ───────────────────────────────────
|
|
80
|
+
(enumerator
|
|
81
|
+
name: (identifier) @declaration.name) @declaration.const
|
|
82
|
+
|
|
83
|
+
;; ─── Declarations — function definition (plain identifier) ──────────
|
|
84
|
+
(function_definition
|
|
85
|
+
declarator: (function_declarator
|
|
86
|
+
declarator: (identifier) @declaration.name)) @declaration.function
|
|
87
|
+
|
|
88
|
+
;; ─── Declarations — function definition with pointer return ─────────
|
|
89
|
+
(function_definition
|
|
90
|
+
declarator: (pointer_declarator
|
|
91
|
+
declarator: (function_declarator
|
|
92
|
+
declarator: (identifier) @declaration.name))) @declaration.function
|
|
93
|
+
|
|
94
|
+
;; ─── Declarations — out-of-class method (qualified_identifier) ──────
|
|
95
|
+
(function_definition
|
|
96
|
+
declarator: (function_declarator
|
|
97
|
+
declarator: (qualified_identifier
|
|
98
|
+
name: (identifier) @declaration.name))) @declaration.method
|
|
99
|
+
|
|
100
|
+
;; ─── Declarations — out-of-class method with pointer return ─────────
|
|
101
|
+
(function_definition
|
|
102
|
+
declarator: (pointer_declarator
|
|
103
|
+
declarator: (function_declarator
|
|
104
|
+
declarator: (qualified_identifier
|
|
105
|
+
name: (identifier) @declaration.name)))) @declaration.method
|
|
106
|
+
|
|
107
|
+
;; ─── Declarations — out-of-class method (destructor_name) ───────────
|
|
108
|
+
(function_definition
|
|
109
|
+
declarator: (function_declarator
|
|
110
|
+
declarator: (qualified_identifier
|
|
111
|
+
name: (destructor_name) @declaration.name))) @declaration.method
|
|
112
|
+
|
|
113
|
+
;; ─── Declarations — template function definition ────────────────────
|
|
114
|
+
(template_declaration
|
|
115
|
+
(function_definition
|
|
116
|
+
declarator: (function_declarator
|
|
117
|
+
declarator: (identifier) @declaration.name)) @declaration.function)
|
|
118
|
+
|
|
119
|
+
;; ─── Declarations — template method (qualified) ─────────────────────
|
|
120
|
+
(template_declaration
|
|
121
|
+
(function_definition
|
|
122
|
+
declarator: (function_declarator
|
|
123
|
+
declarator: (qualified_identifier
|
|
124
|
+
name: (identifier) @declaration.name))) @declaration.method)
|
|
125
|
+
|
|
126
|
+
;; ─── Declarations — inline method in class body (field_identifier) ──
|
|
127
|
+
;; tree-sitter-cpp uses field_identifier for names inside class bodies
|
|
128
|
+
(function_definition
|
|
129
|
+
declarator: (function_declarator
|
|
130
|
+
declarator: (field_identifier) @declaration.name)) @declaration.method
|
|
131
|
+
|
|
132
|
+
;; ─── Declarations — inline method with pointer return (field_identifier) ──
|
|
133
|
+
;; Covers: User* lookup(int id) { ... } inside a class body
|
|
134
|
+
;; AST: function_definition > pointer_declarator > function_declarator > field_identifier
|
|
135
|
+
(function_definition
|
|
136
|
+
declarator: (pointer_declarator
|
|
137
|
+
declarator: (function_declarator
|
|
138
|
+
declarator: (field_identifier) @declaration.name))) @declaration.method
|
|
139
|
+
|
|
140
|
+
;; ─── Declarations — inline method with reference return (field_identifier) ──
|
|
141
|
+
;; Covers: User& getRef() { ... } inside a class body
|
|
142
|
+
(function_definition
|
|
143
|
+
declarator: (reference_declarator
|
|
144
|
+
(function_declarator
|
|
145
|
+
declarator: (field_identifier) @declaration.name))) @declaration.method
|
|
146
|
+
|
|
147
|
+
;; ─── Declarations — function prototype (forward declaration) ────────
|
|
148
|
+
(declaration
|
|
149
|
+
declarator: (function_declarator
|
|
150
|
+
declarator: (identifier) @declaration.name)) @declaration.function
|
|
151
|
+
|
|
152
|
+
;; ─── Declarations — function prototype with pointer return ──────────
|
|
153
|
+
(declaration
|
|
154
|
+
declarator: (pointer_declarator
|
|
155
|
+
declarator: (function_declarator
|
|
156
|
+
declarator: (identifier) @declaration.name))) @declaration.function
|
|
157
|
+
|
|
158
|
+
;; ─── Declarations — typedef ─────────────────────────────────────────
|
|
159
|
+
(type_definition
|
|
160
|
+
declarator: (type_identifier) @declaration.name) @declaration.typedef
|
|
161
|
+
|
|
162
|
+
;; ─── Declarations — type alias (using Name = Type) ──────────────────
|
|
163
|
+
(alias_declaration
|
|
164
|
+
name: (type_identifier) @declaration.name) @declaration.typedef
|
|
165
|
+
|
|
166
|
+
;; ─── Declarations — method prototype in class body (forward decl) ────
|
|
167
|
+
;; Covers: class User { void save(); std::string getName(); };
|
|
168
|
+
;; AST: field_declaration > function_declarator > field_identifier
|
|
169
|
+
(field_declaration
|
|
170
|
+
declarator: (function_declarator
|
|
171
|
+
declarator: (field_identifier) @declaration.name)) @declaration.method
|
|
172
|
+
|
|
173
|
+
;; Method prototype with pointer return: User* lookup(int id);
|
|
174
|
+
(field_declaration
|
|
175
|
+
declarator: (pointer_declarator
|
|
176
|
+
declarator: (function_declarator
|
|
177
|
+
declarator: (field_identifier) @declaration.name))) @declaration.method
|
|
178
|
+
|
|
179
|
+
;; Method prototype with reference return: User& getRef();
|
|
180
|
+
(field_declaration
|
|
181
|
+
declarator: (reference_declarator
|
|
182
|
+
(function_declarator
|
|
183
|
+
declarator: (field_identifier) @declaration.name))) @declaration.method
|
|
184
|
+
|
|
185
|
+
;; ─── Declarations — fields ──────────────────────────────────────────
|
|
186
|
+
(field_declaration
|
|
187
|
+
declarator: (field_identifier) @declaration.name) @declaration.field
|
|
188
|
+
|
|
189
|
+
;; Declarations — fields (pointer)
|
|
190
|
+
(field_declaration
|
|
191
|
+
declarator: (pointer_declarator
|
|
192
|
+
declarator: (field_identifier) @declaration.name)) @declaration.field
|
|
193
|
+
|
|
194
|
+
;; Declarations — fields (reference)
|
|
195
|
+
(field_declaration
|
|
196
|
+
declarator: (reference_declarator
|
|
197
|
+
(field_identifier) @declaration.name)) @declaration.field
|
|
198
|
+
|
|
199
|
+
;; ─── Declarations — variables (with initializer) ────────────────────
|
|
200
|
+
(declaration
|
|
201
|
+
declarator: (init_declarator
|
|
202
|
+
declarator: (identifier) @declaration.name)) @declaration.variable
|
|
203
|
+
|
|
204
|
+
;; ─── Declarations — macro definitions ───────────────────────────────
|
|
205
|
+
(preproc_def
|
|
206
|
+
name: (identifier) @declaration.name) @declaration.macro
|
|
207
|
+
|
|
208
|
+
(preproc_function_def
|
|
209
|
+
name: (identifier) @declaration.name) @declaration.macro
|
|
210
|
+
|
|
211
|
+
;; ─── Imports — #include ─────────────────────────────────────────────
|
|
212
|
+
(preproc_include) @import.statement
|
|
213
|
+
|
|
214
|
+
;; ─── Imports — using declaration ─────────────────────────────────────
|
|
215
|
+
;; Both "using namespace std;" and "using std::vector;" are
|
|
216
|
+
;; using_declaration nodes in tree-sitter-cpp. The captures.ts
|
|
217
|
+
;; differentiates between them by checking for a "namespace" anonymous
|
|
218
|
+
;; child token.
|
|
219
|
+
(using_declaration) @import.using-decl
|
|
220
|
+
|
|
221
|
+
;; ─── Type bindings — parameter annotations ──────────────────────────
|
|
222
|
+
(parameter_declaration
|
|
223
|
+
type: (_) @type-binding.type
|
|
224
|
+
declarator: (identifier) @type-binding.name) @type-binding.parameter
|
|
225
|
+
|
|
226
|
+
;; Type bindings — reference parameter (const std::string& name)
|
|
227
|
+
(parameter_declaration
|
|
228
|
+
type: (_) @type-binding.type
|
|
229
|
+
declarator: (reference_declarator
|
|
230
|
+
(identifier) @type-binding.name)) @type-binding.parameter
|
|
231
|
+
|
|
232
|
+
;; Type bindings — pointer parameter (User* ptr)
|
|
233
|
+
(parameter_declaration
|
|
234
|
+
type: (_) @type-binding.type
|
|
235
|
+
declarator: (pointer_declarator
|
|
236
|
+
declarator: (identifier) @type-binding.name)) @type-binding.parameter
|
|
237
|
+
|
|
238
|
+
;; ─── Type bindings — variable with type (init_declarator) ───────────
|
|
239
|
+
;; Covers: User user("alice"), User user = ..., int x = 0
|
|
240
|
+
(declaration
|
|
241
|
+
type: (_) @type-binding.type
|
|
242
|
+
declarator: (init_declarator
|
|
243
|
+
declarator: (identifier) @type-binding.name)) @type-binding.assignment
|
|
244
|
+
|
|
245
|
+
;; ─── Type bindings — plain declaration (no initializer) ─────────────
|
|
246
|
+
;; Covers: User user;
|
|
247
|
+
(declaration
|
|
248
|
+
type: (type_identifier) @type-binding.type
|
|
249
|
+
declarator: (identifier) @type-binding.name) @type-binding.annotation
|
|
250
|
+
|
|
251
|
+
;; Covers: List<User> users;
|
|
252
|
+
(declaration
|
|
253
|
+
type: (template_type) @type-binding.type
|
|
254
|
+
declarator: (identifier) @type-binding.name) @type-binding.annotation
|
|
255
|
+
|
|
256
|
+
;; ─── Type bindings — pointer variable declaration ───────────────────
|
|
257
|
+
;; Covers: User* ptr = new User()
|
|
258
|
+
(declaration
|
|
259
|
+
type: (type_identifier) @type-binding.type
|
|
260
|
+
declarator: (init_declarator
|
|
261
|
+
declarator: (pointer_declarator
|
|
262
|
+
declarator: (identifier) @type-binding.name))) @type-binding.annotation
|
|
263
|
+
|
|
264
|
+
;; ─── Type bindings — auto + constructor call ────────────────────────
|
|
265
|
+
;; Covers: auto user = User("alice")
|
|
266
|
+
;; AST: declaration > placeholder_type_specifier/auto > init_declarator > identifier + call_expression > identifier
|
|
267
|
+
(declaration
|
|
268
|
+
type: (placeholder_type_specifier)
|
|
269
|
+
declarator: (init_declarator
|
|
270
|
+
declarator: (identifier) @type-binding.name
|
|
271
|
+
value: (call_expression
|
|
272
|
+
function: (identifier) @type-binding.type))) @type-binding.constructor
|
|
273
|
+
|
|
274
|
+
;; ─── Type bindings — auto + brace-init (compound_literal_expression) ─
|
|
275
|
+
;; Covers: auto user = User{}, auto user = User{args}
|
|
276
|
+
;; AST: declaration > placeholder_type_specifier/auto > init_declarator > identifier + compound_literal_expression > type_identifier
|
|
277
|
+
(declaration
|
|
278
|
+
type: (placeholder_type_specifier)
|
|
279
|
+
declarator: (init_declarator
|
|
280
|
+
declarator: (identifier) @type-binding.name
|
|
281
|
+
value: (compound_literal_expression
|
|
282
|
+
type: (type_identifier) @type-binding.type))) @type-binding.constructor
|
|
283
|
+
|
|
284
|
+
;; ─── Type bindings — auto + scoped brace-init (qualified) ───────────
|
|
285
|
+
;; Covers: auto client = ns::HttpClient{}
|
|
286
|
+
;; AST: compound_literal_expression > qualified_identifier > type_identifier
|
|
287
|
+
(declaration
|
|
288
|
+
type: (placeholder_type_specifier)
|
|
289
|
+
declarator: (init_declarator
|
|
290
|
+
declarator: (identifier) @type-binding.name
|
|
291
|
+
value: (compound_literal_expression
|
|
292
|
+
type: (qualified_identifier
|
|
293
|
+
name: (type_identifier) @type-binding.type)))) @type-binding.constructor
|
|
294
|
+
|
|
295
|
+
;; ─── Type bindings — auto + new expression ──────────────────────────
|
|
296
|
+
;; Covers: auto user = new User(name)
|
|
297
|
+
;; AST: declaration > placeholder_type_specifier/auto > init_declarator > identifier + new_expression > type_identifier
|
|
298
|
+
(declaration
|
|
299
|
+
type: (placeholder_type_specifier)
|
|
300
|
+
declarator: (init_declarator
|
|
301
|
+
declarator: (identifier) @type-binding.name
|
|
302
|
+
value: (new_expression
|
|
303
|
+
type: (type_identifier) @type-binding.type))) @type-binding.constructor
|
|
304
|
+
|
|
305
|
+
;; ─── Type bindings — auto + qualified template factory (std::make_shared<Dog>()) ─
|
|
306
|
+
;; AST: declaration(1 > placeholder_type_specifier(2)2 > init_declarator(3 >
|
|
307
|
+
;; identifier(4)4 > call_expression(5 > qualified_identifier(6 >
|
|
308
|
+
;; template_function(7 > template_argument_list(8 > type_descriptor(9 >
|
|
309
|
+
;; type_identifier(10)10 )9 )8 )7 )6 )5 )3 )1
|
|
310
|
+
(declaration
|
|
311
|
+
type: (placeholder_type_specifier)
|
|
312
|
+
declarator: (init_declarator
|
|
313
|
+
declarator: (identifier) @type-binding.name
|
|
314
|
+
value: (call_expression
|
|
315
|
+
function: (qualified_identifier
|
|
316
|
+
name: (template_function
|
|
317
|
+
arguments: (template_argument_list
|
|
318
|
+
(type_descriptor
|
|
319
|
+
type: (type_identifier) @type-binding.type))))))) @type-binding.constructor
|
|
320
|
+
|
|
321
|
+
;; ─── Type bindings — auto + bare template factory (make_shared<Dog>()) ───────
|
|
322
|
+
;; Same but without qualified_identifier wrapper — one fewer nesting level
|
|
323
|
+
(declaration
|
|
324
|
+
type: (placeholder_type_specifier)
|
|
325
|
+
declarator: (init_declarator
|
|
326
|
+
declarator: (identifier) @type-binding.name
|
|
327
|
+
value: (call_expression
|
|
328
|
+
function: (template_function
|
|
329
|
+
arguments: (template_argument_list
|
|
330
|
+
(type_descriptor
|
|
331
|
+
type: (type_identifier) @type-binding.type)))))) @type-binding.constructor
|
|
332
|
+
|
|
333
|
+
;; ─── Type bindings — auto alias assignment ──────────────────────────
|
|
334
|
+
;; Covers: auto alias = existingVar (RHS is a plain identifier)
|
|
335
|
+
;; AST: declaration > placeholder_type_specifier/auto > init_declarator > identifier + identifier
|
|
336
|
+
(declaration
|
|
337
|
+
type: (placeholder_type_specifier)
|
|
338
|
+
declarator: (init_declarator
|
|
339
|
+
declarator: (identifier) @type-binding.name
|
|
340
|
+
value: (identifier) @type-binding.type)) @type-binding.alias
|
|
341
|
+
|
|
342
|
+
;; ─── Type bindings — auto + member access (field_expression) ────────
|
|
343
|
+
;; Covers: auto addr = user.address (RHS is obj.field)
|
|
344
|
+
;; AST: declaration > placeholder_type_specifier > init_declarator > identifier + field_expression
|
|
345
|
+
;; We capture the field name as @type-binding.type so the compound-receiver
|
|
346
|
+
;; chain resolver can look it up on the receiver class scope.
|
|
347
|
+
;; The full obj.field text is synthesized by interpret.ts into a dotted
|
|
348
|
+
;; rawName for chain-follow resolution.
|
|
349
|
+
(declaration
|
|
350
|
+
type: (placeholder_type_specifier)
|
|
351
|
+
declarator: (init_declarator
|
|
352
|
+
declarator: (identifier) @type-binding.name
|
|
353
|
+
value: (field_expression
|
|
354
|
+
argument: (_) @type-binding.member-access-receiver
|
|
355
|
+
field: (field_identifier) @type-binding.type))) @type-binding.member-access
|
|
356
|
+
|
|
357
|
+
;; ─── Type bindings — function return type ───────────────────────────
|
|
358
|
+
;; Covers: User getUser() { ... }
|
|
359
|
+
;; AST: function_definition > type_identifier + function_declarator > identifier
|
|
360
|
+
(function_definition
|
|
361
|
+
type: (type_identifier) @type-binding.type
|
|
362
|
+
declarator: (function_declarator
|
|
363
|
+
declarator: (identifier) @type-binding.name)) @type-binding.return
|
|
364
|
+
|
|
365
|
+
;; Return type — out-of-class method: User Class::getUser() { ... }
|
|
366
|
+
(function_definition
|
|
367
|
+
type: (type_identifier) @type-binding.type
|
|
368
|
+
declarator: (function_declarator
|
|
369
|
+
declarator: (qualified_identifier
|
|
370
|
+
name: (identifier) @type-binding.name))) @type-binding.return
|
|
371
|
+
|
|
372
|
+
;; Return type — pointer return: User* getUser() { ... }
|
|
373
|
+
(function_definition
|
|
374
|
+
type: (type_identifier) @type-binding.type
|
|
375
|
+
declarator: (pointer_declarator
|
|
376
|
+
declarator: (function_declarator
|
|
377
|
+
declarator: (identifier) @type-binding.name))) @type-binding.return
|
|
378
|
+
|
|
379
|
+
;; ─── Type bindings — inline method return type ──────────────────────
|
|
380
|
+
;; Covers: class Foo { User getUser() { ... } };
|
|
381
|
+
(function_definition
|
|
382
|
+
type: (type_identifier) @type-binding.type
|
|
383
|
+
declarator: (function_declarator
|
|
384
|
+
declarator: (field_identifier) @type-binding.name)) @type-binding.return
|
|
385
|
+
|
|
386
|
+
;; Inline method pointer return type: class Foo { User* lookup(int) { ... } };
|
|
387
|
+
(function_definition
|
|
388
|
+
type: (type_identifier) @type-binding.type
|
|
389
|
+
declarator: (pointer_declarator
|
|
390
|
+
declarator: (function_declarator
|
|
391
|
+
declarator: (field_identifier) @type-binding.name))) @type-binding.return
|
|
392
|
+
|
|
393
|
+
;; ─── Type bindings — method prototype return type in class body ──────
|
|
394
|
+
;; Covers: class User { User* lookup(int); std::string getName(); };
|
|
395
|
+
;; AST: field_declaration > function_declarator > field_identifier
|
|
396
|
+
(field_declaration
|
|
397
|
+
type: (type_identifier) @type-binding.type
|
|
398
|
+
declarator: (function_declarator
|
|
399
|
+
declarator: (field_identifier) @type-binding.name)) @type-binding.return
|
|
400
|
+
|
|
401
|
+
;; Method prototype pointer return type: User* lookup(int id);
|
|
402
|
+
(field_declaration
|
|
403
|
+
type: (type_identifier) @type-binding.type
|
|
404
|
+
declarator: (pointer_declarator
|
|
405
|
+
declarator: (function_declarator
|
|
406
|
+
declarator: (field_identifier) @type-binding.name))) @type-binding.return
|
|
407
|
+
|
|
408
|
+
;; ─── Type bindings — field type declarations (class members) ────────
|
|
409
|
+
;; Covers: class User { Address address; };
|
|
410
|
+
(field_declaration
|
|
411
|
+
type: (type_identifier) @type-binding.type
|
|
412
|
+
declarator: (field_identifier) @type-binding.name) @type-binding.field
|
|
413
|
+
|
|
414
|
+
;; Field pointer type: Address* address;
|
|
415
|
+
(field_declaration
|
|
416
|
+
type: (type_identifier) @type-binding.type
|
|
417
|
+
declarator: (pointer_declarator
|
|
418
|
+
declarator: (field_identifier) @type-binding.name)) @type-binding.field
|
|
419
|
+
|
|
420
|
+
;; Field reference type: Address& address;
|
|
421
|
+
(field_declaration
|
|
422
|
+
type: (type_identifier) @type-binding.type
|
|
423
|
+
declarator: (reference_declarator
|
|
424
|
+
(field_identifier) @type-binding.name)) @type-binding.field
|
|
425
|
+
|
|
426
|
+
;; ─── References — constructor calls (new Foo()) ─────────────────────
|
|
427
|
+
(new_expression
|
|
428
|
+
type: (type_identifier) @reference.name) @reference.call.constructor
|
|
429
|
+
|
|
430
|
+
;; Constructor call with qualified type: new ns::Foo()
|
|
431
|
+
(new_expression
|
|
432
|
+
type: (qualified_identifier
|
|
433
|
+
name: (type_identifier) @reference.name)) @reference.call.constructor
|
|
434
|
+
|
|
435
|
+
;; ─── References — free calls ────────────────────────────────────────
|
|
436
|
+
(call_expression
|
|
437
|
+
function: (identifier) @reference.name) @reference.call.free
|
|
438
|
+
|
|
439
|
+
;; ─── References — qualified calls (Namespace func or Class method) ───
|
|
440
|
+
;; Capture the LHS of scope-resolution as the explicit receiver so
|
|
441
|
+
;; qualified static member calls route through receiver-bound-calls
|
|
442
|
+
;; Case 2 (class-name receiver) path. Without the receiver capture,
|
|
443
|
+
;; qualified calls have no explicit receiver and class methods cannot
|
|
444
|
+
;; resolve through receiver-bound paths.
|
|
445
|
+
(call_expression
|
|
446
|
+
function: (qualified_identifier
|
|
447
|
+
scope: (_) @reference.receiver
|
|
448
|
+
name: (identifier) @reference.name)) @reference.call.qualified
|
|
449
|
+
|
|
450
|
+
;; Nested qualified receiver: outer::v1::Base<T>::f()
|
|
451
|
+
;; tree-sitter-cpp nests this as qualified_identifier(name:
|
|
452
|
+
;; qualified_identifier(scope: qualified_identifier(...), name: identifier)).
|
|
453
|
+
;; Capturing the innermost receiver still gives isSuperReceiverInContext
|
|
454
|
+
;; enough text to strip qualifiers/template args down to Base.
|
|
455
|
+
(call_expression
|
|
456
|
+
function: (qualified_identifier
|
|
457
|
+
name: (qualified_identifier
|
|
458
|
+
scope: (_) @reference.receiver
|
|
459
|
+
name: (identifier) @reference.name))) @reference.call.qualified
|
|
460
|
+
|
|
461
|
+
;; Double-nested qualified receiver: outer::v1::Base<T>::f()
|
|
462
|
+
(call_expression
|
|
463
|
+
function: (qualified_identifier
|
|
464
|
+
name: (qualified_identifier
|
|
465
|
+
name: (qualified_identifier
|
|
466
|
+
scope: (_) @reference.receiver
|
|
467
|
+
name: (identifier) @reference.name)))) @reference.call.qualified
|
|
468
|
+
|
|
469
|
+
;; ─── References — member calls (obj.method() / ptr->method()) ───────
|
|
470
|
+
(call_expression
|
|
471
|
+
function: (field_expression
|
|
472
|
+
argument: (_) @reference.receiver
|
|
473
|
+
field: (field_identifier) @reference.name)) @reference.call.member
|
|
474
|
+
|
|
475
|
+
;; ─── References — template calls (func<T>()) ────────────────────────
|
|
476
|
+
(call_expression
|
|
477
|
+
function: (template_function
|
|
478
|
+
name: (identifier) @reference.name)) @reference.call.free
|
|
479
|
+
|
|
480
|
+
;; Note: Ns::func<T>() is parsed as qualified_identifier by tree-sitter-cpp,
|
|
481
|
+
;; already captured by the qualified calls pattern above.
|
|
482
|
+
|
|
483
|
+
;; ─── References — field reads ───────────────────────────────────────
|
|
484
|
+
(field_expression
|
|
485
|
+
argument: (_) @reference.receiver
|
|
486
|
+
field: (field_identifier) @reference.name) @reference.read
|
|
487
|
+
|
|
488
|
+
;; ─── References — field writes (assignment) ─────────────────────────
|
|
489
|
+
(assignment_expression
|
|
490
|
+
left: (field_expression
|
|
491
|
+
argument: (_) @reference.receiver
|
|
492
|
+
field: (field_identifier) @reference.name)) @reference.write
|
|
493
|
+
`;
|
|
494
|
+
let _parser = null;
|
|
495
|
+
let _query = null;
|
|
496
|
+
export function getCppParser() {
|
|
497
|
+
if (_parser === null) {
|
|
498
|
+
_parser = new Parser();
|
|
499
|
+
_parser.setLanguage(CPP);
|
|
500
|
+
}
|
|
501
|
+
return _parser;
|
|
502
|
+
}
|
|
503
|
+
export function getCppScopeQuery() {
|
|
504
|
+
if (_query === null) {
|
|
505
|
+
_query = new Parser.Query(CPP, CPP_SCOPE_QUERY);
|
|
506
|
+
}
|
|
507
|
+
return _query;
|
|
508
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { ParsedFile } from '../../../../_shared/index.js';
|
|
2
|
+
import type { ScopeResolutionIndexes } from '../../model/scope-resolution-indexes.js';
|
|
3
|
+
/**
|
|
4
|
+
* Populate range-for loop variable type bindings for C++.
|
|
5
|
+
*
|
|
6
|
+
* Handles three patterns:
|
|
7
|
+
* 1. `for (auto& user : users)` — simple range-for
|
|
8
|
+
* 2. `for (auto& [key, user] : userMap)` — structured binding
|
|
9
|
+
* 3. `for (auto& user : *usersPtr)` — dereference range-for
|
|
10
|
+
*
|
|
11
|
+
* Strategy: look up the range source variable's type in scope
|
|
12
|
+
* typeBindings, extract the last template argument as the element
|
|
13
|
+
* type, and inject a typeBinding for the loop variable.
|
|
14
|
+
*/
|
|
15
|
+
export declare function populateCppRangeBindings(parsedFiles: readonly ParsedFile[], _indexes: ScopeResolutionIndexes, ctx: {
|
|
16
|
+
readonly fileContents: ReadonlyMap<string, string>;
|
|
17
|
+
readonly treeCache?: {
|
|
18
|
+
get(filePath: string): unknown;
|
|
19
|
+
};
|
|
20
|
+
}): void;
|