-
Notifications
You must be signed in to change notification settings - Fork 985
docs: add markdown formatting for completion in editor example #5714
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. Weβll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR enhances the AI completion feature in the editor documentation example by adding markdown parsing and formatting support. Previously, markdown syntax like **bold** would be inserted as plain text; now it's properly rendered as formatted content.
Key changes:
- Added markdown parsing logic to convert raw markdown text into TipTap nodes/marks during completion insertion
- Implemented throttled streaming updates to improve performance during AI completion
- Restructured completion state management to track inserted ranges and handle inline vs. block content appropriately
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
EditorUseCompletion.ts |
Added markdown parsing functions, throttling mechanism, and rewrote streaming insertion logic to apply markdown formatting during AI completion |
EditorCompletionExtension.ts |
Modified suggestion acceptance to parse markdown content and increased debounce delay from 250ms to 2500ms |
π‘ Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
docs/app/components/content/examples/editor/EditorCompletionExtension.ts
Outdated
Show resolved
Hide resolved
docs/app/components/content/examples/editor/EditorUseCompletion.ts
Outdated
Show resolved
Hide resolved
docs/app/components/content/examples/editor/EditorCompletionExtension.ts
Outdated
Show resolved
Hide resolved
β¦tension.ts Co-authored-by: Copilot <[email protected]>
commit: |
benjamincanac
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it would be easier for the sake of the example to update the prompt in completion.post.ts to prevent it from returning markdown π€
|
Probably, but I also think many people could encounter this "problem" while using code from the example and could see it as a bug |
|
Closing in favor of 86b0fb1. |
π Linked issue
Resolves #5713
β Type of change
π Description
With the example in the current documentation for AI completion in the editor, after completion, the markdown formatting is not applied.
π Checklist