Skip to content

fix(amazonq): update diff view with syntax highlights and proper new file view #5679

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

Merged
merged 9 commits into from
May 8, 2025

Conversation

samgst-amazon
Copy link
Contributor

@samgst-amazon samgst-amazon commented May 6, 2025

Clicking the diff in the chat now shows syntax highlighting in the diff view
Screenshot 2025-05-06 at 3 16 49 PM

Q creating a new file now shows only the new file in the diff view
Screenshot 2025-05-07 at 5 39 33 PM

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)

Description

Checklist

  • My code follows the code style of this project
  • I have added tests to cover my changes
  • A short description of the change has been added to the CHANGELOG if the change is customer-facing in the IDE.
  • I have added metrics for my changes (if required)

License

I confirm that my contribution is made under the terms of the Apache 2.0 license.

@samgst-amazon samgst-amazon requested a review from a team as a code owner May 6, 2025 22:17
Copy link

github-actions bot commented May 6, 2025

Qodana Community for JVM

It seems all right 👌

No new problems were found according to the checks applied

💡 Qodana analysis was run in the pull request mode: only the changed files were checked
☁️ View the detailed Qodana report

Contact Qodana team

Contact us at qodana-support@jetbrains.com

Base automatically changed from samgst/q-lsp-chat-showDiff to feature/q-lsp-chat May 6, 2025 22:50
@samgst-amazon samgst-amazon requested a review from a team as a code owner May 6, 2025 22:50
…howDiffWithHighlighting

# Conflicts:
#	plugins/amazonq/shared/jetbrains-community/src/software/aws/toolkits/jetbrains/services/amazonq/lsp/AmazonQLanguageClientImpl.kt
#	plugins/amazonq/shared/jetbrains-community/src/software/aws/toolkits/jetbrains/services/amazonq/lsp/model/aws/chat/FlareChatCommands.kt
val (leftContent, rightContent) = when {
params.isDeleted -> {
// For deleted files, show original on left, empty on right
contentFactory.create(originalContent) to
contentFactory.create(originalContent, virtualFile) to
Copy link
Contributor

Choose a reason for hiding this comment

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

create has an option for file type, so i think we can keep this in memory and avoid the temp file

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I tried that earlier and wasn't seeing the highlighting being applied. Agree that avoiding the temp file would be ideal. I'll try again

Copy link
Contributor

Choose a reason for hiding this comment

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

i think you should also pass in the project as a parameter so it's taking dependencies into account?

@samgst-amazon samgst-amazon changed the title fix(amazonq): add syntax highlighting to diff view from chat changes fix(amazonq): update diff view with syntax highlights and proper new file view May 8, 2025
@rli rli merged commit d46f890 into feature/q-lsp-chat May 8, 2025
14 of 16 checks passed
@rli rli deleted the samgst/q-lsp-chat-showDiffWithHighlighting branch May 8, 2025 17:33
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