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

Chat: Wrap pasted code blocks in backticks #3357

Merged
merged 6 commits into from
Mar 8, 2024
Merged

Conversation

philipp-spiess
Copy link
Contributor

This PR makes it so that when we paste code into the chat box, it will wrap it in triple backticks.

This improves a few things:

  • If someone pasts html/tsx, the code will now no longer be hidden once the request is sent (since it would be escaped otherwise)
  • Any pasted code will now be showing with the right indentation after submitting the search query
  • LLMs like Opus will not be confused by missing code block delimiters causing the response to also skip code block delimiters.

Test plan

Screen.Recording.2024-03-08.at.13.18.59.mov

@philipp-spiess philipp-spiess requested a review from a team March 8, 2024 12:22
@philipp-spiess philipp-spiess self-assigned this Mar 8, 2024
vscode/CHANGELOG.md Outdated Show resolved Hide resolved
vscode/webviews/chat/TextArea.tsx Outdated Show resolved Hide resolved
philipp-spiess and others added 3 commits March 8, 2024 13:35
Co-authored-by: Tom Ross <tom@umpox.com>
Co-authored-by: Tom Ross <tom@umpox.com>
@philipp-spiess philipp-spiess merged commit fcb91b0 into main Mar 8, 2024
16 checks passed
@philipp-spiess philipp-spiess deleted the ps/paste-code-blocks branch March 8, 2024 12:55
steveyegge pushed a commit that referenced this pull request Mar 13, 2024
Co-authored-by: Tom Ross <tom@umpox.com>
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.

2 participants