Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

Inline suggestion (ghost text) rendering primitive

Open
#124 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
48/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Quiet
Tech stack
swift
Domain
desktop, devtools

Research direction

Start in CodeEditTextView and inspect its caret geometry and layout/rendering path; the issue does not name a file or test target. Run the existing xcodebuild clean test suite and SwiftLint, then verify the InlineSuggestion API renders single- and multi-line overlays without changing textStorage or editing state.

Written by the indexing model from the issue text.

Description

Description

Add a low-level rendering primitive to CodeEditTextView for inline "ghost text" suggestions: text drawn after the caret that previews content the user has not typed yet (the same UI pattern as GitHub Copilot, Xcode predictive completion, and similar inline AI suggestions).

The proposed API is small and rendering-only:

  • A InlineSuggestion value type (a document offset plus the text to show, which may be multi-line).
  • TextView.setInlineSuggestion(_:at:), TextView.setInlineSuggestion(_:) (anchored at the primary caret), and TextView.clearInlineSuggestion().

Key design point: a suggestion is purely a rendering hint. It is drawn as a sibling overlay anchored at the caret and never mutates textStorage or shifts real text layout, so it cannot corrupt the document or interfere with editing, undo, or selection. This keeps the primitive safe and makes it a clean foundation that higher layers can drive.

Alternatives Considered
  • Inserting the suggestion as real (styled) text and removing it on reject. Rejected because it mutates the text storage, pollutes undo, and risks desyncing layout and selection.
  • Building the feature entirely in a downstream package. Rejected because the caret geometry and layout information needed to position ghost text correctly live in CodeEditTextView, so the rendering primitive belongs here. Higher-level packages should only decide what text to show and when.
Additional Context

This is intended as the foundation for native inline AI completions (for example GitHub Copilot) in the CodeEdit stack: CodeEditTextView provides the rendering primitive, CodeEditSourceEditor coordinates request/accept/dismiss, and CodeEdit wires up the provider. This issue covers only the CodeEditTextView rendering layer.

I have a working, documented implementation with unit tests (overlay rendering, multi-line suggestions, and a check that the suggestion never mutates text storage). It builds and tests pass via xcodebuild ... clean test, and SwiftLint is clean. I am happy to open it as a PR for review. Would the maintainers welcome this in CodeEditTextView?

Screenshots

This layer is a non-visual API primitive; the user-visible ghost text appears once a higher layer drives it. The rendered result can be shown in the downstream CodeEditSourceEditor / CodeEdit integration.

Dominant language
Swift
Stars
182
Forks
57
PR merge metrics
No merged PRs in 30d

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from CodeEditApp/CodeEditTextView

All issues in CodeEditApp/CodeEditTextView

Similar issues

More Swift issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.