feat(meta-info): show LimitLevelCount/LevelCount for hierarchical catalogs

Closes #10

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Nick Shirokov
2026-03-17 19:26:14 +03:00
co-authored by Claude Opus 4.6
parent bb02c1b0bd
commit ffa3189442
2 changed files with 15 additions and 2 deletions
@@ -1,4 +1,4 @@
# meta-info v1.0 — Compact summary of 1C metadata object # meta-info v1.1 — Compact summary of 1C metadata object
# Source: https://github.com/Nikolay-Shirokov/cc-1c-skills # Source: https://github.com/Nikolay-Shirokov/cc-1c-skills
param( param(
[Parameter(Mandatory=$true)][string]$ObjectPath, [Parameter(Mandatory=$true)][string]$ObjectPath,
@@ -773,6 +773,13 @@ if (-not $drillDone) {
if ($hier -and $hier.InnerText -eq "true") { if ($hier -and $hier.InnerText -eq "true") {
$ht = $props.SelectSingleNode("md:HierarchyType", $ns) $ht = $props.SelectSingleNode("md:HierarchyType", $ns)
$htText = if ($ht -and $ht.InnerText -eq "HierarchyFoldersAndItems") { "группы и элементы" } else { "элементы" } $htText = if ($ht -and $ht.InnerText -eq "HierarchyFoldersAndItems") { "группы и элементы" } else { "элементы" }
$limitNode = $props.SelectSingleNode("md:LimitLevelCount", $ns)
$levelNode = $props.SelectSingleNode("md:LevelCount", $ns)
if ($limitNode -and $limitNode.InnerText -eq "true" -and $levelNode) {
$htText += ", уровней: $($levelNode.InnerText)"
} else {
$htText += ", без ограничения уровней"
}
$parts += "Иерархический: $htText" $parts += "Иерархический: $htText"
} }
$codeLen = $props.SelectSingleNode("md:CodeLength", $ns) $codeLen = $props.SelectSingleNode("md:CodeLength", $ns)
@@ -1,4 +1,4 @@
# meta-info v1.0 — Compact summary of 1C metadata object (Python port) # meta-info v1.1 — Compact summary of 1C metadata object (Python port)
# Source: https://github.com/Nikolay-Shirokov/cc-1c-skills # Source: https://github.com/Nikolay-Shirokov/cc-1c-skills
import argparse import argparse
import os import os
@@ -793,6 +793,12 @@ if not drill_done:
if hier is not None and inner_text(hier) == "true": if hier is not None and inner_text(hier) == "true":
ht = find(props, "md:HierarchyType") ht = find(props, "md:HierarchyType")
ht_text = "группы и элементы" if ht is not None and inner_text(ht) == "HierarchyFoldersAndItems" else "элементы" ht_text = "группы и элементы" if ht is not None and inner_text(ht) == "HierarchyFoldersAndItems" else "элементы"
limit_node = find(props, "md:LimitLevelCount")
level_node = find(props, "md:LevelCount")
if limit_node is not None and inner_text(limit_node) == "true" and level_node is not None:
ht_text += f", уровней: {inner_text(level_node)}"
else:
ht_text += ", без ограничения уровней"
parts.append(f"Иерархический: {ht_text}") parts.append(f"Иерархический: {ht_text}")
code_len = find(props, "md:CodeLength") code_len = find(props, "md:CodeLength")
desc_len = find(props, "md:DescriptionLength") desc_len = find(props, "md:DescriptionLength")