diff --git a/.claude/skills/cfe-borrow/scripts/cfe-borrow.ps1 b/.claude/skills/cfe-borrow/scripts/cfe-borrow.ps1 index 7f36640a..a64ec15b 100644 --- a/.claude/skills/cfe-borrow/scripts/cfe-borrow.ps1 +++ b/.claude/skills/cfe-borrow/scripts/cfe-borrow.ps1 @@ -1,4 +1,4 @@ -# cfe-borrow v1.0 — Borrow objects from configuration into extension (CFE) +# cfe-borrow v1.1 — Borrow objects from configuration into extension (CFE) # Source: https://github.com/Nikolay-Shirokov/cc-1c-skills param( [Parameter(Mandatory)][string]$ExtensionPath, @@ -476,8 +476,9 @@ function Borrow-Form { $formVersion = $srcFormEl.GetAttribute("version") if (-not $formVersion) { $formVersion = "2.17" } - # Find direct children: form properties and AutoCommandBar + # Find direct children: form properties, AutoCommandBar, ChildItems $srcAutoCmd = $null + $srcChildItems = $null $formProps = @() $reachedVisual = $false foreach ($fc in $srcFormEl.ChildNodes) { @@ -485,11 +486,13 @@ function Borrow-Form { if ($fc.LocalName -eq 'AutoCommandBar' -and -not $srcAutoCmd) { $reachedVisual = $true; $srcAutoCmd = $fc; continue } - if ($fc.LocalName -eq 'ChildItems' -or $fc.LocalName -eq 'Events' -or $fc.LocalName -eq 'Attributes' -or $fc.LocalName -eq 'Commands' -or $fc.LocalName -eq 'Parameters') { + if ($fc.LocalName -eq 'ChildItems' -and -not $srcChildItems) { + $reachedVisual = $true; $srcChildItems = $fc; continue + } + if ($fc.LocalName -eq 'Events' -or $fc.LocalName -eq 'Attributes' -or $fc.LocalName -eq 'Commands' -or $fc.LocalName -eq 'Parameters') { $reachedVisual = $true; continue } if (-not $reachedVisual) { - # Form-level properties before AutoCommandBar (WindowOpeningMode, AutoFillCheck, etc.) $formProps += $fc.OuterXml } } @@ -497,17 +500,187 @@ function Borrow-Form { # Get OuterXml and strip redundant namespace redeclarations (they're on root