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

Add code response part renderer #107

Merged
merged 20 commits into from
Jul 30, 2024

Conversation

haydar-metin
Copy link

@haydar-metin haydar-metin commented Jul 29, 2024

What it does

Close https://github.com/eclipsesource/osweek-2024/issues/19
Part of https://github.com/eclipsesource/osweek-2024/issues/54

Adds a renderer for a code block using the monaco editor.

image

Implements:

  • Copy
  • Insert at cursor
  • Monaco Editor
  • Navigating to the location of the file (if provided)

The parser needs improvement.

How to test

  1. Install the TypeScript Extension for Theia (for syntax highlighting)
  2. packages/ai-chat/src/common/mock-code-chat-agent.ts Replace the URI.
  3. Send a message to the bot
  4. Click on the buttons / see highlighted code

Follow-ups

Review checklist

Reminder for reviewers

@haydar-metin haydar-metin changed the title Osweek24/19 code response part renderer Add code response part renderer Jul 29, 2024
Copy link

@CamilleLetavernier CamilleLetavernier left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The Code renderer is really nice!

Boundary detection should be improved to properly wrap the code segments, but this could be done in a follow-up.

Do we even need the mock responses at all? It's pretty straightforward to get the AI Agent to return a code block in any desired language

Copy link

@CamilleLetavernier CamilleLetavernier left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some changes were pushed while I was reviewing, so here's an update. The code block detection is a lot better 👍

However, the language is still part of the code block:

image

@eneufeld eneufeld self-requested a review July 30, 2024 09:38
Copy link
Member

@eneufeld eneufeld left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Works! thanks!

@haydar-metin haydar-metin merged commit 89b45f1 into feat/ai-chat Jul 30, 2024
1 check passed
@haydar-metin haydar-metin deleted the osweek24/19-code-response-part-renderer branch July 30, 2024 12:25
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.

4 participants