Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -287,16 +287,19 @@ public synchronized final void reset(ICompletionProposal p) {
long oldWakeup= fNextWakeup;
Task task= taskOnReset(p);
schedule(task, System.currentTimeMillis());
if (fNextWakeup < oldWakeup)
if (fNextWakeup < oldWakeup) {
notifyAll();
}
}
}

private Task taskOnReset(ICompletionProposal p) {
if (p == null)
if (p == null) {
return IDLE;
if (isExt5(p))
}
if (isExt5(p)) {
return FIRST_WAIT;
}
return LEGACY_WAIT;
}

Expand Down Expand Up @@ -325,10 +328,11 @@ private Task currentTask() {
private void schedule(Task task, long current) {
fTask= task;
long nextWakeup= current + task.delay();
if (nextWakeup <= current)
if (nextWakeup <= current) {
fNextWakeup= Long.MAX_VALUE;
else
} else {
fNextWakeup= nextWakeup;
}
}

private boolean isExt5(ICompletionProposal p) {
Expand Down Expand Up @@ -473,8 +477,9 @@ public void install(Control control) {
@Override
protected void showInformation(ICompletionProposal proposal, Object info) {
InformationControlReplacer replacer= getInternalAccessor().getInformationControlReplacer();
if (replacer != null)
if (replacer != null) {
replacer.hideInformationControl();
}
AdditionalInfoController.this.showInformation(proposal, info);
}
};
Expand Down Expand Up @@ -601,10 +606,12 @@ protected Point computeSizeConstraints(Control subjectControl, IInformationContr
size.y -= shellTrim.height;
}

if (sizeConstraint.x < size.x)
if (sizeConstraint.x < size.x) {
sizeConstraint.x= size.x;
if (sizeConstraint.y < size.y)
}
if (sizeConstraint.y < size.y) {
sizeConstraint.y= size.y;
}
return sizeConstraint;
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2016 Red Hat Inc. and others.
* Copyright (c) 2016, 2025 Red Hat Inc. and others.
*
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
Expand Down Expand Up @@ -159,8 +159,9 @@ public AsyncCompletionProposalPopup(ContentAssistant contentAssistant, ITextView
*/
@Override
public String showProposals(boolean autoActivated) {
if (fKeyListener == null)
if (fKeyListener == null) {
fKeyListener= new ProposalSelectionListener();
}

final Control control= fContentAssistSubjectControlAdapter.getControl();

Expand Down Expand Up @@ -304,11 +305,13 @@ public String incrementalComplete() {
}
final Control control= fContentAssistSubjectControlAdapter.getControl();

if (fKeyListener == null)
if (fKeyListener == null) {
fKeyListener= new ProposalSelectionListener();
}

if (!isValid(fProposalShell) && !control.isDisposed())
if (!isValid(fProposalShell) && !control.isDisposed()) {
fContentAssistSubjectControlAdapter.addKeyListener(fKeyListener);
}

fInvocationOffset= fContentAssistSubjectControlAdapter.getSelectedRange().x;
fFilterOffset= fInvocationOffset;
Expand Down Expand Up @@ -458,8 +461,9 @@ public void run() {
try {
while (true) {
synchronized (fMutex) {
if (fAutoActivationDelay != 0)
if (fAutoActivationDelay != 0) {
fMutex.wait(fAutoActivationDelay);
}
}
Optional<Display> display= Optional.ofNullable(fContentAssistSubjectControlAdapter.getControl()).map(Control::getDisplay);
display.ifPresent(d -> d.asyncExec(() -> displayProposals(true)));
Expand All @@ -472,8 +476,9 @@ public void run() {

protected void stop() {
Thread threadToStop= fThread;
if (threadToStop != null && threadToStop.isAlive())
if (threadToStop != null && threadToStop.isAlive()) {
threadToStop.interrupt();
}
}

}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -111,8 +111,9 @@ public Image getImage() {

@Override
public String getDisplayString() {
if (fDisplayString != null)
if (fDisplayString != null) {
return fDisplayString;
}
return fReplacementString;
}

Expand Down
Loading
Loading