Commit 676ff747 authored by Emmanuel Bourg's avatar Emmanuel Bourg

New upstream version 4.10

parent b8a5023e
# Contributing to Eclipse Platform
Thanks for your interest in this project.
## Project description
Eclipse Platform defines the set of frameworks and common services that
collectively make up infrastructure required to support the use of Eclipse as a
component model, as a Rich Client Platform (RCP) and as a comprehensive tool
integration platform. These services and frameworks include a standard workbench
user interface model and portable native widget toolkit, a project model for
managing resources, automatic resource delta management for incremental
compilers and builders, language-independent debug infrastructure, and
infrastructure for distributed multi-user versioned resource management.
* https://projects.eclipse.org/projects/eclipse.platform
## Developer resources
Information regarding source code management, builds, coding standards, and
more.
* https://projects.eclipse.org/projects/eclipse.platform/developer
The project maintains the following source code repositories
* http://git.eclipse.org/c/platform/eclipse.platform.common.git
* http://git.eclipse.org/c/platform/eclipse.platform.debug.git
* http://git.eclipse.org/c/platform/eclipse.platform.git
* http://git.eclipse.org/c/platform/eclipse.platform.releng.aggregator.git
* http://git.eclipse.org/c/platform/eclipse.platform.releng.buildtools.git
* http://git.eclipse.org/c/platform/eclipse.platform.releng.git
* http://git.eclipse.org/c/platform/eclipse.platform.resources.git
* http://git.eclipse.org/c/platform/eclipse.platform.runtime.git
* http://git.eclipse.org/c/platform/eclipse.platform.swt.git
* http://git.eclipse.org/c/platform/eclipse.platform.swt.binaries.git
* http://git.eclipse.org/c/platform/eclipse.platform.team.git
* http://git.eclipse.org/c/platform/eclipse.platform.text.git
* http://git.eclipse.org/c/platform/eclipse.platform.ua.git
* http://git.eclipse.org/c/platform/eclipse.platform.ui.git
* http://git.eclipse.org/c/platform/eclipse.platform.ui.tools.git
This project uses Bugzilla to track ongoing development and issues.
* Search for issues: https://eclipse.org/bugs/buglist.cgi?product=Platform
* Create a new report: https://eclipse.org/bugs/enter_bug.cgi?product=Platform
Be sure to search for existing bugs before you create another one. Remember that
contributions are always welcome!
## Eclipse Contributor Agreement
Before your contribution can be accepted by the project team contributors must
electronically sign the Eclipse Contributor Agreement (ECA).
* http://www.eclipse.org/legal/ECA.php
Commits that are provided by non-committers must have a Signed-off-by field in
the footer indicating that the author is aware of the terms by which the
contribution has been provided to the project. The non-committer must
additionally have an Eclipse Foundation account and must have a signed Eclipse
Contributor Agreement (ECA) on file.
For more information, please see the Eclipse Committer Handbook:
https://www.eclipse.org/projects/handbook/#resources-commit
## Contact
Contact the project developers via the project's "dev" list.
* https://dev.eclipse.org/mailman/listinfo/platform-dev
\ No newline at end of file
This diff is collapsed.
# Notices for Eclipse Platform
This content is produced and maintained by the Eclipse Platform project.
* Project home: https://projects.eclipse.org/projects/eclipse.platform
## Trademarks
Eclipse Platform is a trademark of the Eclipse Foundation.
## Copyright
All content is the property of the respective authors or their employers. For
more information regarding authorship of content, please consult the listed
source code repository logs.
## Declared Project Licenses
This program and the accompanying materials are made available under the terms
of the Eclipse Public License v. 2.0 which is available at
http://www.eclipse.org/legal/epl-2.0.
SPDX-License-Identifier: EPL-2.0
## Source Code
The project maintains the following source code repositories:
* http://git.eclipse.org/c/platform/eclipse.platform.common.git
* http://git.eclipse.org/c/platform/eclipse.platform.debug.git
* http://git.eclipse.org/c/platform/eclipse.platform.git
* http://git.eclipse.org/c/platform/eclipse.platform.releng.aggregator.git
* http://git.eclipse.org/c/platform/eclipse.platform.releng.buildtools.git
* http://git.eclipse.org/c/platform/eclipse.platform.releng.git
* http://git.eclipse.org/c/platform/eclipse.platform.resources.git
* http://git.eclipse.org/c/platform/eclipse.platform.runtime.git
* http://git.eclipse.org/c/platform/eclipse.platform.swt.git
* http://git.eclipse.org/c/platform/eclipse.platform.swt.binaries.git
* http://git.eclipse.org/c/platform/eclipse.platform.team.git
* http://git.eclipse.org/c/platform/eclipse.platform.text.git
* http://git.eclipse.org/c/platform/eclipse.platform.ua.git
* http://git.eclipse.org/c/platform/eclipse.platform.ui.git
* http://git.eclipse.org/c/platform/eclipse.platform.ui.tools.git
\ No newline at end of file
......@@ -14,7 +14,7 @@
<parent>
<artifactId>tests-pom</artifactId>
<groupId>eclipse.platform.text</groupId>
<version>4.9.0-SNAPSHOT</version>
<version>4.10.0-SNAPSHOT</version>
<relativePath>../tests-pom/</relativePath>
</parent>
<groupId>org.eclipse.core</groupId>
......
......@@ -2,7 +2,7 @@ Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: %pluginName
Bundle-SymbolicName: org.eclipse.core.filebuffers; singleton:=true
Bundle-Version: 3.6.300.qualifier
Bundle-Version: 3.6.400.qualifier
Bundle-Activator: org.eclipse.core.internal.filebuffers.FileBuffersPlugin
Bundle-ActivationPolicy: lazy
Bundle-Vendor: %providerName
......
......@@ -14,10 +14,10 @@
<parent>
<artifactId>eclipse.platform.text</artifactId>
<groupId>eclipse.platform.text</groupId>
<version>4.9.0-SNAPSHOT</version>
<version>4.10.0-SNAPSHOT</version>
</parent>
<groupId>org.eclipse.core</groupId>
<artifactId>org.eclipse.core.filebuffers</artifactId>
<version>3.6.300-SNAPSHOT</version>
<version>3.6.400-SNAPSHOT</version>
<packaging>eclipse-plugin</packaging>
</project>
......@@ -45,7 +45,7 @@
<element name="factory">
<annotation>
<documentation>
The specification of a annotation model factory. In order to find a factory for a given file the attributes of each factory specification are consulted in the following sequence: contentTypeId, fileNames, extensions. If multiple, equally specific factory specifications are found for a given file it is not specified which factory is used.
The specification of an annotation model factory. In order to find a factory for a given file the attributes of each factory specification are consulted in the following sequence: contentTypeId, fileNames, extensions. If multiple, equally specific factory specifications are found for a given file it is not specified which factory is used.
</documentation>
</annotation>
<complexType>
......
......@@ -14,7 +14,7 @@
<parent>
<artifactId>eclipse.platform.text</artifactId>
<groupId>eclipse.platform.text</groupId>
<version>4.9.0-SNAPSHOT</version>
<version>4.10.0-SNAPSHOT</version>
</parent>
<groupId>org.eclipse.core</groupId>
<artifactId>org.eclipse.jface.text.examples</artifactId>
......
......@@ -2,7 +2,7 @@ Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: %Plugin.name
Bundle-SymbolicName: org.eclipse.jface.text.tests
Bundle-Version: 3.11.300.qualifier
Bundle-Version: 3.11.400.qualifier
Bundle-Vendor: %Plugin.providerName
Bundle-Localization: plugin
Export-Package:
......@@ -10,6 +10,7 @@ Export-Package:
org.eclipse.jface.text.tests.reconciler,
org.eclipse.jface.text.tests.rules,
org.eclipse.jface.text.tests.source,
org.eclipse.jface.text.tests.templates.persistence,
org.eclipse.jface.text.tests.util
Require-Bundle:
org.eclipse.jface.text;bundle-version="[3.5.0,4.0.0)",
......
......@@ -14,12 +14,12 @@
<parent>
<artifactId>tests-pom</artifactId>
<groupId>eclipse.platform.text</groupId>
<version>4.9.0-SNAPSHOT</version>
<version>4.10.0-SNAPSHOT</version>
<relativePath>../tests-pom/</relativePath>
</parent>
<groupId>org.eclipse.jface</groupId>
<artifactId>org.eclipse.jface.text.tests</artifactId>
<version>3.11.300-SNAPSHOT</version>
<version>3.11.400-SNAPSHOT</version>
<packaging>eclipse-test-plugin</packaging>
<properties>
<testSuite>${project.artifactId}</testSuite>
......
......@@ -24,6 +24,7 @@ import org.eclipse.jface.text.tests.rules.FastPartitionerTest;
import org.eclipse.jface.text.tests.rules.ScannerColumnTest;
import org.eclipse.jface.text.tests.rules.WordRuleTest;
import org.eclipse.jface.text.tests.source.LineNumberRulerColumnTest;
import org.eclipse.jface.text.tests.templates.persistence.TemplatePersistenceDataTest;
/**
......@@ -49,7 +50,9 @@ import org.eclipse.jface.text.tests.source.LineNumberRulerColumnTest;
DefaultPartitionerZeroLengthTest.class,
FastPartitionerTest.class,
ScannerColumnTest.class,
WordRuleTest.class
WordRuleTest.class,
TemplatePersistenceDataTest.class,
})
public class JFaceTextTestSuite {
// see @SuiteClasses
......
/*******************************************************************************
* Copyright (c) 2018 SAP SE and others.
*
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
*
* Contributors:
* SAP SE - initial API and implementation
*******************************************************************************/
package org.eclipse.jface.text.tests.templates.persistence;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;
import org.junit.Test;
import org.eclipse.jface.text.templates.Template;
import org.eclipse.jface.text.templates.persistence.TemplatePersistenceData;
@SuppressWarnings("deprecation")
public class TemplatePersistenceDataTest {
@Test
public void testEquals() throws Exception {
Template template= new Template();
org.eclipse.text.templates.TemplatePersistenceData persistenceData1= new org.eclipse.text.templates.TemplatePersistenceData(template, false);
org.eclipse.text.templates.TemplatePersistenceData persistenceData2= new org.eclipse.text.templates.TemplatePersistenceData(template, false);
TemplatePersistenceData deprPersistenceData1A= new TemplatePersistenceData(persistenceData1);
TemplatePersistenceData deprPersistenceData1B= new TemplatePersistenceData(persistenceData1);
TemplatePersistenceData deprPersistenceData1X= new TemplatePersistenceData(deprPersistenceData1A);
TemplatePersistenceData deprPersistenceData2= new TemplatePersistenceData(persistenceData2);
TemplatePersistenceData deprPersistenceData3= new TemplatePersistenceData(template, false);
// deprecated type <-> deprecated type
assertTrue(deprPersistenceData1A.equals(deprPersistenceData1B));
assertFalse(deprPersistenceData1A.equals(deprPersistenceData2));
assertFalse(deprPersistenceData1A.equals(deprPersistenceData3));
assertTrue(deprPersistenceData3.equals(deprPersistenceData3));
assertTrue(deprPersistenceData1X.equals(deprPersistenceData1A));
// super type <-> super type
assertTrue(persistenceData1.equals(persistenceData1));
assertFalse(persistenceData1.equals(persistenceData2));
// super type <-> deprecated type
assertTrue(persistenceData1.equals(deprPersistenceData1A));
assertTrue(deprPersistenceData1A.equals(persistenceData1));
assertFalse(persistenceData1.equals(deprPersistenceData2));
assertFalse(deprPersistenceData2.equals(persistenceData1));
}
}
......@@ -2,7 +2,7 @@ Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: %pluginName
Bundle-SymbolicName: org.eclipse.jface.text
Bundle-Version: 3.14.0.qualifier
Bundle-Version: 3.15.0.qualifier
Bundle-Vendor: %providerName
Bundle-Localization: plugin
Export-Package:
......@@ -34,9 +34,9 @@ Export-Package:
org.eclipse.jface.text.templates.persistence
Require-Bundle:
org.eclipse.core.runtime;bundle-version="[3.5.0,4.0.0)",
org.eclipse.text;bundle-version="[3.5.0,4.0.0)";visibility:=reexport,
org.eclipse.text;bundle-version="[3.8.0,4.0.0)";visibility:=reexport,
org.eclipse.swt;bundle-version="[3.107.0,4.0.0)",
org.eclipse.jface;bundle-version="[3.5.0,4.0.0)"
org.eclipse.jface;bundle-version="[3.15.0,4.0.0)"
Bundle-RequiredExecutionEnvironment: JavaSE-1.8
Import-Package: com.ibm.icu.text
Automatic-Module-Name: org.eclipse.jface.text
......@@ -14,10 +14,10 @@
<parent>
<artifactId>eclipse.platform.text</artifactId>
<groupId>eclipse.platform.text</groupId>
<version>4.9.0-SNAPSHOT</version>
<version>4.10.0-SNAPSHOT</version>
</parent>
<groupId>org.eclipse.jface</groupId>
<artifactId>org.eclipse.jface.text</artifactId>
<version>3.14.0-SNAPSHOT</version>
<version>3.15.0-SNAPSHOT</version>
<packaging>eclipse-plugin</packaging>
</project>
/**
* Copyright (c) 2017 Angelo ZERR.
*
*
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
* https://www.eclipse.org/legal/epl-2.0/
*
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
*
* Contributors:
......@@ -20,14 +20,21 @@ import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.concurrent.CancellationException;
import java.util.concurrent.CompletableFuture;
import java.util.function.Function;
import java.util.stream.Collectors;
import org.osgi.framework.Bundle;
import org.eclipse.swt.graphics.Rectangle;
import org.eclipse.core.runtime.Assert;
import org.eclipse.core.runtime.ILog;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Platform;
import org.eclipse.core.runtime.Status;
import org.eclipse.jface.text.IDocument;
import org.eclipse.jface.text.ITextViewer;
......@@ -89,6 +96,10 @@ public class CodeMiningManager implements Runnable {
* @param codeMiningProviders the codemining providers.
*/
public void setCodeMiningProviders(ICodeMiningProvider[] codeMiningProviders) {
cancel();
if (fCodeMiningProviders != null) {
fCodeMiningProviders.stream().forEach(ICodeMiningProvider::dispose);
}
fCodeMiningProviders= Arrays.asList(codeMiningProviders);
}
......@@ -97,6 +108,9 @@ public class CodeMiningManager implements Runnable {
*/
public void uninstall() {
cancel();
if (fInlinedAnnotationSupport != null) {
fInlinedAnnotationSupport.updateAnnotations(Collections.emptySet());
}
}
/**
......@@ -143,6 +157,22 @@ public class CodeMiningManager implements Runnable {
}
}
private static void logCodeMiningProviderException(Throwable e) {
if (e != null && (e instanceof CancellationException || (e.getCause() != null && e.getCause() instanceof CancellationException))) {
return;
}
String PLUGIN_ID= "org.eclipse.jface.text"; //$NON-NLS-1$
Bundle plugin= Platform.getBundle(PLUGIN_ID);
if (plugin != null) {
// In OSGi context, uses Platform Text log
ILog log= Platform.getLog(plugin);
log.log(new Status(IStatus.ERROR, PLUGIN_ID, IStatus.OK, e.getMessage(), e));
} else {
// In java main context, print stack trace
System.err.println("Error while code mining process: " + e.getMessage()); //$NON-NLS-1$
}
}
/**
* Return the list of {@link CompletableFuture} which provides the list of {@link ICodeMining}
* for the given <code>viewer</code> by using the given providers.
......@@ -156,7 +186,12 @@ public class CodeMiningManager implements Runnable {
private static CompletableFuture<List<? extends ICodeMining>> getCodeMinings(ITextViewer viewer,
List<ICodeMiningProvider> providers, IProgressMonitor monitor) {
List<CompletableFuture<List<? extends ICodeMining>>> com= providers.stream()
.map(provider -> provider.provideCodeMinings(viewer, monitor)).filter(c -> c != null)
.map(provider -> provider.provideCodeMinings(viewer, monitor))
.filter(c -> c != null)
.map(future -> future.exceptionally(e -> {
logCodeMiningProviderException(e);
return Collections.emptyList();
}))
.collect(Collectors.toList());
return CompletableFuture.allOf(com.toArray(new CompletableFuture[com.size()])).thenApply(
v -> com.stream().map(CompletableFuture::join).flatMap(l -> l.stream()).collect(Collectors.toList()));
......
......@@ -32,6 +32,7 @@ import org.eclipse.jface.dialogs.IDialogSettings;
import org.eclipse.jface.internal.text.InformationControlReplacer;
import org.eclipse.jface.internal.text.InternalAccessor;
import org.eclipse.jface.util.Geometry;
import org.eclipse.jface.util.Util;
import org.eclipse.jface.text.ITextViewerExtension8.EnrichMode;
......@@ -1077,41 +1078,7 @@ abstract public class AbstractInformationControlManager {
center= Geometry.centerPoint(area);
else
center= Geometry.centerPoint(Geometry.getExtrudedEdge(area, 0, anchor.getSWTFlag()));
return getClosestMonitor(fSubjectControl.getDisplay(), Geometry.createRectangle(center, new Point(0, 0)));
}
/**
* Copied from org.eclipse.jface.window.Window. Returns the monitor whose client area contains
* the given point. If no monitor contains the point, returns the monitor that is closest to the
* point. If this is ever made public, it should be moved into a separate utility class.
*
* @param display the display to search for monitors
* @param rectangle the rectangle to find the closest monitor for (display coordinates)
* @return the monitor closest to the given point
* @since 3.3
*/
private Monitor getClosestMonitor(Display display, Rectangle rectangle) {
int closest = Integer.MAX_VALUE;
Point toFind= Geometry.centerPoint(rectangle);
Monitor[] monitors = display.getMonitors();
Monitor result = monitors[0];
for (Monitor current : monitors) {
Rectangle clientArea = current.getClientArea();
if (clientArea.contains(toFind)) {
return current;
}
int distance = Geometry.distanceSquared(Geometry.centerPoint(clientArea), toFind);
if (distance < closest) {
closest = distance;
result = current;
}
}
return result;
return Util.getClosestMonitor(fSubjectControl.getDisplay(), center);
}
/**
......@@ -1232,7 +1199,7 @@ abstract public class AbstractInformationControlManager {
* @since 3.4
*/
void cropToClosestMonitor(Rectangle bounds) {
Rectangle monitorBounds= getClosestMonitor(fSubjectControl.getDisplay(), bounds).getClientArea();
Rectangle monitorBounds= Util.getClosestMonitor(fSubjectControl.getDisplay(), Geometry.centerPoint(bounds)).getClientArea();
bounds.intersect(monitorBounds);
}
......
......@@ -15,6 +15,7 @@
package org.eclipse.jface.text;
import java.util.ArrayList;
import java.util.List;
import org.eclipse.jface.fieldassist.ContentProposal;
import org.eclipse.jface.fieldassist.IContentProposal;
......@@ -54,11 +55,11 @@ public class FindReplaceDocumentAdapterContentProposalProvider implements IConte
/**
* The high-priority proposals.
*/
private final ArrayList<ContentProposal> fPriorityProposals;
private final List<ContentProposal> fPriorityProposals;
/**
* The low-priority proposals.
*/
private final ArrayList<ContentProposal> fProposals;
private final List<ContentProposal> fProposals;
/**
* <code>true</code> iff <code>fExpression</code> ends with an open escape.
*/
......
......@@ -72,7 +72,8 @@ public interface IFindReplaceTarget {
int findAndSelect(int widgetOffset, String findString, boolean searchForward, boolean caseSensitive, boolean wholeWord);
/**
* Returns the currently selected range of characters as a offset and length in widget coordinates.
* Returns the currently selected range of characters as an offset and length in widget
* coordinates.
*
* @return the currently selected character range in widget coordinates
*/
......
......@@ -305,12 +305,21 @@ public final class JFaceTextUtil {
* be vertically scrolled, <code>false</code> otherwise
*/
public static boolean isShowingEntireContents(StyledText widget) {
if (widget.getTopPixel() != 0) // more efficient shortcut
if (widget.getTopPixel() != 0) {
// more efficient shortcut
return false;
}
int lastVisiblePixel= computeLastVisiblePixel(widget);
int lastPossiblePixel= widget.getLinePixel(widget.getLineCount());
return lastPossiblePixel <= lastVisiblePixel;
int bottom= widget.getLineIndex(lastVisiblePixel);
if (bottom + 1 < widget.getLineCount()) {
// There's definitely more lines below
return false;
}
// Check whether the last line is fully visible
int bottomLastPixel= getLinePixel(widget, bottom + 1) - 1;
return bottomLastPixel <= lastVisiblePixel;
}
/**
......
......@@ -15,8 +15,10 @@ package org.eclipse.jface.text.contentassist;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collection;
import java.util.Collections;
import java.util.HashSet;
import java.util.LinkedList;
import java.util.List;
import java.util.Set;
import java.util.concurrent.CompletableFuture;
......@@ -33,6 +35,9 @@ import org.eclipse.swt.graphics.Point;
import org.eclipse.swt.widgets.Control;
import org.eclipse.swt.widgets.Display;
import org.eclipse.core.runtime.ISafeRunnable;
import org.eclipse.core.runtime.SafeRunner;
import org.eclipse.jface.contentassist.IContentAssistSubjectControl;
import org.eclipse.jface.text.BadLocationException;
......@@ -341,11 +346,18 @@ class AsyncCompletionProposalPopup extends CompletionProposalPopup {
List<CompletableFuture<List<ICompletionProposal>>> futures = new ArrayList<>(processors.size());
for (IContentAssistProcessor processor : processors) {
futures.add(CompletableFuture.supplyAsync(() -> {
ICompletionProposal[] proposals= processor.computeCompletionProposals(fViewer, invocationOffset);
if (proposals == null) {
return Collections.emptyList();
}
return Arrays.asList(proposals);
final Collection<List<ICompletionProposal>> result= new LinkedList<>();
SafeRunner.run(new ISafeRunnable() {
@Override
public void run() throws Exception {
ICompletionProposal[] proposals= processor.computeCompletionProposals(fViewer, invocationOffset);
if (proposals == null) {
result.add(Collections.emptyList());
}
result.add(Arrays.asList(proposals));
}
});
return result.iterator().next();
}));
}
return futures;
......
......@@ -355,9 +355,10 @@ class CompletionProposalPopup implements IContentAssistListener {
int offset= fContentAssistSubjectControlAdapter.getSelectedRange().x;
List<ICompletionProposal> proposals= null;
DocumentEvent event= null;
try {
if (offset > -1) {
DocumentEvent event= TextUtilities.mergeProcessedDocumentEvents(fDocumentEvents);
event= TextUtilities.mergeProcessedDocumentEvents(fDocumentEvents);
proposals= computeFilteredProposals(offset, event);
}
} catch (BadLocationException x) {
......@@ -368,8 +369,19 @@ class CompletionProposalPopup implements IContentAssistListener {
if (proposals != null && proposals.size() > 0)
setProposals(proposals, fIsFilteredSubset);
else
else {
hide();
if (fContentAssistant.isAutoActivation() && offset > 0 && event != null) {
try {
char charBeforeOffset= event.getDocument().getChar(offset - 1);
if (fContentAssistant.isAutoActivationTriggerChar(charBeforeOffset)) {
fContentAssistant.fireSessionBeginEvent(true);
showProposals(true);
}
} catch (BadLocationException e) {
}
}
}
}
};
/**
......@@ -1369,16 +1381,18 @@ class CompletionProposalPopup implements IContentAssistListener {
return false;
default:
ICompletionProposal p= getSelectedProposal();
if (p instanceof ICompletionProposalExtension) {
ICompletionProposalExtension t= (ICompletionProposalExtension) p;
char[] triggers= t.getTriggerCharacters();
if (contains(triggers, key)) {
e.doit= false;
hide();
insertProposal(p, key, e.stateMask, fContentAssistSubjectControlAdapter.getSelectedRange().x);
if (fContentAssistant.isCompletionProposalTriggerCharsEnabled()) {
ICompletionProposal p= getSelectedProposal();
if (p instanceof ICompletionProposalExtension) {
ICompletionProposalExtension t= (ICompletionProposalExtension) p;
char[] triggers= t.getTriggerCharacters();
if (contains(triggers, key)) {
e.doit= false;
hide();
insertProposal(p, key, e.stateMask, fContentAssistSubjectControlAdapter.getSelectedRange().x);
}
}
}
}
}
return true;
......
......@@ -323,7 +323,7 @@ public class ContentAssistant implements IContentAssistant, IContentAssistantExt
// Only act on characters that are trigger candidates. This
// avoids computing the model selection on every keystroke
if (computeAllAutoActivationTriggers().indexOf(e.character) < 0) {
if (!isAutoActivationTriggerChar(e.character)) {
stop();
return;
}
......@@ -935,7 +935,8 @@ public class ContentAssistant implements IContentAssistant, IContentAssistantExt
private Closer fCloser;
LayoutManager fLayoutManager;
private AutoAssistListener fAutoAssistListener;
AutoAssistListener fAutoAssistListener;
private InternalListener fInternalListener;
private CompletionProposalPopup fProposalPopup;
private ContextInformationPopup fContextInfoPopup;
......@@ -1055,6 +1056,8 @@ public class ContentAssistant implements IContentAssistant, IContentAssistantExt
*/
private boolean fAsynchronous;
private boolean fCompletionProposalTriggerCharsEnabled= true;
/**
* Creates a new content assistant. The content assistant is not automatically activated,
* overlays the completion proposals with context information list if necessary, and shows the
......@@ -1181,27 +1184,26 @@ public class ContentAssistant implements IContentAssistant, IContentAssistantExt
}
/**
* Computes the sorted set of all auto activation trigger characters.
*
* @return the sorted set of all auto activation trigger characters
* @since 3.1
* @return whether the given char is an auto-activation trigger char
* @since 3.15