- is_typing_declaration_name(): had the same Token::Ident bug as
determine_context() — matched string keywords against Token::Ident
but the lexer produces dedicated variants. Extracted shared
is_declaration_keyword() helper that matches actual token variants.
- determine_context(): add Token::Schedule so schedule blocks get
InFieldBlock context instead of falling through to Unknown.
- Tests: add negative assertions to test_top_level_completions,
test_field_block_completions, and test_relationship_completions.
Add test_no_completions_after_declaration_keyword,
test_no_completions_while_typing_name, and
test_schedule_completions_no_toplevel.
The Logos lexer produces dedicated token variants for all keywords
(Token::Behavior, Token::LifeArc, etc.) — Token::Ident is only for
user-defined identifiers. determine_context() was matching against
Token::Ident(keyword), so last_keyword was always None and every
nested block returned CompletionContext::Unknown, causing
all_keyword_completions() to dump top-level declaration keywords
everywhere.
Changes:
- determine_context(): match actual token variants (Token::Behavior,
Token::LifeArc, Token::Relationship, Token::Character, etc.) and
track last_context directly instead of a String keyword
- behavior_keyword_completions(): add all word-based BT keywords
(choose, then, repeat, if, when, invert, retry, timeout, cooldown,
succeed_always, fail_always)
- InFieldBlock arm: always include field_keyword_completions() so
generic fields (age, bond, etc.) appear even without a species
- Tests: add negative assertions confirming top-level keywords are
absent inside behavior/life_arc blocks; add new test
test_behavior_no_toplevel_keywords for nested block isolation
Added top-level keyword completions for:
- concept: with semicolon-terminated snippet
- sub_concept: with dot notation snippet
- concept_comparison: with brace-delimited snippet
Added test verifying type system keywords appear in
completions with correct snippet formatting.
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