diff --git a/CHANGELOG.md b/CHANGELOG.md index 597174c..ed71f39 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -23,6 +23,41 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 --- +## [0.0.5] - 2026-07-21 + +**Codename**: "Stabilization & Engine Modernization" + +After 8 months of dormancy (last commit October 2025), this release returns +the project to a healthy, current baseline before resuming feature work: +lands two PRs that had been finished-but-unmerged since October, pays down +accumulated documentation debt, and upgrades the Godot binding stack +(gdext 0.4.5 → 0.5.4, targeting Godot 4.7) rather than letting the drift +compound further. + +### Added + +- Source span tracking (`Position`/`Span` in `crates/compiler/src/span.rs`) across AST, parser, and type checker — foundation for future LSP support (#59) +- `rust-version = "1.94"` MSRV declaration and Rust Edition 2024 across the workspace + +### Changed + +- **BREAKING (internal)**: Upgraded `godot` (gdext) dependency from 0.4.5 → 0.5.4, targeting Godot API level 4.7 (`api-4-7` feature, was `api-4-3`) + - `godot_test/ferrisscript.gdextension`: `compatibility_minimum` 4.1 → 4.2 + - `godot_test/project.godot`: engine features "4.5" → "4.7" + - `crates/godot_bind/src/lib.rs`: `PropertyInfo`/`PropertyHintInfo` moved from `godot::meta` to `godot::register::info`; `export_info_functions` renamed `export_fns`; `PropertyInfo.class_id: ClassId` replaced by `class_name: StringName`; Inspector virtuals renamed `get_property_list`/`get_property`/`set_property` → `on_get_property_list`/`on_get`/`on_set` +- `Cargo.lock` is now committed (previously gitignored) for reproducible builds of the cdylib/binary artifacts this workspace ships +- README prerequisites narrowed to reflect what's actually tested: "Rust 1.94+ with Edition 2024", "Godot 4.2+ (tested against 4.7)" + +### Fixed + +- `.gdextension` library paths on Linux/macOS were missing the `lib` prefix cargo adds to cdylibs — the extension never loaded on non-Windows platforms (#61) +- Test harness (`ferris-test`) deleted its own source `.ferris` scripts when the scripts directory under test was the project's live scripts directory (#61) +- Inspector properties now clear when a script fails to compile, instead of showing stale values from the last successful load (#60) +- Restored `docs/archive/` and `docs/planning/technical/` (accidentally deleted in earlier merges), fixing dangling links across CHANGELOG/RELEASE_NOTES/planning docs (#62) +- `godot_test/scripts/godot_bind_tests.gd` used invalid `PropertyHint.NONE`-style enum access; fixed to use GDScript's flat `PROPERTY_HINT_*` constants, unblocking the headless integration test suite + +--- + ## [0.0.4] - 2025-10-08 **Codename**: "Godot API Expansion" 🔔🌳 diff --git a/Cargo.lock b/Cargo.lock index 12b2c24..e239720 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -248,14 +248,14 @@ checksum = "877a4ace8713b0bcf2a4e7eec82529c029f1d0619886d18145fea96c3ffe5c0f" [[package]] name = "ferrisscript_compiler" -version = "0.0.3" +version = "0.0.5" dependencies = [ "criterion", ] [[package]] name = "ferrisscript_godot_bind" -version = "0.0.3" +version = "0.0.5" dependencies = [ "ferrisscript_compiler", "ferrisscript_runtime", @@ -265,7 +265,7 @@ dependencies = [ [[package]] name = "ferrisscript_runtime" -version = "0.0.3" +version = "0.0.5" dependencies = [ "criterion", "ferrisscript_compiler", @@ -273,7 +273,7 @@ dependencies = [ [[package]] name = "ferrisscript_test_harness" -version = "0.0.3" +version = "0.0.5" dependencies = [ "anyhow", "clap", @@ -310,21 +310,21 @@ dependencies = [ [[package]] name = "gdextension-api" -version = "0.3.3" +version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5383f33a2772746bbc83e5b0480862dd1eedfd0518b976f37f3db11c81e71a6a" +checksum = "3489a9e7463353467db3cfe3eb12de31c9b6200e4f928bde4959bf5db5b31d2f" [[package]] name = "glam" -version = "0.30.10" +version = "0.32.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "19fc433e8437a212d1b6f1e68c7824af3aed907da60afa994e7f542d18d12aa9" +checksum = "f70749695b063ecbf6b62949ccccde2e733ec3ecbbd71d467dca4e5c6c97cca0" [[package]] name = "godot" -version = "0.4.5" +version = "0.5.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5599d03afd17a511e11d0bf9e06c88d4095a9120f10cf00a74f50b300f53413e" +checksum = "4452effbae3a093b187f82149b6b0025667cde9993b22769a012d5bac9e8f39f" dependencies = [ "godot-core", "godot-macros", @@ -332,38 +332,37 @@ dependencies = [ [[package]] name = "godot-bindings" -version = "0.4.5" +version = "0.5.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f38b6e65306c05e3c3f0131ee8dbf7394691e53268d72019007ec20687f2280f" +checksum = "773860a42753be6f8bdc40fe8e0ee169164a83605ab7d6dc0c9b746892cd85ed" dependencies = [ "gdextension-api", ] [[package]] name = "godot-cell" -version = "0.4.5" +version = "0.5.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "738efef92fdcf1d92f0ed5a29c6f3cdce58e64029d08928c20e08771e1239c16" +checksum = "f18d30809e2d52da0402ad4c6f1d77b9d35832481c9527bc24a63412bc05252d" [[package]] name = "godot-codegen" -version = "0.4.5" +version = "0.5.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "00b9a59f603f354c54d83fb74071209203d0ebe396b2419acc731c90ebf94680" +checksum = "85875076fc06a8ad5a452e494274f233da060764208caf2beac2cde4c9df15b5" dependencies = [ "godot-bindings", "heck", "nanoserde", "proc-macro2", "quote", - "regex", ] [[package]] name = "godot-core" -version = "0.4.5" +version = "0.5.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "989e80dfb58d2048ae0dca60bec32129dc1f96510f904b992ad170d84e950c33" +checksum = "57d22572dbf40e5cf4bf36c05da54f9d46dd1ff0944b6e6c7ee412c16386fe88" dependencies = [ "glam", "godot-bindings", @@ -374,21 +373,20 @@ dependencies = [ [[package]] name = "godot-ffi" -version = "0.4.5" +version = "0.5.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6237b26c52c5baa6566705a73cd8804ea4ef83a666540939dd5a4e068c242666" +checksum = "854633981e4f54c84d240d76ac71a816c738890774291f7d430a0adb29db9bd2" dependencies = [ "godot-bindings", "godot-codegen", - "godot-macros", "libc", ] [[package]] name = "godot-macros" -version = "0.4.5" +version = "0.5.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d696b67ba99ff7d75e07546b04c3a711651d2c9e5851c9225dea3b64f8bb5af6" +checksum = "37dc9ce1b970e798df827dcccfe68d5985804f93b5fbab156e507999272965f0" dependencies = [ "godot-bindings", "proc-macro2", diff --git a/Cargo.toml b/Cargo.toml index 27873db..c882d87 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -8,8 +8,9 @@ members = [ ] [workspace.package] -version = "0.0.4" -edition = "2021" +version = "0.0.5" +edition = "2024" +rust-version = "1.94" authors = ["FerrisScript Contributors"] license = "MIT" diff --git a/README.md b/README.md index 097097d..7b9b869 100644 --- a/README.md +++ b/README.md @@ -206,8 +206,8 @@ See [extensions/vscode/README.md](extensions/vscode/README.md) for full features ### Prerequisites -- **Rust 1.70+** ([Install Rust](https://www.rust-lang.org/tools/install)) -- **Godot 4.2+** ([Download Godot](https://godotengine.org/download)) +- **Rust 1.94+ with Edition 2024** ([Install Rust](https://www.rust-lang.org/tools/install)) +- **Godot 4.2+ (tested against 4.7)** ([Download Godot](https://godotengine.org/download)) - **Git** (for cloning the repository) ### Installation @@ -232,10 +232,10 @@ cargo test --workspace cargo build --package ferrisscript_godot_bind ``` - > **Note for Godot 4.3+**: The project is configured with `api-4-3` feature for compatibility. If you encounter initialization errors, ensure `crates/godot_bind/Cargo.toml` has the correct API version feature enabled. + > The project is configured with the `api-4-7` feature (`crates/godot_bind/Cargo.toml`), matching `godot_test`'s `compatibility_minimum = 4.2` and the Godot 4.7 editor it's tested against. If you encounter initialization errors on a different Godot version, check that this feature matches your engine's minor version. 2. **Open the test project:** - - Open Godot 4.2+ + - Open Godot 4.2+ (tested against 4.7) - Import project from `godot_test/project.godot` 3. **Create your first script:** diff --git a/RELEASE_NOTES.md b/RELEASE_NOTES.md index 281434c..b3d20fb 100644 --- a/RELEASE_NOTES.md +++ b/RELEASE_NOTES.md @@ -6,6 +6,49 @@ --- +## v0.0.5 - Stabilization & Engine Modernization (July 21, 2026) + +**Status**: ✅ Complete +**Tag**: `v0.0.5` +**Codename**: "Stabilization & Engine Modernization" + +### 🎉 Highlights + +After 8 months of dormancy (last commit October 2025), this release returns FerrisScript to a healthy, current baseline before resuming feature work. It lands two PRs that had been finished-but-unmerged since October, restores documentation lost to earlier merge mishaps, and upgrades the Godot binding stack rather than letting the version drift compound further. + +### 🌟 What's New + +#### Stabilization + +- **Source span tracking**: `Position`/`Span` structs across AST, parser, and type checker (`crates/compiler/src/span.rs`) — foundation for future LSP work +- **Inspector property refresh fix**: properties now clear when a `.ferris` script fails to compile, instead of showing stale values from the last successful load +- **Linux/macOS extension loading fix**: `.gdextension` library paths were missing the `lib` prefix cargo adds to cdylibs — the extension had never loaded on non-Windows platforms until this release +- Restored `docs/archive/` (97 files) and `docs/planning/technical/` (9 files), accidentally deleted in October 2025 merges, fixing dangling links throughout the docs + +#### Engine Modernization + +- **gdext upgraded 0.4.5 → 0.5.4**, targeting Godot API level 4.7 (was 4.3) +- **Rust Edition 2021 → 2024**, MSRV declared at 1.94 +- Inspector integration code migrated to the 0.5 API: `PropertyInfo`/`PropertyHintInfo` module relocation, `export_info_functions` → `export_fns`, and the `get_property_list`/`get_property`/`set_property` virtuals renamed to `on_get_property_list`/`on_get`/`on_set` +- `godot_test` project bumped to Godot 4.7; `Cargo.lock` now committed for reproducible builds + +### 📦 Dependencies & Compatibility + +- **Rust**: 1.94+ with Edition 2024 · **Godot**: 4.2+ (tested against 4.7) · **gdext**: 0.5.4 +- No FerrisScript language changes — `.ferris` scripts from v0.0.4 work unchanged + +### 📊 Metrics + +- **Tests**: 883 passing across the workspace, unchanged pass rate on the `ferris-test` integration corpus (19/33 — remaining failures are pre-existing test-script drift against unimplemented language features) +- **PRs merged**: #59, #60, #61, #62, #63 + +### 🔗 Resources + +- **Full Changelog**: [CHANGELOG.md v0.0.5](CHANGELOG.md#005---2026-07-21) +- **Roadmap**: [ROADMAP_MASTER.md](docs/planning/ROADMAP_MASTER.md) — note the v0.0.5 LSP plan is renumbered to v0.0.6 + +--- + ## v0.0.4 - Godot API Expansion (October 8, 2025) **Status**: ✅ Complete diff --git a/crates/compiler/Cargo.toml b/crates/compiler/Cargo.toml index 835c4da..759a521 100644 --- a/crates/compiler/Cargo.toml +++ b/crates/compiler/Cargo.toml @@ -1,7 +1,8 @@ [package] name = "ferrisscript_compiler" -version = "0.0.3" -edition = "2021" +version.workspace = true +edition.workspace = true +rust-version.workspace = true [dependencies] diff --git a/crates/compiler/benches/compiler_benchmarks.rs b/crates/compiler/benches/compiler_benchmarks.rs index 1a6f0cb..86722b8 100644 --- a/crates/compiler/benches/compiler_benchmarks.rs +++ b/crates/compiler/benches/compiler_benchmarks.rs @@ -1,4 +1,4 @@ -use criterion::{criterion_group, criterion_main, BenchmarkId, Criterion}; +use criterion::{BenchmarkId, Criterion, criterion_group, criterion_main}; use ferrisscript_compiler::{lexer, parser, type_checker}; use std::hint::black_box; diff --git a/crates/compiler/src/error_code.rs b/crates/compiler/src/error_code.rs index e938e87..1c1e8f3 100644 --- a/crates/compiler/src/error_code.rs +++ b/crates/compiler/src/error_code.rs @@ -743,7 +743,9 @@ mod tests { #[test] fn test_get_docs_url_default() { // Without FERRIS_DOCS_BASE env var, should return GitHub Pages URL with proper anchors - std::env::remove_var("FERRIS_DOCS_BASE"); + unsafe { + std::env::remove_var("FERRIS_DOCS_BASE"); + } let url = ErrorCode::E001.get_docs_url(); assert!(url.contains("github.io")); @@ -757,7 +759,9 @@ mod tests { #[test] fn test_get_docs_url_format() { // Test URL format structure with proper GitHub Pages slugification - std::env::remove_var("FERRIS_DOCS_BASE"); + unsafe { + std::env::remove_var("FERRIS_DOCS_BASE"); + } // Test that URLs are well-formed let url = ErrorCode::E001.get_docs_url(); diff --git a/crates/compiler/src/error_context.rs b/crates/compiler/src/error_context.rs index bac9623..7248ae1 100644 --- a/crates/compiler/src/error_context.rs +++ b/crates/compiler/src/error_context.rs @@ -63,11 +63,11 @@ pub fn extract_source_context_with_pointer( )); // Insert pointer right after the error line - if line_num == error_line { - if let Some(column) = error_column { - let pointer = format_error_pointer(column, line_num_width, hint); - result.push_str(&pointer); - } + if line_num == error_line + && let Some(column) = error_column + { + let pointer = format_error_pointer(column, line_num_width, hint); + result.push_str(&pointer); } } diff --git a/crates/compiler/src/lexer.rs b/crates/compiler/src/lexer.rs index 3bbb7af..3bf1f5b 100644 --- a/crates/compiler/src/lexer.rs +++ b/crates/compiler/src/lexer.rs @@ -311,7 +311,10 @@ impl<'a> Lexer<'a> { self.source, self.line, self.column, - &format!("Unknown escape '\\{}', valid escapes are \\n \\t \\r \\\\ \\\"", ch), + &format!( + "Unknown escape '\\{}', valid escapes are \\n \\t \\r \\\\ \\\"", + ch + ), )); } None => { diff --git a/crates/compiler/src/parser.rs b/crates/compiler/src/parser.rs index 03b1912..624e302 100644 --- a/crates/compiler/src/parser.rs +++ b/crates/compiler/src/parser.rs @@ -165,11 +165,11 @@ impl<'a> Parser<'a> { // Check if previous token was a statement boundary if self.position > 0 { let prev_idx = self.position - 1; - if let Some(pt) = self.tokens.get(prev_idx) { - if matches!(pt.token, Token::Semicolon) { - self.panic_mode = false; - return; - } + if let Some(pt) = self.tokens.get(prev_idx) + && matches!(pt.token, Token::Semicolon) + { + self.panic_mode = false; + return; } } @@ -1109,7 +1109,7 @@ impl<'a> Parser<'a> { t.name(), self.current_line, self.current_column - )) + )); } }; self.advance(); diff --git a/crates/compiler/src/type_checker.rs b/crates/compiler/src/type_checker.rs index 49dcf37..dc4df55 100644 --- a/crates/compiler/src/type_checker.rs +++ b/crates/compiler/src/type_checker.rs @@ -752,8 +752,7 @@ impl<'a> TypeChecker<'a> { if param_type != Type::InputEvent { let base_msg = format!( "Lifecycle function '_input' parameter must be of type InputEvent, found {} at {}", - func.params[0].ty, - func.span + func.params[0].ty, func.span ); self.error(format_error_with_code( ErrorCode::E305, @@ -789,8 +788,7 @@ impl<'a> TypeChecker<'a> { if param_type != Type::F32 { let base_msg = format!( "Lifecycle function '_physics_process' parameter must be of type f32, found {} at {}", - func.params[0].ty, - func.span + func.params[0].ty, func.span ); self.error(format_error_with_code( ErrorCode::E305, @@ -2437,9 +2435,11 @@ fn _process(delta: f32) { let program = parse(&tokens, input).unwrap(); let result = check(&program, input); assert!(result.is_err()); - assert!(result - .unwrap_err() - .contains("must have exactly 1 parameter")); + assert!( + result + .unwrap_err() + .contains("must have exactly 1 parameter") + ); // Test with two parameters let input2 = r#"fn _input(event: InputEvent, extra: i32) { @@ -2449,9 +2449,11 @@ fn _process(delta: f32) { let program2 = parse(&tokens2, input2).unwrap(); let result2 = check(&program2, input2); assert!(result2.is_err()); - assert!(result2 - .unwrap_err() - .contains("must have exactly 1 parameter")); + assert!( + result2 + .unwrap_err() + .contains("must have exactly 1 parameter") + ); } #[test] @@ -2488,9 +2490,11 @@ fn _process(delta: f32) { let program = parse(&tokens, input).unwrap(); let result = check(&program, input); assert!(result.is_err()); - assert!(result - .unwrap_err() - .contains("must have exactly 1 parameter")); + assert!( + result + .unwrap_err() + .contains("must have exactly 1 parameter") + ); // Test with two parameters let input2 = r#"fn _physics_process(delta: f32, extra: i32) { @@ -2500,9 +2504,11 @@ fn _process(delta: f32) { let program2 = parse(&tokens2, input2).unwrap(); let result2 = check(&program2, input2); assert!(result2.is_err()); - assert!(result2 - .unwrap_err() - .contains("must have exactly 1 parameter")); + assert!( + result2 + .unwrap_err() + .contains("must have exactly 1 parameter") + ); } #[test] @@ -3419,9 +3425,11 @@ let x: float = 3.14; let program2 = parse(&tokens2, input2).unwrap(); let result2 = check(&program2, input2); assert!(result2.is_err()); - assert!(result2 - .unwrap_err() - .contains("expects 1 arguments, found 2")); + assert!( + result2 + .unwrap_err() + .contains("expects 1 arguments, found 2") + ); } #[test] @@ -4684,11 +4692,13 @@ let x: float = 3.14; assert_eq!(metadata.len(), 1); assert_eq!(metadata[0].name, "position"); assert_eq!(metadata[0].type_name, "Vector2"); - assert!(metadata[0] - .default_value - .as_ref() - .unwrap() - .contains("Vector2")); + assert!( + metadata[0] + .default_value + .as_ref() + .unwrap() + .contains("Vector2") + ); assert!(metadata[0].default_value.as_ref().unwrap().contains("x:")); assert!(metadata[0].default_value.as_ref().unwrap().contains("y:")); } diff --git a/crates/godot_bind/Cargo.toml b/crates/godot_bind/Cargo.toml index 8d04b49..35ed17f 100644 --- a/crates/godot_bind/Cargo.toml +++ b/crates/godot_bind/Cargo.toml @@ -1,12 +1,14 @@ [package] name = "ferrisscript_godot_bind" -version = "0.0.3" -edition = "2021" +version.workspace = true +edition.workspace = true +rust-version.workspace = true [dependencies] # gdext is the Godot 4.x Rust binding (formerly gdextension) -# Using version 0.4 with api-4-3 feature for Godot 4.3+ compatibility -godot = { version = "0.4", features = ["api-4-3"] } +# api-4-7 pins codegen to the Godot minor we test against; keep in sync with +# godot_test/ferrisscript.gdextension and godot_test/project.godot +godot = { version = "0.5", features = ["api-4-7"] } ferrisscript_compiler = { path = "../compiler" } ferrisscript_runtime = { path = "../runtime" } diff --git a/crates/godot_bind/src/lib.rs b/crates/godot_bind/src/lib.rs index cf90dde..2befb4e 100644 --- a/crates/godot_bind/src/lib.rs +++ b/crates/godot_bind/src/lib.rs @@ -1,14 +1,13 @@ use ferrisscript_compiler::{ast, compile}; -use ferrisscript_runtime::{call_function, execute, Env, InputEventHandle, Value}; -use godot::classes::{file_access::ModeFlags, FileAccess, InputEvent}; +use ferrisscript_runtime::{Env, InputEventHandle, Value, call_function, execute}; +use godot::classes::{FileAccess, InputEvent, file_access::ModeFlags}; use godot::prelude::*; use std::cell::RefCell; // PropertyInfo imports for Inspector integration (Bundle 4 - Checkpoint 3.7) use godot::builtin::VariantType; -use godot::global::{PropertyHint, PropertyUsageFlags}; -use godot::meta::{ClassId, PropertyHintInfo, PropertyInfo}; -use godot::register::property::export_info_functions; +use godot::register::info::{PropertyHint, PropertyHintInfo, PropertyInfo, PropertyUsageFlags}; +use godot::register::property::export_fns; // Signal prototype module for v0.0.4 research mod signal_prototype; @@ -73,8 +72,8 @@ fn map_hint(hint: &ast::PropertyHint) -> PropertyHintInfo { }, ast::PropertyHint::Range { min, max, step } => { - // Use export_info_functions for robust formatting - export_info_functions::export_range( + // Use export_fns for robust formatting + export_fns::export_range( *min as f64, *max as f64, Some(*step as f64), @@ -124,14 +123,14 @@ fn map_hint(hint: &ast::PropertyHint) -> PropertyHintInfo { /// /// This is the main conversion function that combines type and hint mapping. /// Uses verified API patterns: -/// - ClassId::none() for non-object types +/// - empty class_name for non-object types /// - property_usage_common() for standard usage flags /// - Generates fresh PropertyInfo on each call (Godot best practice) #[allow(dead_code)] fn metadata_to_property_info(metadata: &ast::PropertyMetadata) -> PropertyInfo { PropertyInfo { variant_type: map_type_to_variant(&metadata.type_name), - class_id: ClassId::none(), // FerrisScript types are not Godot objects + class_name: StringName::default(), // FerrisScript types are not Godot objects property_name: StringName::from(&metadata.name), hint_info: map_hint(&metadata.hint), usage: property_usage_common(), @@ -392,26 +391,25 @@ impl INode2D for FerrisScriptNode { } // Register signals with Godot if script is loaded - if self.script_loaded { - if let Some(program) = &self.program { - // Clone signal names to avoid borrowing issues - let signal_names: Vec = - program.signals.iter().map(|s| s.name.clone()).collect(); - - for signal_name in signal_names { - self.base_mut().add_user_signal(&signal_name); - godot_print!("Registered signal: {}", signal_name); - } + if self.script_loaded + && let Some(program) = &self.program + { + // Clone signal names to avoid borrowing issues + let signal_names: Vec = + program.signals.iter().map(|s| s.name.clone()).collect(); + + for signal_name in signal_names { + self.base_mut().add_user_signal(&signal_name); + godot_print!("Registered signal: {}", signal_name); } } // Execute _ready function if it exists - if self.script_loaded { - if let Some(env) = &self.env { - if env.get_function("_ready").is_some() { - self.call_script_function("_ready", &[]); - } - } + if self.script_loaded + && let Some(env) = &self.env + && env.get_function("_ready").is_some() + { + self.call_script_function("_ready", &[]); } } @@ -424,101 +422,96 @@ impl INode2D for FerrisScriptNode { } // Execute _process function if script is loaded and function exists - if self.script_loaded { - if let Some(env) = &self.env { - if env.get_function("_process").is_some() { - // Convert delta to Float (f32 for FerrisScript) - let delta_value = Value::Float(delta as f32); - self.call_script_function_with_self("_process", &[delta_value]); - } - } + if self.script_loaded + && let Some(env) = &self.env + && env.get_function("_process").is_some() + { + // Convert delta to Float (f32 for FerrisScript) + let delta_value = Value::Float(delta as f32); + self.call_script_function_with_self("_process", &[delta_value]); } } fn input(&mut self, event: Gd) { // Execute _input function if script is loaded and function exists - if self.script_loaded { - if let Some(env) = &self.env { - if env.get_function("_input").is_some() { - // Convert Godot InputEvent to FerrisScript InputEventHandle - // NOTE: Simplified implementation for Phase 2.1 - // - Currently checks hardcoded common actions (ui_* actions) - // - Stores action name strings, not full Godot event reference - // - Full InputEvent API (position, button_index, etc.) deferred to Phase 5/6 - // See: docs/planning/v0.0.4/KNOWN_LIMITATIONS.md - "InputEvent Simplified API" - let action_pressed = if event.is_action_pressed("ui_accept") { - Some("ui_accept".to_string()) - } else if event.is_action_pressed("ui_cancel") { - Some("ui_cancel".to_string()) - } else if event.is_action_pressed("ui_left") { - Some("ui_left".to_string()) - } else if event.is_action_pressed("ui_right") { - Some("ui_right".to_string()) - } else if event.is_action_pressed("ui_up") { - Some("ui_up".to_string()) - } else if event.is_action_pressed("ui_down") { - Some("ui_down".to_string()) - } else { - None - }; - - let action_released = if event.is_action_released("ui_accept") { - Some("ui_accept".to_string()) - } else if event.is_action_released("ui_cancel") { - Some("ui_cancel".to_string()) - } else if event.is_action_released("ui_left") { - Some("ui_left".to_string()) - } else if event.is_action_released("ui_right") { - Some("ui_right".to_string()) - } else if event.is_action_released("ui_up") { - Some("ui_up".to_string()) - } else if event.is_action_released("ui_down") { - Some("ui_down".to_string()) - } else { - None - }; + if self.script_loaded + && let Some(env) = &self.env + && env.get_function("_input").is_some() + { + // Convert Godot InputEvent to FerrisScript InputEventHandle + // NOTE: Simplified implementation for Phase 2.1 + // - Currently checks hardcoded common actions (ui_* actions) + // - Stores action name strings, not full Godot event reference + // - Full InputEvent API (position, button_index, etc.) deferred to Phase 5/6 + // See: docs/planning/v0.0.4/KNOWN_LIMITATIONS.md - "InputEvent Simplified API" + let action_pressed = if event.is_action_pressed("ui_accept") { + Some("ui_accept".to_string()) + } else if event.is_action_pressed("ui_cancel") { + Some("ui_cancel".to_string()) + } else if event.is_action_pressed("ui_left") { + Some("ui_left".to_string()) + } else if event.is_action_pressed("ui_right") { + Some("ui_right".to_string()) + } else if event.is_action_pressed("ui_up") { + Some("ui_up".to_string()) + } else if event.is_action_pressed("ui_down") { + Some("ui_down".to_string()) + } else { + None + }; - let input_event_handle = InputEventHandle::new(action_pressed, action_released); - let input_event_value = Value::InputEvent(input_event_handle); + let action_released = if event.is_action_released("ui_accept") { + Some("ui_accept".to_string()) + } else if event.is_action_released("ui_cancel") { + Some("ui_cancel".to_string()) + } else if event.is_action_released("ui_left") { + Some("ui_left".to_string()) + } else if event.is_action_released("ui_right") { + Some("ui_right".to_string()) + } else if event.is_action_released("ui_up") { + Some("ui_up".to_string()) + } else if event.is_action_released("ui_down") { + Some("ui_down".to_string()) + } else { + None + }; - self.call_script_function_with_self("_input", &[input_event_value]); - } - } + let input_event_handle = InputEventHandle::new(action_pressed, action_released); + let input_event_value = Value::InputEvent(input_event_handle); + + self.call_script_function_with_self("_input", &[input_event_value]); } } fn physics_process(&mut self, delta: f64) { // Execute _physics_process function if script is loaded and function exists - if self.script_loaded { - if let Some(env) = &self.env { - if env.get_function("_physics_process").is_some() { - // Convert delta to Float (f32 for FerrisScript) - let delta_value = Value::Float(delta as f32); - self.call_script_function_with_self("_physics_process", &[delta_value]); - } - } + if self.script_loaded + && let Some(env) = &self.env + && env.get_function("_physics_process").is_some() + { + // Convert delta to Float (f32 for FerrisScript) + let delta_value = Value::Float(delta as f32); + self.call_script_function_with_self("_physics_process", &[delta_value]); } } fn enter_tree(&mut self) { // Execute _enter_tree function if script is loaded and function exists - if self.script_loaded { - if let Some(env) = &self.env { - if env.get_function("_enter_tree").is_some() { - self.call_script_function("_enter_tree", &[]); - } - } + if self.script_loaded + && let Some(env) = &self.env + && env.get_function("_enter_tree").is_some() + { + self.call_script_function("_enter_tree", &[]); } } fn exit_tree(&mut self) { // Execute _exit_tree function if script is loaded and function exists - if self.script_loaded { - if let Some(env) = &self.env { - if env.get_function("_exit_tree").is_some() { - self.call_script_function("_exit_tree", &[]); - } - } + if self.script_loaded + && let Some(env) = &self.env + && env.get_function("_exit_tree").is_some() + { + self.call_script_function("_exit_tree", &[]); } } @@ -544,7 +537,7 @@ impl INode2D for FerrisScriptNode { /// - Range(min, max, step): Slider control for numeric types /// - Enum(values): Dropdown selection for String types /// - File(extensions): File picker dialog for String types - fn get_property_list(&mut self) -> Vec { + fn on_get_property_list(&mut self) -> Vec { // Only expose properties if script is successfully loaded and compiled if let Some(program) = &self.program { // Convert each PropertyMetadata to PropertyInfo using helper function @@ -584,7 +577,7 @@ impl INode2D for FerrisScriptNode { /// - If env is None (script not loaded): Returns None gracefully /// - If property doesn't exist: Returns None gracefully (not an error) /// - Never panics (would crash Inspector) - fn get_property(&self, property: StringName) -> Option { + fn on_get(&self, property: StringName) -> Option { let prop_name = property.to_string(); // Check if we have a loaded environment with runtime storage @@ -628,39 +621,39 @@ impl INode2D for FerrisScriptNode { /// - If property doesn't exist: Returns false gracefully /// - If set operation fails: Logs error with godot_error! but doesn't panic /// - Never panics (would crash Inspector) - fn set_property(&mut self, property: StringName, value: Variant) -> bool { + fn on_set(&mut self, property: StringName, value: Variant) -> bool { let prop_name = property.to_string(); // ========== Special Handling: script_path Property ========== // When Inspector changes script_path, reload the script to update property list - if prop_name == "script_path" { - if let Ok(new_path) = value.try_to::() { - // Only reload if path actually changed - if new_path != self.script_path { - godot_print!( - "📝 Script path changed: {} → {}", - self.script_path, - new_path - ); - - self.script_path = new_path.clone(); - - // Clear old script state - self.script_loaded = false; - self.env = None; - self.program = None; - self.last_modified = None; - - // Load new script (will trigger notify_property_list_changed) - if !self.script_path.is_empty() { - self.load_script(); - } else { - // Path cleared - notify Inspector that properties are gone - self.base_mut().notify_property_list_changed(); - } + if prop_name == "script_path" + && let Ok(new_path) = value.try_to::() + { + // Only reload if path actually changed + if new_path != self.script_path { + godot_print!( + "📝 Script path changed: {} → {}", + self.script_path, + new_path + ); + + self.script_path = new_path.clone(); + + // Clear old script state + self.script_loaded = false; + self.env = None; + self.program = None; + self.last_modified = None; + + // Load new script (will trigger notify_property_list_changed) + if !self.script_path.is_empty() { + self.load_script(); + } else { + // Path cleared - notify Inspector that properties are gone + self.base_mut().notify_property_list_changed(); } - return true; // We handled it } + return true; // We handled it } // Check if we have a loaded environment with runtime storage @@ -783,10 +776,10 @@ impl FerrisScriptNode { std::path::PathBuf::from(path_str) }; - if let Ok(metadata) = std::fs::metadata(&absolute_path) { - if let Ok(modified) = metadata.modified() { - self.last_modified = Some(modified); - } + if let Ok(metadata) = std::fs::metadata(&absolute_path) + && let Ok(modified) = metadata.modified() + { + self.last_modified = Some(modified); } godot_print!("Successfully loaded FerrisScript: {}", path); @@ -951,24 +944,24 @@ impl FerrisScriptNode { }; // Get current file modification time - if let Ok(metadata) = std::fs::metadata(&absolute_path) { - if let Ok(modified) = metadata.modified() { - // Check if this is first time or if file was modified since last check - let should_reload = match self.last_modified { - Some(last) => modified > last, // File is newer than cached timestamp - None => { - // First time checking - just cache the timestamp, don't reload - self.last_modified = Some(modified); - false - } - }; - - if should_reload { - godot_print!("🔄 Hot-reload: Script file modified, reloading..."); + if let Ok(metadata) = std::fs::metadata(&absolute_path) + && let Ok(modified) = metadata.modified() + { + // Check if this is first time or if file was modified since last check + let should_reload = match self.last_modified { + Some(last) => modified > last, // File is newer than cached timestamp + None => { + // First time checking - just cache the timestamp, don't reload self.last_modified = Some(modified); - self.reload_script(); - godot_print!("✅ Hot-reload complete! Properties updated."); + false } + }; + + if should_reload { + godot_print!("🔄 Hot-reload: Script file modified, reloading..."); + self.last_modified = Some(modified); + self.reload_script(); + godot_print!("✅ Hot-reload complete! Properties updated."); } } } @@ -1105,7 +1098,7 @@ mod tests { use super::*; /// API Verification Test (Bundle 4 - Checkpoint 3.7) - /// Confirms which PropertyUsageFlags and ClassId API variants work in godot-rust 0.4.0 + /// Confirms which PropertyUsageFlags API variants work in godot-rust 0.5 #[test] fn test_property_usage_flags_api() { // Test 1: Verify bitwise OR operator works on PropertyUsageFlags @@ -1118,15 +1111,6 @@ mod tests { assert_eq!(common, common); } - #[test] - fn test_classid_api() { - // Test which ClassId variant exists - // Try ClassId::none() first (most common in 0.4.0) - let class_id = ClassId::none(); - // API verification: if above compiles, none() is correct - assert_eq!(class_id, ClassId::none()); - } - // ==================== // map_type_to_variant Tests (Bundle 4 - Checkpoint 3.7) // ==================== @@ -1285,7 +1269,7 @@ mod tests { assert_eq!(result.variant_type, VariantType::INT); assert_eq!(result.property_name.to_string(), "test_prop"); assert_eq!(result.hint_info.hint, PropertyHint::NONE); - assert_eq!(result.class_id, ClassId::none()); + assert_eq!(result.class_name, StringName::default()); } #[test] diff --git a/crates/runtime/Cargo.toml b/crates/runtime/Cargo.toml index fd664d8..8798b73 100644 --- a/crates/runtime/Cargo.toml +++ b/crates/runtime/Cargo.toml @@ -1,7 +1,8 @@ [package] name = "ferrisscript_runtime" -version = "0.0.3" -edition = "2021" +version.workspace = true +edition.workspace = true +rust-version.workspace = true [dependencies] ferrisscript_compiler = { path = "../compiler" } diff --git a/crates/runtime/benches/runtime_benchmarks.rs b/crates/runtime/benches/runtime_benchmarks.rs index b557d51..ae5a048 100644 --- a/crates/runtime/benches/runtime_benchmarks.rs +++ b/crates/runtime/benches/runtime_benchmarks.rs @@ -1,6 +1,6 @@ -use criterion::{criterion_group, criterion_main, BenchmarkId, Criterion}; +use criterion::{BenchmarkId, Criterion, criterion_group, criterion_main}; use ferrisscript_compiler::compile; -use ferrisscript_runtime::{call_function, execute, Env, Value}; +use ferrisscript_runtime::{Env, Value, call_function, execute}; use std::hint::black_box; fn compilation_benchmarks(c: &mut Criterion) { diff --git a/crates/runtime/src/lib.rs b/crates/runtime/src/lib.rs index 6685859..6df262d 100644 --- a/crates/runtime/src/lib.rs +++ b/crates/runtime/src/lib.rs @@ -436,7 +436,7 @@ impl Env { _ => { return Err( "Error[E502]: emit_signal first argument must be a string".to_string() - ) + ); } }; @@ -626,51 +626,51 @@ impl Env { "Vector2" => { // Parse "Vector2 { x: 0.0, y: 0.0 }" format // Simplified parsing since format is guaranteed by compiler - if let Some(fields_str) = default_str.strip_prefix("Vector2 {") { - if let Some(fields_str) = fields_str.strip_suffix('}') { - let mut x = 0.0; - let mut y = 0.0; - for field in fields_str.split(',') { - let parts: Vec<&str> = field.split(':').collect(); - if parts.len() == 2 { - let name = parts[0].trim(); - let value = parts[1].trim(); - if name == "x" { - x = value.parse().unwrap_or(0.0); - } else if name == "y" { - y = value.parse().unwrap_or(0.0); - } + if let Some(fields_str) = default_str.strip_prefix("Vector2 {") + && let Some(fields_str) = fields_str.strip_suffix('}') + { + let mut x = 0.0; + let mut y = 0.0; + for field in fields_str.split(',') { + let parts: Vec<&str> = field.split(':').collect(); + if parts.len() == 2 { + let name = parts[0].trim(); + let value = parts[1].trim(); + if name == "x" { + x = value.parse().unwrap_or(0.0); + } else if name == "y" { + y = value.parse().unwrap_or(0.0); } } - return Value::Vector2 { x, y }; } + return Value::Vector2 { x, y }; } Value::Vector2 { x: 0.0, y: 0.0 } // Default } "Color" => { // Parse "Color { r: 1.0, g: 0.0, b: 0.0, a: 1.0 }" format - if let Some(fields_str) = default_str.strip_prefix("Color {") { - if let Some(fields_str) = fields_str.strip_suffix('}') { - let mut r = 0.0; - let mut g = 0.0; - let mut b = 0.0; - let mut a = 1.0; - for field in fields_str.split(',') { - let parts: Vec<&str> = field.split(':').collect(); - if parts.len() == 2 { - let name = parts[0].trim(); - let value = parts[1].trim(); - match name { - "r" => r = value.parse().unwrap_or(0.0), - "g" => g = value.parse().unwrap_or(0.0), - "b" => b = value.parse().unwrap_or(0.0), - "a" => a = value.parse().unwrap_or(1.0), - _ => {} - } + if let Some(fields_str) = default_str.strip_prefix("Color {") + && let Some(fields_str) = fields_str.strip_suffix('}') + { + let mut r = 0.0; + let mut g = 0.0; + let mut b = 0.0; + let mut a = 1.0; + for field in fields_str.split(',') { + let parts: Vec<&str> = field.split(':').collect(); + if parts.len() == 2 { + let name = parts[0].trim(); + let value = parts[1].trim(); + match name { + "r" => r = value.parse().unwrap_or(0.0), + "g" => g = value.parse().unwrap_or(0.0), + "b" => b = value.parse().unwrap_or(0.0), + "a" => a = value.parse().unwrap_or(1.0), + _ => {} } } - return Value::Color { r, g, b, a }; } + return Value::Color { r, g, b, a }; } Value::Color { r: 0.0, @@ -1138,16 +1138,17 @@ fn assign_field( match object { ast::Expr::Variable(name, _) => { // Check if this is 'self' - if let Some(var) = env.get(name) { - if matches!(var, Value::SelfObject) { - // Assigning to self.property - use property setter callback - if let Some(setter) = env.property_setter { - return setter(field, value); - } else { - return Err( - "Error[E404]: Cannot set self properties: no property setter registered".to_string() - ); - } + if let Some(var) = env.get(name) + && matches!(var, Value::SelfObject) + { + // Assigning to self.property - use property setter callback + if let Some(setter) = env.property_setter { + return setter(field, value); + } else { + return Err( + "Error[E404]: Cannot set self properties: no property setter registered" + .to_string(), + ); } } @@ -1261,14 +1262,14 @@ fn assign_field( return Err(format!( "Error[E703]: Transform2D has no field '{}'", field - )) + )); } }, _ => { return Err(format!( "Error[E408]: Cannot access field '{}' on {:?}", field, var - )) + )); } } Ok(()) @@ -1281,65 +1282,65 @@ fn assign_field( // Handle nested field access (e.g., self.position.x) if let ast::Expr::Variable(name, _) = &**object { // Check if this is self.property.field - if let Some(var) = env.get(name) { - if matches!(var, Value::SelfObject) { - // Get the property from Godot (e.g., position) - if let Some(getter) = env.property_getter { - let mut prop_value = getter(parent_field)?; - - // Modify the field (e.g., x or y) - match &mut prop_value { - Value::Vector2 { x, y } => match field { - "x" => { - if let Some(f) = value.to_float() { - *x = f; - } else { - return Err(format!( - "Error[E406]: Cannot assign {:?} to Vector2.x", - value - )); - } - } - "y" => { - if let Some(f) = value.to_float() { - *y = f; - } else { - return Err(format!( - "Error[E406]: Cannot assign {:?} to Vector2.y", - value - )); - } + if let Some(var) = env.get(name) + && matches!(var, Value::SelfObject) + { + // Get the property from Godot (e.g., position) + if let Some(getter) = env.property_getter { + let mut prop_value = getter(parent_field)?; + + // Modify the field (e.g., x or y) + match &mut prop_value { + Value::Vector2 { x, y } => match field { + "x" => { + if let Some(f) = value.to_float() { + *x = f; + } else { + return Err(format!( + "Error[E406]: Cannot assign {:?} to Vector2.x", + value + )); } - _ => { + } + "y" => { + if let Some(f) = value.to_float() { + *y = f; + } else { return Err(format!( - "Error[E407]: Vector2 has no field '{}'", - field - )) + "Error[E406]: Cannot assign {:?} to Vector2.y", + value + )); } - }, + } _ => { return Err(format!( - "Error[E409]: Property '{}' is not a Vector2", - parent_field - )) + "Error[E407]: Vector2 has no field '{}'", + field + )); } + }, + _ => { + return Err(format!( + "Error[E409]: Property '{}' is not a Vector2", + parent_field + )); } + } - // Set the property back to Godot - if let Some(setter) = env.property_setter { - return setter(parent_field, prop_value); - } else { - return Err( + // Set the property back to Godot + if let Some(setter) = env.property_setter { + return setter(parent_field, prop_value); + } else { + return Err( "Error[E404]: Cannot set self properties: no property setter registered" .to_string(), ); - } - } else { - return Err( + } + } else { + return Err( "Error[E410]: Cannot get self properties: no property getter registered" .to_string(), ); - } } } @@ -2229,9 +2230,11 @@ mod tests { let result = call_function("test", &[], &mut env); assert!(result.is_err()); - assert!(result - .unwrap_err() - .contains("Cannot assign to immutable variable")); + assert!( + result + .unwrap_err() + .contains("Cannot assign to immutable variable") + ); } #[test] @@ -2320,9 +2323,11 @@ mod tests { let result = call_function("test", &[], &mut env); assert!(result.is_err()); - assert!(result - .unwrap_err() - .contains("Cannot assign to field of immutable variable")); + assert!( + result + .unwrap_err() + .contains("Cannot assign to field of immutable variable") + ); } #[test] @@ -2799,9 +2804,11 @@ mod tests { let mut env = Env::new(); let result = env.call_builtin("nonexistent_func", &[]); assert!(result.is_err()); - assert!(result - .unwrap_err() - .contains("Unknown built-in function: nonexistent_func")); + assert!( + result + .unwrap_err() + .contains("Unknown built-in function: nonexistent_func") + ); } #[test] @@ -2854,9 +2861,11 @@ mod tests { let result = call_function("get_prop", &[], &mut env); assert!(result.is_err()); - assert!(result - .unwrap_err() - .contains("no property getter registered")); + assert!( + result + .unwrap_err() + .contains("no property getter registered") + ); } #[test] @@ -3306,9 +3315,11 @@ mod tests { let result = call_function("test", &[], &mut env); assert!(result.is_err()); - assert!(result - .unwrap_err() - .contains("Failed to emit signal: test_signal")); + assert!( + result + .unwrap_err() + .contains("Failed to emit signal: test_signal") + ); } #[test] @@ -3318,9 +3329,11 @@ mod tests { // Test calling emit_signal with no arguments let result = env.call_builtin("emit_signal", &[]); assert!(result.is_err()); - assert!(result - .unwrap_err() - .contains("emit_signal requires at least a signal name")); + assert!( + result + .unwrap_err() + .contains("emit_signal requires at least a signal name") + ); } #[test] @@ -3330,9 +3343,11 @@ mod tests { // Test calling emit_signal with non-string first argument let result = env.call_builtin("emit_signal", &[Value::Int(42)]); assert!(result.is_err()); - assert!(result - .unwrap_err() - .contains("emit_signal first argument must be a string")); + assert!( + result + .unwrap_err() + .contains("emit_signal first argument must be a string") + ); } // Phase 2: Lifecycle callback runtime tests diff --git a/crates/test_harness/Cargo.toml b/crates/test_harness/Cargo.toml index d52068b..fa4dc5a 100644 --- a/crates/test_harness/Cargo.toml +++ b/crates/test_harness/Cargo.toml @@ -1,7 +1,8 @@ [package] name = "ferrisscript_test_harness" -version = "0.0.3" -edition = "2021" +version.workspace = true +edition.workspace = true +rust-version.workspace = true authors = ["dev-parkins"] description = "Headless testing harness for FerrisScript + Godot integration" diff --git a/crates/test_harness/src/report_generator.rs b/crates/test_harness/src/report_generator.rs index e909278..274aef2 100644 --- a/crates/test_harness/src/report_generator.rs +++ b/crates/test_harness/src/report_generator.rs @@ -202,24 +202,24 @@ impl ReportGenerator { symbol, result.test_name )); - if self.show_assertions { - if let Some(matched) = result.expected_error_matched { - if matched { - if let Some(error) = &result.actual_error { - output.push_str(&format!( - " {} Error message: \"{}\"\n", - self.colorize("✓", Color::Green), - error - )); - } - } else { + if self.show_assertions + && let Some(matched) = result.expected_error_matched + { + if matched { + if let Some(error) = &result.actual_error { output.push_str(&format!( - " {} Expected error not found\n", - self.colorize("✗", Color::Red) + " {} Error message: \"{}\"\n", + self.colorize("✓", Color::Green), + error )); - if let Some(error) = &result.actual_error { - output.push_str(&format!(" Actual error: \"{}\"\n", error)); - } + } + } else { + output.push_str(&format!( + " {} Expected error not found\n", + self.colorize("✗", Color::Red) + )); + if let Some(error) = &result.actual_error { + output.push_str(&format!(" Actual error: \"{}\"\n", error)); } } } diff --git a/crates/test_harness/src/scene_builder.rs b/crates/test_harness/src/scene_builder.rs index c4bab30..1c13ecb 100644 --- a/crates/test_harness/src/scene_builder.rs +++ b/crates/test_harness/src/scene_builder.rs @@ -171,11 +171,7 @@ pub fn parse_scene_requirements(ferris_content: &str) -> Option { } } - if main_node_found { - Some(builder) - } else { - None - } + if main_node_found { Some(builder) } else { None } } fn extract_node_name(line: &str) -> Option { diff --git a/crates/test_harness/src/test_runner.rs b/crates/test_harness/src/test_runner.rs index 6ecc3a3..3954c0c 100644 --- a/crates/test_harness/src/test_runner.rs +++ b/crates/test_harness/src/test_runner.rs @@ -195,10 +195,10 @@ impl TestHarness { println!(" ✗ {} ({} ms)", result.script_name, result.duration_ms); if !result.markers.is_empty() { for marker in &result.markers { - if marker.kind == crate::TestMarkerKind::Fail { - if let Some(msg) = &marker.message { - println!(" - {}", msg); - } + if marker.kind == crate::TestMarkerKind::Fail + && let Some(msg) = &marker.message + { + println!(" - {}", msg); } } } diff --git a/docs/planning/README.md b/docs/planning/README.md index f61aef2..554e6eb 100644 --- a/docs/planning/README.md +++ b/docs/planning/README.md @@ -6,6 +6,14 @@ This folder contains detailed roadmaps for each development version on the path **Last Updated**: October 5, 2025 +> **⚠️ Superseded (2026-07-21)**: The version numbers and `-roadmap.md` filenames +> below predate the actual v0.0.4/v0.0.5 planning that happened in October +> 2025 and the July 2026 stabilization cycle. **[`ROADMAP_MASTER.md`](ROADMAP_MASTER.md) +> is the current single source of truth** for version status and numbering +> (note in particular that the LSP work referenced here as "v0.0.5" is now +> `v0.0.6` — see the renumbering note at the top of `ROADMAP_MASTER.md`). The +> content below is kept for historical context only. + **Current Status**: - ✅ v0.0.1: Released (October 2, 2025) diff --git a/docs/planning/ROADMAP_MASTER.md b/docs/planning/ROADMAP_MASTER.md index c839e10..5cf86f1 100644 --- a/docs/planning/ROADMAP_MASTER.md +++ b/docs/planning/ROADMAP_MASTER.md @@ -1,8 +1,18 @@ # FerrisScript Master Roadmap **Single Source of Truth for Version Planning** -**Last Updated**: October 11, 2025 -**Current Version**: v0.0.4 (Phases 1-5 complete, documentation polish remaining) +**Last Updated**: July 21, 2026 +**Current Version**: v0.0.5 in progress (Stabilization & Engine Modernization) + +**Note (2026-07-21)**: The version originally planned as "v0.0.5: LSP +Foundation and Safety Fix" has been renumbered to **v0.0.6** and every +version after it shifted up by one (old v0.0.6 → v0.0.7, old v0.0.7 → +v0.0.8, etc.). After 8 months of dormancy, v0.0.5 was re-scoped to +stabilization (landing two stalled PRs, housekeeping) and engine +modernization (gdext 0.4→0.5.4, Godot 4.7) instead — see the new `v0.0.5` +section below. The LSP/test-framework plan itself is unchanged in content, +just renumbered; its planning docs live in `docs/planning/v0.0.6/` (moved +from `docs/planning/v0.0.5/`). --- @@ -49,7 +59,7 @@ Build a statically-typed, Rust-inspired scripting language for Godot with **comp --- -## 📍 Current State (v0.0.4) +## 📍 Current State (v0.0.5 in progress, built on v0.0.4) ### What Works Today ✅ @@ -69,13 +79,13 @@ Build a statically-typed, Rust-inspired scripting language for Godot with **comp ### In Progress 🔄 -- None (v0.0.4 feature-complete, preparing release) +- 🔄 v0.0.5 "Stabilization & Engine Modernization" — see version details below ### What's Missing ❌ -- ❌ LSP / editor support (coming in v0.0.5) -- ❌ Arrays and for loops (coming in v0.0.6) -- ❌ Advanced Godot types (Vector3, Basis, etc. - coming in v0.0.7) +- ❌ LSP / editor support (coming in v0.0.6) +- ❌ Arrays and for loops (coming in v0.0.7) +- ❌ Advanced Godot types (Vector3, Basis, etc. - coming in v0.0.8) - ❌ Metadata/manifest system (coming in v0.1.0) - ❌ Extended type system (i64, f64, u8, i16, u16 - coming in v0.2.0) - ❌ Arithmetic safety (checked/saturating methods - coming in v0.3.0) @@ -89,9 +99,10 @@ Build a statically-typed, Rust-inspired scripting language for Godot with **comp | Version | Status | Focus | Timeline | Premium Requests | |---------|--------|-------|----------|------------------| | **v0.0.4** | ✅ Complete | Godot API + Inspector integration | Completed Oct 10, 2025 | 6-8 used | -| **v0.0.5** | 📋 Next | LSP + Compiler Prerequisites + Test Framework 🛡️ | 6-7 weeks | 20-25 ⬆️ | -| **v0.0.6** | 📋 Planned | Language features (arrays/for) | 2-3 weeks | 8-12 | -| **v0.0.7** | 📋 Planned | Godot API + node safety 🛡️ | 2-3 weeks | 9-12 ⬆️ | +| **v0.0.5** | 🔄 In Progress | Stabilization & Engine Modernization (gdext 0.5.4, Godot 4.7) | ~1 week | 4-6 | +| **v0.0.6** | 📋 Next | LSP + Compiler Prerequisites + Test Framework 🛡️ | 6-7 weeks | 20-25 ⬆️ | +| **v0.0.7** | 📋 Planned | Language features (arrays/for) | 2-3 weeks | 8-12 | +| **v0.0.8** | 📋 Planned | Godot API + node safety 🛡️ | 2-3 weeks | 9-12 ⬆️ | | **v0.1.0** | 🎯 Milestone | LSP UX + Type Safety + Metadata | 3-4 weeks | 10-15 ⬆️ | | **v0.2.0** | 🚀 Planned | Extended types + LSP Navigation + Validation | 4-5 weeks | 12-16 ⬆️ | | **v0.3.0** | 🚀 Planned | Arithmetic safety + LSP Advanced + Type Safety Advanced | 5-7 weeks | 14-20 ⬆️ | @@ -113,7 +124,7 @@ Build a statically-typed, Rust-inspired scripting language for Godot with **comp ## 📦 Version Details -### v0.0.4: Godot API Expansion (CURRENT - 90% Complete) +### v0.0.4: Godot API Expansion (✅ Complete) **Goal**: Comprehensive Godot integration for 2D game development @@ -139,7 +150,7 @@ Build a statically-typed, Rust-inspired scripting language for Godot with **comp - [x] 12 new error codes (E601-E613) - [x] Test harness infrastructure (38 test_harness tests, 3,500+ lines) - [x] Test coverage analysis (31% scenario coverage, 64 scenarios tracked) -- [x] Node invalidation research (safety roadmap for v0.0.5/v0.0.7) +- [x] Node invalidation research (safety roadmap for v0.0.6/v0.0.8) - [x] 4 example scripts with metadata protocol **Phase 4** ✅ Complete (Commit 6b51076, 00e47b0): @@ -190,7 +201,99 @@ Build a statically-typed, Rust-inspired scripting language for Godot with **comp --- -### v0.0.5: LSP Foundation + Safety Fix (HIGHEST PRIORITY) +### v0.0.5: Stabilization & Engine Modernization (🔄 In Progress) + +**Goal**: Return the project to a healthy, current baseline after 8 months of +dormancy (last commit Oct 2025 → resumed July 2026) before continuing feature +work — land the two stalled PRs, pay down housekeeping debt, and bring the +Godot binding stack up to date. + +**Why this exists / why it's not LSP work**: The project's `v0.0.5` slot was +originally slated for LSP Foundation work (see `v0.0.6` below, its +renumbered home). On return, two finished-but-unmerged PRs were sitting on +`origin` and the `godot` (gdext) dependency was a full major version behind +current, with the property/Inspector binding code being the most +version-fragile part of the codebase. Rather than resume a 6-7 week LSP +effort on top of a stale foundation, this cycle stabilizes first. + +**Phase 0 — Environment & baseline**: + +- [x] Installed Godot 4.7.stable locally (first time this project has run + on a non-Windows dev machine) +- [x] Verified `ferris-test` harness works via `GODOT_EXE`/`GODOT_PROJECT` + env overrides (no `ferris-test.toml` edit needed) + +**Phase 1 — Land stalled PRs**: + +- [x] Merged PR #59 (source span tracking — `crates/compiler/src/span.rs`, + `Position`/`Span` across AST/parser/type checker; LSP foundation Phase + 0.1, now filed under `v0.0.6` below) +- [x] Merged PR #60 (Inspector `clear_on_error()` fix — stale exported + properties no longer persist after a compile error) +- [x] Fixed a GitHub repo ruleset that required a "Full Test Suite" status + check which never runs on `pull_request` events, permanently blocking + merges on a solo-maintainer repo; now requires only "Quick Check" + + "Generate Coverage Report", 0 approvals, squash-only + +**Phase 2 — Housekeeping** (PR #61, #62): + +- [x] Fixed `.gdextension` library paths for Linux/macOS (missing the `lib` + prefix cargo adds to cdylibs — the extension had never loaded on + non-Windows platforms) +- [x] Fixed the test harness deleting its own source `.ferris` scripts when + the scripts directory under test was the project's live scripts + directory +- [x] Fixed clippy lints introduced by newer stable Rust +- [x] Restored `docs/archive/` (97 files) and `docs/planning/technical/` (9 + files), unintentionally deleted across the PR #53 revert and #54 + squash-merge; fixed the resulting dangling links +- [x] Added v0.0.3/v0.0.4 sections to `RELEASE_NOTES.md` (was stale at + v0.0.2) +- [x] Untracked harness-generated `.tscn` scenes; committed `Cargo.lock` + +**Phase 3 — gdext 0.4.5 → 0.5.4, Godot 4.7 (PR #63)**: + +- [x] `godot` crate 0.4 → 0.5 (`api-4-3` → `api-4-7`), Rust Edition 2021 → + 2024, MSRV declared 1.94 +- [x] Migrated `crates/godot_bind/src/lib.rs`'s Inspector integration: + `PropertyInfo`/`PropertyHintInfo` module move, `export_info_functions` + → `export_fns` rename, `class_id: ClassId` → `class_name: StringName`, + and the `get_property_list`/`get_property`/`set_property` virtuals + renamed to `on_get_property_list`/`on_get`/`on_set` +- [x] `godot_test/ferrisscript.gdextension` `compatibility_minimum` 4.1 → + 4.2; `godot_test/project.godot` engine features "4.5" → "4.7" +- [x] Verified: full test suite green (883 tests), release build succeeds, + extension loads cleanly under Godot 4.7.stable headless, `ferris-test` + corpus pass rate unchanged (19/33 — remaining failures are pre-existing + test-script drift against unimplemented language features, unrelated + to this upgrade) + +**Phase 4 — Inspector fix verification**: + +- [x] Verified PR #60's fix headlessly (no interactive editor in this + environment) via a scripted GDScript test + (`godot_test/scripts/inspector_refresh_test.gd`) driving a + `FerrisScriptNode` through compile-error/fix/missing-file scenarios — + 5/5 checks pass under Godot 4.7 / gdext 0.5.4 + +**Phase 5 — Release** (this section + roadmap renumbering): + +- [x] Renumbered `v0.0.5` (LSP Foundation) → `v0.0.6` and cascaded every + later version up by one; moved `docs/planning/v0.0.5/` → + `docs/planning/v0.0.6/` +- [ ] Version bumps (workspace + all crates → 0.0.5), CHANGELOG/RELEASE_NOTES + finalization, tag `v0.0.5` + +**Deliverables Remaining**: version bump finalization and release tag (see +Phase 5 above). + +**What Was Delivered**: a current, healthy baseline — no code changes beyond +dependency/API migration and bug fixes already merged in prior versions; +zero new language features (that resumes in `v0.0.7`, see below). + +--- + +### v0.0.6: LSP Foundation + Safety Fix (HIGHEST PRIORITY) **Goal**: Real-time diagnostics and node safety foundation @@ -274,7 +377,7 @@ Build a statically-typed, Rust-inspired scripting language for Godot with **comp - ❌ Autocomplete (needs Phase 0.2 symbol table, but UI deferred) - ❌ Go-to-definition (needs Phase 0.1 spans, but UI deferred) - ❌ Find references (needs Phase 0.2 symbol table, but UI deferred) -- ❌ Node invalidation Phase 1 (moved to v0.0.7) +- ❌ Node invalidation Phase 1 (moved to v0.0.8) **Timeline**: 6-7 weeks (was 3-4 weeks, then 4-5 weeks) **Estimated Premium Requests**: 20-25 (was 11-16, then 13-18) @@ -291,17 +394,17 @@ Build a statically-typed, Rust-inspired scripting language for Godot with **comp **Note**: Focus on **diagnostics only** (Minimum Viable LSP). Additional features come in v0.1.0. -**See**: `docs/planning/v0.0.5/LSP_ARCHITECTURE_SUPPORT.md` for detailed architecture +**See**: `docs/planning/v0.0.6/LSP_ARCHITECTURE_SUPPORT.md` for detailed architecture -#### v0.0.5 Consistency Checklist 🆕 +#### v0.0.6 Consistency Checklist 🆕 -**Purpose**: Ensure all v0.0.5 planning documents align with master roadmap decisions. +**Purpose**: Ensure all v0.0.6 planning documents align with master roadmap decisions. **Critical Decisions Made** (Option A for all): -1. ✅ Ship v0.0.5 with compiler prerequisites (spans + symbol table) - adds 1 week -2. ✅ Full LSP test integration in v0.0.5 - no deferral -3. ✅ Add incremental compilation to v0.0.5 - adds 2-3 weeks +1. ✅ Ship v0.0.6 with compiler prerequisites (spans + symbol table) - adds 1 week +2. ✅ Full LSP test integration in v0.0.6 - no deferral +3. ✅ Add incremental compilation to v0.0.6 - adds 2-3 weeks **Updated Timeline**: 6-7 weeks (was 3-4 weeks, then 4-5 weeks) @@ -321,10 +424,10 @@ Build a statically-typed, Rust-inspired scripting language for Godot with **comp - [x] Ensure span tracking matches Phase 0.1 - [x] Timeline reflects 6-7 weeks total (not just LSP-specific time) - [x] Decision log documents Option A choices - - [x] Roadmap section updated with v0.0.5/v0.1.0 split + - [x] Roadmap section updated with v0.0.6/v0.1.0 split - [ ] **ROADMAP_MASTER.md**: (This document) - - [x] v0.0.5 timeline updated to 6-7 weeks + - [x] v0.0.6 timeline updated to 6-7 weeks - [x] Premium request estimate updated (13-18 → likely 20-25 with added scope) - [ ] Phases 0-3 clearly documented - [ ] Dependencies call out compiler prerequisites @@ -355,7 +458,7 @@ Priority 1 (Keep): - Basic LSP diagnostics - Test framework foundation -Priority 2 (Defer to v0.0.6 if needed): +Priority 2 (Defer to v0.0.7 if needed): - Incremental compilation (fallback: always recompile) - LSP test integration (ship test framework standalone) @@ -367,7 +470,7 @@ Priority 3 (Defer to v0.1.0): --- -### v0.0.6: Language Features +### v0.0.7: Language Features **Goal**: Arrays, loops, and pattern matching @@ -403,13 +506,13 @@ Priority 3 (Defer to v0.1.0): **Timeline**: 2-3 weeks **Estimated Premium Requests**: 8-12 -**Dependencies**: v0.0.5 Phase 2 (compiler integration) +**Dependencies**: v0.0.6 Phase 2 (compiler integration) -**Parallelization**: Can start during v0.0.5 phases 3-5 +**Parallelization**: Can start during v0.0.6 phases 3-5 --- -### v0.0.7: Godot API Expansion + Node Safety +### v0.0.8: Godot API Expansion + Node Safety **Goal**: Comprehensive type coverage for 2D game development + robust node references @@ -456,7 +559,7 @@ Priority 3 (Defer to v0.1.0): **Timeline**: 2-3 weeks **Estimated Premium Requests**: 9-12 ⬆️ (increased by 1 PR for node safety) -**Dependencies**: Arrays (v0.0.6) for `get_children()`, Phase 1 (v0.0.5) for validity checking +**Dependencies**: Arrays (v0.0.7) for `get_children()`, Phase 1 (v0.0.6) for validity checking --- @@ -559,7 +662,7 @@ Priority 3 (Defer to v0.1.0): **Timeline**: 3-4 weeks (was 2-3 weeks) **Estimated Premium Requests**: 10-15 (was 6-9) -**Dependencies**: All v0.0.5-7 complete +**Dependencies**: All v0.0.6-7 complete **Blocks**: 🚨 All Godot editor integration (v0.5.0) @@ -567,7 +670,7 @@ Priority 3 (Defer to v0.1.0): - `docs/planning/v0.1.0-release-plan.md` for execution plan - `docs/TYPE_SAFETY_ROADMAP_ANALYSIS.md` for type safety details -- `docs/planning/v0.0.5/LSP_ARCHITECTURE_SUPPORT.md` for LSP architecture +- `docs/planning/v0.0.6/LSP_ARCHITECTURE_SUPPORT.md` for LSP architecture --- @@ -578,10 +681,10 @@ Priority 3 (Defer to v0.1.0): | Week | Primary Track | Secondary Track | Deliverable | |------|---------------|-----------------|-------------| | 1-2 | v0.0.4 Phase 2 | - | Lifecycle callbacks ✅ | -| 3-6 | v0.0.5 Phases 1-2 | - | LSP foundation + diagnostics | -| 7-9 | v0.0.5 Phases 3-4 | v0.0.6 arrays start | Autocomplete + navigation | -| 10-11 | v0.0.5 Phase 5 | v0.0.6 for/match | VS Code extension published | -| 12-14 | v0.0.7 Godot API | v0.0.6 string interp | API expansion complete | +| 3-6 | v0.0.6 Phases 1-2 | - | LSP foundation + diagnostics | +| 7-9 | v0.0.6 Phases 3-4 | v0.0.7 arrays start | Autocomplete + navigation | +| 10-11 | v0.0.6 Phase 5 | v0.0.7 for/match | VS Code extension published | +| 12-14 | v0.0.8 Godot API | v0.0.7 string interp | API expansion complete | | 15-16 | v0.1.0 polish | - | v0.1.0 release 🎉 | **Key Insight**: Different crates can be developed simultaneously (LSP + language features) @@ -592,7 +695,7 @@ Priority 3 (Defer to v0.1.0): ### 1. Editor Experience First -**Decision**: LSP in v0.0.5 (not v0.2.0 as originally planned) +**Decision**: LSP in v0.0.6 (not v0.2.0 as originally planned) **Rationale**: @@ -603,7 +706,7 @@ Priority 3 (Defer to v0.1.0): ### 2. Smaller, Faster Releases -**Decision**: Split v0.1.0 into v0.0.5-7 + v0.1.0 polish +**Decision**: Split v0.1.0 into v0.0.6-7 + v0.1.0 polish **Rationale**: @@ -704,7 +807,7 @@ Priority 3 (Defer to v0.1.0): - `docs/planning/v0.2.0-roadmap.md` for type system details - `docs/TYPE_SAFETY_ROADMAP_ANALYSIS.md` for validation details -- `docs/planning/v0.0.5/LSP_ARCHITECTURE_SUPPORT.md` for LSP navigation +- `docs/planning/v0.0.6/LSP_ARCHITECTURE_SUPPORT.md` for LSP navigation --- @@ -779,7 +882,7 @@ Priority 3 (Defer to v0.1.0): **See**: - `docs/planning/v0.3.0-roadmap.md` for arithmetic safety details -- `docs/planning/v0.0.5/LSP_ARCHITECTURE_SUPPORT.md` for LSP advanced features +- `docs/planning/v0.0.6/LSP_ARCHITECTURE_SUPPORT.md` for LSP advanced features - `docs/TYPE_SAFETY_ROADMAP_ANALYSIS.md` for type safety advanced (community validation required) --- @@ -971,14 +1074,14 @@ See `planning/VISION.md` for aspirational multi-year goals including: ### Decision & Analysis Documents (Historical Context) - **planning/ROADMAP_CONSOLIDATION_ANALYSIS.md** - Strategic analysis (Oct 2025) -- **planning/LSP_VERSION_RECONCILIATION.md** - LSP priority decision (v0.0.5) +- **planning/LSP_VERSION_RECONCILIATION.md** - LSP priority decision (v0.0.6) - **planning/NODE_INVALIDATION_PRIORITY_RECONCILIATION.md** - Node safety phasing - **planning/EDITOR_INTEGRATION_IMPACT.md** - Editor integration scope analysis (v0.5.0) ### Version-Specific Implementation Plans (Detailed Reference) -- **planning/v0.0.5-roadmap.md** - Detailed 5-phase LSP implementation -- **planning/v0.0.6-7-roadmap.md** - Arrays, for loops, match + Node Invalidation Phase 2 +- **planning/v0.0.6-roadmap.md** - Detailed 5-phase LSP implementation +- **planning/v0.0.7-7-roadmap.md** - Arrays, for loops, match + Node Invalidation Phase 2 - **planning/v0.1.0-ROADMAP.md** - Feature specifications & requirements - **planning/v0.1.0-release-plan.md** - Release execution (demo game, docs, QA) ✅ Merged into v0.1.0 above - **planning/v0.2.0-roadmap.md** - Extended type system implementation details ✅ Merged into v0.2.0 above @@ -1052,20 +1155,20 @@ See `planning/VISION.md` for aspirational multi-year goals including: 1. ✅ Complete roadmap consolidation analysis 2. ✅ Review and approve strategic direction 3. 🔄 Execute v0.0.4 Phase 2 (`_ready()` callback first) -4. ⏳ Begin v0.0.5 LSP research +4. ⏳ Begin v0.0.6 LSP research ### Next 2-4 Weeks 1. ⏳ Complete v0.0.4 Phase 2 (all lifecycle callbacks) 2. ⏳ Ship v0.0.4 release -3. ⏳ Start v0.0.5 LSP implementation +3. ⏳ Start v0.0.6 LSP implementation 4. ⏳ Archive superseded planning docs ### Next 2-3 Months -1. ⏳ Complete v0.0.5 (LSP alpha) -2. ⏳ Complete v0.0.6 (language features) -3. ⏳ Complete v0.0.7 (Godot API) +1. ⏳ Complete v0.0.6 (LSP alpha) +2. ⏳ Complete v0.0.7 (language features) +3. ⏳ Complete v0.0.8 (Godot API) 4. ⏳ Ship v0.1.0 milestone 🎉 --- diff --git a/docs/planning/v0.0.5/CONSOLIDATED_TEST_FRAMEWORK_IMPLEMENTATION.md b/docs/planning/v0.0.6/CONSOLIDATED_TEST_FRAMEWORK_IMPLEMENTATION.md similarity index 99% rename from docs/planning/v0.0.5/CONSOLIDATED_TEST_FRAMEWORK_IMPLEMENTATION.md rename to docs/planning/v0.0.6/CONSOLIDATED_TEST_FRAMEWORK_IMPLEMENTATION.md index 5c890dc..ee5efde 100644 --- a/docs/planning/v0.0.5/CONSOLIDATED_TEST_FRAMEWORK_IMPLEMENTATION.md +++ b/docs/planning/v0.0.6/CONSOLIDATED_TEST_FRAMEWORK_IMPLEMENTATION.md @@ -4,7 +4,7 @@ **Status**: Planning (Updated with LSP Integration) **Date**: October 13, 2025 **Priority**: High -**Dependencies**: Test harness crate, GDExtension runtime, LSP server (v0.0.5) +**Dependencies**: Test harness crate, GDExtension runtime, LSP server (v0.0.6) ## Executive Summary @@ -18,7 +18,7 @@ This document has been **updated to include critical gaps** identified in the fe - Code lens test status indicators (✅/❌/▶️) - "Run Test" command from editor - Real-time test result updates - - **Impact**: Essential for v0.0.5 editor experience + - **Impact**: Essential for v0.0.6 editor experience - **Timeline Impact**: +1-2 weeks 2. **Test Assertions Validation** 🟡 IMPORTANT @@ -1185,7 +1185,7 @@ fn extract_error_code(error_msg: &str) -> String { ### Phase 2.5: LSP Test Integration (2-3 days) 🆕 -**Critical for v0.0.5**: LSP needs to integrate with test framework for editor features. +**Critical for v0.0.6**: LSP needs to integrate with test framework for editor features. #### 2.5.1 LSP Protocol Extensions @@ -2657,15 +2657,15 @@ For more information, see: ### Soft Dependencies (Nice to Have) 1. **Test Coverage Tooling** - - Not required for v0.0.5 + - Not required for v0.0.6 - Can defer to v0.0.6 2. **Test Profiling/Benchmarking** - Nice for identifying slow tests - - Not blocking v0.0.5 release + - Not blocking v0.0.6 release 2. **Performance Benchmarking** - - Not required for v0.0.5 + - Not required for v0.0.6 - Can defer to v0.0.6 ### Integration Points with LSP @@ -2708,7 +2708,7 @@ Test Execution Test Status Cache - **Fallback**: Disable caching if bugs persist (graceful degradation) ### Risk 3: LSP Integration Complexity 🔴 HIGH -**Impact**: Could delay entire v0.0.5 release +**Impact**: Could delay entire v0.0.6 release **Probability**: Medium **Mitigation**: - Complete Phase 0 (compiler prerequisites) FIRST (Weeks 1-3) @@ -2743,7 +2743,7 @@ Test Execution Test Status Cache - **Target**: <100ms for typical edits (cache hit) ### Risk 8: Timeline Overrun (7 weeks → 9+ weeks) 🟡 MEDIUM 🆕 -**Impact**: Delayed v0.0.5 release +**Impact**: Delayed v0.0.6 release **Probability**: Medium **Mitigation**: - Phase 0 has highest risk (3 weeks of compiler changes) @@ -3074,7 +3074,7 @@ RUST_LOG=debug cargo test -- --nocapture --- -**Ready for Implementation**: This plan is production-ready and addresses all issues identified in the feedback phase, including LSP integration requirements for v0.0.5. +**Ready for Implementation**: This plan is production-ready and addresses all issues identified in the feedback phase, including LSP integration requirements for v0.0.6. **Next Steps**: @@ -3087,5 +3087,5 @@ RUST_LOG=debug cargo test -- --nocapture **Critical Dependencies**: - LSP server foundation must be ready before Phase 2.5 -- If LSP is delayed, ship test framework without editor integration in v0.0.5 +- If LSP is delayed, ship test framework without editor integration in v0.0.6 - Add LSP integration in v0.0.6 as enhancement diff --git a/docs/planning/v0.0.5/INSPECTOR_PROPERTY_FIX.md b/docs/planning/v0.0.6/INSPECTOR_PROPERTY_FIX.md similarity index 89% rename from docs/planning/v0.0.5/INSPECTOR_PROPERTY_FIX.md rename to docs/planning/v0.0.6/INSPECTOR_PROPERTY_FIX.md index 9fdc99a..00bce22 100644 --- a/docs/planning/v0.0.5/INSPECTOR_PROPERTY_FIX.md +++ b/docs/planning/v0.0.6/INSPECTOR_PROPERTY_FIX.md @@ -1,12 +1,35 @@ # 🐛 Inspector Property Refresh Fix -**Status**: 📋 Ready for Implementation +**Status**: ✅ Implemented (PR #60) and Verified **Priority**: 🟢 Quick Win (1-2 hours) **Phase**: 0.1.5 (can run in parallel with Phase 0.1) **Delegation**: ✅ Background Agent Task --- +## ✅ Verified in Godot 4.7 / gdext 0.5.4 (2026-07-21) + +PR #60's `clear_on_error()` fix was validated headlessly (no interactive editor +available in this environment) against a live Godot 4.7.stable engine, after +the gdext 0.4→0.5.4 upgrade (PR #63). `godot_test/scripts/inspector_refresh_test.gd` +and `godot_test/test_inspector_refresh.tscn` drive a `FerrisScriptNode` directly +through `script_path` changes and assert on `get_property_list()` results, +covering the fix's checklist: + +| Checklist item | Result | +|---|---| +| 1. Properties clear on compile error | ✅ PASS | +| 2. Properties repopulate on fix | ✅ PASS | +| 3. Rapid edit toggling | ✅ PASS | +| 4. Multiple scripts, only the broken one clears | Not directly exercised (single-node scenario); fix is instance-scoped (`self.env = None` etc.), so lower risk | +| 5. File-not-found path clears properties | ✅ PASS | + +Run via: `godot --headless --path godot_test --scene test_inspector_refresh.tscn --quit-after 5` + +Output: `[SUMMARY] Total: 5, Passed: 5, Failed: 0` + +--- + ## 📝 Problem Statement ### User-Facing Issue @@ -267,7 +290,7 @@ mod tests { **Status**: ✅ Fixed in v0.0.5 **Solution**: Compilation errors now automatically clear Inspector properties **Previous Workaround** (v0.0.4 only): Reload scene (Scene → Reload Saved Scene) -**Implementation**: See [INSPECTOR_PROPERTY_FIX.md](planning/v0.0.5/INSPECTOR_PROPERTY_FIX.md) +**Implementation**: See [INSPECTOR_PROPERTY_FIX.md](INSPECTOR_PROPERTY_FIX.md) ``` --- @@ -329,7 +352,7 @@ mod tests { ## 🔗 Related Documents -- **Planning**: [v0.0.5 README.md](README.md) (this fix is Phase 0.1.5) +- **Planning**: [v0.0.6 README.md](README.md) (this fix is Phase 0.1.5) - **Issue**: [TROUBLESHOOTING.md](../../TROUBLESHOOTING.md#inspector-properties-not-updating) - **Implementation**: `crates/godot_bind/src/lib.rs` @@ -344,7 +367,7 @@ This is a **quick win** that can run in parallel with Phase 0.1 (Source Spans). - Clear root cause - Simple 2-line fix - Well-defined test procedure -- No dependencies on other v0.0.5 work +- No dependencies on other v0.0.6 work ### Agent Execution Steps diff --git a/docs/planning/v0.0.5/LSP_ARCHITECTURE_SUPPORT.md b/docs/planning/v0.0.6/LSP_ARCHITECTURE_SUPPORT.md similarity index 95% rename from docs/planning/v0.0.5/LSP_ARCHITECTURE_SUPPORT.md rename to docs/planning/v0.0.6/LSP_ARCHITECTURE_SUPPORT.md index b46a9cc..0519849 100644 --- a/docs/planning/v0.0.5/LSP_ARCHITECTURE_SUPPORT.md +++ b/docs/planning/v0.0.6/LSP_ARCHITECTURE_SUPPORT.md @@ -1,6 +1,6 @@ Excellent question! LSP is **the missing piece** that transforms FerrisScript from "static types for safety" to "static types for **developer experience**". Let me break down how LSP amplifies your type safety philosophy. -## 📝 Decision Log (v0.0.5 Planning) +## 📝 Decision Log (v0.0.6 Planning) **Date**: October 13, 2025 @@ -12,8 +12,8 @@ Excellent question! LSP is **the missing piece** that transforms FerrisScript fr **Options**: -- **A**: Ship v0.0.5 with compiler prerequisites (+1 week) -- B: Defer to v0.1.0 (ship test framework in v0.0.5, add compiler later) +- **A**: Ship v0.0.6 with compiler prerequisites (+1 week) +- B: Defer to v0.1.0 (ship test framework in v0.0.6, add compiler later) **Chosen**: **Option A** @@ -28,7 +28,7 @@ Excellent question! LSP is **the missing piece** that transforms FerrisScript fr #### Decision 2: LSP Test Integration Scope -**Question**: How much LSP integration in v0.0.5? +**Question**: How much LSP integration in v0.0.6? **Options**: @@ -52,7 +52,7 @@ Excellent question! LSP is **the missing piece** that transforms FerrisScript fr **Options**: -- **A**: Add incremental compilation to v0.0.5 (+2-3 weeks) +- **A**: Add incremental compilation to v0.0.6 (+2-3 weeks) - B: Defer to v0.1.0+ (ship without caching, add later) **Chosen**: **Option A** @@ -428,7 +428,7 @@ async fn publish_diagnostics(&self, uri: &Url) { ## 🎯 LSP Features Priority for FerrisScript -### Phase 0: Test-Specific LSP (v0.0.5) 🆕 UPDATED +### Phase 0: Test-Specific LSP (v0.0.6) 🆕 UPDATED **Goal**: LSP integration for test framework @@ -440,9 +440,9 @@ async fn publish_diagnostics(&self, uri: &Url) { - ✅ Test result caching - ✅ Real-time test status updates -**Implementation**: ~1-2 weeks (Week 5 of v0.0.5) +**Implementation**: ~1-2 weeks (Week 5 of v0.0.6) -**Scope**: LSP features are **test-specific only** in v0.0.5. General LSP features (diagnostics for all code, autocomplete, etc.) come in v0.1.0. +**Scope**: LSP features are **test-specific only** in v0.0.6. General LSP features (diagnostics for all code, autocomplete, etc.) come in v0.1.0. **Why Test-Specific First?**: @@ -466,9 +466,9 @@ async fn publish_diagnostics(&self, uri: &Url) { **Implementation**: ~2 weeks -**Dependencies**: Requires v0.0.5 compiler prerequisites (spans, symbol table, incremental compilation) +**Dependencies**: Requires v0.0.6 compiler prerequisites (spans, symbol table, incremental compilation) -**Note**: This expands the test-specific diagnostics from v0.0.5 to all FerrisScript code. +**Note**: This expands the test-specific diagnostics from v0.0.6 to all FerrisScript code. --- @@ -484,7 +484,7 @@ async fn publish_diagnostics(&self, uri: &Url) { **Implementation**: ~2 weeks -**Dependencies**: v0.0.5 Phase 0.1 (spans) and Phase 0.2 (symbol table) +**Dependencies**: v0.0.6 Phase 0.1 (spans) and Phase 0.2 (symbol table) --- @@ -516,7 +516,7 @@ async fn publish_diagnostics(&self, uri: &Url) { **Implementation**: ~2 weeks -**Dependencies**: v0.1.1 (navigation), v0.0.5 Phase 0.2 (symbol table) +**Dependencies**: v0.1.1 (navigation), v0.0.6 Phase 0.2 (symbol table) --- @@ -531,7 +531,7 @@ async fn publish_diagnostics(&self, uri: &Url) { **Dependencies**: v0.1.3 (full IntelliSense) -## � Incremental Compilation Architecture (v0.0.5 Phase 0.3) +## � Incremental Compilation Architecture (v0.0.6 Phase 0.3) ### Why Incremental Compilation is Critical for LSP @@ -987,7 +987,7 @@ fn move_player(direction: Vector2) { ## 📋 Recommended Roadmap -### v0.0.5 (Current Release) - UPDATED +### v0.0.6 (Current Release) - UPDATED **Focus**: LSP Foundation + Test Framework + Incremental Compilation @@ -995,9 +995,9 @@ fn move_player(direction: Vector2) { **Critical Decisions** (Option A for all): -1. ✅ Ship v0.0.5 with compiler prerequisites (spans + symbol table) - adds 1 week -2. ✅ Full LSP test integration in v0.0.5 - no deferral -3. ✅ Add incremental compilation to v0.0.5 - adds 2-3 weeks +1. ✅ Ship v0.0.6 with compiler prerequisites (spans + symbol table) - adds 1 week +2. ✅ Full LSP test integration in v0.0.6 - no deferral +3. ✅ Add incremental compilation to v0.0.6 - adds 2-3 weeks #### Phase 0: Compiler Prerequisites (Weeks 1-3) 🆕 BLOCKING @@ -1077,9 +1077,9 @@ fn move_player(direction: Vector2) { **Decision Rationale**: -- Chose Option A: Ship v0.0.5 with full compiler prerequisites +- Chose Option A: Ship v0.0.6 with full compiler prerequisites - Chose Option A: Full LSP test integration (not deferred) -- Chose Option A: Incremental compilation in v0.0.5 (not v0.1.0+) +- Chose Option A: Incremental compilation in v0.0.6 (not v0.1.0+) --- @@ -1096,9 +1096,9 @@ fn move_player(direction: Vector2) { - [ ] Document symbols (outline view, Ctrl+Shift+O) - [ ] Basic autocomplete (context-aware completions) -**Note**: v0.0.5 already includes LSP test integration + compiler prerequisites, so v0.1.0 expands LSP to general coding features. +**Note**: v0.0.6 already includes LSP test integration + compiler prerequisites, so v0.1.0 expands LSP to general coding features. -**Dependencies**: v0.0.5 compiler prerequisites (spans, symbol table, incremental compilation) +**Dependencies**: v0.0.6 compiler prerequisites (spans, symbol table, incremental compilation) --- @@ -1140,7 +1140,7 @@ fn move_player(direction: Vector2) { --- -## 📊 v0.0.5 Implementation Summary +## 📊 v0.0.6 Implementation Summary **Timeline**: 6-7 weeks (was 2-3 weeks) @@ -1150,7 +1150,7 @@ fn move_player(direction: Vector2) { - ✅ Test framework with LSP integration - Weeks 4-5 - ✅ Godot test runner and CI - Weeks 6-7 -**v0.0.5 Delivers**: +**v0.0.6 Delivers**: - LSP test integration (CodeLens, run test, status indicators) - Consolidated test framework (single source of truth in `/examples`) @@ -1163,9 +1163,9 @@ fn move_player(direction: Vector2) { - Autocomplete and navigation - Hover tooltips and refactoring tools -**Decision**: We chose Option A for all three decisions, accelerating LSP foundation into v0.0.5 to establish compiler infrastructure early. +**Decision**: We chose Option A for all three decisions, accelerating LSP foundation into v0.0.6 to establish compiler infrastructure early. **See Also**: -- `docs/planning/v0.0.5/CONSOLIDATED_TEST_FRAMEWORK_IMPLEMENTATION.md` - Detailed implementation guide +- `docs/planning/v0.0.6/CONSOLIDATED_TEST_FRAMEWORK_IMPLEMENTATION.md` - Detailed implementation guide - `docs/planning/ROADMAP_MASTER.md` - Version roadmap and consistency checklist diff --git a/docs/planning/v0.0.5/README.md b/docs/planning/v0.0.6/README.md similarity index 98% rename from docs/planning/v0.0.5/README.md rename to docs/planning/v0.0.6/README.md index 9f97acf..e2e5899 100644 --- a/docs/planning/v0.0.5/README.md +++ b/docs/planning/v0.0.6/README.md @@ -1,4 +1,4 @@ -# FerrisScript v0.0.5: LSP Foundation + Test Framework +# FerrisScript v0.0.6: LSP Foundation + Test Framework **Timeline**: 6-7 weeks **Status**: Planning Complete @@ -59,7 +59,7 @@ ### What We're Building -**v0.0.5 transforms FerrisScript from "compile-time safety" to "real-time developer experience"** +**v0.0.6 transforms FerrisScript from "compile-time safety" to "real-time developer experience"** #### Three Pillars @@ -225,8 +225,8 @@ - [x] Parser creates spans from token positions - [x] Error messages include `Span` information - [x] All 568 compiler tests pass with spans (31 new span unit tests + 5 integration tests) -- [ ] **🆕 Inspector clears properties on compilation failure** -- [ ] **🆕 Switching scripts after type error updates Inspector correctly** +- [x] **🆕 Inspector clears properties on compilation failure** (PR #60, shipped in v0.0.5) +- [x] **🆕 Switching scripts after type error updates Inspector correctly** (PR #60, verified headlessly in v0.0.5 — see `INSPECTOR_PROPERTY_FIX.md`) **Complexity**: 🔴 HIGH (touches entire AST, all tests) **Delegation**: ❌ **User-Interactive** (requires careful review of each AST node) @@ -645,7 +645,7 @@ Phase 5 (CI Integration) ← All above complete #### Risk 3: Timeline Overrun (7 weeks → 9+ weeks) 🟡 MEDIUM **Probability**: Medium -**Impact**: Delayed v0.0.5 release +**Impact**: Delayed v0.0.6 release **Mitigation**: @@ -722,7 +722,7 @@ Phase 5 (CI Integration) ← All above complete |--------|--------|-------------| | **LSP Usage** | >50% of contributors | VS Code extension installs | | **Test Additions** | +10% tests in 2 weeks | Track new `.ferris` files in `/examples` | -| **Issue Reports** | <5 critical bugs | GitHub issues labeled `v0.0.5` | +| **Issue Reports** | <5 critical bugs | GitHub issues labeled `v0.0.6` | | **Feedback Sentiment** | >80% positive | Survey or Discord reactions | --- diff --git a/docs/planning/v0.0.5/RUSTDOC_IMPLEMENTATION_PLAN.md b/docs/planning/v0.0.6/RUSTDOC_IMPLEMENTATION_PLAN.md similarity index 99% rename from docs/planning/v0.0.5/RUSTDOC_IMPLEMENTATION_PLAN.md rename to docs/planning/v0.0.6/RUSTDOC_IMPLEMENTATION_PLAN.md index bee0753..aab4175 100644 --- a/docs/planning/v0.0.5/RUSTDOC_IMPLEMENTATION_PLAN.md +++ b/docs/planning/v0.0.6/RUSTDOC_IMPLEMENTATION_PLAN.md @@ -1,6 +1,6 @@ # Rustdoc Implementation Plan for FerrisScript -**Version**: v0.0.5 (or later) +**Version**: v0.0.6 (or later) **Created**: October 13, 2025 **Status**: Planning **Effort Estimate**: 2-3 weeks (Medium complexity) @@ -676,7 +676,7 @@ pub fn my_method(&self, param1: Type1, param2: Type2) -> Result { ## 🚀 Future Enhancements -### Phase 5: Rustdoc JSON Export (Post-v0.0.5) +### Phase 5: Rustdoc JSON Export (Post-v0.0.6) **Goal**: Enable AI-assisted development via Rustdoc JSON @@ -870,4 +870,4 @@ fn extract_docs(json_path: &str) -> Result, Error> { --- **Status**: Ready for implementation -**Next Steps**: Assign to v0.0.5 milestone and begin Phase 1 +**Next Steps**: Assign to v0.0.6 milestone and begin Phase 1 diff --git a/godot_test/ferrisscript.gdextension b/godot_test/ferrisscript.gdextension index d1fdcb2..679232f 100644 --- a/godot_test/ferrisscript.gdextension +++ b/godot_test/ferrisscript.gdextension @@ -1,6 +1,6 @@ [configuration] entry_symbol = "gdext_rust_init" -compatibility_minimum = 4.1 +compatibility_minimum = 4.2 reloadable = true [libraries] diff --git a/godot_test/project.godot b/godot_test/project.godot index 38bf6d5..0284526 100644 --- a/godot_test/project.godot +++ b/godot_test/project.godot @@ -12,7 +12,7 @@ config_version=5 config/name="FerrisScript Test" run/main_scene="res://tests/generated/test_hello.tscn" -config/features=PackedStringArray("4.5", "Forward Plus") +config/features=PackedStringArray("4.7", "Forward Plus") config/icon="res://icon.svg" [display] diff --git a/godot_test/scripts/godot_bind_tests.gd b/godot_test/scripts/godot_bind_tests.gd index a02f8d1..2b79ff1 100644 --- a/godot_test/scripts/godot_bind_tests.gd +++ b/godot_test/scripts/godot_bind_tests.gd @@ -56,11 +56,11 @@ func test_basic_functionality(): ) run_test("property_hint_enum", func(): - # Test that Godot PropertyHint enum is available - assert_equal(PropertyHint.NONE, 0, "PropertyHint.NONE value") - assert_equal(PropertyHint.RANGE, 1, "PropertyHint.RANGE value") - assert_equal(PropertyHint.ENUM, 2, "PropertyHint.ENUM value") - assert_equal(PropertyHint.FILE, 13, "PropertyHint.FILE value") + # Test that Godot PropertyHint constants are available + assert_equal(PROPERTY_HINT_NONE, 0, "PROPERTY_HINT_NONE value") + assert_equal(PROPERTY_HINT_RANGE, 1, "PROPERTY_HINT_RANGE value") + assert_equal(PROPERTY_HINT_ENUM, 2, "PROPERTY_HINT_ENUM value") + assert_equal(PROPERTY_HINT_FILE, 13, "PROPERTY_HINT_FILE value") ) run_test("variant_type_enum", func(): diff --git a/godot_test/scripts/inspector_refresh_test.gd b/godot_test/scripts/inspector_refresh_test.gd new file mode 100644 index 0000000..52c79f5 --- /dev/null +++ b/godot_test/scripts/inspector_refresh_test.gd @@ -0,0 +1,83 @@ +extends Node +## Headless verification of PR #60: Inspector property refresh on compilation errors. +## +## Scripts through the checklist from docs/planning/v0.0.5/INSPECTOR_PROPERTY_FIX.md +## by driving a FerrisScriptNode's script_path property directly and inspecting +## get_property_list() results, since interactive Inspector clicking isn't +## possible headlessly. +## +## Output markers: [TEST_START] / [PASS] / [FAIL] / [TEST_END], consumed by +## the same convention as godot_bind_tests.gd. + +var node: Node +var total_tests: int = 0 +var passed_tests: int = 0 + +func _ready(): + print("[TEST_START] inspector_refresh_test") + + node = ClassDB.instantiate("FerrisScriptNode") + add_child(node) + + # 1. Valid script with @export properties populates the Inspector. + node.script_path = "res://scripts/inspector_refresh_valid.ferris" + var props_after_valid = node.get_property_list() + var ferris_count_valid = count_ferris_properties(props_after_valid) + check("valid_script_populates_properties", ferris_count_valid > 0, + "expected >0 exported properties, got %d" % ferris_count_valid) + + # 2. Broken script clears properties (the PR #60 fix under test). + node.script_path = "res://scripts/type_error.ferris" + var props_after_error = node.get_property_list() + var ferris_count_error = count_ferris_properties(props_after_error) + check("compile_error_clears_properties", ferris_count_error == 0, + "expected 0 exported properties after compile error, got %d" % ferris_count_error) + + # 3. Fixing the script (switching back to a valid one) repopulates. + node.script_path = "res://scripts/inspector_refresh_valid.ferris" + var props_after_fix = node.get_property_list() + var ferris_count_fix = count_ferris_properties(props_after_fix) + check("fix_repopulates_properties", ferris_count_fix > 0, + "expected >0 exported properties after fix, got %d" % ferris_count_fix) + + # 4. Rapid toggling between broken and valid leaves a consistent final state. + for i in range(3): + node.script_path = "res://scripts/type_error.ferris" + node.script_path = "res://scripts/inspector_refresh_valid.ferris" + var props_after_toggle = node.get_property_list() + var ferris_count_toggle = count_ferris_properties(props_after_toggle) + check("rapid_toggle_ends_consistent", ferris_count_toggle == ferris_count_valid, + "expected %d properties after toggling, got %d" % [ferris_count_valid, ferris_count_toggle]) + + # 5. Nonexistent file path clears properties. + node.script_path = "res://scripts/does_not_exist.ferris" + var props_after_missing = node.get_property_list() + var ferris_count_missing = count_ferris_properties(props_after_missing) + check("missing_file_clears_properties", ferris_count_missing == 0, + "expected 0 exported properties for missing file, got %d" % ferris_count_missing) + + print("") + print("[SUMMARY] Total: %d, Passed: %d, Failed: %d" % [total_tests, passed_tests, total_tests - passed_tests]) + print("[TEST_END]") + + get_tree().quit(0 if passed_tests == total_tests else 1) + +func count_ferris_properties(props: Array) -> int: + # inspector_refresh_valid.ferris exports these specific names; matching + # against the known set is more reliable than guessing from usage flags, + # since Node2D's own built-in properties also carry PROPERTY_USAGE_EDITOR. + var ferris_names = ["basic_int", "basic_float"] + var count = 0 + for prop in props: + if ferris_names.has(prop.get("name", "")): + count += 1 + return count + +func check(name: String, condition: bool, detail: String): + total_tests += 1 + print("[TEST] %s" % name) + if condition: + passed_tests += 1 + print("[PASS] %s" % name) + else: + print("[FAIL] %s: %s" % [name, detail]) diff --git a/godot_test/scripts/inspector_refresh_valid.ferris b/godot_test/scripts/inspector_refresh_valid.ferris new file mode 100644 index 0000000..da8af9a --- /dev/null +++ b/godot_test/scripts/inspector_refresh_valid.ferris @@ -0,0 +1,9 @@ +// Minimal valid script with exported properties, used by inspector_refresh_test.gd +// to verify PR #60's Inspector clear-on-error behavior headlessly. + +@export let mut basic_int: i32 = 42; +@export let mut basic_float: f32 = 3.14; + +fn _ready() { + print("inspector_refresh_valid ready"); +} diff --git a/godot_test/test_inspector_refresh.tscn b/godot_test/test_inspector_refresh.tscn new file mode 100644 index 0000000..cffc7f0 --- /dev/null +++ b/godot_test/test_inspector_refresh.tscn @@ -0,0 +1,6 @@ +[gd_scene load_steps=2 format=3] + +[ext_resource type="Script" path="res://scripts/inspector_refresh_test.gd" id="1"] + +[node name="InspectorRefreshTest" type="Node"] +script = ExtResource("1")