From 53014b9733392d0da5d092f297249426d6a5eabd Mon Sep 17 00:00:00 2001 From: Tom Date: Sun, 1 Mar 2026 21:12:51 +0100 Subject: [PATCH] fix: remove invalid ;; comments from template_with_symbols_expanded.kicad_sch MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit PROBLEM ------- Upstream commit b98c94b added 7 comment lines (;; PASSIVES, ;; SEMICONDUCTORS, ;; INTEGRATED CIRCUITS, ;; CONNECTORS, ;; POWER/REGULATORS, ;; MISC, ;; TEMPLATE INSTANCES) to template_with_symbols_expanded.kicad_sch. KiCAD's S-expression parser does NOT support any comment syntax. It expects every non-empty line to begin with '('. These comments caused KiCAD 9 to refuse opening any schematic generated from this template: Expecting '(' in .kicad_sch, line 8, offset 5 AFFECTED USERS -------------- Any project whose .kicad_sch was generated by the MCP server after upstream commit b98c94b and before this fix contains the same invalid lines. Those files must be repaired manually: open the .kicad_sch in a text editor and delete every line beginning with ';;'. FIX --- Remove all 7 ;; lines from the template. No functional change — the comments provided no information that is not already evident from the symbol names. ALSO ---- CHANGELOG: add critical bug-fix entry for this regression under v2.2.2-alpha --- CHANGELOG.md | 10 ++++++++++ .../templates/template_with_symbols_expanded.kicad_sch | 7 ------- 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 4c6e598..5ddfc60 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -40,6 +40,16 @@ All notable changes to the KiCAD MCP Server project are documented here. format version `20250114` (KiCAD 9) after upstream commit `2b38796` accidentally downgraded both files to `20240101`. KiCAD 9 rejects schematics with outdated version numbers. +- **CRITICAL: `template_with_symbols_expanded.kicad_sch`**: removed 7 invalid `;;` comment + lines introduced by upstream commit `b98c94b`. KiCAD's S-expression parser does not support + any comment syntax — it expects every non-empty, non-whitespace line to start with `(`. + The comments (`;; PASSIVES`, `;; SEMICONDUCTORS`, `;; INTEGRATED CIRCUITS`, `;; CONNECTORS`, + `;; POWER/REGULATORS`, `;; MISC`, `;; TEMPLATE INSTANCES (...)`) caused KiCAD 9 to reject + every schematic created from this template with a hard parse error: + > `Expecting '(' in .kicad_sch, line 8, offset 5` + **Action required for existing projects:** delete every line beginning with `;;` from any + `.kicad_sch` file created between upstream commit `b98c94b` and this fix. + ### Maintenance - `.gitignore`: added `*.kicad_pcb.bak`, `*.kicad_pro.bak` alongside existing `-bak` variants; diff --git a/python/templates/template_with_symbols_expanded.kicad_sch b/python/templates/template_with_symbols_expanded.kicad_sch index 09beebb..157e346 100644 --- a/python/templates/template_with_symbols_expanded.kicad_sch +++ b/python/templates/template_with_symbols_expanded.kicad_sch @@ -5,7 +5,6 @@ (paper "A4") (lib_symbols - ;; PASSIVES (symbol "Device:R" (pin_numbers hide) (pin_names (offset 0)) (in_bom yes) (on_board yes) (property "Reference" "R" (at 2.032 0 90) (effects (font (size 1.27 1.27))) @@ -182,7 +181,6 @@ ) ) ) - ;; SEMICONDUCTORS (symbol "Device:D" (pin_numbers hide) (pin_names (offset 1.016) hide) (in_bom yes) (on_board yes) (property "Reference" "D" (at 0 2.54 0) (effects (font (size 1.27 1.27))) @@ -497,7 +495,6 @@ ) ) ) - ;; INTEGRATED CIRCUITS (symbol "Amplifier_Operational:LM358" (pin_names (offset 0.127)) (in_bom yes) (on_board yes) (property "Reference" "U" (at 0 5.08 0) (effects (font (size 1.27 1.27)) (justify left)) @@ -546,7 +543,6 @@ ) ) ) - ;; CONNECTORS (symbol "Connector_Generic:Conn_01x02" (pin_names (offset 1.016) hide) (in_bom yes) (on_board yes) (property "Reference" "J" (at 0 2.54 0) (effects (font (size 1.27 1.27))) @@ -635,7 +631,6 @@ ) ) ) - ;; POWER/REGULATORS (symbol "Regulator_Linear:AMS1117-3.3" (pin_names (offset 0.254)) (in_bom yes) (on_board yes) (property "Reference" "U" (at -3.81 3.175 0) (effects (font (size 1.27 1.27))) @@ -670,7 +665,6 @@ ) ) ) - ;; MISC (symbol "Switch:SW_Push" (pin_numbers hide) (pin_names (offset 1.016) hide) (in_bom yes) (on_board yes) (property "Reference" "SW" (at 1.27 2.54 0) (effects (font (size 1.27 1.27)) (justify left)) @@ -721,7 +715,6 @@ ) ) - ;; TEMPLATE INSTANCES (placed offscreen at -100, -110, etc.) (symbol (lib_id "Device:R") (at -100 -100 0) (unit 1) (in_bom no) (on_board no) (dnp yes) (uuid 00000000-0000-0000-0000-000000000001)