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,195 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* C++ two-phase template lookup support.
|
|
3
|
+
*
|
|
4
|
+
* Inside a class template body, names from a dependent base class are NOT
|
|
5
|
+
* found by ordinary unqualified lookup. The standard requires the
|
|
6
|
+
* `this->name` or `Base<T>::name` forms to make the lookup dependent.
|
|
7
|
+
* GitNexus's global free-call fallback otherwise binds such names to the
|
|
8
|
+
* dependent base's members, producing CALLS edges the compiler would
|
|
9
|
+
* reject.
|
|
10
|
+
*
|
|
11
|
+
* This module records — during `emitCppScopeCaptures` — which template
|
|
12
|
+
* class declarations have which dependent base class names (per file).
|
|
13
|
+
* `populateCppDependentBases` then resolves those names to class nodeIds
|
|
14
|
+
* using a workspace-wide registry, building the per-class set the
|
|
15
|
+
* `isCppDependentBaseMember` predicate consumes.
|
|
16
|
+
*
|
|
17
|
+
* Cross-file resolution: `Base<T>` may be declared in a different header
|
|
18
|
+
* than `Derived<T>`. `populateCppDependentBases` therefore runs as a
|
|
19
|
+
* workspace-wide pass (`populateWorkspaceOwners` hook) after every file
|
|
20
|
+
* has had `populateOwners` applied, so all class defs are reachable.
|
|
21
|
+
*
|
|
22
|
+
* Namespace disambiguation: when multiple classes share a simple name
|
|
23
|
+
* (e.g., `Box` in two namespaces), the resolver prefers the candidate
|
|
24
|
+
* whose qualified-name prefix (namespace path) matches the deriving
|
|
25
|
+
* class's prefix. If no namespace match is found, a unique simple-name
|
|
26
|
+
* match is accepted; ambiguous matches (multiple candidates, no
|
|
27
|
+
* namespace winner) are skipped conservatively.
|
|
28
|
+
*
|
|
29
|
+
* NOTE: module-level state, single-process-single-repo use only.
|
|
30
|
+
* `clearFileLocalNames()` clears this state alongside file-local linkage
|
|
31
|
+
* (see `file-local-linkage.ts`).
|
|
32
|
+
*/
|
|
33
|
+
import { findEnclosingClassDef } from '../../scope-resolution/scope/walkers.js';
|
|
34
|
+
/**
|
|
35
|
+
* Capture-time record: for each template class declaration in a file,
|
|
36
|
+
* the simple names of its dependent base classes.
|
|
37
|
+
*
|
|
38
|
+
* Key: filePath
|
|
39
|
+
* Value: Map<className, Set<dependentBaseSimpleName>>
|
|
40
|
+
*/
|
|
41
|
+
const dependentBasesByFile = new Map();
|
|
42
|
+
/**
|
|
43
|
+
* Post-`populateOwners` resolution: per-class-nodeId, the set of
|
|
44
|
+
* dependent-base-class nodeIds. Built by `populateCppDependentBases`
|
|
45
|
+
* from `dependentBasesByFile` + the workspace registry.
|
|
46
|
+
*/
|
|
47
|
+
const dependentBaseNodeIds = new Map();
|
|
48
|
+
/**
|
|
49
|
+
* Record a dependent-base relationship discovered during scope-capture
|
|
50
|
+
* emission. `className` is the simple name of the template class;
|
|
51
|
+
* `baseName` is the simple name of the dependent base class.
|
|
52
|
+
*
|
|
53
|
+
* The capture-time recorder uses simple names because the registry
|
|
54
|
+
* resolution that maps names → nodeIds runs later (in
|
|
55
|
+
* `populateCppDependentBases`).
|
|
56
|
+
*/
|
|
57
|
+
export function markCppDependentBase(filePath, className, baseName) {
|
|
58
|
+
let perFile = dependentBasesByFile.get(filePath);
|
|
59
|
+
if (perFile === undefined) {
|
|
60
|
+
perFile = new Map();
|
|
61
|
+
dependentBasesByFile.set(filePath, perFile);
|
|
62
|
+
}
|
|
63
|
+
let bases = perFile.get(className);
|
|
64
|
+
if (bases === undefined) {
|
|
65
|
+
bases = new Set();
|
|
66
|
+
perFile.set(className, bases);
|
|
67
|
+
}
|
|
68
|
+
bases.add(baseName);
|
|
69
|
+
}
|
|
70
|
+
/** Clear two-phase-lookup state. Called from `clearFileLocalNames`. */
|
|
71
|
+
export function clearCppDependentBases() {
|
|
72
|
+
dependentBasesByFile.clear();
|
|
73
|
+
dependentBaseNodeIds.clear();
|
|
74
|
+
}
|
|
75
|
+
/**
|
|
76
|
+
* Resolve recorded dependent-base simple names to class nodeIds using a
|
|
77
|
+
* workspace-wide index. Run as `populateWorkspaceOwners` after every
|
|
78
|
+
* file has had `populateOwners` applied, so class defs from ALL files
|
|
79
|
+
* are reachable.
|
|
80
|
+
*
|
|
81
|
+
* Disambiguation strategy (multiple classes sharing a simple name):
|
|
82
|
+
* 1. Prefer the candidate whose qualified-name namespace prefix matches
|
|
83
|
+
* the deriving class's namespace prefix (same-namespace bias).
|
|
84
|
+
* 2. Fall back to accepting a unique simple-name match.
|
|
85
|
+
* 3. Skip when multiple candidates exist and no namespace match is
|
|
86
|
+
* found (conservative: avoids false associations).
|
|
87
|
+
*/
|
|
88
|
+
export function populateCppDependentBases(parsedFiles) {
|
|
89
|
+
if (dependentBasesByFile.size === 0)
|
|
90
|
+
return;
|
|
91
|
+
// Build workspace-wide index: simpleName → {nodeId, nsPrefix}[]
|
|
92
|
+
// nsPrefix is the dot-joined namespace path (qualifiedName without the
|
|
93
|
+
// last segment). Classes at global scope have nsPrefix = ''.
|
|
94
|
+
const classesBySimpleName = new Map();
|
|
95
|
+
for (const parsed of parsedFiles) {
|
|
96
|
+
for (const def of parsed.localDefs) {
|
|
97
|
+
if (def.type !== 'Class' && def.type !== 'Struct' && def.type !== 'Interface')
|
|
98
|
+
continue;
|
|
99
|
+
const qn = def.qualifiedName ?? '';
|
|
100
|
+
const lastDot = qn.lastIndexOf('.');
|
|
101
|
+
const simple = lastDot >= 0 ? qn.slice(lastDot + 1) : qn;
|
|
102
|
+
if (simple === '')
|
|
103
|
+
continue;
|
|
104
|
+
const nsPrefix = lastDot >= 0 ? qn.slice(0, lastDot) : '';
|
|
105
|
+
let entries = classesBySimpleName.get(simple);
|
|
106
|
+
if (entries === undefined) {
|
|
107
|
+
entries = [];
|
|
108
|
+
classesBySimpleName.set(simple, entries);
|
|
109
|
+
}
|
|
110
|
+
entries.push({ nodeId: def.nodeId, nsPrefix });
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
// Build a filePath → ParsedFile lookup for fast per-file access.
|
|
114
|
+
const parsedByFile = new Map();
|
|
115
|
+
for (const parsed of parsedFiles)
|
|
116
|
+
parsedByFile.set(parsed.filePath, parsed);
|
|
117
|
+
for (const [filePath, perFile] of dependentBasesByFile) {
|
|
118
|
+
const parsed = parsedByFile.get(filePath);
|
|
119
|
+
if (parsed === undefined)
|
|
120
|
+
continue;
|
|
121
|
+
// Build a simple-name → {nodeId, nsPrefix} map for THIS file's
|
|
122
|
+
// class-like defs so we can identify each template class precisely
|
|
123
|
+
// (avoids cross-file name collisions for the deriving class itself).
|
|
124
|
+
const localClassByName = new Map();
|
|
125
|
+
for (const def of parsed.localDefs) {
|
|
126
|
+
if (def.type !== 'Class' && def.type !== 'Struct' && def.type !== 'Interface')
|
|
127
|
+
continue;
|
|
128
|
+
const qn = def.qualifiedName ?? '';
|
|
129
|
+
const lastDot = qn.lastIndexOf('.');
|
|
130
|
+
const simple = lastDot >= 0 ? qn.slice(lastDot + 1) : qn;
|
|
131
|
+
if (simple === '')
|
|
132
|
+
continue;
|
|
133
|
+
const nsPrefix = lastDot >= 0 ? qn.slice(0, lastDot) : '';
|
|
134
|
+
localClassByName.set(simple, { nodeId: def.nodeId, nsPrefix });
|
|
135
|
+
}
|
|
136
|
+
for (const [className, baseNames] of perFile) {
|
|
137
|
+
const classEntry = localClassByName.get(className);
|
|
138
|
+
if (classEntry === undefined)
|
|
139
|
+
continue;
|
|
140
|
+
let bases = dependentBaseNodeIds.get(classEntry.nodeId);
|
|
141
|
+
if (bases === undefined) {
|
|
142
|
+
bases = new Set();
|
|
143
|
+
dependentBaseNodeIds.set(classEntry.nodeId, bases);
|
|
144
|
+
}
|
|
145
|
+
for (const baseName of baseNames) {
|
|
146
|
+
const candidates = classesBySimpleName.get(baseName);
|
|
147
|
+
if (candidates === undefined || candidates.length === 0)
|
|
148
|
+
continue;
|
|
149
|
+
if (candidates.length === 1) {
|
|
150
|
+
// Unique simple-name match — accept regardless of namespace.
|
|
151
|
+
bases.add(candidates[0].nodeId);
|
|
152
|
+
continue;
|
|
153
|
+
}
|
|
154
|
+
// Multiple classes share the same simple name — prefer the one
|
|
155
|
+
// whose namespace matches the deriving class's namespace.
|
|
156
|
+
// V1: exact dot-prefix match only. Cross-namespace inheritance
|
|
157
|
+
// (e.g., `ns::outer::Derived` extending bare `Inner` defined in
|
|
158
|
+
// `ns::outer::inner`) and inline-namespace cases are deferred to
|
|
159
|
+
// V2; the conservative skip-on-ambiguity below avoids false
|
|
160
|
+
// associations in those edge cases.
|
|
161
|
+
const nsMatch = candidates.find((c) => c.nsPrefix === classEntry.nsPrefix);
|
|
162
|
+
if (nsMatch !== undefined) {
|
|
163
|
+
bases.add(nsMatch.nodeId);
|
|
164
|
+
}
|
|
165
|
+
// else: ambiguous (multiple candidates, no namespace match) → skip.
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
}
|
|
170
|
+
/**
|
|
171
|
+
* Two-phase lookup predicate: is the candidate def a member of a
|
|
172
|
+
* dependent base of the caller's enclosing template class?
|
|
173
|
+
*
|
|
174
|
+
* Used as an additional reject-filter in `pickUniqueGlobalCallable` and
|
|
175
|
+
* the receiver-bound member chain walk. ONLY apply for unqualified
|
|
176
|
+
* call forms — `this->name` and `Base<T>::name` are dependent lookup
|
|
177
|
+
* forms that the standard allows.
|
|
178
|
+
*
|
|
179
|
+
* Conservative bias: when the caller's enclosing class can't be
|
|
180
|
+
* identified, return `false` (let normal resolution proceed). Over-
|
|
181
|
+
* rejection is acceptable for the template case because the standard
|
|
182
|
+
* itself requires `this->` or qualified forms for dependent base
|
|
183
|
+
* access; missing edges here match the compiler's diagnostic shape.
|
|
184
|
+
*/
|
|
185
|
+
export function isCppDependentBaseMember(callerScopeId, candidateDef, scopes) {
|
|
186
|
+
if (candidateDef.ownerId === undefined)
|
|
187
|
+
return false;
|
|
188
|
+
const enclosing = findEnclosingClassDef(callerScopeId, scopes);
|
|
189
|
+
if (enclosing === undefined)
|
|
190
|
+
return false;
|
|
191
|
+
const bases = dependentBaseNodeIds.get(enclosing.nodeId);
|
|
192
|
+
if (bases === undefined)
|
|
193
|
+
return false;
|
|
194
|
+
return bases.has(candidateDef.ownerId);
|
|
195
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Extract Java arity metadata from a method-like tree-sitter node —
|
|
3
|
+
* `method_declaration` or `constructor_declaration`.
|
|
4
|
+
*
|
|
5
|
+
* Reuses `javaMethodConfig.extractParameters` so scope-extracted defs
|
|
6
|
+
* carry the same arity semantics as the legacy parse-worker path:
|
|
7
|
+
* - varargs (`...`) collapses `parameterCount` to `undefined`
|
|
8
|
+
* - `parameterTypes` collects declared type names; a literal
|
|
9
|
+
* `'varargs'` marker is appended for variadic methods so
|
|
10
|
+
* `javaArityCompatibility` can detect them.
|
|
11
|
+
*/
|
|
12
|
+
import type { SyntaxNode } from '../../utils/ast-helpers.js';
|
|
13
|
+
export interface JavaArityMetadata {
|
|
14
|
+
readonly parameterCount: number | undefined;
|
|
15
|
+
readonly requiredParameterCount: number | undefined;
|
|
16
|
+
readonly parameterTypes: readonly string[] | undefined;
|
|
17
|
+
}
|
|
18
|
+
export declare function computeJavaArityMetadata(fnNode: SyntaxNode): JavaArityMetadata;
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Extract Java arity metadata from a method-like tree-sitter node —
|
|
3
|
+
* `method_declaration` or `constructor_declaration`.
|
|
4
|
+
*
|
|
5
|
+
* Reuses `javaMethodConfig.extractParameters` so scope-extracted defs
|
|
6
|
+
* carry the same arity semantics as the legacy parse-worker path:
|
|
7
|
+
* - varargs (`...`) collapses `parameterCount` to `undefined`
|
|
8
|
+
* - `parameterTypes` collects declared type names; a literal
|
|
9
|
+
* `'varargs'` marker is appended for variadic methods so
|
|
10
|
+
* `javaArityCompatibility` can detect them.
|
|
11
|
+
*/
|
|
12
|
+
import { javaMethodConfig } from '../../method-extractors/configs/jvm.js';
|
|
13
|
+
export function computeJavaArityMetadata(fnNode) {
|
|
14
|
+
const params = javaMethodConfig.extractParameters?.(fnNode) ?? [];
|
|
15
|
+
let hasVariadic = false;
|
|
16
|
+
const types = [];
|
|
17
|
+
for (const p of params) {
|
|
18
|
+
if (p.isVariadic)
|
|
19
|
+
hasVariadic = true;
|
|
20
|
+
if (p.type !== null)
|
|
21
|
+
types.push(p.type);
|
|
22
|
+
}
|
|
23
|
+
if (hasVariadic)
|
|
24
|
+
types.push('varargs');
|
|
25
|
+
const total = params.length;
|
|
26
|
+
// For varargs methods, `parameterCount` (max) is unknown — any number of
|
|
27
|
+
// trailing arguments is valid. But the fixed-prefix parameters (everything
|
|
28
|
+
// before the variadic `...` param) are still required, so we preserve that
|
|
29
|
+
// count in `requiredParameterCount` so `javaArityCompatibility` can reject
|
|
30
|
+
// calls that undersupply the fixed prefix (e.g. `f(int x, String... args)`
|
|
31
|
+
// called with 0 args).
|
|
32
|
+
const fixedCount = params.filter((p) => !p.isVariadic).length;
|
|
33
|
+
const parameterCount = hasVariadic ? undefined : total;
|
|
34
|
+
const requiredParameterCount = hasVariadic ? fixedCount : total;
|
|
35
|
+
return {
|
|
36
|
+
parameterCount,
|
|
37
|
+
requiredParameterCount,
|
|
38
|
+
parameterTypes: types.length > 0 ? types : undefined,
|
|
39
|
+
};
|
|
40
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Java arity check, accommodating varargs (`...`).
|
|
3
|
+
*
|
|
4
|
+
* Verdicts:
|
|
5
|
+
* - `'compatible'` — argCount matches parameterCount, OR varargs present.
|
|
6
|
+
* - `'incompatible'` — argCount mismatches with no varargs.
|
|
7
|
+
* - `'unknown'` — metadata absent / incomplete.
|
|
8
|
+
*/
|
|
9
|
+
import type { Callsite, SymbolDefinition } from '../../../../_shared/index.js';
|
|
10
|
+
export declare function javaArityCompatibility(def: SymbolDefinition, callsite: Callsite): 'compatible' | 'unknown' | 'incompatible';
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Java arity check, accommodating varargs (`...`).
|
|
3
|
+
*
|
|
4
|
+
* Verdicts:
|
|
5
|
+
* - `'compatible'` — argCount matches parameterCount, OR varargs present.
|
|
6
|
+
* - `'incompatible'` — argCount mismatches with no varargs.
|
|
7
|
+
* - `'unknown'` — metadata absent / incomplete.
|
|
8
|
+
*/
|
|
9
|
+
export function javaArityCompatibility(def, callsite) {
|
|
10
|
+
const max = def.parameterCount;
|
|
11
|
+
const min = def.requiredParameterCount;
|
|
12
|
+
if (max === undefined && min === undefined)
|
|
13
|
+
return 'unknown';
|
|
14
|
+
const argCount = callsite.arity;
|
|
15
|
+
if (!Number.isFinite(argCount) || argCount < 0)
|
|
16
|
+
return 'unknown';
|
|
17
|
+
const hasVarArgs = def.parameterTypes !== undefined &&
|
|
18
|
+
def.parameterTypes.some((t) => t === 'varargs' || t.includes('...'));
|
|
19
|
+
if (min !== undefined && argCount < min)
|
|
20
|
+
return 'incompatible';
|
|
21
|
+
if (max !== undefined && argCount > max && !hasVarArgs)
|
|
22
|
+
return 'incompatible';
|
|
23
|
+
return 'compatible';
|
|
24
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Dev-mode counters for the cross-phase scope-captures parse cache
|
|
3
|
+
* (Java mirror of `languages/csharp/cache-stats.ts`).
|
|
4
|
+
*
|
|
5
|
+
* Gated by `PROF_SCOPE_RESOLUTION=1`. Production builds fold every
|
|
6
|
+
* increment into dead code via the module-level `PROF` constant, so
|
|
7
|
+
* the hot path in `captures.ts` stays branch-free.
|
|
8
|
+
*/
|
|
9
|
+
export declare function recordCacheHit(): void;
|
|
10
|
+
export declare function recordCacheMiss(): void;
|
|
11
|
+
export declare function getJavaCaptureCacheStats(): {
|
|
12
|
+
hits: number;
|
|
13
|
+
misses: number;
|
|
14
|
+
};
|
|
15
|
+
export declare function resetJavaCaptureCacheStats(): void;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Dev-mode counters for the cross-phase scope-captures parse cache
|
|
3
|
+
* (Java mirror of `languages/csharp/cache-stats.ts`).
|
|
4
|
+
*
|
|
5
|
+
* Gated by `PROF_SCOPE_RESOLUTION=1`. Production builds fold every
|
|
6
|
+
* increment into dead code via the module-level `PROF` constant, so
|
|
7
|
+
* the hot path in `captures.ts` stays branch-free.
|
|
8
|
+
*/
|
|
9
|
+
const PROF = process.env.PROF_SCOPE_RESOLUTION === '1';
|
|
10
|
+
let CACHE_HITS = 0;
|
|
11
|
+
let CACHE_MISSES = 0;
|
|
12
|
+
export function recordCacheHit() {
|
|
13
|
+
if (PROF)
|
|
14
|
+
CACHE_HITS++;
|
|
15
|
+
}
|
|
16
|
+
export function recordCacheMiss() {
|
|
17
|
+
if (PROF)
|
|
18
|
+
CACHE_MISSES++;
|
|
19
|
+
}
|
|
20
|
+
export function getJavaCaptureCacheStats() {
|
|
21
|
+
return { hits: CACHE_HITS, misses: CACHE_MISSES };
|
|
22
|
+
}
|
|
23
|
+
export function resetJavaCaptureCacheStats() {
|
|
24
|
+
CACHE_HITS = 0;
|
|
25
|
+
CACHE_MISSES = 0;
|
|
26
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `emitScopeCaptures` for Java.
|
|
3
|
+
*
|
|
4
|
+
* Drives the Java scope query against tree-sitter-java and groups raw
|
|
5
|
+
* matches into `CaptureMatch[]` for the central extractor. Layers:
|
|
6
|
+
*
|
|
7
|
+
* 1. **Decomposed import declarations** — each `import_declaration`
|
|
8
|
+
* is re-emitted with `@import.kind/source/name` markers.
|
|
9
|
+
* 2. **Receiver binding synthesis** — `this`/`super` type-bindings
|
|
10
|
+
* on instance methods.
|
|
11
|
+
* 3. **Arity metadata** on method/constructor declarations.
|
|
12
|
+
* 4. **Reference arity** on call sites.
|
|
13
|
+
*
|
|
14
|
+
* Pure given the input source text. No I/O, no globals consulted.
|
|
15
|
+
*/
|
|
16
|
+
import type { CaptureMatch } from '../../../../_shared/index.js';
|
|
17
|
+
export declare function emitJavaScopeCaptures(sourceText: string, _filePath: string, cachedTree?: unknown): readonly CaptureMatch[];
|
|
@@ -0,0 +1,187 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `emitScopeCaptures` for Java.
|
|
3
|
+
*
|
|
4
|
+
* Drives the Java scope query against tree-sitter-java and groups raw
|
|
5
|
+
* matches into `CaptureMatch[]` for the central extractor. Layers:
|
|
6
|
+
*
|
|
7
|
+
* 1. **Decomposed import declarations** — each `import_declaration`
|
|
8
|
+
* is re-emitted with `@import.kind/source/name` markers.
|
|
9
|
+
* 2. **Receiver binding synthesis** — `this`/`super` type-bindings
|
|
10
|
+
* on instance methods.
|
|
11
|
+
* 3. **Arity metadata** on method/constructor declarations.
|
|
12
|
+
* 4. **Reference arity** on call sites.
|
|
13
|
+
*
|
|
14
|
+
* Pure given the input source text. No I/O, no globals consulted.
|
|
15
|
+
*/
|
|
16
|
+
import { findNodeAtRange, nodeToCapture, syntheticCapture } from '../../utils/ast-helpers.js';
|
|
17
|
+
import { splitImportDeclaration } from './import-decomposer.js';
|
|
18
|
+
import { computeJavaArityMetadata } from './arity-metadata.js';
|
|
19
|
+
import { synthesizeJavaReceiverBinding } from './receiver-binding.js';
|
|
20
|
+
import { getJavaParser, getJavaScopeQuery } from './query.js';
|
|
21
|
+
import { recordCacheHit, recordCacheMiss } from './cache-stats.js';
|
|
22
|
+
import { getTreeSitterBufferSize } from '../../constants.js';
|
|
23
|
+
import { parseSourceSafe } from '../../../tree-sitter/safe-parse.js';
|
|
24
|
+
/** Declaration anchors that carry function-like arity metadata. */
|
|
25
|
+
const FUNCTION_DECL_TAGS = ['@declaration.method', '@declaration.constructor'];
|
|
26
|
+
/** tree-sitter-java node types that the method extractor accepts. */
|
|
27
|
+
const FUNCTION_NODE_TYPES = ['method_declaration', 'constructor_declaration'];
|
|
28
|
+
/** Suppress read.member emissions when the field_access is already
|
|
29
|
+
* covered by a method_invocation (object of a call) or an
|
|
30
|
+
* assignment_expression (write target). */
|
|
31
|
+
function shouldEmitReadMember(memberNode) {
|
|
32
|
+
const parent = memberNode.parent;
|
|
33
|
+
if (parent === null)
|
|
34
|
+
return true;
|
|
35
|
+
switch (parent.type) {
|
|
36
|
+
case 'method_invocation':
|
|
37
|
+
// Don't emit read.member when the field_access is the object of a method_invocation
|
|
38
|
+
// (the method call already handles this relationship)
|
|
39
|
+
return parent.childForFieldName('object')?.id !== memberNode.id;
|
|
40
|
+
case 'assignment_expression':
|
|
41
|
+
return parent.childForFieldName('left')?.id !== memberNode.id;
|
|
42
|
+
default:
|
|
43
|
+
return true;
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
export function emitJavaScopeCaptures(sourceText, _filePath, cachedTree) {
|
|
47
|
+
let tree = cachedTree;
|
|
48
|
+
if (tree === undefined) {
|
|
49
|
+
tree = parseSourceSafe(getJavaParser(), sourceText, undefined, {
|
|
50
|
+
bufferSize: getTreeSitterBufferSize(sourceText),
|
|
51
|
+
});
|
|
52
|
+
recordCacheMiss();
|
|
53
|
+
}
|
|
54
|
+
else {
|
|
55
|
+
recordCacheHit();
|
|
56
|
+
}
|
|
57
|
+
const rawMatches = getJavaScopeQuery().matches(tree.rootNode);
|
|
58
|
+
const out = [];
|
|
59
|
+
for (const m of rawMatches) {
|
|
60
|
+
const grouped = {};
|
|
61
|
+
for (const c of m.captures) {
|
|
62
|
+
const tag = '@' + c.name;
|
|
63
|
+
grouped[tag] = nodeToCapture(tag, c.node);
|
|
64
|
+
}
|
|
65
|
+
if (Object.keys(grouped).length === 0)
|
|
66
|
+
continue;
|
|
67
|
+
// Decompose each `import_declaration`.
|
|
68
|
+
if (grouped['@import.statement'] !== undefined) {
|
|
69
|
+
const stmtCapture = grouped['@import.statement'];
|
|
70
|
+
const stmtNode = findNodeAtRange(tree.rootNode, stmtCapture.range, 'import_declaration');
|
|
71
|
+
if (stmtNode !== null) {
|
|
72
|
+
const decomposed = splitImportDeclaration(stmtNode);
|
|
73
|
+
if (decomposed !== null) {
|
|
74
|
+
out.push(decomposed);
|
|
75
|
+
continue;
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
out.push(grouped);
|
|
79
|
+
continue;
|
|
80
|
+
}
|
|
81
|
+
// Skip free-call matches that are actually member calls. The query
|
|
82
|
+
// matches ALL method_invocations as @reference.call.free (without
|
|
83
|
+
// negation) because tree-sitter-java's query engine drops !object
|
|
84
|
+
// patterns when a positive object: pattern exists for the same node
|
|
85
|
+
// type. Filter here: if the match has @reference.call.free but also
|
|
86
|
+
// has @reference.receiver, it's a member call — skip the free match
|
|
87
|
+
// (the separate @reference.call.member match covers it).
|
|
88
|
+
if (grouped['@reference.call.free'] !== undefined &&
|
|
89
|
+
grouped['@reference.receiver'] !== undefined) {
|
|
90
|
+
continue;
|
|
91
|
+
}
|
|
92
|
+
// Filter read.member when it's a child of method_invocation or assignment.
|
|
93
|
+
if (grouped['@reference.read.member'] !== undefined) {
|
|
94
|
+
const anchor = grouped['@reference.read.member'];
|
|
95
|
+
const memberNode = findNodeAtRange(tree.rootNode, anchor.range, 'field_access');
|
|
96
|
+
if (memberNode === null || !shouldEmitReadMember(memberNode)) {
|
|
97
|
+
continue;
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
// Synthesize `this` / `super` receiver type-bindings on every
|
|
101
|
+
// instance method-like.
|
|
102
|
+
if (grouped['@scope.function'] !== undefined) {
|
|
103
|
+
out.push(grouped);
|
|
104
|
+
const anchor = grouped['@scope.function'];
|
|
105
|
+
const fnNode = findFunctionNode(tree.rootNode, anchor.range);
|
|
106
|
+
if (fnNode !== null) {
|
|
107
|
+
for (const synth of synthesizeJavaReceiverBinding(fnNode)) {
|
|
108
|
+
out.push(synth);
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
continue;
|
|
112
|
+
}
|
|
113
|
+
// Synthesize arity metadata on function-like declarations.
|
|
114
|
+
const declTag = FUNCTION_DECL_TAGS.find((t) => grouped[t] !== undefined);
|
|
115
|
+
if (declTag !== undefined) {
|
|
116
|
+
const anchor = grouped[declTag];
|
|
117
|
+
const fnNode = findFunctionNode(tree.rootNode, anchor.range);
|
|
118
|
+
if (fnNode !== null) {
|
|
119
|
+
const arity = computeJavaArityMetadata(fnNode);
|
|
120
|
+
if (arity.parameterCount !== undefined) {
|
|
121
|
+
grouped['@declaration.parameter-count'] = syntheticCapture('@declaration.parameter-count', fnNode, String(arity.parameterCount));
|
|
122
|
+
}
|
|
123
|
+
if (arity.requiredParameterCount !== undefined) {
|
|
124
|
+
grouped['@declaration.required-parameter-count'] = syntheticCapture('@declaration.required-parameter-count', fnNode, String(arity.requiredParameterCount));
|
|
125
|
+
}
|
|
126
|
+
if (arity.parameterTypes !== undefined) {
|
|
127
|
+
grouped['@declaration.parameter-types'] = syntheticCapture('@declaration.parameter-types', fnNode, JSON.stringify(arity.parameterTypes));
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
// Synthesize `@reference.arity` on every callsite.
|
|
132
|
+
const callTag = ['@reference.call.free', '@reference.call.member', '@reference.call.constructor'].find((t) => grouped[t] !== undefined);
|
|
133
|
+
if (callTag !== undefined && grouped['@reference.arity'] === undefined) {
|
|
134
|
+
const anchor = grouped[callTag];
|
|
135
|
+
const callNode = findNodeAtRange(tree.rootNode, anchor.range, 'method_invocation') ??
|
|
136
|
+
findNodeAtRange(tree.rootNode, anchor.range, 'object_creation_expression');
|
|
137
|
+
if (callNode !== null) {
|
|
138
|
+
const argList = callNode.childForFieldName('arguments');
|
|
139
|
+
const args = argList === null
|
|
140
|
+
? []
|
|
141
|
+
: argList.namedChildren.filter((c) => c !== null && c.type !== 'comment');
|
|
142
|
+
grouped['@reference.arity'] = syntheticCapture('@reference.arity', callNode, String(args.length));
|
|
143
|
+
const argTypes = args.map((arg) => inferArgType(arg));
|
|
144
|
+
grouped['@reference.parameter-types'] = syntheticCapture('@reference.parameter-types', callNode, JSON.stringify(argTypes));
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
out.push(grouped);
|
|
148
|
+
}
|
|
149
|
+
return out;
|
|
150
|
+
}
|
|
151
|
+
/** Infer a Java argument's static type from literal patterns. */
|
|
152
|
+
function inferArgType(argNode) {
|
|
153
|
+
switch (argNode.type) {
|
|
154
|
+
case 'decimal_integer_literal':
|
|
155
|
+
case 'hex_integer_literal':
|
|
156
|
+
case 'octal_integer_literal':
|
|
157
|
+
case 'binary_integer_literal':
|
|
158
|
+
return 'int';
|
|
159
|
+
case 'decimal_floating_point_literal':
|
|
160
|
+
case 'hex_floating_point_literal':
|
|
161
|
+
return 'double';
|
|
162
|
+
case 'string_literal':
|
|
163
|
+
return 'String';
|
|
164
|
+
case 'character_literal':
|
|
165
|
+
return 'char';
|
|
166
|
+
case 'true':
|
|
167
|
+
case 'false':
|
|
168
|
+
return 'boolean';
|
|
169
|
+
case 'null_literal':
|
|
170
|
+
return 'null';
|
|
171
|
+
case 'object_creation_expression': {
|
|
172
|
+
const typeNode = argNode.childForFieldName('type');
|
|
173
|
+
return typeNode?.text ?? '';
|
|
174
|
+
}
|
|
175
|
+
default:
|
|
176
|
+
return '';
|
|
177
|
+
}
|
|
178
|
+
}
|
|
179
|
+
/** Find the first Java function-like node at the given range. */
|
|
180
|
+
function findFunctionNode(rootNode, range) {
|
|
181
|
+
for (const nodeType of FUNCTION_NODE_TYPES) {
|
|
182
|
+
const n = findNodeAtRange(rootNode, range, nodeType);
|
|
183
|
+
if (n !== null)
|
|
184
|
+
return n;
|
|
185
|
+
}
|
|
186
|
+
return null;
|
|
187
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Decompose a Java `import_declaration` into a `CaptureMatch` carrying
|
|
3
|
+
* the synthesized markers `@import.kind` / `@import.source` /
|
|
4
|
+
* `@import.name` that `interpretJavaImport` consumes.
|
|
5
|
+
*
|
|
6
|
+
* Unlike C#'s using-directive decomposer, Java has four import forms:
|
|
7
|
+
*
|
|
8
|
+
* import com.example.User; → named
|
|
9
|
+
* import com.example.*; → wildcard
|
|
10
|
+
* import static com.example.Utils.format; → static
|
|
11
|
+
* import static com.example.Utils.*; → static-wildcard
|
|
12
|
+
*
|
|
13
|
+
* Each produces exactly one import. The decomposer inspects the raw
|
|
14
|
+
* source text and tree-sitter children to determine the flavor.
|
|
15
|
+
*/
|
|
16
|
+
import type { CaptureMatch } from '../../../../_shared/index.js';
|
|
17
|
+
import { type SyntaxNode } from '../../utils/ast-helpers.js';
|
|
18
|
+
export declare function splitImportDeclaration(stmtNode: SyntaxNode): CaptureMatch | null;
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Decompose a Java `import_declaration` into a `CaptureMatch` carrying
|
|
3
|
+
* the synthesized markers `@import.kind` / `@import.source` /
|
|
4
|
+
* `@import.name` that `interpretJavaImport` consumes.
|
|
5
|
+
*
|
|
6
|
+
* Unlike C#'s using-directive decomposer, Java has four import forms:
|
|
7
|
+
*
|
|
8
|
+
* import com.example.User; → named
|
|
9
|
+
* import com.example.*; → wildcard
|
|
10
|
+
* import static com.example.Utils.format; → static
|
|
11
|
+
* import static com.example.Utils.*; → static-wildcard
|
|
12
|
+
*
|
|
13
|
+
* Each produces exactly one import. The decomposer inspects the raw
|
|
14
|
+
* source text and tree-sitter children to determine the flavor.
|
|
15
|
+
*/
|
|
16
|
+
import { nodeToCapture, syntheticCapture } from '../../utils/ast-helpers.js';
|
|
17
|
+
export function splitImportDeclaration(stmtNode) {
|
|
18
|
+
if (stmtNode.type !== 'import_declaration')
|
|
19
|
+
return null;
|
|
20
|
+
const spec = parseImportDeclaration(stmtNode);
|
|
21
|
+
if (spec === null)
|
|
22
|
+
return null;
|
|
23
|
+
return buildImportMatch(stmtNode, spec);
|
|
24
|
+
}
|
|
25
|
+
function parseImportDeclaration(node) {
|
|
26
|
+
// Detect `static` by checking for an anonymous `static` token child.
|
|
27
|
+
let isStatic = false;
|
|
28
|
+
for (let i = 0; i < node.childCount; i++) {
|
|
29
|
+
const child = node.child(i);
|
|
30
|
+
if (child !== null && child.type === 'static') {
|
|
31
|
+
isStatic = true;
|
|
32
|
+
break;
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
// Detect wildcard by checking for `asterisk` named child.
|
|
36
|
+
let isWildcard = false;
|
|
37
|
+
for (let i = 0; i < node.namedChildCount; i++) {
|
|
38
|
+
const child = node.namedChild(i);
|
|
39
|
+
if (child !== null && child.type === 'asterisk') {
|
|
40
|
+
isWildcard = true;
|
|
41
|
+
break;
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
// Find the scoped_identifier (or identifier for single-segment imports).
|
|
45
|
+
let pathNode = null;
|
|
46
|
+
for (let i = 0; i < node.namedChildCount; i++) {
|
|
47
|
+
const child = node.namedChild(i);
|
|
48
|
+
if (child !== null && (child.type === 'scoped_identifier' || child.type === 'identifier')) {
|
|
49
|
+
pathNode = child;
|
|
50
|
+
break;
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
if (pathNode === null)
|
|
54
|
+
return null;
|
|
55
|
+
const fullPath = pathNode.text;
|
|
56
|
+
if (fullPath === '')
|
|
57
|
+
return null;
|
|
58
|
+
if (isStatic && isWildcard) {
|
|
59
|
+
// `import static com.example.Utils.*;`
|
|
60
|
+
return { kind: 'static-wildcard', source: fullPath, name: '*', atNode: node };
|
|
61
|
+
}
|
|
62
|
+
if (isStatic) {
|
|
63
|
+
// `import static com.example.Utils.format;`
|
|
64
|
+
const lastDot = fullPath.lastIndexOf('.');
|
|
65
|
+
const name = lastDot >= 0 ? fullPath.slice(lastDot + 1) : fullPath;
|
|
66
|
+
return { kind: 'static', source: fullPath, name, atNode: node };
|
|
67
|
+
}
|
|
68
|
+
if (isWildcard) {
|
|
69
|
+
// `import com.example.*;`
|
|
70
|
+
return { kind: 'wildcard', source: fullPath, name: '*', atNode: node };
|
|
71
|
+
}
|
|
72
|
+
// `import com.example.User;`
|
|
73
|
+
const lastDot = fullPath.lastIndexOf('.');
|
|
74
|
+
const name = lastDot >= 0 ? fullPath.slice(lastDot + 1) : fullPath;
|
|
75
|
+
return { kind: 'named', source: fullPath, name, atNode: node };
|
|
76
|
+
}
|
|
77
|
+
function buildImportMatch(stmtNode, spec) {
|
|
78
|
+
const m = {
|
|
79
|
+
'@import.statement': nodeToCapture('@import.statement', stmtNode),
|
|
80
|
+
'@import.kind': syntheticCapture('@import.kind', spec.atNode, spec.kind),
|
|
81
|
+
'@import.source': syntheticCapture('@import.source', spec.atNode, spec.source),
|
|
82
|
+
'@import.name': syntheticCapture('@import.name', spec.atNode, spec.name),
|
|
83
|
+
};
|
|
84
|
+
return m;
|
|
85
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Adapter from `(ParsedImport, WorkspaceIndex)` → concrete file path.
|
|
3
|
+
*
|
|
4
|
+
* Converts Java package paths (dots → slashes) and tries:
|
|
5
|
+
* 1. Exact file match: `com/example/User.java`
|
|
6
|
+
* 2. Suffix match for nested layouts
|
|
7
|
+
* 3. Directory match (wildcard imports)
|
|
8
|
+
* 4. Progressive prefix stripping for non-standard layouts
|
|
9
|
+
*
|
|
10
|
+
* Returns `null` for unresolvable / JDK imports.
|
|
11
|
+
*/
|
|
12
|
+
import type { ParsedImport, WorkspaceIndex } from '../../../../_shared/index.js';
|
|
13
|
+
export interface JavaResolveContext {
|
|
14
|
+
readonly fromFile: string;
|
|
15
|
+
readonly allFilePaths: ReadonlySet<string>;
|
|
16
|
+
}
|
|
17
|
+
export declare function resolveJavaImportTarget(parsedImport: ParsedImport, workspaceIndex: WorkspaceIndex): string | null;
|