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

Fix incorrect cross-project event propagation #2662

Merged
merged 1 commit into from
Nov 18, 2024

Conversation

pkukielka
Copy link
Contributor

@pkukielka pkukielka commented Nov 18, 2024

Changes

Due to incorrect implementation of event listeners, if more than one project was open, events like caret change were propagated between editors. This PR fixes it.

Test plan

Test separately with four different options ([opened file | active file | caret position | selected text]):

  1. Open two projects in IntelliJ.
  2. Change [opened file | active file | caret position | selected text] for the first project
  3. Change [opened file | active file | caret position | selected text] for the second project
  4. Files set as context in the Cody chat should be different and match files activated on the previous steps.

val disposable = CodyAgentService.getInstance(project)

// WARNING: All listeners should check if an event they are receiving is matching project
Copy link
Contributor

Choose a reason for hiding this comment

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

😕

@pkukielka pkukielka merged commit f9e8198 into main Nov 18, 2024
9 of 10 checks passed
@pkukielka pkukielka deleted the pkukielka-fix-event-propagation branch November 18, 2024 11:38
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.

2 participants