mirror of
https://github.com/Nikolay-Shirokov/cc-1c-skills.git
synced 2026-07-24 05:31:02 +03:00
feat(meta-compile,meta-decompile): кастомизация LineNumber табличной части (v1.32/v0.22)
У каждой ТЧ ровно один стандартный реквизит — НомерСтроки (LineNumber), и его свойства (синоним/подсказка/полнотекстовый поиск/…) тоже переопределяемы. Раньше компилятор эмитил only-default блок, декомпилятор кастомизацию не ловил. DSL `lineNumber` на объектной форме ТЧ (omit-on-default по каждому свойству): synonym/comment/fullTextSearch/tooltip/format/editFormat/choiceHistoryOnInput. Emit-StandardAttribute расширен (Format/EditFormat через Emit-MLText, ChoiceHistoryOnInput из ov — были захардкожены); Emit-TabularStandardAttributes принимает spec и строит ov. Декомпилятор захватывает из xr:StandardAttribute[@name='LineNumber'] → ключ lineNumber. Покрыта КАСТОМИЗАЦИЯ (в корпусе 2/1728, только synonym — но задокументирован полный набор из 7 свойств). 44/1728 ТЧ блок вовсе ОПУСКАЮТ — правило опущения не выводится (FillChecking/Use не различают опускающие/имеющие), компилятор эмитит блок всегда → not-covered хвост (решение совместное). Аддитивно: all-default блок (1684/1728) эмитится идентично, регрессий нет (TOTAL 78 без изменений). Регресс 47/47 ps1+py, ps1↔py identical. spec §5.1, кейс catalog-ts-linenumber. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 4.8
parent
177c9bb0fa
commit
027e6a4a89
@@ -1,4 +1,4 @@
|
||||
# meta-decompile v0.21 — XML объекта метаданных 1С → JSON-черновик формата meta-compile
|
||||
# meta-decompile v0.22 — XML объекта метаданных 1С → JSON-черновик формата meta-compile
|
||||
# Source: https://github.com/Nikolay-Shirokov/cc-1c-skills
|
||||
#
|
||||
# Пилот: только Catalog. Инверс meta-compile (omit-on-default: ключ эмитим только
|
||||
@@ -573,11 +573,24 @@ if ($childObjs) {
|
||||
elseif ($null -ne $tsSyn) { $tsSynCustom = $true }
|
||||
$tsTt = Get-MLValue ($tsp.SelectSingleNode('md:ToolTip', $nsm))
|
||||
$tsCmtN = $tsp.SelectSingleNode('md:Comment', $nsm); $tsCmt = if ($tsCmtN) { $tsCmtN.InnerText } else { '' }
|
||||
if ($tsSynCustom -or ($null -ne $tsTt) -or $tsCmt) {
|
||||
# Кастомизация стандартного реквизита LineNumber (НомерСтроки) — omit-on-default по каждому свойству.
|
||||
$lnObj = [ordered]@{}
|
||||
$lnNode = $tsp.SelectSingleNode("md:StandardAttributes/xr:StandardAttribute[@name='LineNumber']", $nsm)
|
||||
if ($lnNode) {
|
||||
$lnSyn = Get-MLValue ($lnNode.SelectSingleNode('xr:Synonym', $nsm)); if ($null -ne $lnSyn) { $lnObj['synonym'] = $lnSyn }
|
||||
$lnCmtN = $lnNode.SelectSingleNode('xr:Comment', $nsm); if ($lnCmtN -and $lnCmtN.InnerText) { $lnObj['comment'] = $lnCmtN.InnerText }
|
||||
$lnFtsN = $lnNode.SelectSingleNode('xr:FullTextSearch', $nsm); if ($lnFtsN -and $lnFtsN.InnerText -ne 'Use') { $lnObj['fullTextSearch'] = $lnFtsN.InnerText }
|
||||
$lnTt = Get-MLValue ($lnNode.SelectSingleNode('xr:ToolTip', $nsm)); if ($null -ne $lnTt) { $lnObj['tooltip'] = $lnTt }
|
||||
$lnFmt = Get-MLValue ($lnNode.SelectSingleNode('xr:Format', $nsm)); if ($null -ne $lnFmt) { $lnObj['format'] = $lnFmt }
|
||||
$lnEfmt = Get-MLValue ($lnNode.SelectSingleNode('xr:EditFormat', $nsm)); if ($null -ne $lnEfmt) { $lnObj['editFormat'] = $lnEfmt }
|
||||
$lnChiN = $lnNode.SelectSingleNode('xr:ChoiceHistoryOnInput', $nsm); if ($lnChiN -and $lnChiN.InnerText -ne 'Auto') { $lnObj['choiceHistoryOnInput'] = $lnChiN.InnerText }
|
||||
}
|
||||
if ($tsSynCustom -or ($null -ne $tsTt) -or $tsCmt -or $lnObj.Count -gt 0) {
|
||||
$to = [ordered]@{}
|
||||
if ($tsSynCustom) { $to['synonym'] = $tsSyn }
|
||||
if ($null -ne $tsTt) { $to['tooltip'] = $tsTt }
|
||||
if ($tsCmt) { $to['comment'] = $tsCmt }
|
||||
if ($lnObj.Count -gt 0) { $to['lineNumber'] = $lnObj }
|
||||
$to['attributes'] = $cols
|
||||
$tsMap[$tsName] = $to
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user