Skip to content

Commit 313245a

Browse files
authored
feat: force refesh project files after accepting code (#1839)
JetBrains does not refresh files automatically after the file system is updated, which is expected. However, for the customer experience of featureDev it is needed to have the project files be refreshed after accepting code so the customer has feedback that they had been created successfully. It was decided to use the async refreshing to let the UI and JetBraisn continue why these files are being refreshed. In summary, it will look like the user decided to reload from disk.
1 parent 1ef7255 commit 313245a

File tree

1 file changed

+4
-0
lines changed
  • plugins/toolkit/jetbrains-core/src/software/aws/toolkits/jetbrains/services/amazonqFeatureDev/session

1 file changed

+4
-0
lines changed

plugins/toolkit/jetbrains-core/src/software/aws/toolkits/jetbrains/services/amazonqFeatureDev/session/Session.kt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
package software.aws.toolkits.jetbrains.services.amazonqFeatureDev.session
55

66
import com.intellij.openapi.project.Project
7+
import com.intellij.openapi.vfs.VfsUtil
78
import software.aws.toolkits.jetbrains.services.amazonq.messages.MessagePublisher
89
import software.aws.toolkits.jetbrains.services.amazonqFeatureDev.APPROACH_RETRY_LIMIT
910
import software.aws.toolkits.jetbrains.services.amazonqFeatureDev.CODE_GENERATION_RETRY_LIMIT
@@ -107,6 +108,9 @@ class Session(val tabID: String, val project: Project) {
107108
}
108109

109110
ReferenceLogController.addReferenceLog(references, project)
111+
112+
// Taken from https://intellij-support.jetbrains.com/hc/en-us/community/posts/206118439-Refresh-after-external-changes-to-project-structure-and-sources
113+
VfsUtil.markDirtyAndRefresh(true, true, true, context.projectRoot)
110114
}
111115

112116
suspend fun send(msg: String): Interaction {

0 commit comments

Comments
 (0)