zidane-gui 7.2.5 → 8.0.4
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/out/main/chunks/remote-hosts-CdVisI0d.js +69 -0
- package/out/main/chunks/{usage-sql-BdDLRz11.js → usage-sql-CqAEudo_.js} +2 -3
- package/out/main/index.js +8985 -3124
- package/out/main/lsp-host.js +66 -2
- package/out/main/usage-worker.js +1 -1
- package/out/preload/index.mjs +188 -18
- package/out/renderer/assets/SymbolsNerdFontMono-Regular-aK5vsLov.woff2 +0 -0
- package/out/renderer/assets/__vite-browser-external-2447137e-DYxpcVy9.js +4 -0
- package/out/renderer/assets/abap-CP7sauhU.js +7 -0
- package/out/renderer/assets/actionscript-3-C2Q-pNj-.js +7 -0
- package/out/renderer/assets/actionscript-3-XzMDKpbw.js +7 -0
- package/out/renderer/assets/{ada-BZS802Se.js → ada-BygE0u4b.js} +1 -1
- package/out/renderer/assets/ada-MjpOMhHS.js +7 -0
- package/out/renderer/assets/ahk-8PrdkPpN.js +7 -0
- package/out/renderer/assets/ahk-BMkQhlCC.js +7 -0
- package/out/renderer/assets/ahk2-CcfgwDsZ.js +7 -0
- package/out/renderer/assets/ahk2-WYNXiRg-.js +7 -0
- package/out/renderer/assets/andromeeda-BGwBKBlu.js +4 -0
- package/out/renderer/assets/{angular-html-CegnDNeO.js → angular-html-DuB66kSz.js} +6 -6
- package/out/renderer/assets/angular-html-Dxc9Z6vk.js +42 -0
- package/out/renderer/assets/angular-ts-CkZeFPmS.js +29 -0
- package/out/renderer/assets/{angular-ts-CgWhMm89.js → angular-ts-D5xc9lym.js} +4 -4
- package/out/renderer/assets/apache-CNinduwi.js +7 -0
- package/out/renderer/assets/apex-Bb5lJMDj.js +7 -0
- package/out/renderer/assets/apex-qg9RQ075.js +7 -0
- package/out/renderer/assets/apl-CwOdpgox.js +18 -0
- package/out/renderer/assets/{apl-DaBQFEEA.js → apl-yOYUHP8d.js} +2 -2
- package/out/renderer/assets/applescript-lnbIqF8m.js +7 -0
- package/out/renderer/assets/ara-Bk0qEO6o.js +7 -0
- package/out/renderer/assets/asciidoc-C0WHk4w6.js +7 -0
- package/out/renderer/assets/asciidoc-jqujbz-y.js +7 -0
- package/out/renderer/assets/asm-B11lya7B.js +7 -0
- package/out/renderer/assets/{astro-y3sdhPpl.js → astro-2kT-iZU2.js} +1 -1
- package/out/renderer/assets/astro-4_84hckR.js +19 -0
- package/out/renderer/assets/aurora-x-dRl8fFfP.js +4 -0
- package/out/renderer/assets/awk-BN7JeWnO.js +7 -0
- package/out/renderer/assets/ayu-dark-B5h4MFGf.js +4 -0
- package/out/renderer/assets/ayu-light-DdIFAd0D.js +4 -0
- package/out/renderer/assets/ayu-mirage-CCbK8EIf.js +4 -0
- package/out/renderer/assets/ballerina-D6P6J-nf.js +7 -0
- package/out/renderer/assets/bat-BoGgQ5T6.js +7 -0
- package/out/renderer/assets/{bat-BzNgQIA7.js → bat-Dkbx_DMM.js} +1 -1
- package/out/renderer/assets/beancount-Dem2RF3B.js +7 -0
- package/out/renderer/assets/beancount-DsK3lj01.js +7 -0
- package/out/renderer/assets/berry-CITLy8nd.js +7 -0
- package/out/renderer/assets/bibtex-BKDf3U3R.js +7 -0
- package/out/renderer/assets/bicep-D9MrUHJX.js +7 -0
- package/out/renderer/assets/bird2-DX8zzZRD.js +7 -0
- package/out/renderer/assets/bird2-iVuaRSDs.js +7 -0
- package/out/renderer/assets/blade-5WpJHG7Z.js +22 -0
- package/out/renderer/assets/{blade-DTIBeXBj.js → blade-H7By5jXu.js} +4 -4
- package/out/renderer/assets/bsl-BLoo_ZYi.js +9 -0
- package/out/renderer/assets/bsl-BQH46PtH.js +9 -0
- package/out/renderer/assets/c-B_qLgXdW.js +7 -0
- package/out/renderer/assets/c3-DoGCSPbO.js +7 -0
- package/out/renderer/assets/c3-_0-mb_f-.js +7 -0
- package/out/renderer/assets/cadence-ScN53l_d.js +7 -0
- package/out/renderer/assets/cairo-BWzqvDlm.js +9 -0
- package/out/renderer/assets/catppuccin-frappe-CsW6iLIR.js +4 -0
- package/out/renderer/assets/catppuccin-frappe-jQGA813A.js +4 -0
- package/out/renderer/assets/catppuccin-latte-Dyky2vs1.js +4 -0
- package/out/renderer/assets/catppuccin-latte-reHbSDAH.js +4 -0
- package/out/renderer/assets/catppuccin-macchiato-B7OcFy0M.js +4 -0
- package/out/renderer/assets/catppuccin-macchiato-rSGd47q5.js +4 -0
- package/out/renderer/assets/catppuccin-mocha-C6c0_b-7.js +4 -0
- package/out/renderer/assets/catppuccin-mocha-h6uXIMxA.js +4 -0
- package/out/renderer/assets/chapel-uyFADvHr.js +9 -0
- package/out/renderer/assets/chapel-wQk8d_On.js +9 -0
- package/out/renderer/assets/clarity-C5IjJ-qf.js +7 -0
- package/out/renderer/assets/clarity-DNm-MnnX.js +7 -0
- package/out/renderer/assets/clojure-BxhVpje2.js +7 -0
- package/out/renderer/assets/cmake-DnL0Z3_Z.js +7 -0
- package/out/renderer/assets/cobol-DWAPGkiy.js +13 -0
- package/out/renderer/assets/{cobol-Cff68WIy.js → cobol-DauSNXId.js} +2 -2
- package/out/renderer/assets/codeowners-BrRFUr63.js +7 -0
- package/out/renderer/assets/codeql-BHzOY7Cv.js +7 -0
- package/out/renderer/assets/coffee-C2yVc3WY.js +9 -0
- package/out/renderer/assets/common-lisp-D2tOrc9D.js +7 -0
- package/out/renderer/assets/coq-D9cgUZrT.js +7 -0
- package/out/renderer/assets/coq-DPxrIdHD.js +7 -0
- package/out/renderer/assets/cpp-CalJHMQ6.js +19 -0
- package/out/renderer/assets/cpp-CjtLXoXm.js +19 -0
- package/out/renderer/assets/crystal-C8dXkafs.js +19 -0
- package/out/renderer/assets/{crystal-CCwukLCR.js → crystal-DhDF6hP-.js} +3 -3
- package/out/renderer/assets/csharp-B9Sq4das.js +7 -0
- package/out/renderer/assets/csharp-C6MvVA8t.js +7 -0
- package/out/renderer/assets/css-B7NKTc7o.js +7 -0
- package/out/renderer/assets/css-RFTgTh3p.js +7 -0
- package/out/renderer/assets/csv-DP1zGign.js +7 -0
- package/out/renderer/assets/cue-F2spVcwu.js +7 -0
- package/out/renderer/assets/cypher-DY4T0ZTH.js +7 -0
- package/out/renderer/assets/d-BiXHudTl.js +7 -0
- package/out/renderer/assets/dark-plus-BS-IP20f.js +4 -0
- package/out/renderer/assets/dart-BEYJw54V.js +7 -0
- package/out/renderer/assets/dart-C9cA83Kz.js +7 -0
- package/out/renderer/assets/dax-1P4NHeLq.js +7 -0
- package/out/renderer/assets/desktop-uAF143fJ.js +7 -0
- package/out/renderer/assets/diff-D4SVBfCP.js +7 -0
- package/out/renderer/assets/docker-C42iq0ej.js +7 -0
- package/out/renderer/assets/dotenv-D6mB0Q3S.js +7 -0
- package/out/renderer/assets/dotenv-D87hbKBr.js +7 -0
- package/out/renderer/assets/dracula-BUuMa4E9.js +4 -0
- package/out/renderer/assets/dracula-soft-VBYEUajy.js +4 -0
- package/out/renderer/assets/dream-maker-BtBJ4UAT.js +7 -0
- package/out/renderer/assets/edge-CxiWGXIG.js +15 -0
- package/out/renderer/assets/{edge-Bt6vbpjM.js → edge-DwlWfPqZ.js} +3 -3
- package/out/renderer/assets/{elixir-Cuo0djbX.js → elixir-B5T6YfxL.js} +2 -2
- package/out/renderer/assets/elixir-CmZtJUj9.js +11 -0
- package/out/renderer/assets/elm-oHizeGCl.js +10 -0
- package/out/renderer/assets/emacs-lisp-D4AyRuZR.js +7 -0
- package/out/renderer/assets/emacs-lisp-DA7QHB8Q.js +7 -0
- package/out/renderer/assets/erb-Bs36RMzA.js +28 -0
- package/out/renderer/assets/{erb-V2Ws3SNY.js → erb-ClV2iBZ3.js} +6 -6
- package/out/renderer/assets/erlang-D_zrgYMT.js +9 -0
- package/out/renderer/assets/everforest-dark-D6eDV5WR.js +4 -0
- package/out/renderer/assets/everforest-light-33yezsH8.js +4 -0
- package/out/renderer/assets/fennel-B7fQ-V09.js +7 -0
- package/out/renderer/assets/fish-D34eEdK0.js +7 -0
- package/out/renderer/assets/fluent-B8LinUgT.js +7 -0
- package/out/renderer/assets/fortran-fixed-form-C2KTzkT8.js +9 -0
- package/out/renderer/assets/fortran-free-form-DMz3__1l.js +7 -0
- package/out/renderer/assets/fsharp-B0WlLLum.js +9 -0
- package/out/renderer/assets/{gdresource-B5TLWiFO.js → gdresource-CRSgAcUB.js} +1 -1
- package/out/renderer/assets/gdresource-k7e_Az9Q.js +11 -0
- package/out/renderer/assets/gdscript-DO90EOCr.js +7 -0
- package/out/renderer/assets/gdscript-I92DZiEA.js +7 -0
- package/out/renderer/assets/gdshader-DptSZ_Cq.js +7 -0
- package/out/renderer/assets/genie-pEa_wqhG.js +7 -0
- package/out/renderer/assets/gherkin-CsGrIJ1t.js +7 -0
- package/out/renderer/assets/ghostty-web-DPKNHpFa.js +3488 -0
- package/out/renderer/assets/git-commit-DtwjgW_E.js +9 -0
- package/out/renderer/assets/{git-commit-PP9xCApN.js → git-commit-Dv4XKH0P.js} +2 -2
- package/out/renderer/assets/git-rebase-B2Hk1uXk.js +9 -0
- package/out/renderer/assets/{git-rebase-D-XQSvDj.js → git-rebase-CBPs_8pF.js} +2 -2
- package/out/renderer/assets/github-dark-BA5Caf8C.js +4 -0
- package/out/renderer/assets/github-dark-default-0xOkz-U0.js +4 -0
- package/out/renderer/assets/github-dark-dimmed-C4ly6bKH.js +4 -0
- package/out/renderer/assets/github-dark-high-contrast-Bfic7DM_.js +4 -0
- package/out/renderer/assets/github-light-C5z6FMS6.js +4 -0
- package/out/renderer/assets/github-light-default-CCfLAB4T.js +4 -0
- package/out/renderer/assets/github-light-high-contrast-DQvXcqYm.js +4 -0
- package/out/renderer/assets/gleam-Yjk8la1G.js +7 -0
- package/out/renderer/assets/{glimmer-js-DG20vYlC.js → glimmer-js-BoSiU7IK.js} +2 -2
- package/out/renderer/assets/glimmer-js-CSbLS_ZS.js +15 -0
- package/out/renderer/assets/{glimmer-ts-C6w_4QSb.js → glimmer-ts-D5t4bJm3.js} +2 -2
- package/out/renderer/assets/glimmer-ts-NKGX2VoI.js +15 -0
- package/out/renderer/assets/glsl-CtC-aZYT.js +9 -0
- package/out/renderer/assets/gn-CuW-uObe.js +7 -0
- package/out/renderer/assets/gn-hQC9pe50.js +7 -0
- package/out/renderer/assets/gnuplot-BHaJVsVJ.js +7 -0
- package/out/renderer/assets/go-B7ftlFGP.js +7 -0
- package/out/renderer/assets/graphql-DD09nAvz.js +15 -0
- package/out/renderer/assets/groovy-BE7jAkWL.js +7 -0
- package/out/renderer/assets/gruvbox-dark-hard-BJBUTaW5.js +4 -0
- package/out/renderer/assets/gruvbox-dark-medium-CAVBAOjX.js +4 -0
- package/out/renderer/assets/gruvbox-dark-soft-DrY2h9YX.js +4 -0
- package/out/renderer/assets/gruvbox-light-hard-B2Q4w_BD.js +4 -0
- package/out/renderer/assets/gruvbox-light-medium-B0DDiR60.js +4 -0
- package/out/renderer/assets/gruvbox-light-soft-DUZi2A9Q.js +4 -0
- package/out/renderer/assets/hack-BMCu-aN4.js +13 -0
- package/out/renderer/assets/hack-BrX5xOKj.js +13 -0
- package/out/renderer/assets/haml-C5LfZHg8.js +11 -0
- package/out/renderer/assets/{haml-DlpJLJBj.js → haml-aYVaJAFz.js} +1 -1
- package/out/renderer/assets/handlebars-BsWv8y2s.js +15 -0
- package/out/renderer/assets/handlebars-DOx8io1-.js +15 -0
- package/out/renderer/assets/haskell-WLyi2Rcd.js +7 -0
- package/out/renderer/assets/haxe-BRsgd3cI.js +7 -0
- package/out/renderer/assets/haxe-DNXNrES8.js +7 -0
- package/out/renderer/assets/hcl-Ci-KpKFJ.js +7 -0
- package/out/renderer/assets/hjson-BcCq_Ebf.js +7 -0
- package/out/renderer/assets/hlsl-BZOttydV.js +7 -0
- package/out/renderer/assets/horizon-bright-B7L9fK1d.js +4 -0
- package/out/renderer/assets/horizon-c-2pkAki.js +4 -0
- package/out/renderer/assets/houston-D7kpvNP-.js +4 -0
- package/out/renderer/assets/{html-DmbcFRC9.js → html-BJOXR_IN.js} +1 -1
- package/out/renderer/assets/html-DLeVhUDm.js +11 -0
- package/out/renderer/assets/{html-derivative-hBF5i0yR.js → html-derivative-DMkc3qiA.js} +2 -2
- package/out/renderer/assets/html-derivative-iuplDqYX.js +11 -0
- package/out/renderer/assets/http-DdZ-6iVw.js +20 -0
- package/out/renderer/assets/hurl-CmEyw7uU.js +18 -0
- package/out/renderer/assets/hxml-CDauTPrD.js +9 -0
- package/out/renderer/assets/hxml-bhUxPckm.js +9 -0
- package/out/renderer/assets/hy-Cs-QqqE9.js +7 -0
- package/out/renderer/assets/imba-DFbXxFpr.js +7 -0
- package/out/renderer/assets/index-miPiOG60.css +4096 -0
- package/out/renderer/assets/{index-CL7JsAld.js → index-rup1hjNH.js} +140480 -111764
- package/out/renderer/assets/ini-DxP60zMM.js +7 -0
- package/out/renderer/assets/java-CMgxwKMs.js +7 -0
- package/out/renderer/assets/javascript-Cxk329ux.js +7 -0
- package/out/renderer/assets/{jinja-Co0rsagz.js → jinja-CYR28n3S.js} +2 -2
- package/out/renderer/assets/jinja-Cjs5-5qJ.js +16 -0
- package/out/renderer/assets/jison-D2sXEqQT.js +9 -0
- package/out/renderer/assets/json-DrXVx-W7.js +7 -0
- package/out/renderer/assets/json5-sxX9ynt0.js +7 -0
- package/out/renderer/assets/jsonc-BGsFDnEt.js +7 -0
- package/out/renderer/assets/jsonl-xAPhF7fY.js +7 -0
- package/out/renderer/assets/jsonnet-B9R46_F7.js +7 -0
- package/out/renderer/assets/jssm-DEgylAzK.js +7 -0
- package/out/renderer/assets/jsx-D2S6mCx2.js +7 -0
- package/out/renderer/assets/{julia-CF2trtnW.js → julia-DiYuCSV5.js} +4 -4
- package/out/renderer/assets/julia-zQqS00p9.js +20 -0
- package/out/renderer/assets/just-j_w0TwrE.js +34 -0
- package/out/renderer/assets/{just-DLfNrYXP.js → just-njno1COI.js} +8 -8
- package/out/renderer/assets/kanagawa-dragon-BzrndB3G.js +4 -0
- package/out/renderer/assets/kanagawa-dragon-zmsgWiA3.js +4 -0
- package/out/renderer/assets/kanagawa-lotus-B2om_CY5.js +4 -0
- package/out/renderer/assets/kanagawa-lotus-BMbWLXSu.js +4 -0
- package/out/renderer/assets/kanagawa-wave-BZiPpOzw.js +4 -0
- package/out/renderer/assets/kanagawa-wave-OC_VodQx.js +4 -0
- package/out/renderer/assets/kdl-Bs2b6z_p.js +7 -0
- package/out/renderer/assets/kotlin-TjDYB5VL.js +7 -0
- package/out/renderer/assets/kusto-Bwcr0FvH.js +7 -0
- package/out/renderer/assets/laserwave-CE9zOEi7.js +4 -0
- package/out/renderer/assets/latex-B9v8pMd0.js +10 -0
- package/out/renderer/assets/latex-BfwbXcds.js +10 -0
- package/out/renderer/assets/lean-C1IdfB94.js +7 -0
- package/out/renderer/assets/less-extcxn5D.js +7 -0
- package/out/renderer/assets/light-plus-C9wrMYdv.js +4 -0
- package/out/renderer/assets/liquid-cbwBeziI.js +15 -0
- package/out/renderer/assets/{liquid-CRPVOqng.js → liquid-er0ejDCL.js} +2 -2
- package/out/renderer/assets/llvm-CN5ygcAQ.js +7 -0
- package/out/renderer/assets/{llvm-CTKcAHbb.js → llvm-vwd2ARYn.js} +1 -1
- package/out/renderer/assets/log-CKWGjxko.js +7 -0
- package/out/renderer/assets/logo-BLfVu6qk.js +7 -0
- package/out/renderer/assets/lua-Boeal4SO.js +9 -0
- package/out/renderer/assets/luau-_M-Xr-8y.js +7 -0
- package/out/renderer/assets/luau-oTh1ONZ7.js +7 -0
- package/out/renderer/assets/make-DpNCWw77.js +7 -0
- package/out/renderer/assets/markdown-BCxDWYWv.js +7 -0
- package/out/renderer/assets/marko-BijJ8vNf.js +15 -0
- package/out/renderer/assets/marko-DZ3fVwnp.js +15 -0
- package/out/renderer/assets/material-theme-darker-CGVy914Q.js +4 -0
- package/out/renderer/assets/material-theme-lighter-JeL9jnhU.js +4 -0
- package/out/renderer/assets/material-theme-oNPvhgMJ.js +4 -0
- package/out/renderer/assets/material-theme-ocean-BezEwMT4.js +4 -0
- package/out/renderer/assets/material-theme-palenight-BxauIjM6.js +4 -0
- package/out/renderer/assets/matlab-6XFrojJL.js +7 -0
- package/out/renderer/assets/mdc-Dg7yoyIh.js +16 -0
- package/out/renderer/assets/mdc-ViGgjupT.js +16 -0
- package/out/renderer/assets/mdx-Dofm6Sb4.js +7 -0
- package/out/renderer/assets/mermaid-DfkH4c_u.js +7 -0
- package/out/renderer/assets/mermaid-cpc8TKa6.js +7 -0
- package/out/renderer/assets/min-dark-cw6au1UL.js +4 -0
- package/out/renderer/assets/min-light-Dh5Sgcfe.js +4 -0
- package/out/renderer/assets/mipsasm-BKjObKuj.js +7 -0
- package/out/renderer/assets/mojo-CCMjFYSY.js +7 -0
- package/out/renderer/assets/mojo-CueU91aX.js +7 -0
- package/out/renderer/assets/monokai-B6s2D1pk.js +4 -0
- package/out/renderer/assets/monokai-BL-7sM2b.js +4 -0
- package/out/renderer/assets/moonbit-B2pKiEWK.js +7 -0
- package/out/renderer/assets/moonbit-NJknOnNj.js +7 -0
- package/out/renderer/assets/move-DVefDQ-j.js +7 -0
- package/out/renderer/assets/move-e8N3PYLu.js +7 -0
- package/out/renderer/assets/narrat-DjGkKkH6.js +7 -0
- package/out/renderer/assets/nextflow-CUAPH6ZN.js +9 -0
- package/out/renderer/assets/{nextflow-CZlu-KJ9.js → nextflow-duJcHzhS.js} +2 -2
- package/out/renderer/assets/{nextflow-groovy-BoHzzNJ-.js → nextflow-groovy-BVAMb5Nw.js} +1 -1
- package/out/renderer/assets/nextflow-groovy-Df98LQVb.js +7 -0
- package/out/renderer/assets/nginx-CbVuxyyP.js +10 -0
- package/out/renderer/assets/night-owl-1YcqDsUP.js +4 -0
- package/out/renderer/assets/night-owl-light-EhW_zGvD.js +4 -0
- package/out/renderer/assets/{nim-DH52b3O2.js → nim-CO9jlkx_.js} +2 -2
- package/out/renderer/assets/nim-DA8XI9sS.js +22 -0
- package/out/renderer/assets/nix-DL_ivQ6g.js +12 -0
- package/out/renderer/assets/nord-DwXZcUpD.js +4 -0
- package/out/renderer/assets/nsis-CgTxT63b.js +7 -0
- package/out/renderer/assets/nsis-wiIR3_u7.js +7 -0
- package/out/renderer/assets/nushell-DhZRrV4v.js +7 -0
- package/out/renderer/assets/nushell-XLSMMD3o.js +7 -0
- package/out/renderer/assets/objective-c-BSkeXF7b.js +7 -0
- package/out/renderer/assets/{objective-c-BRoNQF42.js → objective-c-WMmwmO29.js} +2 -2
- package/out/renderer/assets/objective-cpp-s1Q26Oui.js +7 -0
- package/out/renderer/assets/ocaml-CfezreSr.js +7 -0
- package/out/renderer/assets/odin-CqOJVjf6.js +7 -0
- package/out/renderer/assets/one-dark-pro-BmFSndTA.js +4 -0
- package/out/renderer/assets/one-dark-pro-DfmyFT_9.js +4 -0
- package/out/renderer/assets/one-light-A45kOCBk.js +4 -0
- package/out/renderer/assets/openscad-DuOkRsMG.js +7 -0
- package/out/renderer/assets/org-CQ3J1455.js +106 -0
- package/out/renderer/assets/org-DaaT4cnd.js +106 -0
- package/out/renderer/assets/pascal-Cb3iWwdQ.js +7 -0
- package/out/renderer/assets/{perl-DNMq5TeG.js → perl-BFPqQ3p2.js} +3 -3
- package/out/renderer/assets/perl-DgKkQF1c.js +18 -0
- package/out/renderer/assets/php-ARmKHgeC.js +20 -0
- package/out/renderer/assets/php-BWimq2sn.js +20 -0
- package/out/renderer/assets/pkl-QZxh7kIy.js +7 -0
- package/out/renderer/assets/plastic-COWcVExN.js +4 -0
- package/out/renderer/assets/plsql-BcFRakii.js +7 -0
- package/out/renderer/assets/po-Rc6YVSqP.js +7 -0
- package/out/renderer/assets/poimandres-BcqNEoyR.js +4 -0
- package/out/renderer/assets/polar-Cpg5oEto.js +7 -0
- package/out/renderer/assets/postcss-d8O1Nqpb.js +7 -0
- package/out/renderer/assets/powerquery-CCe2ZpZi.js +7 -0
- package/out/renderer/assets/{powershell-BcMVbGpk.js → powershell-BM-TNTx9.js} +1 -1
- package/out/renderer/assets/powershell-DaRN83Hi.js +7 -0
- package/out/renderer/assets/prisma-BGGfvhdm.js +7 -0
- package/out/renderer/assets/prisma-gE1TWuhL.js +7 -0
- package/out/renderer/assets/prolog-C57IBtVZ.js +7 -0
- package/out/renderer/assets/proto-DAZAysFo.js +7 -0
- package/out/renderer/assets/{pug-SkQ8WOMr.js → pug-BFbasRPI.js} +2 -2
- package/out/renderer/assets/pug-Dd62hy3O.js +13 -0
- package/out/renderer/assets/puppet-CXd9ytLa.js +7 -0
- package/out/renderer/assets/purescript-CLp9hK3-.js +7 -0
- package/out/renderer/assets/python-B6gaqrA3.js +7 -0
- package/out/renderer/assets/qml-DD2cFkX1.js +9 -0
- package/out/renderer/assets/qmldir-C8Zk1tov.js +7 -0
- package/out/renderer/assets/qss-PnkW0_Oc.js +7 -0
- package/out/renderer/assets/r-AvJ-_IZz.js +7 -0
- package/out/renderer/assets/r-Ovg79Xib.js +7 -0
- package/out/renderer/assets/racket-oOimIK_L.js +7 -0
- package/out/renderer/assets/raku-CvQgJIya.js +7 -0
- package/out/renderer/assets/rank.worker-DpSKMnwd.js +197 -0
- package/out/renderer/assets/razor-DgD4EFT1.js +13 -0
- package/out/renderer/assets/{razor-CAqfpVJf.js → razor-dJKRQxMy.js} +3 -3
- package/out/renderer/assets/rbs-BNri--NX.js +7 -0
- package/out/renderer/assets/rbs-CsVKzbYM.js +7 -0
- package/out/renderer/assets/red-BcXR4G_B.js +4 -0
- package/out/renderer/assets/red-DB6wGUas.js +4 -0
- package/out/renderer/assets/reg-CYjz17be.js +7 -0
- package/out/renderer/assets/regexp-BR1XSWGx.js +7 -0
- package/out/renderer/assets/rel-BA1qkG6l.js +7 -0
- package/out/renderer/assets/riscv-2_I2VwHC.js +7 -0
- package/out/renderer/assets/ron-DCFWW0oK.js +7 -0
- package/out/renderer/assets/rose-pine-D2pIHTUv.js +4 -0
- package/out/renderer/assets/rose-pine-DsUfEP3G.js +4 -0
- package/out/renderer/assets/rose-pine-dawn-BvRaiqBN.js +4 -0
- package/out/renderer/assets/rose-pine-dawn-q6ecc16C.js +4 -0
- package/out/renderer/assets/rose-pine-moon-7dxa9wGV.js +4 -0
- package/out/renderer/assets/rose-pine-moon-B51k6Eh0.js +4 -0
- package/out/renderer/assets/rosmsg-41UAeRlI.js +7 -0
- package/out/renderer/assets/rst-BQLv7lpx.js +37 -0
- package/out/renderer/assets/{rst-d2ON5Kil.js → rst-rpZ4ExZM.js} +7 -7
- package/out/renderer/assets/ruby-DAb9KWjb.js +37 -0
- package/out/renderer/assets/{ruby-D3ZRMd1J.js → ruby-DqVdtl8n.js} +6 -6
- package/out/renderer/assets/rust-5INkirJ2.js +7 -0
- package/out/renderer/assets/rust-66fbAM7D.js +7 -0
- package/out/renderer/assets/sas-BgilnX2x.js +9 -0
- package/out/renderer/assets/{sas-C8EJbWIQ.js → sas-BqoR79ug.js} +1 -1
- package/out/renderer/assets/sass-Dv20W86A.js +7 -0
- package/out/renderer/assets/{scala-B-_7vFVn.js → scala-X3YXDlFi.js} +1 -1
- package/out/renderer/assets/scala-tyjCf1jG.js +7 -0
- package/out/renderer/assets/scheme-Cp-NYOFK.js +7 -0
- package/out/renderer/assets/{scss-FZJI91Eq.js → scss-3k6UWg9O.js} +1 -1
- package/out/renderer/assets/scss-BBaq7E3Q.js +9 -0
- package/out/renderer/assets/sdbl-Wx2oHFSA.js +7 -0
- package/out/renderer/assets/shaderlab-D_3FHzy3.js +9 -0
- package/out/renderer/assets/shellscript-CBwpHwlb.js +7 -0
- package/out/renderer/assets/shellsession-Bgbph8uJ.js +9 -0
- package/out/renderer/assets/shiki-html.worker-gURcNJD7.js +9236 -0
- package/out/renderer/assets/slack-dark-Dd-K-xgH.js +4 -0
- package/out/renderer/assets/slack-ochin-GXJ3Rp3F.js +4 -0
- package/out/renderer/assets/smalltalk-CwntpOpi.js +7 -0
- package/out/renderer/assets/smalltalk-DgVYDHi1.js +7 -0
- package/out/renderer/assets/smithy-DtHBEXRo.js +7 -0
- package/out/renderer/assets/smithy-y2AkadvV.js +7 -0
- package/out/renderer/assets/snazzy-light-FVyX3nlJ.js +4 -0
- package/out/renderer/assets/solarized-dark-9CqJc6gu.js +4 -0
- package/out/renderer/assets/solarized-dark-C2o1QBmz.js +4 -0
- package/out/renderer/assets/solarized-light-Bwn1srvX.js +4 -0
- package/out/renderer/assets/solarized-light-CahvOdlg.js +4 -0
- package/out/renderer/assets/solidity-7D_UgM9r.js +7 -0
- package/out/renderer/assets/solidity-CxpNwQ9c.js +7 -0
- package/out/renderer/assets/{soy-DAT1Vt2Q.js → soy-COqPEtV1.js} +2 -2
- package/out/renderer/assets/soy-cKTiWhfW.js +11 -0
- package/out/renderer/assets/sparql-hFFn0v_s.js +9 -0
- package/out/renderer/assets/splunk-DsOLgLM_.js +7 -0
- package/out/renderer/assets/sql-DRwHerI8.js +7 -0
- package/out/renderer/assets/sql-cpG3lxvB.js +7 -0
- package/out/renderer/assets/ssh-config-nouhaKUT.js +7 -0
- package/out/renderer/assets/stata-Bn21-ifC.js +9 -0
- package/out/renderer/assets/{stata-BQJhX8pA.js → stata-Cq8N7nxi.js} +1 -1
- package/out/renderer/assets/stylus-n0pyux8w.js +7 -0
- package/out/renderer/assets/surrealql-CU92wPzz.js +9 -0
- package/out/renderer/assets/surrealql-h-HP0MOZ.js +9 -0
- package/out/renderer/assets/svelte-CIneEz4M.js +15 -0
- package/out/renderer/assets/{svelte-DYzzbzh8.js → svelte-Cv_F2nMH.js} +2 -2
- package/out/renderer/assets/swift-C0Fmtg1M.js +7 -0
- package/out/renderer/assets/swift-Dmi_J61t.js +7 -0
- package/out/renderer/assets/synthwave-84-CnkNip0H.js +4 -0
- package/out/renderer/assets/system-verilog-D8UnDpk2.js +7 -0
- package/out/renderer/assets/system-verilog-yaG6IMEl.js +7 -0
- package/out/renderer/assets/systemd-BzKcuMl8.js +7 -0
- package/out/renderer/assets/talonscript-DY_HAJtZ.js +7 -0
- package/out/renderer/assets/tasl-BztvWVDb.js +7 -0
- package/out/renderer/assets/tcl-BuBTDVg-.js +7 -0
- package/out/renderer/assets/templ-Bz105jSX.js +13 -0
- package/out/renderer/assets/{templ-BwefK4nX.js → templ-G5iBeRA1.js} +1 -1
- package/out/renderer/assets/terraform-BeL08n1I.js +7 -0
- package/out/renderer/assets/tex-CnYddObv.js +9 -0
- package/out/renderer/assets/{tex-CGVqF8nD.js → tex-DieQ98e7.js} +1 -1
- package/out/renderer/assets/tokyo-night-BcrgZwlL.js +4 -0
- package/out/renderer/assets/toml-Bopw04tQ.js +7 -0
- package/out/renderer/assets/ts-tags-DNN76ePW.js +54 -0
- package/out/renderer/assets/{ts-tags-Bbg2DCJJ.js → ts-tags-dhWLpawA.js} +3 -3
- package/out/renderer/assets/tsv-vUy7jUxg.js +7 -0
- package/out/renderer/assets/tsx-DrHVEsbG.js +7 -0
- package/out/renderer/assets/turtle-CviU3hZ6.js +7 -0
- package/out/renderer/assets/twig-9a95SXZv.js +36 -0
- package/out/renderer/assets/twig-D9Wa-3Eg.js +36 -0
- package/out/renderer/assets/typescript-B-202KI2.js +7 -0
- package/out/renderer/assets/typespec-BxYMz8HZ.js +7 -0
- package/out/renderer/assets/typespec-fjDFSoHc.js +7 -0
- package/out/renderer/assets/typst-1lLWEwvy.js +126 -0
- package/out/renderer/assets/typst-C8rHYIyJ.js +126 -0
- package/out/renderer/assets/v-CyXy1aR-.js +7 -0
- package/out/renderer/assets/{v-BSYXvR4g.js → v-Dq8gf8Kd.js} +1 -1
- package/out/renderer/assets/vala-B-l9BgxC.js +7 -0
- package/out/renderer/assets/{vb-Bzg9rspf.js → vb-Csa1FuFR.js} +1 -1
- package/out/renderer/assets/vb-TsDm_UJe.js +7 -0
- package/out/renderer/assets/verilog-D6UvsxG6.js +7 -0
- package/out/renderer/assets/verilog-DTIYYOEx.js +7 -0
- package/out/renderer/assets/vesper-fqJ-8vwf.js +4 -0
- package/out/renderer/assets/vhdl-Bmis3rmf.js +7 -0
- package/out/renderer/assets/viml-nSJ_8gjj.js +7 -0
- package/out/renderer/assets/vitesse-black-BHNb4xfw.js +4 -0
- package/out/renderer/assets/vitesse-dark-CK2cPWV_.js +4 -0
- package/out/renderer/assets/vitesse-light-CJZ7QWdo.js +4 -0
- package/out/renderer/assets/vue-CRo-KeE2.js +40 -0
- package/out/renderer/assets/{vue-BSHLbQPw.js → vue-DhJhQFen.js} +4 -4
- package/out/renderer/assets/vue-html-wh5UYqhG.js +9 -0
- package/out/renderer/assets/vue-vine-BgmYVkHX.js +19 -0
- package/out/renderer/assets/{vue-vine-CBak_P96.js → vue-vine-Da6PFzL2.js} +2 -2
- package/out/renderer/assets/vyper-CKC3dqNs.js +7 -0
- package/out/renderer/assets/wasm-SfiT7gTt.js +7 -0
- package/out/renderer/assets/wenyan-BG18ywmR.js +7 -0
- package/out/renderer/assets/wgsl-B2HpUyqw.js +7 -0
- package/out/renderer/assets/wikitext-D4AsF2N7.js +7 -0
- package/out/renderer/assets/wit-CqXItG7W.js +7 -0
- package/out/renderer/assets/wolfram-Bw1Mtvp_.js +7 -0
- package/out/renderer/assets/{worker-BPSdoz7S.js → worker-DNIQ0wG8.js} +182 -57
- package/out/renderer/assets/working-tree-parse.worker-BAW1QWyk.js +715 -0
- package/out/renderer/assets/xml-BjrmDCxo.js +9 -0
- package/out/renderer/assets/xsl-FW7iPx-f.js +10 -0
- package/out/renderer/assets/yaml-CWgZCikz.js +7 -0
- package/out/renderer/assets/zenscript-XfZDFnVp.js +7 -0
- package/out/renderer/assets/zig-Cj9HXqVC.js +7 -0
- package/out/renderer/index.html +2 -2
- package/package.json +31 -31
- package/resources/icon.png +0 -0
- package/out/renderer/assets/actionscript-3-DtnkuHN2.js +0 -7
- package/out/renderer/assets/apex-Df0W-oIK.js +0 -7
- package/out/renderer/assets/asciidoc-CT8_dLUs.js +0 -7
- package/out/renderer/assets/beancount-aZWrE5WV.js +0 -7
- package/out/renderer/assets/bird2-BQeaUJ-I.js +0 -7
- package/out/renderer/assets/bsl-DwPS0BId.js +0 -9
- package/out/renderer/assets/c3-D2B0LXIg.js +0 -7
- package/out/renderer/assets/catppuccin-frappe-C21OPQfC.js +0 -4
- package/out/renderer/assets/catppuccin-latte-0ZtXlsrX.js +0 -4
- package/out/renderer/assets/catppuccin-macchiato-BD_FR4sl.js +0 -4
- package/out/renderer/assets/catppuccin-mocha-C653csR5.js +0 -4
- package/out/renderer/assets/clarity-D2ViJC0i.js +0 -7
- package/out/renderer/assets/coq-l_JvzFJl.js +0 -7
- package/out/renderer/assets/cpp-B-e1Rzcy.js +0 -22
- package/out/renderer/assets/csharp-ChNHWsy7.js +0 -7
- package/out/renderer/assets/css-DfTYai-u.js +0 -7
- package/out/renderer/assets/dart-BNVTaiA9.js +0 -7
- package/out/renderer/assets/dotenv-Bb4iNxXK.js +0 -7
- package/out/renderer/assets/emacs-lisp-DbZW1X_J.js +0 -7
- package/out/renderer/assets/gdscript-CNW3Aj-d.js +0 -7
- package/out/renderer/assets/gn-OUMx7fqt.js +0 -7
- package/out/renderer/assets/hack-DjUcXazN.js +0 -13
- package/out/renderer/assets/handlebars-DCI1Liu6.js +0 -15
- package/out/renderer/assets/haxe-BpobLYM9.js +0 -7
- package/out/renderer/assets/hxml-Jle7oGdm.js +0 -9
- package/out/renderer/assets/index-DuUPTo-E.css +0 -2614
- package/out/renderer/assets/kanagawa-dragon-DU8n2NNT.js +0 -4
- package/out/renderer/assets/kanagawa-lotus-Byd0CDet.js +0 -4
- package/out/renderer/assets/kanagawa-wave-DExoagcR.js +0 -4
- package/out/renderer/assets/latex-CXCNXL7j.js +0 -10
- package/out/renderer/assets/luau-CZXYDZ20.js +0 -7
- package/out/renderer/assets/marko-CIEVFCDi.js +0 -15
- package/out/renderer/assets/mdc-CgmrJS3R.js +0 -16
- package/out/renderer/assets/mermaid-z_1ejSlp.js +0 -7
- package/out/renderer/assets/mojo-ByCRDvCf.js +0 -7
- package/out/renderer/assets/monokai-DelygWXa.js +0 -4
- package/out/renderer/assets/moonbit-CqjK87KZ.js +0 -7
- package/out/renderer/assets/move-DhTNmxqC.js +0 -7
- package/out/renderer/assets/nushell-DB8ZUEbK.js +0 -7
- package/out/renderer/assets/one-dark-pro-CsMf0BoJ.js +0 -4
- package/out/renderer/assets/php-Dhtz88su.js +0 -20
- package/out/renderer/assets/prisma-bmxcSDxq.js +0 -7
- package/out/renderer/assets/r-Dpdc-Kyk.js +0 -7
- package/out/renderer/assets/red-DByOl5N0.js +0 -4
- package/out/renderer/assets/rose-pine-B-kZ4Z9q.js +0 -4
- package/out/renderer/assets/rose-pine-dawn-efeVGdSI.js +0 -4
- package/out/renderer/assets/rose-pine-moon-DmodZNzl.js +0 -4
- package/out/renderer/assets/rust-CMNYZh5a.js +0 -7
- package/out/renderer/assets/smalltalk-qxcGy4fT.js +0 -7
- package/out/renderer/assets/solarized-dark-BBl5y5sR.js +0 -4
- package/out/renderer/assets/solarized-light-DW9b_AY8.js +0 -4
- package/out/renderer/assets/solidity-CSTQ0FCC.js +0 -7
- package/out/renderer/assets/sql-D_4CBcMI.js +0 -7
- package/out/renderer/assets/surrealql-Bs3vUeKA.js +0 -9
- package/out/renderer/assets/swift-Cohr-WZC.js +0 -7
- package/out/renderer/assets/system-verilog-BcESSvRn.js +0 -7
- package/out/renderer/assets/twig-B5sqQI1E.js +0 -36
- package/out/renderer/assets/typespec-CmH6i407.js +0 -7
- package/out/renderer/assets/typst-XYLFxYau.js +0 -7
- package/out/renderer/assets/verilog-CCb_iTfF.js +0 -7
|
@@ -0,0 +1,715 @@
|
|
|
1
|
+
(() => {
|
|
2
|
+
try {
|
|
3
|
+
return false;
|
|
4
|
+
} catch {
|
|
5
|
+
return false;
|
|
6
|
+
}
|
|
7
|
+
})();
|
|
8
|
+
const COMMIT_METADATA_SPLIT = /(?=^From [a-f0-9]+ .+$)/m;
|
|
9
|
+
const GIT_DIFF_FILE_BREAK_REGEX = /(?=^diff --git)/gm;
|
|
10
|
+
const FILENAME_HEADER_REGEX = /^(---|\+\+\+)\s+([^\t\r\n]+)/;
|
|
11
|
+
const INDEX_LINE_METADATA = /^index ([0-9a-f]+)\.\.([0-9a-f]+)(?: (\d+))?$/i;
|
|
12
|
+
function getHunkSideStartBoundary(start, count) {
|
|
13
|
+
return start - (count === 0 ? 0 : 1);
|
|
14
|
+
}
|
|
15
|
+
function getHunkSideEndBoundary(start, count) {
|
|
16
|
+
return getHunkSideStartBoundary(start, count) + count;
|
|
17
|
+
}
|
|
18
|
+
const CACHE_KEY_VERSION = 1;
|
|
19
|
+
function composeCacheKey(scope, ...segments) {
|
|
20
|
+
return `ck${CACHE_KEY_VERSION}:${JSON.stringify([scope, ...segments])}`;
|
|
21
|
+
}
|
|
22
|
+
function cleanLastNewline(contents) {
|
|
23
|
+
let end = contents.length;
|
|
24
|
+
if (contents.charCodeAt(end - 1) === 10) {
|
|
25
|
+
end--;
|
|
26
|
+
if (contents.charCodeAt(end - 1) === 13) end--;
|
|
27
|
+
}
|
|
28
|
+
return contents.slice(0, end);
|
|
29
|
+
}
|
|
30
|
+
const stringDetachEncoder = new TextEncoder();
|
|
31
|
+
const stringDetachDecoder = new TextDecoder("utf-8", { ignoreBOM: true });
|
|
32
|
+
const SURROGATE_CODE_UNIT_PATTERN = /[\uD800-\uDFFF]/;
|
|
33
|
+
const STRING_DETACH_INITIAL_BUFFER_SIZE = 1024;
|
|
34
|
+
let stringDetachBuffer = new Uint8Array(STRING_DETACH_INITIAL_BUFFER_SIZE);
|
|
35
|
+
function releaseStringDetachBuffer() {
|
|
36
|
+
if (stringDetachBuffer.length !== STRING_DETACH_INITIAL_BUFFER_SIZE) stringDetachBuffer = new Uint8Array(STRING_DETACH_INITIAL_BUFFER_SIZE);
|
|
37
|
+
}
|
|
38
|
+
function detachString(value) {
|
|
39
|
+
if (value.length === 0) return value;
|
|
40
|
+
if (SURROGATE_CODE_UNIT_PATTERN.test(value)) return JSON.parse(JSON.stringify(value));
|
|
41
|
+
const requiredByteLength = value.length * 3;
|
|
42
|
+
if (stringDetachBuffer.length < requiredByteLength) stringDetachBuffer = new Uint8Array(requiredByteLength);
|
|
43
|
+
const { written } = stringDetachEncoder.encodeInto(value, stringDetachBuffer);
|
|
44
|
+
return stringDetachDecoder.decode(stringDetachBuffer.subarray(0, written));
|
|
45
|
+
}
|
|
46
|
+
const filenameDecoder = new TextDecoder("utf-8", { ignoreBOM: true });
|
|
47
|
+
const NAMED_ESCAPES = {
|
|
48
|
+
'"': '"',
|
|
49
|
+
"\\": "\\",
|
|
50
|
+
a: "\x07",
|
|
51
|
+
b: "\b",
|
|
52
|
+
t: " ",
|
|
53
|
+
n: "\n",
|
|
54
|
+
v: "\v",
|
|
55
|
+
f: "\f",
|
|
56
|
+
r: "\r"
|
|
57
|
+
};
|
|
58
|
+
function parseQuotedDiffFileName(input) {
|
|
59
|
+
if (input[0] !== '"') return;
|
|
60
|
+
let fileName = "";
|
|
61
|
+
let index = 1;
|
|
62
|
+
while (index < input.length) {
|
|
63
|
+
const char = input[index];
|
|
64
|
+
if (char === '"') return {
|
|
65
|
+
fileName,
|
|
66
|
+
rawLength: index + 1
|
|
67
|
+
};
|
|
68
|
+
if (char !== "\\") {
|
|
69
|
+
fileName += char;
|
|
70
|
+
index++;
|
|
71
|
+
continue;
|
|
72
|
+
}
|
|
73
|
+
const escaped = NAMED_ESCAPES[input[index + 1]];
|
|
74
|
+
if (escaped != null) {
|
|
75
|
+
fileName += escaped;
|
|
76
|
+
index += 2;
|
|
77
|
+
continue;
|
|
78
|
+
}
|
|
79
|
+
const bytes = [];
|
|
80
|
+
do {
|
|
81
|
+
const byte = readOctalByte(input, index + 1);
|
|
82
|
+
if (byte == null) return;
|
|
83
|
+
bytes.push(byte);
|
|
84
|
+
index += 4;
|
|
85
|
+
} while (input[index] === "\\" && input[index + 1] >= "0" && input[index + 1] <= "7");
|
|
86
|
+
fileName += filenameDecoder.decode(new Uint8Array(bytes));
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
function readOctalByte(input, index) {
|
|
90
|
+
const first = input.charCodeAt(index) - 48;
|
|
91
|
+
const second = input.charCodeAt(index + 1) - 48;
|
|
92
|
+
const third = input.charCodeAt(index + 2) - 48;
|
|
93
|
+
if (first >= 0 && first <= 3 && second >= 0 && second <= 7 && third >= 0 && third <= 7) return first * 64 + second * 8 + third;
|
|
94
|
+
}
|
|
95
|
+
const MAX_ALIGNMENT_COMPARISONS = 4096;
|
|
96
|
+
const MIN_IMPROVEMENT_PER_PAIR = 0.5;
|
|
97
|
+
function realignChangeContentBySimilarity(diff) {
|
|
98
|
+
for (const hunk of diff.hunks) for (let index = 0; index < hunk.hunkContent.length; index++) {
|
|
99
|
+
const content = hunk.hunkContent[index];
|
|
100
|
+
if (content.type !== "change") continue;
|
|
101
|
+
const replacement = realignChangeBlock(diff, content);
|
|
102
|
+
if (replacement != null) {
|
|
103
|
+
hunk.hunkContent.splice(index, 1, ...replacement);
|
|
104
|
+
index += replacement.length - 1;
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
function realignChangeBlock(diff, content) {
|
|
109
|
+
const { deletions, additions, deletionLineIndex, additionLineIndex } = content;
|
|
110
|
+
const pairCount = Math.min(deletions, additions);
|
|
111
|
+
const surplus = Math.abs(additions - deletions);
|
|
112
|
+
if (pairCount === 0 || surplus === 0 || pairCount * (surplus + 1) > MAX_ALIGNMENT_COMPARISONS) return null;
|
|
113
|
+
const strippedDeletions = [];
|
|
114
|
+
for (let line = 0; line < deletions; line++) strippedDeletions.push(stripWhitespace(diff.deletionLines[deletionLineIndex + line] ?? ""));
|
|
115
|
+
const strippedAdditions = [];
|
|
116
|
+
for (let line = 0; line < additions; line++) strippedAdditions.push(stripWhitespace(diff.additionLines[additionLineIndex + line] ?? ""));
|
|
117
|
+
const additionsAreLonger = additions > deletions;
|
|
118
|
+
let bestOffset = 0;
|
|
119
|
+
let bestScore = -1;
|
|
120
|
+
for (let offset = 0; offset <= surplus; offset++) {
|
|
121
|
+
let score = 0;
|
|
122
|
+
for (let pair = 0; pair < pairCount; pair++) score += lineSimilarity(strippedDeletions[pair + (additionsAreLonger ? 0 : offset)], strippedAdditions[pair + (additionsAreLonger ? offset : 0)]);
|
|
123
|
+
if (offset === 0) bestScore = score + pairCount * MIN_IMPROVEMENT_PER_PAIR;
|
|
124
|
+
else if (score > bestScore) {
|
|
125
|
+
bestScore = score;
|
|
126
|
+
bestOffset = offset;
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
if (bestOffset === 0) return null;
|
|
130
|
+
const blocks = [];
|
|
131
|
+
const pushBlock = (blockDeletions, blockAdditions, blockDeletionIndex, blockAdditionIndex) => {
|
|
132
|
+
if (blockDeletions > 0 || blockAdditions > 0) blocks.push({
|
|
133
|
+
type: "change",
|
|
134
|
+
deletions: blockDeletions,
|
|
135
|
+
additions: blockAdditions,
|
|
136
|
+
deletionLineIndex: blockDeletionIndex,
|
|
137
|
+
additionLineIndex: blockAdditionIndex
|
|
138
|
+
});
|
|
139
|
+
};
|
|
140
|
+
if (additionsAreLonger) {
|
|
141
|
+
pushBlock(0, bestOffset, deletionLineIndex, additionLineIndex);
|
|
142
|
+
pushBlock(pairCount, pairCount, deletionLineIndex, additionLineIndex + bestOffset);
|
|
143
|
+
pushBlock(0, additions - pairCount - bestOffset, deletionLineIndex + pairCount, additionLineIndex + bestOffset + pairCount);
|
|
144
|
+
} else {
|
|
145
|
+
pushBlock(bestOffset, 0, deletionLineIndex, additionLineIndex);
|
|
146
|
+
pushBlock(pairCount, pairCount, deletionLineIndex + bestOffset, additionLineIndex);
|
|
147
|
+
pushBlock(deletions - pairCount - bestOffset, 0, deletionLineIndex + bestOffset + pairCount, additionLineIndex + pairCount);
|
|
148
|
+
}
|
|
149
|
+
return blocks;
|
|
150
|
+
}
|
|
151
|
+
const WHITESPACE = /\s+/g;
|
|
152
|
+
function stripWhitespace(line) {
|
|
153
|
+
return line.replace(WHITESPACE, "");
|
|
154
|
+
}
|
|
155
|
+
function lineSimilarity(a, b) {
|
|
156
|
+
if (a === b) return 1;
|
|
157
|
+
const maxLength = Math.max(a.length, b.length);
|
|
158
|
+
const minLength = Math.min(a.length, b.length);
|
|
159
|
+
if (minLength === 0) return 0;
|
|
160
|
+
let prefix = 0;
|
|
161
|
+
while (prefix < minLength && a[prefix] === b[prefix]) prefix++;
|
|
162
|
+
let suffix = 0;
|
|
163
|
+
while (suffix < minLength - prefix && a[a.length - 1 - suffix] === b[b.length - 1 - suffix]) suffix++;
|
|
164
|
+
return (prefix + suffix) / maxLength;
|
|
165
|
+
}
|
|
166
|
+
const GIT_DIFF_HEADER_FILENAMES = /^diff --git ("a\/(?:[^"\\]|\\.)*"|a\/.+?) ("b\/(?:[^"\\]|\\.)*"|b\/.+?)$/;
|
|
167
|
+
function _processPatch(data, cacheKeyPrefix, throwOnError = false, patchIndex) {
|
|
168
|
+
const isGitDiff = isGitDiffPatch(data);
|
|
169
|
+
const rawFiles = isGitDiff ? splitGitDiffFiles(data) : splitUnifiedDiffFiles(data);
|
|
170
|
+
let patchMetadata;
|
|
171
|
+
const files = [];
|
|
172
|
+
for (const fileOrPatchMetadata of rawFiles) {
|
|
173
|
+
if (isGitDiff && !GIT_DIFF_FILE_BREAK_REGEX.test(fileOrPatchMetadata)) {
|
|
174
|
+
if (patchMetadata == null) patchMetadata = detachString(fileOrPatchMetadata);
|
|
175
|
+
else if (throwOnError) throw Error("parsePatchContent: unknown file blob");
|
|
176
|
+
else console.error("parsePatchContent: unknown file blob:", fileOrPatchMetadata);
|
|
177
|
+
continue;
|
|
178
|
+
} else if (!isGitDiff && !startsWithUnifiedDiffFileHeader(fileOrPatchMetadata)) {
|
|
179
|
+
if (patchMetadata == null) patchMetadata = detachString(fileOrPatchMetadata);
|
|
180
|
+
else if (throwOnError) throw Error("parsePatchContent: unknown file blob");
|
|
181
|
+
else console.error("parsePatchContent: unknown file blob:", fileOrPatchMetadata);
|
|
182
|
+
continue;
|
|
183
|
+
}
|
|
184
|
+
const currentFile = _processFile(fileOrPatchMetadata, {
|
|
185
|
+
cacheKey: cacheKeyPrefix != null ? patchIndex == null ? composeCacheKey("patch-file", cacheKeyPrefix, String(files.length)) : composeCacheKey("patch-file", cacheKeyPrefix, String(patchIndex), String(files.length)) : void 0,
|
|
186
|
+
isGitDiff,
|
|
187
|
+
throwOnError
|
|
188
|
+
});
|
|
189
|
+
if (currentFile != null) files.push(currentFile);
|
|
190
|
+
}
|
|
191
|
+
return {
|
|
192
|
+
patchMetadata,
|
|
193
|
+
files
|
|
194
|
+
};
|
|
195
|
+
}
|
|
196
|
+
function _processFile(fileDiffString, { cacheKey, isGitDiff = GIT_DIFF_FILE_BREAK_REGEX.test(fileDiffString), oldFile, newFile, throwOnError = false } = {}) {
|
|
197
|
+
let lastHunkEnd = 0;
|
|
198
|
+
const hunks = splitAtLinePrefix(fileDiffString, "@@ ");
|
|
199
|
+
let currentFile;
|
|
200
|
+
const isPartial = oldFile == null || newFile == null;
|
|
201
|
+
let deletionLineIndex = 0;
|
|
202
|
+
let additionLineIndex = 0;
|
|
203
|
+
for (const hunk of hunks) {
|
|
204
|
+
const lines = splitWithNewlines(hunk);
|
|
205
|
+
const firstLine = lines[0];
|
|
206
|
+
if (firstLine == null) {
|
|
207
|
+
if (throwOnError) throw Error("parsePatchContent: invalid hunk");
|
|
208
|
+
else console.error("parsePatchContent: invalid hunk", hunk);
|
|
209
|
+
continue;
|
|
210
|
+
}
|
|
211
|
+
const fileHeader = parseHunkHeader(firstLine);
|
|
212
|
+
let additionLines = 0;
|
|
213
|
+
let deletionLines = 0;
|
|
214
|
+
if (fileHeader == null || currentFile == null) {
|
|
215
|
+
if (currentFile != null) {
|
|
216
|
+
if (throwOnError) throw Error("parsePatchContent: Invalid hunk");
|
|
217
|
+
else console.error("parsePatchContent: Invalid hunk", hunk);
|
|
218
|
+
continue;
|
|
219
|
+
}
|
|
220
|
+
currentFile = {
|
|
221
|
+
name: "",
|
|
222
|
+
type: "change",
|
|
223
|
+
hunks: [],
|
|
224
|
+
splitLineCount: 0,
|
|
225
|
+
unifiedLineCount: 0,
|
|
226
|
+
isPartial,
|
|
227
|
+
additionLines: !isPartial && oldFile != null && newFile != null ? splitFileContents(newFile.contents) : [],
|
|
228
|
+
deletionLines: !isPartial && oldFile != null && newFile != null ? splitFileContents(oldFile.contents) : [],
|
|
229
|
+
cacheKey: maybeDetachOptionalString(cacheKey)
|
|
230
|
+
};
|
|
231
|
+
if (currentFile.additionLines.length === 1 && newFile?.contents === "") currentFile.additionLines.length = 0;
|
|
232
|
+
if (currentFile.deletionLines.length === 1 && oldFile?.contents === "") currentFile.deletionLines.length = 0;
|
|
233
|
+
for (const line of lines) {
|
|
234
|
+
if (line.startsWith("diff --git")) {
|
|
235
|
+
const filenameMatch2 = line.trim().match(GIT_DIFF_HEADER_FILENAMES);
|
|
236
|
+
if (filenameMatch2 == null) {
|
|
237
|
+
if (throwOnError) throw Error("parsePatchContent: invalid git diff header");
|
|
238
|
+
else console.error("parsePatchContent: invalid git diff header", line);
|
|
239
|
+
continue;
|
|
240
|
+
}
|
|
241
|
+
const prevName = decodeDiffFileName(filenameMatch2[1], true);
|
|
242
|
+
const name = decodeDiffFileName(filenameMatch2[2], true);
|
|
243
|
+
currentFile.name = detachString(name);
|
|
244
|
+
if (prevName !== name) currentFile.prevName = detachString(prevName);
|
|
245
|
+
continue;
|
|
246
|
+
}
|
|
247
|
+
const filenameMatch = line.startsWith("---") || line.startsWith("+++") ? line.match(FILENAME_HEADER_REGEX) : null;
|
|
248
|
+
if (filenameMatch != null) {
|
|
249
|
+
const [, type, rawFileName] = filenameMatch;
|
|
250
|
+
const fileName = decodeDiffFileName(rawFileName, isGitDiff);
|
|
251
|
+
if (type === "---" && fileName !== "/dev/null") {
|
|
252
|
+
const detachedFileName = detachString(fileName);
|
|
253
|
+
currentFile.prevName = detachedFileName;
|
|
254
|
+
currentFile.name = detachedFileName;
|
|
255
|
+
} else if (type === "+++" && fileName !== "/dev/null") currentFile.name = detachString(fileName);
|
|
256
|
+
} else if (isGitDiff) {
|
|
257
|
+
if (line.startsWith("new mode ")) currentFile.mode = detachString(line.slice(8).trim());
|
|
258
|
+
if (line.startsWith("old mode ")) currentFile.prevMode = detachString(line.slice(8).trim());
|
|
259
|
+
if (line.startsWith("new file mode")) {
|
|
260
|
+
currentFile.type = "new";
|
|
261
|
+
currentFile.mode = detachString(line.slice(13).trim());
|
|
262
|
+
}
|
|
263
|
+
if (line.startsWith("deleted file mode")) {
|
|
264
|
+
currentFile.type = "deleted";
|
|
265
|
+
currentFile.mode = detachString(line.slice(17).trim());
|
|
266
|
+
}
|
|
267
|
+
if (line.startsWith("similarity index")) {
|
|
268
|
+
if (line.startsWith("similarity index 100%")) currentFile.type = "rename-pure";
|
|
269
|
+
else currentFile.type = "rename-changed";
|
|
270
|
+
}
|
|
271
|
+
if (line.startsWith("index ")) {
|
|
272
|
+
const [, prevObjectId, newObjectId, mode] = line.trim().match(INDEX_LINE_METADATA) ?? [];
|
|
273
|
+
if (prevObjectId != null) currentFile.prevObjectId = detachString(prevObjectId);
|
|
274
|
+
if (newObjectId != null) currentFile.newObjectId = detachString(newObjectId);
|
|
275
|
+
if (mode != null) currentFile.mode = detachString(mode);
|
|
276
|
+
}
|
|
277
|
+
if (line.startsWith("rename from ") || line.startsWith("copy from ")) currentFile.prevName = detachString(decodeDiffFileName(line.slice(line.startsWith("rename") ? 12 : 10)));
|
|
278
|
+
if (line.startsWith("rename to ") || line.startsWith("copy to ")) currentFile.name = detachString(decodeDiffFileName(line.slice(line.startsWith("rename") ? 10 : 8)));
|
|
279
|
+
}
|
|
280
|
+
}
|
|
281
|
+
continue;
|
|
282
|
+
}
|
|
283
|
+
let currentContent;
|
|
284
|
+
let lastLineType;
|
|
285
|
+
while (lines.length > 0 && (lines[lines.length - 1] === "\n" || lines[lines.length - 1] === "\r" || lines[lines.length - 1] === "\r\n" || lines[lines.length - 1] === "")) lines.pop();
|
|
286
|
+
const { additionStart, deletionStart } = fileHeader;
|
|
287
|
+
deletionLineIndex = isPartial ? deletionLineIndex : deletionStart - 1;
|
|
288
|
+
additionLineIndex = isPartial ? additionLineIndex : additionStart - 1;
|
|
289
|
+
const hunkData = {
|
|
290
|
+
collapsedBefore: 0,
|
|
291
|
+
splitLineCount: 0,
|
|
292
|
+
splitLineStart: 0,
|
|
293
|
+
unifiedLineCount: 0,
|
|
294
|
+
unifiedLineStart: 0,
|
|
295
|
+
additionCount: fileHeader.additionCount,
|
|
296
|
+
additionStart,
|
|
297
|
+
additionLines,
|
|
298
|
+
deletionCount: fileHeader.deletionCount,
|
|
299
|
+
deletionStart,
|
|
300
|
+
deletionLines,
|
|
301
|
+
deletionLineIndex,
|
|
302
|
+
additionLineIndex,
|
|
303
|
+
hunkContent: [],
|
|
304
|
+
hunkContext: maybeDetachOptionalString(fileHeader.hunkContext),
|
|
305
|
+
hunkSpecs: detachString(firstLine),
|
|
306
|
+
noEOFCRAdditions: false,
|
|
307
|
+
noEOFCRDeletions: false
|
|
308
|
+
};
|
|
309
|
+
let parsedAdditionLines = 0;
|
|
310
|
+
let parsedDeletionLines = 0;
|
|
311
|
+
for (let lineIndex = 1; lineIndex < lines.length; lineIndex++) {
|
|
312
|
+
const rawLine = lines[lineIndex];
|
|
313
|
+
if (parsedAdditionLines >= hunkData.additionCount && parsedDeletionLines >= hunkData.deletionCount && !rawLine.startsWith("\\")) {
|
|
314
|
+
if (!(isHunkBodyLine(rawLine) && !isFormatPatchVersionSeparator(rawLine))) break;
|
|
315
|
+
if (throwOnError) throw Error("parsePatchContent: hunk has more lines than expected");
|
|
316
|
+
}
|
|
317
|
+
const firstChar = rawLine[0];
|
|
318
|
+
if (firstChar !== "+" && firstChar !== "-" && firstChar !== " " && firstChar !== "\\") {
|
|
319
|
+
if (throwOnError) throw Error("parsePatchContent: invalid hunk line");
|
|
320
|
+
console.error(`parseLineType: Invalid firstChar: "${firstChar}", full line: "${rawLine}"`);
|
|
321
|
+
console.error("processFile: invalid rawLine:", rawLine);
|
|
322
|
+
continue;
|
|
323
|
+
}
|
|
324
|
+
const type = parseRawLineType(firstChar);
|
|
325
|
+
if (type === "addition") {
|
|
326
|
+
if (throwOnError && parsedAdditionLines >= hunkData.additionCount) throw Error("parsePatchContent: hunk has too many addition lines");
|
|
327
|
+
const line = getParsedLineContent(rawLine);
|
|
328
|
+
if (currentContent == null || currentContent.type !== "change") {
|
|
329
|
+
currentContent = createContentGroup("change", deletionLineIndex, additionLineIndex);
|
|
330
|
+
hunkData.hunkContent.push(currentContent);
|
|
331
|
+
}
|
|
332
|
+
additionLineIndex++;
|
|
333
|
+
parsedAdditionLines++;
|
|
334
|
+
if (isPartial) currentFile.additionLines.push(line);
|
|
335
|
+
currentContent.additions++;
|
|
336
|
+
additionLines++;
|
|
337
|
+
lastLineType = "addition";
|
|
338
|
+
} else if (type === "deletion") {
|
|
339
|
+
if (throwOnError && parsedDeletionLines >= hunkData.deletionCount) throw Error("parsePatchContent: hunk has too many deletion lines");
|
|
340
|
+
const line = getParsedLineContent(rawLine);
|
|
341
|
+
if (currentContent == null || currentContent.type !== "change") {
|
|
342
|
+
currentContent = createContentGroup("change", deletionLineIndex, additionLineIndex);
|
|
343
|
+
hunkData.hunkContent.push(currentContent);
|
|
344
|
+
}
|
|
345
|
+
deletionLineIndex++;
|
|
346
|
+
parsedDeletionLines++;
|
|
347
|
+
if (isPartial) currentFile.deletionLines.push(line);
|
|
348
|
+
currentContent.deletions++;
|
|
349
|
+
deletionLines++;
|
|
350
|
+
lastLineType = "deletion";
|
|
351
|
+
} else if (type === "context") {
|
|
352
|
+
if (throwOnError && (parsedDeletionLines >= hunkData.deletionCount || parsedAdditionLines >= hunkData.additionCount)) throw Error("parsePatchContent: hunk has too many context lines");
|
|
353
|
+
const line = getParsedLineContent(rawLine);
|
|
354
|
+
if (currentContent == null || currentContent.type !== "context") {
|
|
355
|
+
currentContent = createContentGroup("context", deletionLineIndex, additionLineIndex);
|
|
356
|
+
hunkData.hunkContent.push(currentContent);
|
|
357
|
+
}
|
|
358
|
+
additionLineIndex++;
|
|
359
|
+
deletionLineIndex++;
|
|
360
|
+
parsedAdditionLines++;
|
|
361
|
+
parsedDeletionLines++;
|
|
362
|
+
if (isPartial) {
|
|
363
|
+
currentFile.deletionLines.push(line);
|
|
364
|
+
currentFile.additionLines.push(line);
|
|
365
|
+
}
|
|
366
|
+
currentContent.lines++;
|
|
367
|
+
lastLineType = "context";
|
|
368
|
+
} else if (type === "metadata" && currentContent != null) {
|
|
369
|
+
if (currentContent.type === "context") {
|
|
370
|
+
hunkData.noEOFCRAdditions = true;
|
|
371
|
+
hunkData.noEOFCRDeletions = true;
|
|
372
|
+
} else if (lastLineType === "deletion") hunkData.noEOFCRDeletions = true;
|
|
373
|
+
else if (lastLineType === "addition") hunkData.noEOFCRAdditions = true;
|
|
374
|
+
if (isPartial && (lastLineType === "addition" || lastLineType === "context")) {
|
|
375
|
+
const lastIndex = currentFile.additionLines.length - 1;
|
|
376
|
+
if (lastIndex >= 0) currentFile.additionLines[lastIndex] = cleanLastNewline(currentFile.additionLines[lastIndex]);
|
|
377
|
+
}
|
|
378
|
+
if (isPartial && (lastLineType === "deletion" || lastLineType === "context")) {
|
|
379
|
+
const lastIndex = currentFile.deletionLines.length - 1;
|
|
380
|
+
if (lastIndex >= 0) currentFile.deletionLines[lastIndex] = cleanLastNewline(currentFile.deletionLines[lastIndex]);
|
|
381
|
+
}
|
|
382
|
+
}
|
|
383
|
+
}
|
|
384
|
+
if (parsedAdditionLines !== hunkData.additionCount || parsedDeletionLines !== hunkData.deletionCount) {
|
|
385
|
+
if (throwOnError) throw Error("parsePatchContent: hunk line count mismatch");
|
|
386
|
+
console.error(`parsePatchContent: hunk line count mismatch: "${firstLine.trimEnd()}", declared old/new ${hunkData.deletionCount}/${hunkData.additionCount}, parsed old/new ${parsedDeletionLines}/${parsedAdditionLines}`);
|
|
387
|
+
const repairedAdditionStart = getHunkSideStartBoundary(hunkData.additionStart, hunkData.additionCount) + (parsedAdditionLines === 0 ? 0 : 1);
|
|
388
|
+
const repairedDeletionStart = getHunkSideStartBoundary(hunkData.deletionStart, hunkData.deletionCount) + (parsedDeletionLines === 0 ? 0 : 1);
|
|
389
|
+
if (!isPartial) {
|
|
390
|
+
const additionStartDelta = repairedAdditionStart - hunkData.additionStart;
|
|
391
|
+
const deletionStartDelta = repairedDeletionStart - hunkData.deletionStart;
|
|
392
|
+
hunkData.additionLineIndex += additionStartDelta;
|
|
393
|
+
hunkData.deletionLineIndex += deletionStartDelta;
|
|
394
|
+
for (const content of hunkData.hunkContent) {
|
|
395
|
+
content.additionLineIndex += additionStartDelta;
|
|
396
|
+
content.deletionLineIndex += deletionStartDelta;
|
|
397
|
+
}
|
|
398
|
+
}
|
|
399
|
+
hunkData.additionStart = repairedAdditionStart;
|
|
400
|
+
hunkData.deletionStart = repairedDeletionStart;
|
|
401
|
+
hunkData.additionCount = parsedAdditionLines;
|
|
402
|
+
hunkData.deletionCount = parsedDeletionLines;
|
|
403
|
+
}
|
|
404
|
+
hunkData.additionLines = additionLines;
|
|
405
|
+
hunkData.deletionLines = deletionLines;
|
|
406
|
+
hunkData.collapsedBefore = Math.max(getHunkSideStartBoundary(hunkData.additionStart, hunkData.additionCount) - lastHunkEnd, 0);
|
|
407
|
+
currentFile.hunks.push(hunkData);
|
|
408
|
+
lastHunkEnd = getHunkSideEndBoundary(hunkData.additionStart, hunkData.additionCount);
|
|
409
|
+
for (const content of hunkData.hunkContent) if (content.type === "context") {
|
|
410
|
+
hunkData.splitLineCount += content.lines;
|
|
411
|
+
hunkData.unifiedLineCount += content.lines;
|
|
412
|
+
} else {
|
|
413
|
+
hunkData.splitLineCount += Math.max(content.additions, content.deletions);
|
|
414
|
+
hunkData.unifiedLineCount += content.deletions + content.additions;
|
|
415
|
+
}
|
|
416
|
+
hunkData.splitLineStart = currentFile.splitLineCount + hunkData.collapsedBefore;
|
|
417
|
+
hunkData.unifiedLineStart = currentFile.unifiedLineCount + hunkData.collapsedBefore;
|
|
418
|
+
currentFile.splitLineCount += hunkData.collapsedBefore + hunkData.splitLineCount;
|
|
419
|
+
currentFile.unifiedLineCount += hunkData.collapsedBefore + hunkData.unifiedLineCount;
|
|
420
|
+
}
|
|
421
|
+
if (currentFile == null) return;
|
|
422
|
+
if (throwOnError && isPartial && !isGitDiff && currentFile.hunks.length === 0) throw Error("parsePatchContent: unified file has no hunks");
|
|
423
|
+
if (currentFile.hunks.length > 0 && !isPartial && currentFile.additionLines.length > 0 && currentFile.deletionLines.length > 0) {
|
|
424
|
+
const lastHunk = currentFile.hunks[currentFile.hunks.length - 1];
|
|
425
|
+
const lastHunkEnd2 = getHunkSideEndBoundary(lastHunk.additionStart, lastHunk.additionCount);
|
|
426
|
+
const totalFileLines = currentFile.additionLines.length;
|
|
427
|
+
const collapsedAfter = Math.max(totalFileLines - lastHunkEnd2, 0);
|
|
428
|
+
currentFile.splitLineCount += collapsedAfter;
|
|
429
|
+
currentFile.unifiedLineCount += collapsedAfter;
|
|
430
|
+
}
|
|
431
|
+
if (!isGitDiff) {
|
|
432
|
+
if (currentFile.prevName != null && currentFile.name !== currentFile.prevName) {
|
|
433
|
+
if (currentFile.hunks.length > 0) currentFile.type = "rename-changed";
|
|
434
|
+
else currentFile.type = "rename-pure";
|
|
435
|
+
} else if ((oldFile == null || oldFile.contents === "") && newFile != null && newFile.contents !== "") currentFile.type = "new";
|
|
436
|
+
else if (oldFile != null && oldFile.contents !== "" && (newFile == null || newFile.contents === "")) currentFile.type = "deleted";
|
|
437
|
+
}
|
|
438
|
+
if (currentFile.type !== "rename-pure" && currentFile.type !== "rename-changed") currentFile.prevName = void 0;
|
|
439
|
+
realignChangeContentBySimilarity(currentFile);
|
|
440
|
+
return currentFile;
|
|
441
|
+
}
|
|
442
|
+
function parsePatchFiles(data, cacheKeyPrefix, throwOnError = false) {
|
|
443
|
+
const patches = [];
|
|
444
|
+
const rawPatches = hasCommitMetadataBoundary(data) ? data.split(COMMIT_METADATA_SPLIT) : [data];
|
|
445
|
+
for (const patch of rawPatches) try {
|
|
446
|
+
patches.push(_processPatch(patch, cacheKeyPrefix, throwOnError, cacheKeyPrefix != null ? patches.length : void 0));
|
|
447
|
+
} catch (error) {
|
|
448
|
+
if (throwOnError) throw error;
|
|
449
|
+
else console.error(error);
|
|
450
|
+
} finally {
|
|
451
|
+
releaseStringDetachBuffer();
|
|
452
|
+
}
|
|
453
|
+
return patches;
|
|
454
|
+
}
|
|
455
|
+
function decodeDiffFileName(value, stripGitPrefix = false) {
|
|
456
|
+
const rawName = value.trim();
|
|
457
|
+
const name = rawName.startsWith('"') ? parseQuotedDiffFileName(rawName)?.fileName ?? rawName : rawName;
|
|
458
|
+
return stripGitPrefix && (name.startsWith("a/") || name.startsWith("b/")) ? name.slice(2) : name;
|
|
459
|
+
}
|
|
460
|
+
function hasCommitMetadataBoundary(data) {
|
|
461
|
+
return data.startsWith("From ") || data.includes("\nFrom ");
|
|
462
|
+
}
|
|
463
|
+
function splitFileContents(contents) {
|
|
464
|
+
const lines = splitWithNewlines(contents);
|
|
465
|
+
for (let index = 0; index < lines.length; index++) lines[index] = detachString(lines[index]);
|
|
466
|
+
return lines;
|
|
467
|
+
}
|
|
468
|
+
function splitWithNewlines(contents) {
|
|
469
|
+
if (contents.length === 0) return [""];
|
|
470
|
+
const lines = [];
|
|
471
|
+
let startIndex = 0;
|
|
472
|
+
for (; ; ) {
|
|
473
|
+
const newlineIndex = contents.indexOf("\n", startIndex);
|
|
474
|
+
if (newlineIndex === -1) break;
|
|
475
|
+
lines.push(contents.slice(startIndex, newlineIndex + 1));
|
|
476
|
+
startIndex = newlineIndex + 1;
|
|
477
|
+
}
|
|
478
|
+
if (startIndex < contents.length) lines.push(contents.slice(startIndex));
|
|
479
|
+
return lines;
|
|
480
|
+
}
|
|
481
|
+
function splitGitDiffFiles(contents) {
|
|
482
|
+
return splitAtLinePrefix(contents, "diff --git");
|
|
483
|
+
}
|
|
484
|
+
function splitUnifiedDiffFiles(contents) {
|
|
485
|
+
if (contents.length === 0) return [""];
|
|
486
|
+
const parts = [];
|
|
487
|
+
let partStartIndex = 0;
|
|
488
|
+
let lineStartIndex = 0;
|
|
489
|
+
let remainingDeletionLines = 0;
|
|
490
|
+
let remainingAdditionLines = 0;
|
|
491
|
+
let hasOpenedUnifiedFile = false;
|
|
492
|
+
while (lineStartIndex < contents.length) {
|
|
493
|
+
const nextLineStartIndex = getNextLineStartIndex(contents, lineStartIndex);
|
|
494
|
+
if (remainingDeletionLines <= 0 && remainingAdditionLines <= 0) {
|
|
495
|
+
if (isUnifiedDiffFileHeaderAt(contents, lineStartIndex)) {
|
|
496
|
+
if (lineStartIndex > partStartIndex) parts.push(contents.slice(partStartIndex, lineStartIndex));
|
|
497
|
+
partStartIndex = lineStartIndex;
|
|
498
|
+
hasOpenedUnifiedFile = true;
|
|
499
|
+
lineStartIndex = getNextLineStartIndex(contents, nextLineStartIndex);
|
|
500
|
+
continue;
|
|
501
|
+
}
|
|
502
|
+
if (hasOpenedUnifiedFile && contents.startsWith("@@ -", lineStartIndex)) {
|
|
503
|
+
const fileHeader = parseHunkHeader(contents.slice(lineStartIndex, nextLineStartIndex));
|
|
504
|
+
if (fileHeader != null) {
|
|
505
|
+
remainingDeletionLines = fileHeader.deletionCount;
|
|
506
|
+
remainingAdditionLines = fileHeader.additionCount;
|
|
507
|
+
}
|
|
508
|
+
}
|
|
509
|
+
lineStartIndex = nextLineStartIndex;
|
|
510
|
+
continue;
|
|
511
|
+
}
|
|
512
|
+
const firstChar = contents[lineStartIndex];
|
|
513
|
+
if (firstChar === "\\") {
|
|
514
|
+
lineStartIndex = nextLineStartIndex;
|
|
515
|
+
continue;
|
|
516
|
+
}
|
|
517
|
+
if (firstChar === " ") {
|
|
518
|
+
remainingDeletionLines = Math.max(remainingDeletionLines - 1, 0);
|
|
519
|
+
remainingAdditionLines = Math.max(remainingAdditionLines - 1, 0);
|
|
520
|
+
} else if (firstChar === "-") remainingDeletionLines = Math.max(remainingDeletionLines - 1, 0);
|
|
521
|
+
else if (firstChar === "+") remainingAdditionLines = Math.max(remainingAdditionLines - 1, 0);
|
|
522
|
+
lineStartIndex = nextLineStartIndex;
|
|
523
|
+
}
|
|
524
|
+
parts.push(contents.slice(partStartIndex));
|
|
525
|
+
return parts;
|
|
526
|
+
}
|
|
527
|
+
function startsWithUnifiedDiffFileHeader(contents) {
|
|
528
|
+
return isUnifiedDiffFileHeaderAt(contents, 0);
|
|
529
|
+
}
|
|
530
|
+
function isUnifiedDiffFileHeaderAt(contents, lineStartIndex) {
|
|
531
|
+
const nextLineStartIndex = getNextLineStartIndex(contents, lineStartIndex);
|
|
532
|
+
return isUnifiedDiffHeaderLineAt(contents, lineStartIndex, "---") && isUnifiedDiffHeaderLineAt(contents, nextLineStartIndex, "+++");
|
|
533
|
+
}
|
|
534
|
+
function isUnifiedDiffHeaderLineAt(contents, lineStartIndex, prefix) {
|
|
535
|
+
if (!contents.startsWith(prefix, lineStartIndex)) return false;
|
|
536
|
+
const separator = contents[lineStartIndex + prefix.length];
|
|
537
|
+
if (separator !== " " && separator !== " ") return false;
|
|
538
|
+
for (let index = lineStartIndex + prefix.length + 1; index < contents.length; index++) {
|
|
539
|
+
const char = contents[index];
|
|
540
|
+
if (char === "\n" || char === "\r") break;
|
|
541
|
+
if (char !== " " && char !== " ") return true;
|
|
542
|
+
}
|
|
543
|
+
return false;
|
|
544
|
+
}
|
|
545
|
+
function getNextLineStartIndex(contents, lineStartIndex) {
|
|
546
|
+
const newlineIndex = contents.indexOf("\n", lineStartIndex);
|
|
547
|
+
return newlineIndex === -1 ? contents.length : newlineIndex + 1;
|
|
548
|
+
}
|
|
549
|
+
function isHunkBodyLine(line) {
|
|
550
|
+
const firstChar = line[0];
|
|
551
|
+
return firstChar === "+" || firstChar === "-" || firstChar === " ";
|
|
552
|
+
}
|
|
553
|
+
function isFormatPatchVersionSeparator(line) {
|
|
554
|
+
if (!line.startsWith("--")) return false;
|
|
555
|
+
for (let index = 2; index < line.length; index++) {
|
|
556
|
+
const char = line[index];
|
|
557
|
+
if (char !== " " && char !== " " && char !== "\n" && char !== "\r") return false;
|
|
558
|
+
}
|
|
559
|
+
return true;
|
|
560
|
+
}
|
|
561
|
+
function parseHunkHeader(line) {
|
|
562
|
+
if (!line.startsWith("@@ -")) return;
|
|
563
|
+
let index = 4;
|
|
564
|
+
const deletionStartResult = readPositiveInteger(line, index);
|
|
565
|
+
if (deletionStartResult == null) return;
|
|
566
|
+
const deletionStart = deletionStartResult.value;
|
|
567
|
+
index = deletionStartResult.endIndex;
|
|
568
|
+
let deletionCount = 1;
|
|
569
|
+
if (line[index] === ",") {
|
|
570
|
+
const deletionCountResult = readPositiveInteger(line, index + 1);
|
|
571
|
+
if (deletionCountResult == null) return;
|
|
572
|
+
deletionCount = deletionCountResult.value;
|
|
573
|
+
index = deletionCountResult.endIndex;
|
|
574
|
+
}
|
|
575
|
+
if (line[index] !== " " || line[index + 1] !== "+") return;
|
|
576
|
+
index += 2;
|
|
577
|
+
const additionStartResult = readPositiveInteger(line, index);
|
|
578
|
+
if (additionStartResult == null) return;
|
|
579
|
+
const additionStart = additionStartResult.value;
|
|
580
|
+
index = additionStartResult.endIndex;
|
|
581
|
+
let additionCount = 1;
|
|
582
|
+
if (line[index] === ",") {
|
|
583
|
+
const additionCountResult = readPositiveInteger(line, index + 1);
|
|
584
|
+
if (additionCountResult == null) return;
|
|
585
|
+
additionCount = additionCountResult.value;
|
|
586
|
+
index = additionCountResult.endIndex;
|
|
587
|
+
}
|
|
588
|
+
if (line[index] !== " " || line[index + 1] !== "@" || line[index + 2] !== "@") return;
|
|
589
|
+
let hunkContext;
|
|
590
|
+
const contextStartIndex = index + 3;
|
|
591
|
+
if (line[contextStartIndex] === " ") hunkContext = trimLineEnd(line.slice(contextStartIndex + 1));
|
|
592
|
+
return {
|
|
593
|
+
additionCount,
|
|
594
|
+
additionStart,
|
|
595
|
+
deletionCount,
|
|
596
|
+
deletionStart,
|
|
597
|
+
hunkContext
|
|
598
|
+
};
|
|
599
|
+
}
|
|
600
|
+
function readPositiveInteger(value, startIndex) {
|
|
601
|
+
let index = startIndex;
|
|
602
|
+
let parsedValue = 0;
|
|
603
|
+
for (; index < value.length; index++) {
|
|
604
|
+
const digit = value.charCodeAt(index) - 48;
|
|
605
|
+
if (digit < 0 || digit > 9) break;
|
|
606
|
+
parsedValue = parsedValue * 10 + digit;
|
|
607
|
+
}
|
|
608
|
+
if (index === startIndex) return;
|
|
609
|
+
return {
|
|
610
|
+
value: parsedValue,
|
|
611
|
+
endIndex: index
|
|
612
|
+
};
|
|
613
|
+
}
|
|
614
|
+
function trimLineEnd(value) {
|
|
615
|
+
if (value.endsWith("\r\n")) return value.slice(0, -2);
|
|
616
|
+
if (value.endsWith("\n")) return value.slice(0, -1);
|
|
617
|
+
return value;
|
|
618
|
+
}
|
|
619
|
+
function isGitDiffPatch(data) {
|
|
620
|
+
return data.startsWith("diff --git") || data.includes("\ndiff --git");
|
|
621
|
+
}
|
|
622
|
+
function splitAtLinePrefix(contents, prefix) {
|
|
623
|
+
if (contents.length === 0) return [""];
|
|
624
|
+
const newlinePrefix = `
|
|
625
|
+
${prefix}`;
|
|
626
|
+
const firstBoundaryIndex = contents.startsWith(prefix) ? 0 : findLinePrefixIndex(contents, newlinePrefix, 0);
|
|
627
|
+
if (firstBoundaryIndex === -1) return [contents];
|
|
628
|
+
const parts = [];
|
|
629
|
+
if (firstBoundaryIndex > 0) parts.push(contents.slice(0, firstBoundaryIndex));
|
|
630
|
+
let startIndex = firstBoundaryIndex;
|
|
631
|
+
for (; ; ) {
|
|
632
|
+
const nextBoundaryIndex = findLinePrefixIndex(contents, newlinePrefix, startIndex + 1);
|
|
633
|
+
if (nextBoundaryIndex === -1) break;
|
|
634
|
+
parts.push(contents.slice(startIndex, nextBoundaryIndex));
|
|
635
|
+
startIndex = nextBoundaryIndex;
|
|
636
|
+
}
|
|
637
|
+
parts.push(contents.slice(startIndex));
|
|
638
|
+
return parts;
|
|
639
|
+
}
|
|
640
|
+
function findLinePrefixIndex(contents, newlinePrefix, fromIndex) {
|
|
641
|
+
const index = contents.indexOf(newlinePrefix, fromIndex);
|
|
642
|
+
return index === -1 ? -1 : index + 1;
|
|
643
|
+
}
|
|
644
|
+
function maybeDetachOptionalString(value) {
|
|
645
|
+
return value == null ? value : detachString(value);
|
|
646
|
+
}
|
|
647
|
+
function parseRawLineType(firstChar) {
|
|
648
|
+
return firstChar === " " ? "context" : firstChar === "\\" ? "metadata" : firstChar === "+" ? "addition" : "deletion";
|
|
649
|
+
}
|
|
650
|
+
function getParsedLineContent(rawLine) {
|
|
651
|
+
const processedLine = rawLine.slice(1);
|
|
652
|
+
return detachString(processedLine === "" ? "\n" : processedLine);
|
|
653
|
+
}
|
|
654
|
+
function createContentGroup(type, deletionLineIndex, additionLineIndex) {
|
|
655
|
+
if (type === "change") return {
|
|
656
|
+
type: "change",
|
|
657
|
+
additions: 0,
|
|
658
|
+
deletions: 0,
|
|
659
|
+
additionLineIndex,
|
|
660
|
+
deletionLineIndex
|
|
661
|
+
};
|
|
662
|
+
return {
|
|
663
|
+
type: "context",
|
|
664
|
+
lines: 0,
|
|
665
|
+
additionLineIndex,
|
|
666
|
+
deletionLineIndex
|
|
667
|
+
};
|
|
668
|
+
}
|
|
669
|
+
function hashText(text) {
|
|
670
|
+
let h = 2166136261;
|
|
671
|
+
for (let i = 0; i < text.length; i++) {
|
|
672
|
+
h ^= text.charCodeAt(i);
|
|
673
|
+
h = Math.imul(h, 16777619);
|
|
674
|
+
}
|
|
675
|
+
return (h >>> 0).toString(16).padStart(8, "0");
|
|
676
|
+
}
|
|
677
|
+
function splitPatch(patch) {
|
|
678
|
+
const out = [];
|
|
679
|
+
const re = /^diff --git /gm;
|
|
680
|
+
let start = -1;
|
|
681
|
+
for (let m = re.exec(patch); m; m = re.exec(patch)) {
|
|
682
|
+
if (start >= 0) out.push(patch.slice(start, m.index));
|
|
683
|
+
start = m.index;
|
|
684
|
+
}
|
|
685
|
+
if (start >= 0) out.push(patch.slice(start));
|
|
686
|
+
return out;
|
|
687
|
+
}
|
|
688
|
+
function sectionKeys(patch) {
|
|
689
|
+
const seen = /* @__PURE__ */ new Map();
|
|
690
|
+
return splitPatch(patch).map((text) => {
|
|
691
|
+
const hash = hashText(text);
|
|
692
|
+
const n = seen.get(hash) ?? 0;
|
|
693
|
+
seen.set(hash, n + 1);
|
|
694
|
+
return { key: n === 0 ? hash : `${hash}.${n}`, text };
|
|
695
|
+
});
|
|
696
|
+
}
|
|
697
|
+
function parseSection(key, text) {
|
|
698
|
+
try {
|
|
699
|
+
return parsePatchFiles(text, `wt:${key}:`).flatMap((p) => p.files)[0] ?? null;
|
|
700
|
+
} catch {
|
|
701
|
+
return null;
|
|
702
|
+
}
|
|
703
|
+
}
|
|
704
|
+
function parseWorkingTree(req) {
|
|
705
|
+
const known = new Set(req.known);
|
|
706
|
+
return {
|
|
707
|
+
id: req.id,
|
|
708
|
+
files: sectionKeys(req.patch).map(
|
|
709
|
+
({ key, text }) => known.has(key) ? { key } : { key, file: parseSection(key, text) }
|
|
710
|
+
)
|
|
711
|
+
};
|
|
712
|
+
}
|
|
713
|
+
self.onmessage = (event) => {
|
|
714
|
+
self.postMessage(parseWorkingTree(event.data));
|
|
715
|
+
};
|