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,13 @@
|
|
|
1
|
+
import { resolveCImportTarget } from '../c/import-target.js';
|
|
2
|
+
/**
|
|
3
|
+
* Resolve a C++ #include path to a file in the workspace.
|
|
4
|
+
* C++ #include path resolution is identical to C:
|
|
5
|
+
* 1. Same-directory sibling (relative lookup)
|
|
6
|
+
* 2. Exact match
|
|
7
|
+
* 3. Suffix match with depth + lexicographic tiebreak
|
|
8
|
+
*
|
|
9
|
+
* Re-exports the C implementation since the #include semantics are shared.
|
|
10
|
+
*/
|
|
11
|
+
export function resolveCppImportTarget(targetRaw, fromFile, allFilePaths) {
|
|
12
|
+
return resolveCImportTarget(targetRaw, fromFile, allFilePaths);
|
|
13
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* C++ scope-resolution hooks (RFC #909 Ring 3).
|
|
3
|
+
*/
|
|
4
|
+
export { emitCppScopeCaptures } from './captures.js';
|
|
5
|
+
export { interpretCppImport, interpretCppTypeBinding, normalizeCppTypeName } from './interpret.js';
|
|
6
|
+
export { splitCppInclude, splitCppUsingDecl } from './import-decomposer.js';
|
|
7
|
+
export { cppArityCompatibility } from './arity.js';
|
|
8
|
+
export { cppMergeBindings } from './merge-bindings.js';
|
|
9
|
+
export { cppBindingScopeFor, cppImportOwningScope, cppReceiverBinding } from './simple-hooks.js';
|
|
10
|
+
export { resolveCppImportTarget } from './import-target.js';
|
|
11
|
+
export { markFileLocal, isFileLocal, clearFileLocalNames, expandCppWildcardNames, } from './file-local-linkage.js';
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* C++ scope-resolution hooks (RFC #909 Ring 3).
|
|
3
|
+
*/
|
|
4
|
+
export { emitCppScopeCaptures } from './captures.js';
|
|
5
|
+
export { interpretCppImport, interpretCppTypeBinding, normalizeCppTypeName } from './interpret.js';
|
|
6
|
+
export { splitCppInclude, splitCppUsingDecl } from './import-decomposer.js';
|
|
7
|
+
export { cppArityCompatibility } from './arity.js';
|
|
8
|
+
export { cppMergeBindings } from './merge-bindings.js';
|
|
9
|
+
export { cppBindingScopeFor, cppImportOwningScope, cppReceiverBinding } from './simple-hooks.js';
|
|
10
|
+
export { resolveCppImportTarget } from './import-target.js';
|
|
11
|
+
export { markFileLocal, isFileLocal, clearFileLocalNames, expandCppWildcardNames, } from './file-local-linkage.js';
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* C++ inline namespace support (U5 of plan 2026-05-13-001).
|
|
3
|
+
*
|
|
4
|
+
* `inline namespace v1 { void foo(); }` has two ISO C++ semantics that
|
|
5
|
+
* GitNexus must model:
|
|
6
|
+
*
|
|
7
|
+
* 1. **Transitive unqualified visibility.** Names declared in an inline
|
|
8
|
+
* namespace are reachable by unqualified lookup from the enclosing
|
|
9
|
+
* namespace's scope, as if they were declared directly there.
|
|
10
|
+
* `populateCppNonGloballyVisible` (file-local-linkage.ts) treats
|
|
11
|
+
* inline-namespace members as globally visible for cross-file
|
|
12
|
+
* unqualified lookup.
|
|
13
|
+
*
|
|
14
|
+
* 2. **Transitive qualified visibility.** `outer::foo()` resolves to
|
|
15
|
+
* `outer::v1::foo()` when `v1` is inline. The qualified-namespace
|
|
16
|
+
* receiver resolver (`resolveCppQualifiedNamespaceMember`) walks
|
|
17
|
+
* inline-namespace children transitively when collecting candidates.
|
|
18
|
+
*
|
|
19
|
+
* State lifecycle: capture-time `markCppInlineNamespaceRange` records each
|
|
20
|
+
* inline namespace's source range; `populateCppInlineNamespaceScopes`
|
|
21
|
+
* resolves ranges to `ScopeId`s during `populateOwners`. Cleared via
|
|
22
|
+
* `clearCppInlineNamespaces`, called from `clearFileLocalNames`.
|
|
23
|
+
*
|
|
24
|
+
* STL idiom this enables: `std::__1::vector` (libc++) and `std::__cxx11`
|
|
25
|
+
* (libstdc++) are inline namespaces of `std`. With this support,
|
|
26
|
+
* `std::vector` qualified calls resolve to the inline-namespace
|
|
27
|
+
* declaration transparently.
|
|
28
|
+
*/
|
|
29
|
+
import type { ParsedFile, ScopeId, SymbolDefinition } from '../../../../_shared/index.js';
|
|
30
|
+
import type { ScopeResolutionIndexes } from '../../model/scope-resolution-indexes.js';
|
|
31
|
+
interface RangeKey {
|
|
32
|
+
readonly startLine: number;
|
|
33
|
+
readonly startCol: number;
|
|
34
|
+
readonly endLine: number;
|
|
35
|
+
readonly endCol: number;
|
|
36
|
+
}
|
|
37
|
+
/** Capture-time: record a namespace_definition's range as inline.
|
|
38
|
+
* Called from `emitCppScopeCaptures` when the tree-sitter AST shows an
|
|
39
|
+
* `inline` keyword child on `namespace_definition`. */
|
|
40
|
+
export declare function markCppInlineNamespaceRange(filePath: string, range: RangeKey): void;
|
|
41
|
+
/** Clear all inline-namespace state. Called from `clearFileLocalNames`. */
|
|
42
|
+
export declare function clearCppInlineNamespaces(): void;
|
|
43
|
+
/** Resolve captured ranges to actual ScopeIds by matching scope ranges
|
|
44
|
+
* against the inline-namespace ranges recorded for this file. Run from
|
|
45
|
+
* the cpp resolver's `populateOwners` hook so the per-pipeline Set is
|
|
46
|
+
* populated before any resolution pass consults it. */
|
|
47
|
+
export declare function populateCppInlineNamespaceScopes(parsed: ParsedFile): void;
|
|
48
|
+
/** Predicate consumed by `populateCppNonGloballyVisible` to exempt
|
|
49
|
+
* inline-namespace members from cross-file unqualified-lookup
|
|
50
|
+
* exclusion (they remain reachable as if declared at the enclosing
|
|
51
|
+
* namespace's level). */
|
|
52
|
+
export declare function isCppInlineNamespaceScope(scopeId: ScopeId): boolean;
|
|
53
|
+
/**
|
|
54
|
+
* Walk every parsed file looking for a Namespace scope whose qualified
|
|
55
|
+
* name matches `receiverName`, collect its callable ownedDefs matching
|
|
56
|
+
* `memberName`, transitively descending into any inline-namespace
|
|
57
|
+
* children (since they're members of the enclosing namespace under ISO
|
|
58
|
+
* C++).
|
|
59
|
+
*
|
|
60
|
+
* Returns the most specific (innermost) match — for `outer::foo()`
|
|
61
|
+
* where `inline namespace v1` declares `foo`, returns `v1::foo`. When
|
|
62
|
+
* multiple inline-namespace children declare the same name, ISO C++
|
|
63
|
+
* leaves the call ambiguous; returns `'ambiguous'` so the caller
|
|
64
|
+
* suppresses edge emission rather than picking arbitrarily (#1564).
|
|
65
|
+
*/
|
|
66
|
+
export declare function resolveCppQualifiedNamespaceMember(receiverName: string, memberName: string, parsedFiles: readonly ParsedFile[], _scopes: ScopeResolutionIndexes): SymbolDefinition | 'ambiguous' | undefined;
|
|
67
|
+
export {};
|
|
@@ -0,0 +1,176 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* C++ inline namespace support (U5 of plan 2026-05-13-001).
|
|
3
|
+
*
|
|
4
|
+
* `inline namespace v1 { void foo(); }` has two ISO C++ semantics that
|
|
5
|
+
* GitNexus must model:
|
|
6
|
+
*
|
|
7
|
+
* 1. **Transitive unqualified visibility.** Names declared in an inline
|
|
8
|
+
* namespace are reachable by unqualified lookup from the enclosing
|
|
9
|
+
* namespace's scope, as if they were declared directly there.
|
|
10
|
+
* `populateCppNonGloballyVisible` (file-local-linkage.ts) treats
|
|
11
|
+
* inline-namespace members as globally visible for cross-file
|
|
12
|
+
* unqualified lookup.
|
|
13
|
+
*
|
|
14
|
+
* 2. **Transitive qualified visibility.** `outer::foo()` resolves to
|
|
15
|
+
* `outer::v1::foo()` when `v1` is inline. The qualified-namespace
|
|
16
|
+
* receiver resolver (`resolveCppQualifiedNamespaceMember`) walks
|
|
17
|
+
* inline-namespace children transitively when collecting candidates.
|
|
18
|
+
*
|
|
19
|
+
* State lifecycle: capture-time `markCppInlineNamespaceRange` records each
|
|
20
|
+
* inline namespace's source range; `populateCppInlineNamespaceScopes`
|
|
21
|
+
* resolves ranges to `ScopeId`s during `populateOwners`. Cleared via
|
|
22
|
+
* `clearCppInlineNamespaces`, called from `clearFileLocalNames`.
|
|
23
|
+
*
|
|
24
|
+
* STL idiom this enables: `std::__1::vector` (libc++) and `std::__cxx11`
|
|
25
|
+
* (libstdc++) are inline namespaces of `std`. With this support,
|
|
26
|
+
* `std::vector` qualified calls resolve to the inline-namespace
|
|
27
|
+
* declaration transparently.
|
|
28
|
+
*/
|
|
29
|
+
import { isOverloadAmbiguousAfterNormalization, narrowOverloadCandidates, } from '../../scope-resolution/passes/overload-narrowing.js';
|
|
30
|
+
const inlineNamespaceRangesByFile = new Map();
|
|
31
|
+
const inlineNamespaceScopeIds = new Set();
|
|
32
|
+
function rangeKey(r) {
|
|
33
|
+
return `${r.startLine}:${r.startCol}:${r.endLine}:${r.endCol}`;
|
|
34
|
+
}
|
|
35
|
+
/** Capture-time: record a namespace_definition's range as inline.
|
|
36
|
+
* Called from `emitCppScopeCaptures` when the tree-sitter AST shows an
|
|
37
|
+
* `inline` keyword child on `namespace_definition`. */
|
|
38
|
+
export function markCppInlineNamespaceRange(filePath, range) {
|
|
39
|
+
let set = inlineNamespaceRangesByFile.get(filePath);
|
|
40
|
+
if (set === undefined) {
|
|
41
|
+
set = new Set();
|
|
42
|
+
inlineNamespaceRangesByFile.set(filePath, set);
|
|
43
|
+
}
|
|
44
|
+
set.add(rangeKey(range));
|
|
45
|
+
}
|
|
46
|
+
/** Clear all inline-namespace state. Called from `clearFileLocalNames`. */
|
|
47
|
+
export function clearCppInlineNamespaces() {
|
|
48
|
+
inlineNamespaceRangesByFile.clear();
|
|
49
|
+
inlineNamespaceScopeIds.clear();
|
|
50
|
+
}
|
|
51
|
+
/** Resolve captured ranges to actual ScopeIds by matching scope ranges
|
|
52
|
+
* against the inline-namespace ranges recorded for this file. Run from
|
|
53
|
+
* the cpp resolver's `populateOwners` hook so the per-pipeline Set is
|
|
54
|
+
* populated before any resolution pass consults it. */
|
|
55
|
+
export function populateCppInlineNamespaceScopes(parsed) {
|
|
56
|
+
const ranges = inlineNamespaceRangesByFile.get(parsed.filePath);
|
|
57
|
+
if (ranges === undefined || ranges.size === 0)
|
|
58
|
+
return;
|
|
59
|
+
for (const scope of parsed.scopes) {
|
|
60
|
+
if (scope.kind !== 'Namespace')
|
|
61
|
+
continue;
|
|
62
|
+
if (ranges.has(rangeKey(scope.range))) {
|
|
63
|
+
inlineNamespaceScopeIds.add(scope.id);
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
/** Predicate consumed by `populateCppNonGloballyVisible` to exempt
|
|
68
|
+
* inline-namespace members from cross-file unqualified-lookup
|
|
69
|
+
* exclusion (they remain reachable as if declared at the enclosing
|
|
70
|
+
* namespace's level). */
|
|
71
|
+
export function isCppInlineNamespaceScope(scopeId) {
|
|
72
|
+
return inlineNamespaceScopeIds.has(scopeId);
|
|
73
|
+
}
|
|
74
|
+
/**
|
|
75
|
+
* Walk every parsed file looking for a Namespace scope whose qualified
|
|
76
|
+
* name matches `receiverName`, collect its callable ownedDefs matching
|
|
77
|
+
* `memberName`, transitively descending into any inline-namespace
|
|
78
|
+
* children (since they're members of the enclosing namespace under ISO
|
|
79
|
+
* C++).
|
|
80
|
+
*
|
|
81
|
+
* Returns the most specific (innermost) match — for `outer::foo()`
|
|
82
|
+
* where `inline namespace v1` declares `foo`, returns `v1::foo`. When
|
|
83
|
+
* multiple inline-namespace children declare the same name, ISO C++
|
|
84
|
+
* leaves the call ambiguous; returns `'ambiguous'` so the caller
|
|
85
|
+
* suppresses edge emission rather than picking arbitrarily (#1564).
|
|
86
|
+
*/
|
|
87
|
+
export function resolveCppQualifiedNamespaceMember(receiverName, memberName, parsedFiles, _scopes) {
|
|
88
|
+
const allHits = [];
|
|
89
|
+
const seenNodeId = new Set();
|
|
90
|
+
for (const parsed of parsedFiles) {
|
|
91
|
+
const scopesById = new Map();
|
|
92
|
+
for (const sc of parsed.scopes)
|
|
93
|
+
scopesById.set(sc.id, sc);
|
|
94
|
+
for (const scope of parsed.scopes) {
|
|
95
|
+
if (scope.kind !== 'Namespace')
|
|
96
|
+
continue;
|
|
97
|
+
const nsDef = findNamespaceDefInScope(scope);
|
|
98
|
+
if (nsDef === undefined)
|
|
99
|
+
continue;
|
|
100
|
+
const nsName = nsDef.qualifiedName?.split('.').pop() ?? nsDef.qualifiedName ?? '';
|
|
101
|
+
if (nsName !== receiverName)
|
|
102
|
+
continue;
|
|
103
|
+
// Found a matching namespace scope in this file. Collect ALL
|
|
104
|
+
// members transitively through any inline-namespace children.
|
|
105
|
+
const hits = findMemberInNamespaceTransitive(scope, scopesById, memberName);
|
|
106
|
+
for (const hit of hits) {
|
|
107
|
+
if (seenNodeId.has(hit.nodeId))
|
|
108
|
+
continue;
|
|
109
|
+
seenNodeId.add(hit.nodeId);
|
|
110
|
+
allHits.push(hit);
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
if (allHits.length === 0)
|
|
115
|
+
return undefined;
|
|
116
|
+
if (allHits.length === 1)
|
|
117
|
+
return allHits[0];
|
|
118
|
+
// Multi-candidate: the `resolveQualifiedReceiverMember` hook has no
|
|
119
|
+
// access to call-site arity or argument types, so
|
|
120
|
+
// `narrowOverloadCandidates` cannot actually narrow here — the call
|
|
121
|
+
// with `(allHits, undefined, undefined)` is effectively a pass-through.
|
|
122
|
+
// We retain it so that `isOverloadAmbiguousAfterNormalization` can
|
|
123
|
+
// still detect int/long-style normalization collisions on this path,
|
|
124
|
+
// but for any multi-hit case where candidates have genuinely distinct
|
|
125
|
+
// signatures (e.g. `foo(int)` vs `foo(double)` in different inline
|
|
126
|
+
// children), we conservatively suppress rather than pick arbitrarily.
|
|
127
|
+
// A future enhancement could thread call-site argument info through
|
|
128
|
+
// the `resolveQualifiedReceiverMember` contract to enable real
|
|
129
|
+
// narrowing here.
|
|
130
|
+
const narrowed = narrowOverloadCandidates(allHits, undefined, undefined);
|
|
131
|
+
if (narrowed.length === 1)
|
|
132
|
+
return narrowed[0];
|
|
133
|
+
if (narrowed.length === 0)
|
|
134
|
+
return undefined;
|
|
135
|
+
if (isOverloadAmbiguousAfterNormalization(narrowed, undefined))
|
|
136
|
+
return 'ambiguous';
|
|
137
|
+
// Multiple surviving candidates (distinct signatures) — conservative
|
|
138
|
+
// suppress because we lack call-site info to disambiguate.
|
|
139
|
+
return 'ambiguous';
|
|
140
|
+
}
|
|
141
|
+
/** Recursively search a namespace scope and any inline-namespace
|
|
142
|
+
* descendants for callable defs with the given simple name. Non-inline
|
|
143
|
+
* nested namespaces are NOT traversed — they require explicit
|
|
144
|
+
* qualification (`outer::nested::foo`). Returns ALL matches so the
|
|
145
|
+
* caller can detect same-name ambiguity across inline children (#1564). */
|
|
146
|
+
function findMemberInNamespaceTransitive(scope, scopesById, memberName) {
|
|
147
|
+
const results = [];
|
|
148
|
+
// Check this scope's own ownedDefs first.
|
|
149
|
+
for (const def of scope.ownedDefs) {
|
|
150
|
+
if (def.type !== 'Function' && def.type !== 'Method' && def.type !== 'Constructor')
|
|
151
|
+
continue;
|
|
152
|
+
const simple = def.qualifiedName?.split('.').pop() ?? def.qualifiedName ?? '';
|
|
153
|
+
if (simple === memberName)
|
|
154
|
+
results.push(def);
|
|
155
|
+
}
|
|
156
|
+
// Descend into inline-namespace children.
|
|
157
|
+
for (const childScope of scopesById.values()) {
|
|
158
|
+
if (childScope.parent !== scope.id)
|
|
159
|
+
continue;
|
|
160
|
+
if (childScope.kind !== 'Namespace')
|
|
161
|
+
continue;
|
|
162
|
+
if (!inlineNamespaceScopeIds.has(childScope.id))
|
|
163
|
+
continue;
|
|
164
|
+
const childHits = findMemberInNamespaceTransitive(childScope, scopesById, memberName);
|
|
165
|
+
for (const hit of childHits)
|
|
166
|
+
results.push(hit);
|
|
167
|
+
}
|
|
168
|
+
return results;
|
|
169
|
+
}
|
|
170
|
+
function findNamespaceDefInScope(scope) {
|
|
171
|
+
for (const def of scope.ownedDefs) {
|
|
172
|
+
if (def.type === 'Namespace')
|
|
173
|
+
return def;
|
|
174
|
+
}
|
|
175
|
+
return undefined;
|
|
176
|
+
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import type { CaptureMatch, ParsedImport, ParsedTypeBinding } from '../../../../_shared/index.js';
|
|
2
|
+
/**
|
|
3
|
+
* Interpret a C++ import capture into a ParsedImport.
|
|
4
|
+
*
|
|
5
|
+
* C++ has three import forms:
|
|
6
|
+
* 1. #include "file.h" → wildcard import (all symbols from header)
|
|
7
|
+
* 2. using namespace X; → wildcard import (all symbols from namespace X)
|
|
8
|
+
* 3. using X::name; → named import (single symbol from namespace X)
|
|
9
|
+
*
|
|
10
|
+
* System headers (#include <...>) are not resolved to local files.
|
|
11
|
+
*/
|
|
12
|
+
export declare function interpretCppImport(captures: CaptureMatch): ParsedImport | null;
|
|
13
|
+
/**
|
|
14
|
+
* Interpret a C++ type-binding capture into a ParsedTypeBinding.
|
|
15
|
+
*
|
|
16
|
+
* Source classification (strongest → weakest):
|
|
17
|
+
* - `'parameter-annotation'` — function parameter type
|
|
18
|
+
* - `'annotation'` — explicit type declaration (`User user;`)
|
|
19
|
+
* - `'assignment-inferred'` — typed init (`User user = ...`)
|
|
20
|
+
* - `'constructor'` — constructor call (`auto u = User(...)` / `User{}`)
|
|
21
|
+
* - `'return'` — function return type
|
|
22
|
+
* - `'field'` — class field type
|
|
23
|
+
* - `'alias'` — `auto x = existingVar`
|
|
24
|
+
*/
|
|
25
|
+
export declare function interpretCppTypeBinding(captures: CaptureMatch): ParsedTypeBinding | null;
|
|
26
|
+
/**
|
|
27
|
+
* Normalize a C++ type name: strip pointer/array/reference syntax,
|
|
28
|
+
* qualifiers, while preserving template arguments for specialization-aware
|
|
29
|
+
* receiver binding (`List<User>` vs `List<Order>`).
|
|
30
|
+
*
|
|
31
|
+
* Keeping template arguments here allows receiver-bound fallback to match
|
|
32
|
+
* specialization-specific class defs first; non-template behavior is preserved
|
|
33
|
+
* by base-name fallback in resolveClassBindingForName.
|
|
34
|
+
*/
|
|
35
|
+
export declare function normalizeCppTypeName(text: string): string;
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Interpret a C++ import capture into a ParsedImport.
|
|
3
|
+
*
|
|
4
|
+
* C++ has three import forms:
|
|
5
|
+
* 1. #include "file.h" → wildcard import (all symbols from header)
|
|
6
|
+
* 2. using namespace X; → wildcard import (all symbols from namespace X)
|
|
7
|
+
* 3. using X::name; → named import (single symbol from namespace X)
|
|
8
|
+
*
|
|
9
|
+
* System headers (#include <...>) are not resolved to local files.
|
|
10
|
+
*/
|
|
11
|
+
export function interpretCppImport(captures) {
|
|
12
|
+
const source = captures['@import.source']?.text;
|
|
13
|
+
if (source === undefined)
|
|
14
|
+
return null;
|
|
15
|
+
// System headers are not resolved to local files
|
|
16
|
+
if (captures['@import.system'] !== undefined)
|
|
17
|
+
return null;
|
|
18
|
+
const kind = captures['@import.kind']?.text;
|
|
19
|
+
if (kind === 'named') {
|
|
20
|
+
// using X::name — named import
|
|
21
|
+
const importedName = captures['@import.name']?.text;
|
|
22
|
+
if (importedName === undefined)
|
|
23
|
+
return null;
|
|
24
|
+
return { kind: 'named', targetRaw: source, localName: importedName, importedName };
|
|
25
|
+
}
|
|
26
|
+
// #include or using namespace — wildcard import
|
|
27
|
+
return { kind: 'wildcard', targetRaw: source };
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* Interpret a C++ type-binding capture into a ParsedTypeBinding.
|
|
31
|
+
*
|
|
32
|
+
* Source classification (strongest → weakest):
|
|
33
|
+
* - `'parameter-annotation'` — function parameter type
|
|
34
|
+
* - `'annotation'` — explicit type declaration (`User user;`)
|
|
35
|
+
* - `'assignment-inferred'` — typed init (`User user = ...`)
|
|
36
|
+
* - `'constructor'` — constructor call (`auto u = User(...)` / `User{}`)
|
|
37
|
+
* - `'return'` — function return type
|
|
38
|
+
* - `'field'` — class field type
|
|
39
|
+
* - `'alias'` — `auto x = existingVar`
|
|
40
|
+
*/
|
|
41
|
+
export function interpretCppTypeBinding(captures) {
|
|
42
|
+
const name = captures['@type-binding.name']?.text;
|
|
43
|
+
const type = captures['@type-binding.type']?.text;
|
|
44
|
+
if (name === undefined || type === undefined)
|
|
45
|
+
return null;
|
|
46
|
+
let source = 'annotation';
|
|
47
|
+
if (captures['@type-binding.parameter'] !== undefined) {
|
|
48
|
+
source = 'parameter-annotation';
|
|
49
|
+
}
|
|
50
|
+
else if (captures['@type-binding.constructor'] !== undefined) {
|
|
51
|
+
source = 'constructor-inferred';
|
|
52
|
+
}
|
|
53
|
+
else if (captures['@type-binding.return'] !== undefined) {
|
|
54
|
+
source = 'return-annotation';
|
|
55
|
+
}
|
|
56
|
+
else if (captures['@type-binding.field'] !== undefined) {
|
|
57
|
+
// Field types are structurally equivalent to annotations — the type
|
|
58
|
+
// is explicitly written, not inferred.
|
|
59
|
+
source = 'annotation';
|
|
60
|
+
}
|
|
61
|
+
else if (captures['@type-binding.member-access'] !== undefined) {
|
|
62
|
+
// auto addr = user.address — the type is inferred from the member access.
|
|
63
|
+
// Synthesize a dotted rawName ("receiver.field") so compound-receiver
|
|
64
|
+
// can resolve the chain: look up receiver's class, then field's type.
|
|
65
|
+
const receiver = captures['@type-binding.member-access-receiver']?.text;
|
|
66
|
+
if (receiver !== undefined) {
|
|
67
|
+
return { boundName: name, rawTypeName: `${receiver}.${type}`, source: 'assignment-inferred' };
|
|
68
|
+
}
|
|
69
|
+
source = 'assignment-inferred';
|
|
70
|
+
}
|
|
71
|
+
else if (captures['@type-binding.alias'] !== undefined) {
|
|
72
|
+
// auto alias = existingVar — the type is inferred from the RHS variable.
|
|
73
|
+
source = 'assignment-inferred';
|
|
74
|
+
}
|
|
75
|
+
else if (captures['@type-binding.assignment'] !== undefined) {
|
|
76
|
+
source = 'assignment-inferred';
|
|
77
|
+
}
|
|
78
|
+
else if (captures['@type-binding.annotation'] !== undefined) {
|
|
79
|
+
source = 'annotation';
|
|
80
|
+
}
|
|
81
|
+
return { boundName: name, rawTypeName: normalizeCppTypeName(type), source };
|
|
82
|
+
}
|
|
83
|
+
/**
|
|
84
|
+
* Normalize a C++ type name: strip pointer/array/reference syntax,
|
|
85
|
+
* qualifiers, while preserving template arguments for specialization-aware
|
|
86
|
+
* receiver binding (`List<User>` vs `List<Order>`).
|
|
87
|
+
*
|
|
88
|
+
* Keeping template arguments here allows receiver-bound fallback to match
|
|
89
|
+
* specialization-specific class defs first; non-template behavior is preserved
|
|
90
|
+
* by base-name fallback in resolveClassBindingForName.
|
|
91
|
+
*/
|
|
92
|
+
export function normalizeCppTypeName(text) {
|
|
93
|
+
let t = text.trim();
|
|
94
|
+
// Strip const, volatile, restrict, static, extern, inline, mutable, constexpr
|
|
95
|
+
t = t
|
|
96
|
+
.replace(/\b(const|volatile|restrict|static|extern|inline|mutable|constexpr|consteval)\b/g, '')
|
|
97
|
+
.trim();
|
|
98
|
+
// Strip pointer stars
|
|
99
|
+
while (t.endsWith('*'))
|
|
100
|
+
t = t.slice(0, -1).trim();
|
|
101
|
+
while (t.startsWith('*'))
|
|
102
|
+
t = t.slice(1).trim();
|
|
103
|
+
// Strip reference markers
|
|
104
|
+
while (t.endsWith('&'))
|
|
105
|
+
t = t.slice(0, -1).trim();
|
|
106
|
+
// Strip array brackets
|
|
107
|
+
t = t.replace(/\[.*?\]/g, '').trim();
|
|
108
|
+
// Strip struct/union/enum/class prefixes
|
|
109
|
+
t = t.replace(/^(struct|union|enum|class)\s+/, '');
|
|
110
|
+
// Strip leading :: (global namespace qualifier)
|
|
111
|
+
t = t.replace(/^::/, '');
|
|
112
|
+
return t;
|
|
113
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { BindingRef } from '../../../../_shared/index.js';
|
|
2
|
+
/**
|
|
3
|
+
* C++ merge bindings: first-wins by tier.
|
|
4
|
+
*
|
|
5
|
+
* C++ tier precedence:
|
|
6
|
+
* local(0) > namespace(1) > import(2) > reexport(3) > wildcard(4)
|
|
7
|
+
*
|
|
8
|
+
* Unlike C (no namespaces), C++ uses the `namespace` tier for symbols
|
|
9
|
+
* brought in via `using namespace X;` that are then locally referenced.
|
|
10
|
+
* The tier ordering ensures local definitions shadow namespace imports,
|
|
11
|
+
* which in turn shadow wildcard #include imports.
|
|
12
|
+
*/
|
|
13
|
+
export declare function cppMergeBindings(existing: readonly BindingRef[], incoming: readonly BindingRef[], _scopeId: string): BindingRef[];
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
const TIER = {
|
|
2
|
+
local: 0,
|
|
3
|
+
namespace: 1,
|
|
4
|
+
import: 2,
|
|
5
|
+
reexport: 3,
|
|
6
|
+
wildcard: 4,
|
|
7
|
+
};
|
|
8
|
+
/**
|
|
9
|
+
* C++ merge bindings: first-wins by tier.
|
|
10
|
+
*
|
|
11
|
+
* C++ tier precedence:
|
|
12
|
+
* local(0) > namespace(1) > import(2) > reexport(3) > wildcard(4)
|
|
13
|
+
*
|
|
14
|
+
* Unlike C (no namespaces), C++ uses the `namespace` tier for symbols
|
|
15
|
+
* brought in via `using namespace X;` that are then locally referenced.
|
|
16
|
+
* The tier ordering ensures local definitions shadow namespace imports,
|
|
17
|
+
* which in turn shadow wildcard #include imports.
|
|
18
|
+
*/
|
|
19
|
+
export function cppMergeBindings(existing, incoming, _scopeId) {
|
|
20
|
+
const seen = new Set();
|
|
21
|
+
return [...existing, ...incoming]
|
|
22
|
+
.sort((a, b) => (TIER[a.origin] ?? 99) - (TIER[b.origin] ?? 99) || a.def.nodeId.localeCompare(b.def.nodeId))
|
|
23
|
+
.filter((binding) => {
|
|
24
|
+
if (seen.has(binding.def.nodeId))
|
|
25
|
+
return false;
|
|
26
|
+
seen.add(binding.def.nodeId);
|
|
27
|
+
return true;
|
|
28
|
+
});
|
|
29
|
+
}
|