Skip to content

fix(copilot): keep autocomplete enabled alongside suggestions - #279

Merged
fcoury merged 1 commit into
mainfrom
fcoury/copilot-autocomplete
Aug 18, 2026
Merged

fcoury merged 1 commit into
mainfrom
fcoury/copilot-autocomplete

Conversation

@fcoury-oai

Copy link
Copy Markdown
Collaborator

Why

Enabling Copilot currently suppresses automatic identifier completion, even when Copilot has no suggestion. Ordinary completion also cancels pending inline suggestions, so restoring the popup alone would still make the two features compete.

This follows #277 and lets users keep ordinary autocomplete and Copilot enabled together.

What changed

  • Restore automatic language-server and buffer-word completion while Copilot is enabled.
  • Give a visible completion popup priority over ghost text and defer automatic Copilot requests until the popup closes or becomes empty.
  • Preserve current and in-flight inline suggestions when ordinary completion opens, including through Ctrl-Space. Explicit inline requests can still replace the popup.
  • Prevent acceptance of hidden ghost text, and clear an invisible completion popup when an inline suggestion is accepted.
  • Document the behavior and add focused scheduler, popup-priority, empty-menu, and late-response regression tests.

How to Test

  1. Build with cargo build --bin red. With Copilot installed and authenticated, open a source file using target/debug/red -c 'copilot.enabled=true'. Type an identifier prefix with known completions. The ordinary completion menu should appear automatically; Tab or Enter should accept its selected item.
  2. While ghost text is visible, press Ctrl-Space. The completion menu should hide the ghost text. Press Ctrl-e to close the menu without leaving Insert mode; a still-current suggestion should reappear, or a deferred Copilot request should run.
  3. While the menu is open, press Alt-\ to request Copilot explicitly. The menu should close, and an older ordinary-completion response must not reopen it.
  4. Run cargo test --lib editor::inline_completion::tests -- --test-threads=1. In particular, empty_completion_popup_does_not_block_copilot and empty_ordinary_completion_does_not_cancel_copilot cover cases where ordinary completion has nothing to show. Hidden ghost text must not be accepted, and empty menus must not starve Copilot.

Validation completed

  • Inline-completion unit tests: 26 passed.
  • Completion-popup unit tests: 26 passed.
  • Snippet unit tests: 3 passed.
  • cargo clippy --all-targets --all-features -- -D warnings: passed.
  • Formatting, diff checks, and cargo build --bin red: passed.

End-to-end and live Copilot testing were intentionally deferred for a manual feel check.

@fcoury
fcoury merged commit 6d1af35 into main Aug 18, 2026
10 checks passed
@fcoury
fcoury deleted the fcoury/copilot-autocomplete branch August 18, 2026 03:38
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