From 8009a8150f2cff2410a61296de79d5271e2c9b54 Mon Sep 17 00:00:00 2001 From: Nick Shirokov Date: Fri, 22 May 2026 21:37:26 +0300 Subject: [PATCH] =?UTF-8?q?feat(skd-compile):=20use=3Dfalse=20wrapper=20?= =?UTF-8?q?=D0=B2=20outputParameters?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit outputParameters item тоже может иметь false (например — отключённый «Заголовок» в варианте). Emit-OutputParameters теперь распознаёт wrapper {value, use: false} и эмитит в начале item, как уже делал Emit-AppearanceValue. Co-Authored-By: Claude Opus 4.7 --- .claude/skills/skd-compile/scripts/skd-compile.ps1 | 12 +++++++++++- .claude/skills/skd-compile/scripts/skd-compile.py | 9 ++++++++- 2 files changed, 19 insertions(+), 2 deletions(-) diff --git a/.claude/skills/skd-compile/scripts/skd-compile.ps1 b/.claude/skills/skd-compile/scripts/skd-compile.ps1 index 7f873e3a..5041e49c 100644 --- a/.claude/skills/skd-compile/scripts/skd-compile.ps1 +++ b/.claude/skills/skd-compile/scripts/skd-compile.ps1 @@ -1,4 +1,4 @@ -# skd-compile v1.59 — Compile 1C DCS from JSON +# skd-compile v1.60 — Compile 1C DCS from JSON # Source: https://github.com/Nikolay-Shirokov/cc-1c-skills param( [string]$DefinitionFile, @@ -2314,6 +2314,15 @@ function Emit-OutputParameters { foreach ($prop in $params.PSObject.Properties) { $key = $prop.Name $rawVal = $prop.Value + # Распознаём wrapper {use: false, value: ...} (отличаем от multilang dict) + $useWrapper = $false + if ($rawVal -is [PSCustomObject] -and $rawVal.PSObject.Properties['use'] -and $rawVal.use -eq $false -and $rawVal.PSObject.Properties['value']) { + $useWrapper = $true + $rawVal = $rawVal.value + } elseif (($rawVal -is [hashtable] -or $rawVal -is [System.Collections.IDictionary]) -and $rawVal.Contains('use') -and $rawVal['use'] -eq $false -and $rawVal.Contains('value')) { + $useWrapper = $true + $rawVal = $rawVal['value'] + } $ptype = $script:outputParamTypes[$key] if (-not $ptype) { $ptype = "xs:string" } # Auto-promote to mltext if value is a multilang dict ({ru, en, ...}) @@ -2322,6 +2331,7 @@ function Emit-OutputParameters { } X "$indent`t" + if ($useWrapper) { X "$indent`t`tfalse" } X "$indent`t`t$(Esc-Xml $key)" if ($ptype -eq "mltext") { Emit-MLText -tag "dcscor:value" -text $rawVal -indent "$indent`t`t" diff --git a/.claude/skills/skd-compile/scripts/skd-compile.py b/.claude/skills/skd-compile/scripts/skd-compile.py index e098adf4..86f55559 100644 --- a/.claude/skills/skd-compile/scripts/skd-compile.py +++ b/.claude/skills/skd-compile/scripts/skd-compile.py @@ -1,5 +1,5 @@ #!/usr/bin/env python3 -# skd-compile v1.59 — Compile 1C DCS from JSON +# skd-compile v1.60 — Compile 1C DCS from JSON # Source: https://github.com/Nikolay-Shirokov/cc-1c-skills import argparse import json @@ -1931,12 +1931,19 @@ def emit_output_parameters(lines, params, indent): lines.append(f'{indent}') for key, val in params.items(): + # Распознаём wrapper {use: false, value: ...} — отличаем от multilang dict + use_wrapper = False + if isinstance(val, dict) and val.get('use') is False and 'value' in val: + use_wrapper = True + val = val['value'] ptype = OUTPUT_PARAM_TYPES.get(key, 'xs:string') # Auto-promote to mltext if value is a multilang dict ({ru, en, ...}) if isinstance(val, dict): ptype = 'mltext' lines.append(f'{indent}\t') + if use_wrapper: + lines.append(f'{indent}\t\tfalse') lines.append(f'{indent}\t\t{esc_xml(key)}') if ptype == 'mltext': emit_mltext(lines, f'{indent}\t\t', 'dcscor:value', val)