Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'org.eclipse.jface.text')
-rw-r--r--org.eclipse.jface.text/META-INF/MANIFEST.MF2
-rw-r--r--org.eclipse.jface.text/pom.xml2
-rw-r--r--org.eclipse.jface.text/src/org/eclipse/jface/text/contentassist/CompletionProposalPopup.java20
-rw-r--r--org.eclipse.jface.text/src/org/eclipse/jface/text/contentassist/ContentAssistant.java26
4 files changed, 39 insertions, 11 deletions
diff --git a/org.eclipse.jface.text/META-INF/MANIFEST.MF b/org.eclipse.jface.text/META-INF/MANIFEST.MF
index 0ea8ae6a7..2a8c18e6b 100644
--- a/org.eclipse.jface.text/META-INF/MANIFEST.MF
+++ b/org.eclipse.jface.text/META-INF/MANIFEST.MF
@@ -2,7 +2,7 @@ Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: %pluginName
Bundle-SymbolicName: org.eclipse.jface.text
-Bundle-Version: 3.14.100.qualifier
+Bundle-Version: 3.15.0.qualifier
Bundle-Vendor: %providerName
Bundle-Localization: plugin
Export-Package:
diff --git a/org.eclipse.jface.text/pom.xml b/org.eclipse.jface.text/pom.xml
index 371154fd0..c053cc331 100644
--- a/org.eclipse.jface.text/pom.xml
+++ b/org.eclipse.jface.text/pom.xml
@@ -18,6 +18,6 @@
</parent>
<groupId>org.eclipse.jface</groupId>
<artifactId>org.eclipse.jface.text</artifactId>
- <version>3.14.100-SNAPSHOT</version>
+ <version>3.15.0-SNAPSHOT</version>
<packaging>eclipse-plugin</packaging>
</project>
diff --git a/org.eclipse.jface.text/src/org/eclipse/jface/text/contentassist/CompletionProposalPopup.java b/org.eclipse.jface.text/src/org/eclipse/jface/text/contentassist/CompletionProposalPopup.java
index 55009fe0b..7d077f2bb 100644
--- a/org.eclipse.jface.text/src/org/eclipse/jface/text/contentassist/CompletionProposalPopup.java
+++ b/org.eclipse.jface.text/src/org/eclipse/jface/text/contentassist/CompletionProposalPopup.java
@@ -1369,16 +1369,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;
diff --git a/org.eclipse.jface.text/src/org/eclipse/jface/text/contentassist/ContentAssistant.java b/org.eclipse.jface.text/src/org/eclipse/jface/text/contentassist/ContentAssistant.java
index bfe38f378..7c614d561 100644
--- a/org.eclipse.jface.text/src/org/eclipse/jface/text/contentassist/ContentAssistant.java
+++ b/org.eclipse.jface.text/src/org/eclipse/jface/text/contentassist/ContentAssistant.java
@@ -1055,6 +1055,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
@@ -2757,4 +2759,28 @@ public class ContentAssistant implements IContentAssistant, IContentAssistantExt
fProposalPopup.setSorter(fSorter);
}
}
+
+ /**
+ * Returns whether completion trigger char are enabled. If false, completion proposal trigger
+ * chars are ignored and only Enter key can be used to select a proposal.
+ *
+ * @return whether completion trigger char are enabled.
+ * @see ICompletionProposalExtension#getTriggerCharacters()
+ * @since 3.15
+ */
+ public boolean isCompletionProposalTriggerCharsEnabled() {
+ return fCompletionProposalTriggerCharsEnabled;
+ }
+
+ /**
+ * Set whether completion trigger chars are enabled. If set to false, completion proposal
+ * trigger chars are ignored and only Enter key can be used to select a proposal.
+ *
+ * @param enable whether current content assistant should consider completion trigger chars.
+ * @see ICompletionProposalExtension#getTriggerCharacters()
+ * @since 3.15
+ */
+ public void enableCompletionProposalTriggerChars(boolean enable) {
+ fCompletionProposalTriggerCharsEnabled= enable;
+ }
}

Back to the top