Skip to content
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

feature: format code blocks as they’re streaming in from AI #473

Closed
jimniels opened this issue May 5, 2023 · 0 comments · Fixed by #583
Closed

feature: format code blocks as they’re streaming in from AI #473

jimniels opened this issue May 5, 2023 · 0 comments · Fixed by #583
Assignees
Labels
type: enhancement new feature or request

Comments

@jimniels
Copy link
Collaborator

jimniels commented May 5, 2023

For code blocks, it kinda stinks you don't get the code highlighting until the full code block comes in, e.g. a response might look like this:

This is a code sample from me, an AI assistant:

```javascript
var x = 0;
// a cod

Only once you get everything between the code fences ``` will it turn into an editor preview.

There's probably a way we can eagerly begin styling a code block when we see the first set of code fences by changing this regex.


Note how chatGPT triggers a formatting a code response at the first sign of a code block:

block-code-edit-highlight

It does now, however, do this for inline code. It waits until the final backtick

inline-code-no-highlight

@jimniels jimniels self-assigned this May 17, 2023
@jimniels jimniels moved this to 💎 Shaped in Quadratic Roadmap May 17, 2023
@jimniels jimniels added the type: enhancement new feature or request label May 17, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: enhancement new feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant