Skip to content

レコードの値を作る式とフィールドを取り出す式を選択肢に出す - #823

Merged
narumincho merged 3 commits into
mainfrom
record-expressions
Nov 1, 2026
Merged

narumincho merged 3 commits into
mainfrom
record-expressions

Conversation

@narumincho

Copy link
Copy Markdown
Owner

Requested by ナルミンチョ · project thread

#821 で洗い出した「レコードを UI で扱えない」を直します。

変えたこと

  • 置換メニューに record (レコードの値) と get-field (□.key) を追加。record は期待する型がレコードならそのフィールドを未入力で並べる
  • 型が分かるレコード型の変数 (パーツの型から型が決まる関数の引数。型パーツの参照は宣言をたどる) には p.key の選択肢を出す
  • レコードの式とレコードの型のフィールドを add-field / insert-field-before / insert-field-after / move-field-* / delete-field で編集できるようにした (src/tree_layout/record_fields.ts)
  • フィールド名と record_get のフィールド名は, 変数の名前と同じく選ぶとその場で名前を変えられる (パス recordItemKey / recordGetKey)
  • record_get は p.key と並べて表示する

確認

  • 単体テスト record_fields.test.ts と E2E (引数 p の型をレコードにしてフィールド y を足し, 本体を p.y にしてコミット) を追加。ローカルの E2E 42 件すべて通過
  • docs/ui.md「式エディタの操作」に追記

Generated by Claude Code

@narumincho narumincho self-assigned this Oct 31, 2026
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DHYnFuQUdypvyuGYZvKNxN
@narumincho
narumincho merged commit 8c7d683 into main Nov 1, 2026
1 check passed
@narumincho
narumincho deleted the record-expressions branch November 1, 2026 01:58
narumincho pushed a commit that referenced this pull request Nov 1, 2026
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DHYnFuQUdypvyuGYZvKNxN
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants