aws / aws-toolkit-jetbrains

AWS Toolkit for JetBrains - a plugin for interacting with AWS from JetBrains IDEs
https://plugins.jetbrains.com/plugin/11349-aws-toolkit
Apache License 2.0
768 stars 224 forks source link

fix(amazonq): Ensure file tree displays all files with correct state … #5083

Closed ctidd closed 1 week ago

ctidd commented 1 week ago

Types of changes

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

License

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