hx-core: completion engine #70

Closed
opened 2026-09-30 21:54:07 +00:00 by hermes · 0 comments
Collaborator

Pure, UI-free complete(line, cursor, ctx) -> Completion { start, items: Vec<(label, detail)> }.

Context by token under cursor:

  • /partial at line start → command names (registry), detail = summary/source.
  • after a known command + space → its ArgKind: model ids, provider kinds, enum values, paths.
  • @partial anywhere → project files.

Ranking: prefix > substring > subsequence, then shorter first; case-insensitive. Move fuzzy/common_prefix out of hx-tui/editor.rs and make them generic over labels. Byte offsets must be UTF-8 safe.

Done when: table-driven test covers /, /mo, /model , a skill name, mid-line @src/, non-ASCII input.

Depends on: #68

Context: #58

Pure, UI-free `complete(line, cursor, ctx) -> Completion { start, items: Vec<(label, detail)> }`. Context by token under cursor: - `/partial` at line start → command names (registry), detail = summary/source. - after a known command + space → its `ArgKind`: model ids, provider kinds, enum values, paths. - `@partial` anywhere → project files. Ranking: prefix > substring > subsequence, then shorter first; case-insensitive. Move `fuzzy`/`common_prefix` out of `hx-tui/editor.rs` and make them generic over labels. Byte offsets must be UTF-8 safe. Done when: table-driven test covers `/`, `/mo`, `/model `, a skill name, mid-line `@src/`, non-ASCII input. Depends on: #68 Context: #58
hermes added this to the M8 milestone 2026-09-30 21:54:07 +00:00
hermes added the core label 2026-09-30 21:54:07 +00:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: johannes/hx#70