Skip to content

feat(amazonq): Add events to trigger file refresh on file changes in agentic #5709

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 12 commits into from
May 15, 2025

Conversation

manodnyab
Copy link
Contributor

Types of changes

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

Description

JetBrains does not automatically refresh the editor when a file is changed externally.(https://youtrack.jetbrains.com/issue/IJPL-2188/Background-changes-by-external-tool-not-being-picked-up-until-VFS-refresh-happens)
Whenever a file is written to externally, trigger a vfs refresh(either for a file or directory) so new changes can be easily reflected in the workspace.

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.

Copy link

github-actions bot commented May 12, 2025

Qodana Community for JVM

1 new problem were found

Inspection name Severity Problems
Function or property has platform type ◽️ Notice 1

💡 Qodana analysis was run in the pull request mode: only the changed files were checked
☁️ View the detailed Qodana report

Contact Qodana team

Contact us at qodana-support@jetbrains.com

@manodnyab manodnyab marked this pull request as ready for review May 14, 2025 16:28
@manodnyab manodnyab requested review from a team as code owners May 14, 2025 16:28
if (Path(path).startsWith(userHomePath)) return
try {
ApplicationManager.getApplication().invokeLater {
VfsUtil.markDirtyAndRefresh(false, true, true, Path(path).toFile())
Copy link
Contributor

Choose a reason for hiding this comment

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

async should be fine

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It does not populate the changes immediately if we do async

companion object {
val localHistoryPath = Paths.get(

Check notice

Code scanning / QDJVMC

Function or property has platform type Note

Declaration has type inferred from a platform call, which can lead to unchecked nullability issues. Specify type explicitly as nullable or non-nullable.
@rli rli merged commit 5390890 into feature/q-lsp-chat May 15, 2025
12 of 16 checks passed
@rli rli deleted the manodnyb/addEventsForRefreshingFiles branch May 15, 2025 23:24
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