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

'Insert at cursor' in Amazon Q chat fails when text is selected in JetBrains IDE #4881

Open
Eseperio opened this issue Sep 15, 2024 · 0 comments
Labels
amazon-q bug We can reproduce the issue and confirmed it is a bug. codewhisperer

Comments

@Eseperio
Copy link

Describe the bug
When trying to use the "Insert at cursor" functionality in the Amazon Q chat within the JetBrains IDE, the feature does not work properly if text is already selected in the target file. Instead of replacing the selected text with the suggestion, it inserts an empty string.

To reproduce
Steps to reproduce the behavior:

  1. Open a file and select some text in the JetBrains IDE.
  2. Request a code improvement or replacement via the Amazon Q chat.
  3. Click the "Insert at cursor" button to insert the suggested code.
  4. Instead of inserting the suggested code, an empty string is inserted.

Expected behavior
The expected behavior is that the selected text should be replaced by the suggested code from the Amazon Q chat, or the new code should be inserted at the cursor's position if no text is selected.

Screenshots

Your Environment

  • OS: MacOS
  • JetBrains product: PhpStorm
  • JetBrains product version: 2024.2.1
  • AWS Toolkit version: 3.28-242
  • SAM CLI version: [Insert version here]
  • JVM/Python version: [Insert version here]

Additional context
This issue occurs specifically when there is text already selected in the file. Without selected text, the "Insert at cursor" feature works as expected.

@Eseperio Eseperio added the bug We can reproduce the issue and confirmed it is a bug. label Sep 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
amazon-q bug We can reproduce the issue and confirmed it is a bug. codewhisperer
Projects
None yet
Development

No branches or pull requests

2 participants