Files
storybook/.serena/memories/lsp-testing-status.md
Sienna Meridian Satterwhite 16deb5d237 release: Storybook v0.2.0 - Major syntax and features update
BREAKING CHANGES:
- Relationship syntax now requires blocks for all participants
- Removed self/other perspective blocks from relationships
- Replaced 'guard' keyword with 'if' for behavior tree decorators

Language Features:
- Add tree-sitter grammar with improved if/condition disambiguation
- Add comprehensive tutorial and reference documentation
- Add SBIR v0.2.0 binary format specification
- Add resource linking system for behaviors and schedules
- Add year-long schedule patterns (day, season, recurrence)
- Add behavior tree enhancements (named nodes, decorators)

Documentation:
- Complete tutorial series (9 chapters) with baker family examples
- Complete reference documentation for all language features
- SBIR v0.2.0 specification with binary format details
- Added locations and institutions documentation

Examples:
- Convert all examples to baker family scenario
- Add comprehensive working examples

Tooling:
- Zed extension with LSP integration
- Tree-sitter grammar for syntax highlighting
- Build scripts and development tools

Version Updates:
- Main package: 0.1.0 → 0.2.0
- Tree-sitter grammar: 0.1.0 → 0.2.0
- Zed extension: 0.1.0 → 0.2.0
- Storybook editor: 0.1.0 → 0.2.0
2026-02-13 21:52:03 +00:00

4.1 KiB

LSP Testing Status (Phase 3 Complete)

Summary

Phase 3 (LSP Server Core Features) testing complete

  • All LSP tests passing: 78/78 ✓
  • All tree-sitter grammar tests passing: 27/27 ✓
  • Code coverage significantly improved
  • Behavior tree support fully tested in both LSP and tree-sitter

Test Coverage

LSP Tests (78 total)

Location: /Users/sienna/Development/storybook/storybook/src/lsp/

Behavior Tests (8 tests) - behavior_tests.rs

  • test_behavior_parsing
  • test_behavior_symbols
  • test_behavior_symbol_kinds
  • test_behavior_in_document_symbols
  • test_behavior_with_subtrees
  • test_behavior_simple_action
  • test_behavior_selectors_and_sequences

Diagnostics Tests (15 tests) - diagnostics_tests.rs

  • Parse error detection and reporting
  • Error position tracking
  • Error severity levels
  • Utility functions (byte_offset_to_position, create_diagnostic)
  • Edge cases (empty input, whitespace, comments only)

Document Edge Tests (20 tests) - document_edge_tests.rs

  • Word-at-offset with unicode, underscores, boundaries
  • Document updates and symbol table management
  • All declaration types: species, characters, templates, life_arcs, schedules, behaviors, institutions
  • Symbol extraction for all entity types

Existing Tests (35 tests)

  • Integration tests, formatting, hover, completion, definition, references, symbols

Tree-sitter Grammar Tests (27 total)

Location: /Users/sienna/Development/storybook/tree-sitter-storybook/test/corpus/

Behavior Tests (7 tests) - behaviors.txt

  • Simple Behavior (single action)
  • Selector Behavior (? { ... })
  • Sequence Behavior (> { ... })
  • Nested Behavior (selectors + sequences)
  • Repeat Behavior (* { ... })
  • Behavior with Subtree (@path::notation)
  • Complex Nested Behavior (all node types)

Declaration Tests (17 tests) - declarations.txt

  • All declaration types (use, character, template, life_arc, schedule, behavior, etc.)

Basic Tests (3 tests) - basic.txt

  • Simple character, use declaration, prose block

Coverage Improvements

Before testing push:

  • document.rs: 80.11%
  • symbols.rs: 93.04%
  • diagnostics.rs: 0%
  • behavior support: untested
  • Total LSP tests: 34

After testing push:

  • document.rs: 97.79% (+17.68%)
  • symbols.rs: 95.24% (+2.20%)
  • diagnostics.rs: fully tested
  • behavior support: comprehensive test coverage
  • Total LSP tests: 78 (+44 new tests, +129% increase)

Run Commands

LSP Tests

cd /Users/sienna/Development/storybook/storybook
cargo test --lib lsp

Tree-sitter Tests

cd /Users/sienna/Development/storybook/tree-sitter-storybook
npm run test

Note: If Bash tool fails, use Serena's execute_shell_command instead.

Behavior Tree Support Verified

Both LSP and tree-sitter grammar now have comprehensive behavior tree support:

Node Types Tested:

  • action_node: Simple action identifiers (e.g., walk_around)
  • selector_node: ? { ... } - Try options in order until one succeeds
  • sequence_node: > { ... } - Execute children in sequence
  • repeat_node: * { ... } - Repeat child forever
  • subtree_node: @path::to::tree - Reference external behavior tree

Syntax Examples:

behavior SimpleBehavior {
    walk_around
}

behavior ComplexBehavior {
    ? {
        > {
            check_threat
            flee_to_safety
        }
        > {
            check_resources
            gather_resources
        }
        * {
            idle
        }
    }
}

behavior WithSubtree {
    > {
        @helpers::check_preconditions
        main_action
    }
}

Next Steps (Phase 4)

  • Navigation features (go-to-definition, find references)
  • Cross-file symbol resolution
  • Template includes and species references

Files Modified

  • Created: storybook/src/lsp/behavior_tests.rs
  • Created: storybook/src/lsp/diagnostics_tests.rs
  • Created: storybook/src/lsp/document_edge_tests.rs
  • Created: tree-sitter-storybook/test/corpus/behaviors.txt
  • Modified: storybook/src/lsp/mod.rs (added test modules)
  • Modified: storybook/src/lsp/server.rs (fixed imports and mutability)