Skip to content
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

[Feature Request] JetBrains' File Watcher integration for "AI!" comments #2562

Open
wizzard0 opened this issue Dec 8, 2024 · 2 comments
Open
Labels
enhancement New feature or request

Comments

@wizzard0
Copy link

wizzard0 commented Dec 8, 2024

Issue

"AI!" comments work great with VS Code, but with JetBrains products' (Webstorm, Goland, IntelliJ IDEA etc) they cause a blocking modal "File Cache Conflict" dialog when the file in the active editor tab gets modified (i.e. always)
image

Looking at the JetBrains' bug tracker, this behavior is by design and they are unlikely to implement the "always reload" option.

They prefer to trigger the external on-save tools directly from the IDE.
When registered this way, tsc or gofmt run upon file save and their changes get reloaded just fine.

I tried to register Aider this way, but a) it doesn't seem to pick up AI! comments when started without --watch-files, and b) the tool stdout is not available until the tool exits

Solution

What we can do is to add an additional script that simply blocks while the main Aider watcher process is talking to the LLM/running tests/etc, then exits when the main process is ready to accept new commands.

To avoid fragile stuff like sockets etc, the simplest way to integrate them would be to create a file like .aider-processing with PID of the main Aider process in the repository root, and delete it when Aider is ready to accept further input.

Version and model info

Aider v0.67.0, --watch-files

@wizzard0 wizzard0 changed the title [Feature Request] Manual trigger for "AI!" comments for JetBrains products [Feature Request] File Watcher integration for "AI!" comments for JetBrains products Dec 8, 2024
@wizzard0 wizzard0 changed the title [Feature Request] File Watcher integration for "AI!" comments for JetBrains products [Feature Request] JetBrains' File Watcher integration for "AI!" comments Dec 8, 2024
@paul-gauthier paul-gauthier added the enhancement New feature or request label Dec 9, 2024
@paul-gauthier
Copy link
Collaborator

Thanks for trying aider and filing this issue.

I'd like to make aider work better with JetBrains, but they've made a pretty unusual and opinionated choice here if you describing it correctly.

wizzard0 added a commit to wizzard0/aider that referenced this issue Dec 12, 2024
wizzard0 added a commit to wizzard0/aider that referenced this issue Dec 12, 2024
@wizzard0
Copy link
Author

Well, i got impatient and implemented that in #2612 :)

No idea how that fits with Aider style/architecture, so I'm open to suggestions if there are better places to create/clear the canary file.

Otherwise, works smoothly for me so far.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants