Skip to content

Editor: in-editor completion / autocomplete popup #145

@tig

Description

@tig

Summary

Terminal.Gui.TextView ships an in-editor completion dropdown (AutocompleteIAutocomplete / PopupAutocomplete, TextViewAutocomplete): a caret-anchored suggestion popup with insert / delete-backwards / set-cursor hooks and first-priority key handling. Editor has none. specs/public-api.md reserves IEditorCompletionProvider? CompletionProvider as post-MLP and specs/decisions.md OPEN-002 parks the completion-item shape (reuse TG IAutocomplete vs. a fresh LSP-flavored provider). No code, no spec yet.

Editor is intended to functionally replace TextView (not API/UI-compatible), so a completion surface is in scope post-beta.

Not replicable by a consumer: needs caret-anchored popover placement, key interception ahead of the editor, and edit coordination inside a single undo group — none exposed today.

Scope

  • Resolve OPEN-002 first (completion-item shape + provider interface). TG-native vehicle is PopoverMenu (already used in the codebase), not a lift of AvaloniaEdit CodeCompletion/ (explicit non-goal).
  • Public surface: finalize IEditorCompletionProvider? CompletionProvider on Editor (specs/public-api.md, rule R8).
  • Caret-anchored popup positioned via TG popover; first-priority key handling in Editor.Keyboard.cs (suggestions get keys before the editor); accept/dismiss; filter-as-you-type.
  • Accepted suggestion applies as one undo step (RunUpdate).
  • examples/ted wires a trivial word/identifier completion provider end-to-end (R9).

Definition of done

  • OPEN-002 resolved and logged in specs/decisions.md.
  • specs/completion/spec.md written; specs/public-api.md updated.
  • Popup renders at the caret, filters live, accept/dismiss work, key handling has first priority.
  • Accept = single undo step.
  • ted demonstrates it (R9); help text updated.
  • Tests (parallel project; integration for the popup); dotnet format + jb clean.

Refs: specs/textview-parity-gap/spec.md Gap 1, specs/decisions.md OPEN-002, specs/public-api.md.

🤖 Generated with Claude Code

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions