Commit Graph

5 Commits

Author SHA1 Message Date
1fa90aff0e fix(lsp): fix remaining completion scoping issues
- 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.
2026-02-23 21:09:36 +00:00
dcc27a6988 fix(lsp): context-aware completions now use correct token variants
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
2026-02-23 21:00:03 +00:00
9c18bfa028 feat(lang): rename concept_comparison to definition (v0.3.2)
Renames the `concept_comparison` keyword to `definition` across the
entire codebase for better readability and conciseness.

Changes:
- Tree-sitter grammar: `concept_comparison` node → `definition`
- Tree-sitter queries: highlights, outline, and indents updated
- Zed extension highlights.scm updated to match
- Lexer: `Token::ConceptComparison` → `Token::Definition`
- Parser: `ConceptComparisonDecl` rule → `DefinitionDecl`
- AST: `Declaration::ConceptComparison` → `Declaration::Definition`,
  `ConceptComparisonDecl` struct → `DefinitionDecl`
- All Rust source files updated (validate, names, convert, references,
  semantic_tokens, symbols, code_actions, hover, completion)
- `validate_concept_comparison_patterns` → `validate_definition_patterns`
- Example file and test corpus updated
- Spec docs: created SBIR-v0.3.2-SPEC.md, updated TYPE-SYSTEM.md,
  README.md, SBIR-CHANGELOG.md, SBIR-v0.3.1-SPEC.md
2026-02-23 20:37:52 +00:00
b3110c8b0f feat(lsp): add completions for type system keywords
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.
2026-02-14 14:32:51 +00:00
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