From 1a77f28ce414e286436b64014afff03128a2ec0e Mon Sep 17 00:00:00 2001 From: Kyle Isom Date: Mon, 1 Dec 2025 18:20:36 -0800 Subject: [PATCH] Add syntax highlighting infrastructure - Introduced `HighlighterRegistry` with support for multiple language highlighters (e.g., JSON, Markdown, Python). - Added `JsonHighlighter` implementation for basic JSON syntax highlighting. --- .idea/workspace.xml | 390 ----------------------------------------- Buffer.h | 33 ++++ CMakeLists.txt | 24 +++ Command.cc | 132 +++++++++++++- Command.h | 5 +- CppHighlighter.cc | 170 ++++++++++++++++++ CppHighlighter.h | 34 ++++ Editor.cc | 87 +++++++-- GUIConfig.cc | 34 ++-- GUIConfig.h | 20 ++- GUIFrontend.cc | 44 ++++- GUIRenderer.cc | 59 +++++-- GUITheme.h | 133 +++++++------- GoHighlighter.cc | 48 +++++ GoHighlighter.h | 18 ++ Highlight.h | 39 +++++ HighlighterEngine.cc | 94 ++++++++++ HighlighterEngine.h | 45 +++++ HighlighterRegistry.cc | 93 ++++++++++ HighlighterRegistry.h | 26 +++ JsonHighlighter.cc | 42 +++++ JsonHighlighter.h | 14 ++ LanguageHighlighter.h | 43 +++++ LispHighlighter.cc | 41 +++++ LispHighlighter.h | 17 ++ MarkdownHighlighter.cc | 88 ++++++++++ MarkdownHighlighter.h | 14 ++ NullHighlighter.cc | 16 ++ NullHighlighter.h | 13 ++ PythonHighlighter.cc | 85 +++++++++ PythonHighlighter.h | 18 ++ RustHighlighter.cc | 39 +++++ RustHighlighter.h | 18 ++ ShellHighlighter.cc | 43 +++++ ShellHighlighter.h | 13 ++ TerminalRenderer.cc | 199 +++++++++++++-------- docs/syntax.md | 52 ++++++ kte-cloc | 8 +- 38 files changed, 1701 insertions(+), 590 deletions(-) delete mode 100644 .idea/workspace.xml create mode 100644 CppHighlighter.cc create mode 100644 CppHighlighter.h create mode 100644 GoHighlighter.cc create mode 100644 GoHighlighter.h create mode 100644 Highlight.h create mode 100644 HighlighterEngine.cc create mode 100644 HighlighterEngine.h create mode 100644 HighlighterRegistry.cc create mode 100644 HighlighterRegistry.h create mode 100644 JsonHighlighter.cc create mode 100644 JsonHighlighter.h create mode 100644 LanguageHighlighter.h create mode 100644 LispHighlighter.cc create mode 100644 LispHighlighter.h create mode 100644 MarkdownHighlighter.cc create mode 100644 MarkdownHighlighter.h create mode 100644 NullHighlighter.cc create mode 100644 NullHighlighter.h create mode 100644 PythonHighlighter.cc create mode 100644 PythonHighlighter.h create mode 100644 RustHighlighter.cc create mode 100644 RustHighlighter.h create mode 100644 ShellHighlighter.cc create mode 100644 ShellHighlighter.h create mode 100644 docs/syntax.md diff --git a/.idea/workspace.xml b/.idea/workspace.xml deleted file mode 100644 index 5ddee4a..0000000 --- a/.idea/workspace.xml +++ /dev/null @@ -1,390 +0,0 @@ - - - - - - - { - "useNewFormat": true -} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - { - "associatedIndex": 3 -} - - - - - - - { - "keyToString": { - "CMake Application.kge.executor": "Run", - "CMake Application.test_example.executor": "Run", - "CMake Application.test_undo.executor": "Run", - "ModuleVcsDetector.initialDetectionPerformed": "true", - "NIXITCH_NIXPKGS_CONFIG": "", - "NIXITCH_NIX_CONF_DIR": "", - "NIXITCH_NIX_OTHER_STORES": "", - "NIXITCH_NIX_PATH": "", - "NIXITCH_NIX_PROFILES": "", - "NIXITCH_NIX_REMOTE": "", - "NIXITCH_NIX_USER_PROFILE_DIR": "", - "RunOnceActivity.RadMigrateCodeStyle": "true", - "RunOnceActivity.ShowReadmeOnStart": "true", - "RunOnceActivity.cidr.known.project.marker": "true", - "RunOnceActivity.git.unshallow": "true", - "RunOnceActivity.readMode.enableVisualFormatting": "true", - "RunOnceActivity.west.config.association.type.startup.service": "true", - "cf.first.check.clang-format": "false", - "cidr.known.project.marker": "true", - "code.cleanup.on.save": "true", - "com.intellij.ml.llm.matterhorn.ej.ui.settings.DefaultModelSelectionForGA.v1": "true", - "git-widget-placeholder": "master", - "junie.onboarding.icon.badge.shown": "true", - "node.js.detected.package.eslint": "true", - "node.js.detected.package.tslint": "true", - "node.js.selected.package.eslint": "(autodetect)", - "node.js.selected.package.tslint": "(autodetect)", - "nodejs_package_manager_path": "npm", - "onboarding.tips.debug.path": "/Users/kyle/src/kte/main.cpp", - "rearrange.code.on.save": "true", - "settings.editor.selected.configurable": "CMakeSettings", - "to.speed.mode.migration.done": "true", - "vue.rearranger.settings.migration": "true" - } -} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 1764457173148 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -