Skip to content

feat(dialog-sdk): add Python syntax highlighter and runtime language swapping#56

Merged
pabloinigoblasco merged 1 commit into
developmentfrom
feat/python-syntax-highlighter
Apr 14, 2026
Merged

feat(dialog-sdk): add Python syntax highlighter and runtime language swapping#56
pabloinigoblasco merged 1 commit into
developmentfrom
feat/python-syntax-highlighter

Conversation

@pabloinigoblasco
Copy link
Copy Markdown
Collaborator

@pabloinigoblasco pabloinigoblasco commented Apr 14, 2026

Motivation

The Lua Editor toolbox is being extended to support Python as an alternative scripting language. The dialog engine needs to know how to highlight Python code and how to swap highlighters when the user changes language mid-session (e.g. switching a "Language" combo box from Lua to Python).

Summary

  • New PythonSyntaxHighlighter following the same pattern as LuaSyntaxHighlighter: keywords, builtins, # comments, triple-quoted multiline strings
  • widget_binding.cpp: detect when codeLanguage changes between ticks, delete the old QSyntaxHighlighter, install the one matching the requested language

Test plan

  • Build pj_plugins — no compile errors
  • Set setCodeLanguage("editor", "python") — Python keywords highlighted
  • Switch from "lua" to "python" at runtime — highlighter swaps correctly
  • Set "lua" — Lua highlighting still works as before

…swapping

Add Python syntax highlighting for code editor widgets and support
runtime language swapping when the plugin changes codeLanguage mid-session.

Contents:
- PythonSyntaxHighlighter: keywords, builtins, # comments, triple-quoted
  multiline strings (same pattern as LuaSyntaxHighlighter)
- widget_binding: detect when codeLanguage changes, delete the old
  QSyntaxHighlighter, install the new one matching the requested language
@pabloinigoblasco pabloinigoblasco merged commit d808a50 into development Apr 14, 2026
2 checks passed
pabloinigoblasco added a commit that referenced this pull request Apr 15, 2026
Sync from GitHub development:
- PR #45: feat: drag-and-drop support for dialog plugins
- PR #54: fix: persist config on dialog close
- PR #55: feat: Tools menu with toolbox plugin discovery
- PR #56: feat: Python syntax highlighter + runtime language swapping
@pabloinigoblasco pabloinigoblasco deleted the feat/python-syntax-highlighter branch May 4, 2026 12:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant