0
0
Fork 0
Codesys-MCP-SP21-plus/src/scripts
Karstein Phobic Nyvold Kvistad d4e71f61ca fix(compile_messages): discover real category GUIDs via system.get_message_categories()
The 0.6.3 fix replaced 'first-non-empty-pattern-wins' with category
iteration but used a HARDCODED list of 'well-known V3.5 GUIDs' that was
wrong. None of those GUIDs matched the actual Build category, so
compile errors stayed invisible (compile_project still reported '0
errors' even when the IDE-side download path saw them).

Diagnosed via a one-shot probe injected into compile_project on
2026-04-29: dumped attrs of script_engine.system, then called
script_engine.system.get_message_categories() (the METHOD) directly.
That returned the actual 7 category GUIDs in this CODESYS V3.5 SP22
Patch 1 install:

  05581bd1-66d3-4251-aff2-047cc8e9adf7  Offline Help
  936e1a33-3af8-47fa-b40b-903f0ae0b6cc  Application Composer
  a9b26e07-6ae1-4c06-9cd1-9ddddd397a2d  SVN
  0a6fcb64-7f24-43c6-a6d3-f70cb5d31114  (no parameterless ctor; Git)
  194b48a9-ab51-43ae-b9a9-51d3edaaddf3  Script Messages
  97f48d64-a2a3-4856-b640-75c046e37ea9  Build              <-- the one we needed
  220493a1-f49b-4416-9a3f-a545db707cbe  Additional code checks

Real fix: replace the hardcoded list in _enumerate_categories() in both
compile_project.py and get_compile_messages.py with a call to
system.get_message_categories(); label each one via
get_message_category_description(guid). Iterate per category as before.
GUIDs are now discovered at runtime so the same code works on any SP
and any locale.

Verification: injected `THIS_IS_NOT_VALID_IEC_KEYWORD;` into
PLC_PRG.implementation, ran compile_project; output now reads
"1 error(s), 2 warning(s). ERROR: Identifier
'THIS_IS_NOT_VALID_IEC_KEYWORD' not defined". Restored PLC_PRG;
0 error(s) again. End-to-end fix confirmed.

Bumped 0.6.3 -> 0.6.4.
2026-04-29 07:39:31 +02:00
..
add_library.py fix(compile_messages): probe every category + tighten _is_resolved hollow-ref check 2026-04-28 23:35:24 +02:00
bump_project_version.py fix(read_running_version_online): document the real root cause + fix 2026-04-26 20:13:25 +02:00
check_status.py Initial release: MCP server for CODESYS with persistent UI instance 2026-02-08 18:59:16 +10:00
compile_project.py fix(compile_messages): discover real category GUIDs via system.get_message_categories() 2026-04-29 07:39:31 +02:00
connect_to_device.py feat(online): pre-register Device User credentials to suppress modal login dialog 2026-04-28 21:41:31 +02:00
create_dut.py Add 17 new MCP tools for v0.4.0: compiler diagnostics, project authoring, runtime monitoring, library management 2026-02-08 21:05:12 +10:00
create_folder.py fix(create_folder): dump dir(parent) on total-miss to diagnose unknown SPs 2026-04-28 20:51:32 +02:00
create_gvl.py Add 17 new MCP tools for v0.4.0: compiler diagnostics, project authoring, runtime monitoring, library management 2026-02-08 21:05:12 +10:00
create_method.py Initial release: MCP server for CODESYS with persistent UI instance 2026-02-08 18:59:16 +10:00
create_pou.py Initial release: MCP server for CODESYS with persistent UI instance 2026-02-08 18:59:16 +10:00
create_project.py Initial release: MCP server for CODESYS with persistent UI instance 2026-02-08 18:59:16 +10:00
create_property.py Initial release: MCP server for CODESYS with persistent UI instance 2026-02-08 18:59:16 +10:00
create_symbol_config.py feat(symbol-config): 10 new MCP tools for the Symbol Configuration object 2026-04-28 23:44:21 +02:00
delete_object.py Add 17 new MCP tools for v0.4.0: compiler diagnostics, project authoring, runtime monitoring, library management 2026-02-08 21:05:12 +10:00
disconnect_from_device.py Add 17 new MCP tools for v0.4.0: compiler diagnostics, project authoring, runtime monitoring, library management 2026-02-08 21:05:12 +10:00
download_to_device.py feat(online): pre-register Device User credentials to suppress modal login dialog 2026-04-28 21:41:31 +02:00
ensure_online_connection.py fix(online tools): auto-login + non-CONSTANT version GVL 2026-04-26 19:54:13 +02:00
ensure_project_open.py fix: 4 broken-tool fixes (compile json long, connect_to_device LoginMode, 2026-04-26 16:53:25 +02:00
export_symbol_xsd.py feat(symbol-config): 10 new MCP tools for the Symbol Configuration object 2026-04-28 23:44:21 +02:00
find_object_by_path.py Initial release: MCP server for CODESYS with persistent UI instance 2026-02-08 18:59:16 +10:00
find_symbol_config.py feat(symbol-config): 10 new MCP tools for the Symbol Configuration object 2026-04-28 23:44:21 +02:00
find_symbol_config_object.py fix(compile_messages): probe every category + tighten _is_resolved hollow-ref check 2026-04-28 23:35:24 +02:00
get_all_pou_code.py Add 17 new MCP tools for v0.4.0: compiler diagnostics, project authoring, runtime monitoring, library management 2026-02-08 21:05:12 +10:00
get_application_state.py Add 17 new MCP tools for v0.4.0: compiler diagnostics, project authoring, runtime monitoring, library management 2026-02-08 21:05:12 +10:00
get_compile_messages.py fix(compile_messages): discover real category GUIDs via system.get_message_categories() 2026-04-29 07:39:31 +02:00
get_pou_code.py Initial release: MCP server for CODESYS with persistent UI instance 2026-02-08 18:59:16 +10:00
get_project_structure.py Initial release: MCP server for CODESYS with persistent UI instance 2026-02-08 18:59:16 +10:00
get_symbol_config_settings.py feat(symbol-config): 10 new MCP tools for the Symbol Configuration object 2026-04-28 23:44:21 +02:00
list_all_datatypes.py feat(symbol-config): 10 new MCP tools for the Symbol Configuration object 2026-04-28 23:44:21 +02:00
list_all_signatures.py feat(symbol-config): 10 new MCP tools for the Symbol Configuration object 2026-04-28 23:44:21 +02:00
list_configured_symbols.py feat(symbol-config): 10 new MCP tools for the Symbol Configuration object 2026-04-28 23:44:21 +02:00
list_project_libraries.py fix(list_project_libraries): mirror add_library.py discovery + accept bare libman from find() fallback 2026-04-28 20:55:52 +02:00
mirror_export.py fix(mirror): per-project mirror dir name when multiple .project files share a parent 2026-04-27 22:22:09 +02:00
open_project.py Initial release: MCP server for CODESYS with persistent UI instance 2026-02-08 18:59:16 +10:00
read_running_version_online.py fix(read_running_version_online): document the real root cause + fix 2026-04-26 20:13:25 +02:00
read_variable.py fix(online tools): auto-login + non-CONSTANT version GVL 2026-04-26 19:54:13 +02:00
register_device_credentials.py feat(online): pre-register Device User credentials to suppress modal login dialog 2026-04-28 21:41:31 +02:00
rename_object.py fix(rename_object): rewrite \bOldName\b refs in every POU/DUT/GVL by default 2026-04-28 20:58:45 +02:00
save_project.py Initial release: MCP server for CODESYS with persistent UI instance 2026-02-08 18:59:16 +10:00
set_pou_code.py fix(set_pou_code): omitted declaration/impl no longer wipes the POU 2026-04-26 18:41:48 +02:00
set_signature_access_bulk.py feat(symbol-config): 10 new MCP tools for the Symbol Configuration object 2026-04-28 23:44:21 +02:00
set_symbol_access.py feat(symbol-config): 10 new MCP tools for the Symbol Configuration object 2026-04-28 23:44:21 +02:00
set_symbol_config_settings.py feat(symbol-config): 10 new MCP tools for the Symbol Configuration object 2026-04-28 23:44:21 +02:00
start_stop_application.py fix(online tools): auto-login + non-CONSTANT version GVL 2026-04-26 19:54:13 +02:00
watcher.py fix(watcher): use ASCII-only comments/log strings (IronPython 2.7 syntax error) 2026-04-25 15:10:21 +02:00
write_variable.py fix(online tools): auto-login + non-CONSTANT version GVL 2026-04-26 19:54:13 +02:00