Commit 70ce3b8
committed
refactor(godot): extract helpers and fix compilation errors in bindings
- Extract 7 helper functions from validate() and complete_code() methods
* build_completion_item() - Eliminates 3 duplicated patterns
* strip_incomplete_interpolation() - Handles incomplete interpolations
* is_in_interpolation() - Detects cursor position in interpolations
* build_error_dict() - Converts diagnostics to Godot format
* format_error_message() - Formats errors for logging
* should_output_errors() - Implements error deduplication
- Add 13 unit tests for pure helper functions
- Fix BobbinLanguage init constructor using #[class(init)]
- Fix borrow of moved path value in from_file_with_host()
- Fix mutable/immutable borrow conflict in start_hot_reload()
- Move BobbinSyntaxHighlighter helpers to separate impl block
- Make LastErrorState unconditional to avoid gdext cfg complexity
Results:
- validate() reduced from 120+ to 40 lines
- complete_code() reduced from 100+ to 30 lines
- Both release and debug builds now pass1 parent 09ab31b commit 70ce3b8
1 file changed
Lines changed: 293 additions & 135 deletions
0 commit comments