Add openProposalPopup(boolean beep) to allow suppressing beep when no proposals exist #3394
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
This PR adds a new public API method to
ContentProposalAdapter
that allows callers to control whether a beep sound is emitted when programmatically opening the proposal popup with no proposals available.Problem
Currently,
ContentProposalAdapter#openProposalPopup()
always emits a beep sound when the popup cannot be opened due to no proposals being available. This behavior is hardcoded and cannot be controlled by the caller. In some scenarios, such as programmatically refreshing proposals in response to automated events (e.g., file system changes), this beeping behavior is undesirable.Solution
As suggested in the issue, this PR makes the existing private
openProposalPopup(boolean)
method public with a more intuitive parameter name:Changes
New public method:
openProposalPopup(boolean beep)
beep=true
: Beeps if no proposals are available (default behavior)beep=false
: Suppresses the beep even when no proposals exist@since 3.23
Internal refactoring:
openProposalPopup(boolean autoActivated)
toopenProposalPopup0(boolean autoActivated)
to distinguish it from the new public APITesting: Added
testOpenProposalPopupWithBeepParameter()
to verify both beep modes work correctlyBackward Compatibility
✅ Fully backward compatible - All existing code continues to work unchanged:
openProposalPopup()
method maintains its original behavior (beeps by default)Use Cases
Suppress beep for automated actions:
Keep beep for user-triggered actions:
Fixes the issue where callers had no control over the beep behavior when programmatically opening the proposal popup.
Warning
Firewall rules blocked me from connecting to one or more addresses (expand for details)
I tried to connect to the following addresses, but was blocked by firewall rules:
repo.eclipse.org
/usr/lib/jvm/temurin-17-jdk-amd64/bin/java --enable-native-access=ALL-UNNAMED -classpath /usr/share/apache-maven-3.9.11/boot/plexus-classworlds-2.9.0.jar -Dclassworlds.conf=/usr/share/apache-maven-3.9.11/bin/m2.conf -Dmaven.home=/usr/share/apache-maven-3.9.11 -Dlibrary.jansi.path=/usr/share/apache-maven-3.9.11/lib/jansi-native -Dmaven.multiModuleProjectDirectory=/home/REDACTED/work/eclipse.platform.ui/eclipse.platform.ui org.codehaus.plexus.classworlds.launcher.Launcher clean compile -Pbuild-individual-bundles
(dns block)/usr/lib/jvm/temurin-17-jdk-amd64/bin/java --enable-native-access=ALL-UNNAMED -classpath /usr/share/apache-maven-3.9.11/boot/plexus-classworlds-2.9.0.jar -Dclassworlds.conf=/usr/share/apache-maven-3.9.11/bin/m2.conf -Dmaven.home=/usr/share/apache-maven-3.9.11 -Dlibrary.jansi.path=/usr/share/apache-maven-3.9.11/lib/jansi-native -Dmaven.multiModuleProjectDirectory=/home/REDACTED/work/eclipse.platform.ui/eclipse.platform.ui org.codehaus.plexus.classworlds.launcher.Launcher clean test -Pbuild-individual-bundles -Dtest=ContentProposalAdapterTest
(dns block)If you need me to access, download, or install something from one of these locations, you can either:
Original prompt
Fixes #3393
💬 Share your feedback on Copilot coding agent for the chance to win a $200 gift card! Click here to start the survey.