Skip to content

fix(completion): preserve punctuation during deferred completion - #390

Merged
fcoury merged 2 commits into
mainfrom
fcoury/repro-member-completion
Oct 15, 2026
Merged

fcoury merged 2 commits into
mainfrom
fcoury/repro-member-completion

Conversation

@fcoury-oai

Copy link
Copy Markdown
Collaborator

Typing cons, waiting for the completion menu, then typing ole.lo could lose the period or leave console.lo without member suggestions. Red requested members before asynchronous completion work inserted the period; further typing could invalidate that work and discard the period entirely.

Request members after applying and synchronizing the completion. If another input arrives while a punctuation-triggered completion is pending, finish the selected completion and its punctuation first, then ignore late deferred edits, including imports. Paused input still receives resolved import edits. Completion application also owns dismissal of its old popup, so it cannot close the new member menu.

Fixes #389.

How to Test

With the TypeScript language server available, open an empty .ts file:

  1. Type cons, wait for the menu, press Enter to accept console, then type .lo. Expect console.lo with log among the member suggestions.
  2. Start again. Type cons, wait for the menu, then type ole.lo quickly without accepting the menu. Expect the same text and member suggestions; the period must remain.
  3. Repeat step 2, pausing after the period. Expect the member menu to appear after console. and filter to log when typing lo.

The focused regressions in tests/completion.rs cover deferred import resolution, request ordering, typing during both refresh and resolve, and late responses that must not reopen stale completions.

Validation: 155 targeted library tests and 49 completion integration tests passed; Clippy passed for all targets/features with warnings denied, and formatting checks passed. Five interactive cases passed, including a repeat with ESLint and Prettier configured. Traces confirm the period reaches the server before the member request, which returns 20 candidates including log and timeLog.

The configured dependency mirror cannot supply locked Wasmtime 48.0.6. Local validation uses an isolated historical lockfile with cached Wasmtime 48.0.5; this change leaves Cargo.lock untouched. CI must confirm validation with the committed lockfile.

@fcoury

fcoury commented Oct 15, 2026

Copy link
Copy Markdown
Contributor

@codex review

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 15, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-15T03:12:14.885340Z c0b4bfb Manual request
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: c0b4bfb03a

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/editor.rs Resolved
Accepting a completion after its language server restarted returned
before taking completion_snapshot. With completion application now
owning popup dismissal, no CloseDialog follows to clear it, so a
delayed displayed-immediately response passed the snapshot dismissal
guard and reopened the popup the user had already accepted. Take the
snapshot ahead of the rejection paths so every accept ends the
completion session.
@fcoury
fcoury merged commit 54ebd61 into main Oct 15, 2026
14 checks passed
@fcoury
fcoury deleted the fcoury/repro-member-completion branch October 15, 2026 04:14
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.

Completion doesn't continue into member completion unless the previous item is accepted with Enter (e.g. console.lo)

2 participants