Skip to content

feat(vnext): add disposable completion info#200

Merged
Light2Dark merged 1 commit into
dev-refactorfrom
codex/vnext-completion-info
Jul 25, 2026
Merged

feat(vnext): add disposable completion info#200
Light2Dark merged 1 commit into
dev-refactorfrom
codex/vnext-completion-info

Conversation

@Light2Dark

@Light2Dark Light2Dark commented Jul 25, 2026

Copy link
Copy Markdown
Member

Summary

  • expose an opt-in, type-safe completion info resolver on the vNext CodeMirror adapter
  • give every resolver an AbortSignal and require explicit DOM resource cleanup
  • abort pending work and destroy resolved UI on option, document, context, region, or view changes
  • contain resolver/cleanup failures and reject cleanup reentrancy
  • document the React-root integration pattern and export the public resolver types

Verification

  • 43 test files; 2,036 passed and 1 expected failure
  • changed coverage: 98.15% statements, 95.90% branches, 100% functions, 99.20% lines
  • all strict/loose/demo TypeScript configurations pass
  • oxlint and test-integrity checks pass
  • build and runtime export smoke pass
  • two independent exact-head adversarial reviews approve e07f8e525d6e6f2c7f73e24acd4e1f0b1ff90cc0

Stacked on #199, now merged into dev-refactor.


Summary by cubic

Adds opt-in rich completion info to the vNext CodeMirror adapter. Introduces a type-safe infoResolver that returns a disposable DOM panel, with automatic abort and cleanup on selection or editor changes.

  • New Features

    • autocomplete.infoResolver(item, { signal }) lets you render rich info and return { dom, destroy }; pending work is aborted and resolved resources are destroyed on option selection changes, document/context/region updates, or view disposal.
    • Stale results are ignored; null results omit the panel; resolver and cleanup failures are contained; reentrancy during cleanup is rejected.
    • Docs updated with a React root example; exported SqlCompletionInfoResolver, SqlCompletionInfoResolverContext, and SqlDisposableCompletionInfo from src/vnext/codemirror/index.ts.
  • Migration

    • Opt in by passing sqlEditor({ autocomplete: { infoResolver } }).
    • Your resolver should use the provided AbortSignal and return { dom, destroy } or null.

Written for commit e07f8e5. Summary will update on new commits.

Review in cubic

@github-actions

Copy link
Copy Markdown

Coverage Report

Status Category Percentage Covered / Total
🔵 Lines 99.2% (🎯 91%) 251 / 253
🔵 Statements 98.15% (🎯 91%) 266 / 271
🔵 Functions 100% (🎯 90%) 46 / 46
🔵 Branches 95.9% (🎯 85%) 164 / 171
File Coverage
File Stmts Branches Functions Lines Uncovered Lines
Changed Files
src/vnext/codemirror/index.ts 0% 0% 0% 0%
src/vnext/codemirror/sql-editor.ts 98.15% 95.9% 100% 99.2% 200, 379, 445, 549, 553
Generated in workflow #760 for commit e07f8e5 by the Vitest Coverage Report Action

@Light2Dark
Light2Dark marked this pull request as ready for review July 25, 2026 17:40
@Light2Dark
Light2Dark merged commit e052af6 into dev-refactor Jul 25, 2026
8 checks passed
@Light2Dark
Light2Dark deleted the codex/vnext-completion-info branch July 25, 2026 17:40
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.

1 participant