Files
storybook/docs/book/lsp/keywords/choose.toml
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

62 lines
1.6 KiB
TOML

# LSP Documentation for 'choose' keyword
[keyword]
name = "choose"
category = "behavior_tree"
short_description = "Selector node that tries children in order until one succeeds"
web_url = "https://r3t-studios.github.io/storybook/reference/behavior-trees.html#choose"
[syntax]
format = "choose [label] { children... }"
example = """
choose panic_response {
then time_panic { ... }
then obstacle_panic { ... }
then default_panic { ... }
}
"""
[hover]
markdown = """
**`choose` - Selector Node**
Tries each child behavior in order until one succeeds.
**Behavior:**
- Evaluates children left-to-right
- Returns **success** on first successful child
- Skips remaining children after first success
- Returns **failure** only if all children fail
**Named nodes (optional):**
```storybook
choose state_dependent_action {
then appear { ... }
then confuse_alice { ... }
then fade_away { ... }
}
```
Labels make intent clear and aid debugging!
**Use cases:**
- Decision-making between alternatives
- Fallback chains (try A, if fails try B)
- Priority ordering (prefer A, accept B)
[Learn more →](https://r3t-studios.github.io/storybook/reference/behavior-trees.html#choose)
"""
[completion]
snippet = "choose ${1:label} {\n\t$0\n}"
description = "Selector node (tries children until one succeeds)"
sort_text = "01-choose"
[context]
valid_in = ["behavior_block", "choose_block", "then_block", "decorator_block"]
invalid_in = ["character_block", "life_arc_block", "schedule_block"]
[related]
keywords = ["then", "if", "when"]
concepts = ["behavior_trees", "named_nodes", "selectors"]