← Commit history

v0.9.188: closes #37 - symbol extraction required leading whitespace, so a valid .kicad_sym with its top-level symbol at column 0 yielded 'No symbols found'. Indentation is not semantic; the _N_N suffix filter is the real sub-unit signal

John Lauer ·7949b9014d ·1mo ago ·parent 8808fb0
5 files changed +16−12
BRIDGE_VERSION+1−1
@@ -1 +1 @@-0.9.187+0.9.188
adom-bridge-kicad-manifest.json+5−5
@@ -1,15 +1,15 @@ {   "manifest_version": 1,   "name": "kicad",-  "version": "0.9.187",-  "url": "https://wiki.adom.inc/download/adom/kicad-bridge/0.9.187/adom-bridge-kicad-v0.9.187.zip",-  "sha256": "279aec2125f3cb52f91bbd8ddfd24cf1a0c8b485824b0e597246caf2484af510",-  "size": 455506,+  "version": "0.9.188",+  "url": "https://wiki.adom.inc/download/adom/kicad-bridge/0.9.188/adom-bridge-kicad-v0.9.188.zip",+  "sha256": "551063bec787383debea7324f659ee9274195fd530f9aae840a452271815547f",+  "size": 455691,   "verbPrefixes": [     "kicad_"   ],   "healthEndpoint": "/status",-  "released_at": "2026-08-19T20:32:19Z",+  "released_at": "2026-08-19T20:37:29Z",   "hero": "https://wiki.adom.inc/blob/app/kicad-bridge/kicad-hero.png",   "languages": [     "Python",
adom-bridge-kicad-v0.9.188.zipadded
⋯ 1 unchanged line ⋯
adom_library.py+9−5
@@ -20,10 +20,14 @@ ADOM_LIB_FILE = "Adom.kicad_sym" ADOM_LIB_DESCRIPTION = "Adom Bridge - custom symbols"  # Regex to extract top-level (symbol "NAME" ...) blocks.-# Top-level symbols are indented with exactly one leading whitespace group-# (2 spaces typically) whereas sub-unit symbols have deeper indentation.-# We use a balanced-paren counter to find the closing paren.-_SYMBOL_NAME_RE = re.compile(r'^\s+\(symbol\s+"([^"]+)"', re.MULTILINE)+# INDENTATION IS NOT SEMANTIC in s-expressions, so it must not be load-bearing+# here. This regex has now failed in BOTH directions: keying on exactly 2 spaces+# missed every tab-indented library, and requiring at least one whitespace char+# missed a file whose top-level symbol sits at column 0 (wiki issue #37, Colby+# Knox - a valid KiCad 10 file that renders fine elsewhere). Match ANY leading+# whitespace INCLUDING NONE, and let the `_N_N` name-suffix filter do the real+# work of excluding sub-units, which is the only reliable signal.+_SYMBOL_NAME_RE = re.compile(r'^[ \t]*\(symbol\s+"([^"]+)"', re.MULTILINE)  # Template for an empty Adom.kicad_sym _EMPTY_LIB = (@@ -165,7 +169,7 @@ def _extract_top_level_symbols(text: str) -> list[tuple[str, str]]:     # `_N_N` name-suffix filter below to drop the nested sub-unit symbols. Keying     # on exactly 2 spaces silently extracted ZERO symbols from every tab-indented     # library → install_symbol failed "No symbols found". (ADOMBASELINE 2026-07.)-    for m in re.finditer(r'^[ \t]+\(symbol\s+"([^"]+)"', text, re.MULTILINE):+    for m in re.finditer(r'^[ \t]*\(symbol\s+"([^"]+)"', text, re.MULTILINE):         name = m.group(1)         # Skip sub-unit symbols (named "Parent_0_1", "Parent_1_1", ...)         if re.search(r"_\d+_\d+$", name):
bridge.json+1−1
@@ -2,7 +2,7 @@   "manifest_version": 1,   "name": "kicad",   "displayName": "KiCad EDA",-  "version": "0.9.187",+  "version": "0.9.188",   "description": "Reverse bridge for KiCad \u2014 board/schematic introspection, lint via kicad-cli, plugin install, multi-instance probe, in-process DRC.",   "homepage": "https://wiki.adom.inc/adom/adom-bridge",   "author": "Adom Inc.",