mirror of
https://github.com/Nikolay-Shirokov/cc-1c-skills.git
synced 2026-08-01 09:17:44 +03:00
feat(form-decompile,form-compile): заголовок реквизита — суппресс-маркер "" + omit авто-вывода (кластер Attribute>Title)
Компилятор для не-main реквизита БЕЗ ключа title додумывал <Title> из имени, хотя платформа реквизит без синонима хранит без <Title>. На корпусе (295609 реквизитов): 22% без <Title> — всем додумывался заголовок (ADDED Attribute>Title = 170 в выборке). Компилятор (ps1+py): эмиссия Title реквизита приведена к логике Emit-Title — нет ключа → авто-вывод (кроме main); title "" → подавить (раньше "" был falsy и уходил в авто-вывод — это и был баг); непустой → как есть. Декомпилятор (ps1): нет <Title> → title:"" (суппресс-маркер); ru-only заголовок, равный авто-выводу из имени → опускаем ключ (компилятор воспроизведёт, 35% = 103908 реквизитов корпуса); иначе → явный. Скопировано точное зеркало Title-FromName для сверки. Регресс: attributes-types.json — реквизит с title:"" (подавление) рядом с авто-выводом + снэпшот. spec §реквизиты обновлён. TOTAL diff lines выборки 2.17: 2255 → 1750 (−505); cascade ADDED 292 → 33. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 4.8
parent
2367eaa353
commit
cfce486004
@@ -1,4 +1,4 @@
|
||||
# form-compile v1.61 — Compile 1C managed form from JSON or object metadata
|
||||
# form-compile v1.62 — Compile 1C managed form from JSON or object metadata
|
||||
# Source: https://github.com/Nikolay-Shirokov/cc-1c-skills
|
||||
param(
|
||||
[string]$JsonPath,
|
||||
@@ -3664,9 +3664,13 @@ function Emit-Attributes {
|
||||
X "$indent`t<Attribute name=`"$attrName`" id=`"$attrId`">"
|
||||
$inner = "$indent`t`t"
|
||||
|
||||
$attrTitle = if ($attr.title) { $attr.title } elseif ($attr.main -ne $true) { Title-FromName -name $attrName } else { '' }
|
||||
if ($attrTitle) {
|
||||
Emit-MLText -tag "Title" -text $attrTitle -indent $inner
|
||||
# Title атрибута (зеркало Emit-Title): нет ключа → авто-вывод из имени (кроме main);
|
||||
# title "" → подавить; непустой → эмитить как есть.
|
||||
$hasTitleKey = $null -ne $attr.PSObject.Properties['title']
|
||||
if ($hasTitleKey) {
|
||||
if ($attr.title) { Emit-MLText -tag "Title" -text $attr.title -indent $inner }
|
||||
} elseif ($attr.main -ne $true) {
|
||||
Emit-MLText -tag "Title" -text (Title-FromName -name $attrName) -indent $inner
|
||||
}
|
||||
|
||||
# Type
|
||||
|
||||
Reference in New Issue
Block a user