Skip to content

test(amazonq): add tests for edge cases #7305

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 1 commit into from
May 14, 2025

Conversation

Hweinstock
Copy link
Contributor

@Hweinstock Hweinstock commented May 14, 2025

Problem

There are two edge cases discovered during testing that warrant some tests.

  1. the language server will respond without a range, causing the result to not be rendered.
  2. the language server COULD respond with a StringValue instead of string (currently doesn't, but valid in the type contract).

Solution

  • add tests for these cases, and do minor refactoring to make this easier.

  • Treat all work as PUBLIC. Private feature/x branches will not be squash-merged at release time.
  • Your code changes must meet the guidelines in CONTRIBUTING.md.
  • License: I confirm that my contribution is made under the terms of the Apache 2.0 license.

@@ -246,8 +245,7 @@ export class AmazonQInlineCompletionItemProvider implements InlineCompletionItem
return []
}

const start = document.validatePosition(editor.selection.active)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

In non-testing scenarios, editor.selection.active appears to always be the same as the position passed in here.

@Hweinstock Hweinstock marked this pull request as ready for review May 14, 2025 13:47
@Hweinstock Hweinstock requested a review from a team as a code owner May 14, 2025 13:47
@Hweinstock Hweinstock merged commit 692847a into aws:feature/flare-inline May 14, 2025
18 of 22 checks passed
@Hweinstock Hweinstock deleted the test/edgeCases branch May 14, 2025 14:36
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