-
Notifications
You must be signed in to change notification settings - Fork 23
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
IntelliJ reacts to attribution enable/disable from site config #318
IntelliJ reacts to attribution enable/disable from site config #318
Conversation
src/main/java/com/sourcegraph/cody/agent/CurrentConfigFeatures.java
Outdated
Show resolved
Hide resolved
All comments addressed, please take another look! This should be good to review now. |
b9ef3a7
to
623d90a
Compare
623d90a
to
6ffbe11
Compare
* Given listener will be given new {@link ConfigFeatures} whenever they arrive. Observation | ||
* relationship is ended once the returned cleanup {@link Runnable} is {@link Runnable#run()}. | ||
*/ | ||
public Runnable attach(ConfigFeaturesObserver observer) { |
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.
Minor thing, but you could use CancellationToken
here.
val cancellationToken = CancellationToken()
cancellationToken.onCancel { observers.remove(id) }
return cancellationToken
A bit more code but I think it is a bit more clear regarding the intent.
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.
Done!
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.
LGTM
Closes sourcegraph/sourcegraph#59427
This change adds
CurrentConfigFeatures
singleton/observer that allows the UI to react on whether attribution is turned on or off.Background:
TODO
Test plan