-
Notifications
You must be signed in to change notification settings - Fork 275
Fix rejected files display inconsistency between VS Code and JetBrains #5169
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
Conversation
8e2db67 to
eb85ee8
Compare
...-community/src/software/aws/toolkits/jetbrains/services/amazonqFeatureDev/session/Session.kt
Fixed
Show fixed
Hide fixed
| * Triggered by the Insert code follow-up button to apply code changes. | ||
| */ | ||
| suspend fun insertChanges( | ||
| suspend fun insertChangesAndUpdateFileComponents( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm going to add comments to make sure I understand the roles of each component.
This is used to
- write files to disk and log any references
- update the file tree to present visually what has been added or not
Is that right?
| } | ||
| } | ||
|
|
||
| suspend fun insertChangesWithoutUpdateFileComponents( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm going to add comments to make sure I understand the roles of each component.
This is used to
- write files to disk
- log any references
Is that right?
|
|
||
| if (action == "accept-change") { | ||
| session.insertChanges( | ||
| session.insertChangesWithoutUpdateFileComponents( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the method name including "WithoutUpdateFileComponents" is an artifact of today's state of code and will not be clear to those reading a future state.
Can we refine this to be more focused on what is actually happening here? Something like writeChangesToDisk?
| session.insertChanges( | ||
| filePaths = filePaths.filter { !it.rejected }, | ||
| deletedFiles = deletedFiles.filter { !it.rejected }, | ||
| session.insertChangesAndUpdateFileComponents( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: I recognize that we're trying to maintain the existing logic of both writing to disk and updating the file component because it appears to be appropriate here. Is it cleaner to avoid introducing the "And" method and just perform the individual operations here?
If we do introduce this method, we add a choice to future authors to either update separately or together and I don't think we've sufficiently explained when it should be performed together versus not.
session.writeChangesToDisk(...)
val codeResultMessageId = this._codeResultMessageId
if (codeResultMessageId != null) {
messenger.updateFileComponent(...)
}
...-community/src/software/aws/toolkits/jetbrains/services/amazonqFeatureDev/session/Session.kt
Fixed
Show fixed
Hide fixed
...-community/src/software/aws/toolkits/jetbrains/services/amazonqFeatureDev/session/Session.kt
Fixed
Show fixed
Hide fixed
...-community/src/software/aws/toolkits/jetbrains/services/amazonqFeatureDev/session/Session.kt
Fixed
Show fixed
Hide fixed
...-community/src/software/aws/toolkits/jetbrains/services/amazonqFeatureDev/session/Session.kt
Show resolved
Hide resolved
...-community/src/software/aws/toolkits/jetbrains/services/amazonqFeatureDev/session/Session.kt
Show resolved
Hide resolved
...-community/src/software/aws/toolkits/jetbrains/services/amazonqFeatureDev/session/Session.kt
Fixed
Show fixed
Hide fixed
|
Reply to the above comment about |
...are/aws/toolkits/jetbrains/services/amazonqFeatureDev/controller/FeatureDevControllerTest.kt
Outdated
Show resolved
Hide resolved
3828f42 to
8f34394
Compare
aws#5169) * Fix rejected files display inconsistency between VS Code and JetBrains * Refactor * Refactor * Refactor * Clean * Clean * Changed from `when` to whenever * Fixing detekt * Fixing detekt * Fixing detekt --------- Co-authored-by: Richard Li <[email protected]>
aws#5169) * Fix rejected files display inconsistency between VS Code and JetBrains * Refactor * Refactor * Refactor * Clean * Clean * Changed from `when` to whenever * Fixing detekt * Fixing detekt * Fixing detekt --------- Co-authored-by: Richard Li <[email protected]>
aws#5169) * Fix rejected files display inconsistency between VS Code and JetBrains * Refactor * Refactor * Refactor * Clean * Clean * Changed from `when` to whenever * Fixing detekt * Fixing detekt * Fixing detekt --------- Co-authored-by: Richard Li <[email protected]>
Description
Originally when a file is rejected in
/devand we accepted all other files, VS Code displays the original file trees with the accepted files and rejected files, but JetBrains hides rejected files. This PR aligns JetBrains with VS Code.License
I confirm that my contribution is made under the terms of the Apache 2.0 license.