Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMickael Istria2016-11-19 17:02:18 +0000
committerMickael Istria - away until January 11th2017-01-17 15:38:17 +0000
commitaa9773529d30c379ea5c0b25683e698ce2fb4574 (patch)
tree425fa5db3bce7f1c79c5e460290071f135bcfb01 /org.eclipse.ui.genericeditor.examples
parentd77b078388163500961bdab34c0248806eb5c208 (diff)
downloadeclipse.platform.text-aa9773529d30c379ea5c0b25683e698ce2fb4574.tar.gz
eclipse.platform.text-aa9773529d30c379ea5c0b25683e698ce2fb4574.tar.xz
eclipse.platform.text-aa9773529d30c379ea5c0b25683e698ce2fb4574.zip
Bug 251156 - Asynchronous content assist
This provides a new AsyncContentAssistant, performaing computation and presentation of content assist proposals (and related operations) asynchronously whenever possible. Part of this change is also internally allowing the parent ContentAssistant to support multiple IConteantAssistProcessors (although this is not exposed through public API). The AsyncContentAssistant does expose the manipulation of multiple contentAssistProcessors though. Some fields and methods where also made more visible (usually from private to protected or package, to maximize the ability to reuse existing code from the current synchronous framework, in order to make the feature easier to write, and also to provide a consistent experience with aysnc and sync content assist. Change-Id: I3e80c6422eaababc165e955ddeb3539909bfcb9f Signed-off-by: Mickael Istria <mistria@redhat.com>
Diffstat (limited to 'org.eclipse.ui.genericeditor.examples')
-rw-r--r--org.eclipse.ui.genericeditor.examples/plugin.xml4
-rw-r--r--org.eclipse.ui.genericeditor.examples/src/org/eclipse/ui/genericeditor/examples/dotproject/NaturesAndProjectsContentAssistProcessor.java2
2 files changed, 3 insertions, 3 deletions
diff --git a/org.eclipse.ui.genericeditor.examples/plugin.xml b/org.eclipse.ui.genericeditor.examples/plugin.xml
index 245f1019d66..f03f4b6b7bc 100644
--- a/org.eclipse.ui.genericeditor.examples/plugin.xml
+++ b/org.eclipse.ui.genericeditor.examples/plugin.xml
@@ -14,11 +14,11 @@
<extension
point="org.eclipse.core.contenttype.contentTypes">
<content-type
- base-type="org.eclipse.core.runtime.text"
+ base-type="org.eclipse.core.runtime.xml"
file-names=".project"
id="dotproject"
name="Eclipse .project"
- priority="normal">
+ priority="high">
</content-type>
</extension>
<extension
diff --git a/org.eclipse.ui.genericeditor.examples/src/org/eclipse/ui/genericeditor/examples/dotproject/NaturesAndProjectsContentAssistProcessor.java b/org.eclipse.ui.genericeditor.examples/src/org/eclipse/ui/genericeditor/examples/dotproject/NaturesAndProjectsContentAssistProcessor.java
index 37509080b2c..86f7848b01f 100644
--- a/org.eclipse.ui.genericeditor.examples/src/org/eclipse/ui/genericeditor/examples/dotproject/NaturesAndProjectsContentAssistProcessor.java
+++ b/org.eclipse.ui.genericeditor.examples/src/org/eclipse/ui/genericeditor/examples/dotproject/NaturesAndProjectsContentAssistProcessor.java
@@ -26,7 +26,7 @@ public class NaturesAndProjectsContentAssistProcessor implements IContentAssistP
@Override
public ICompletionProposal[] computeCompletionProposals(ITextViewer viewer, int offset) {
- String text = viewer.getTextWidget().getText();
+ String text = viewer.getDocument().get();
String natureTag= "<nature>";
String projectReferenceTag="<project>";
IWorkspace workspace = ResourcesPlugin.getWorkspace();

Back to the top