Skip to content

Conversation

@ctidd
Copy link
Contributor

@ctidd ctidd commented Nov 14, 2024

Types of changes

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

Description

Problem: When you 1) accept/reject a subset of changes and then 2) accept remaining changes, the file tree is updated to only display the subset of remaining files from 2 that were just accepted. (The files from 1 disappear.) This change is caused due to filtering on an insertCode call's inputs which was introduced with file-level accept. The filtering was attempting to avoid overwriting already-inserted changes (e.g. if the user edited an file after accepting it, and then accepted remaining changes), but actually is not necessary because insertCode filters internally.

The problem is confused by a misuse of insertCode to insert a single file (where it is passed one file), as well as all remaining files (where it must be passed all files -- not just remaining files).

Solution: There is already a kludge to re-render the file tree after inserting a single file. This change removes the incorrect filter when inserting remaining changes. As a follow up, we need to clean up the use of insertCode and separate this responsibility.

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.

@ctidd ctidd requested review from a team as code owners November 14, 2024 01:28
@ctidd ctidd force-pushed the ctidd/file-accept-fix branch from 7e3d7e0 to a10038a Compare November 14, 2024 02:25
@ctidd ctidd merged commit f6e731f into aws:main Nov 14, 2024
12 of 13 checks passed
dhasani23 pushed a commit to ntarakad-aws/aws-toolkit-jetbrains that referenced this pull request Nov 18, 2024
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.

3 participants