-
Notifications
You must be signed in to change notification settings - Fork 5
Troubleshooting Guide
Mahan Khalili edited this page Aug 21, 2025
·
1 revision
This guide helps you diagnose and resolve common issues when developing or using modes in Text Forge.
It covers both mode-specific bugs and editor behaviors that may seem unexpected.
Possible causes:
-
syntax_highlighternot assigned in_initialize_mode() - Regex pattern errors or missing delimiters
Fixes:
- Use
print()to inspect highlighter assignment - Test with minimal patterns first
- Check engine docs
Possible causes:
-
panelnot assigned or not added to the scene tree
Fixes:
- Ensure
panelis a validTextForgePanelnode - Try with
panel = Factory.simple_panel()andpanel.load_scene_as_child(scene_path)
Possible causes:
-
_string_to_buffer()or_buffer_to_string()not implemented - Returned value is not a valid byte array or string
Fixes:
- Use
print()to inspect buffer contents - Ensure encoding is consistent (e.g. UTF-8)
Possible causes:
-
_update_code_completion_options()logic have no effect
Fixes:
- Use
Global.get_editor().add_code_completion_option()and try with static options
Possible causes:
- Missing or incorrect
comment_delimiters/string_delimitersin modes - No structural markers (e.g. headers, braces)
Fixes:
- Define folding patterns in
mode.gd
Cause:
_auto_format(text) modifies content aggressively
Fix:
- Make formatting context-aware
- Apply formatting just for white spaces
Possible causes:
-
_buffer_to_string()returns empty string
Fixes:
- Validate buffer conversion logic
Cause:
Multiple modes or editor actions using same key binding
Fix:
- Use
Customization Guidewiki page to remap shortcuts - Avoid assigning global shortcuts inside modes
- Find shortcuts with command palette
- Use
print()generously during development - Use Godot’s Remote Inspector to inspect live nodes
- Test modes with real files and edge cases
- Keep mode logic modular for easier isolation
If you encounter a bug that isn’t covered here:
- Check the CONTRIBUTING.md for reporting guidelines
- Include reproduction steps, screenshots, and mode files if possible