Author: vrubezhny
Date: 2010-09-01 10:00:21 -0400 (Wed, 01 Sep 2010)
New Revision: 24607
Modified:
trunk/common/plugins/org.jboss.tools.common.text.xml/src/org/jboss/tools/common/text/xml/XMLTextViewerConfiguration.java
trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/HTMLTextViewerConfiguration.java
trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/JSPTextViewerConfiguration.java
Log:
JBIDE-6949: Auto code completion for EL doesn't work when a user types "."
Issue is fixed
Modified:
trunk/common/plugins/org.jboss.tools.common.text.xml/src/org/jboss/tools/common/text/xml/XMLTextViewerConfiguration.java
===================================================================
---
trunk/common/plugins/org.jboss.tools.common.text.xml/src/org/jboss/tools/common/text/xml/XMLTextViewerConfiguration.java 2010-09-01
13:33:42 UTC (rev 24606)
+++
trunk/common/plugins/org.jboss.tools.common.text.xml/src/org/jboss/tools/common/text/xml/XMLTextViewerConfiguration.java 2010-09-01
14:00:21 UTC (rev 24607)
@@ -35,7 +35,10 @@
*/
@SuppressWarnings("restriction")
public class XMLTextViewerConfiguration extends StructuredTextViewerConfigurationXML {
-
+ private static final char[] PROPOSAL_AUTO_ACTIVATION_CHARS = new char[] {
+ '<', '=', '"', '\'', '.',
'{'
+ };
+
SourceViewerConfiguration initial = null;
public XMLTextViewerConfiguration() {
@@ -62,6 +65,20 @@
return ProposalSorter.filterAndSortProposals(proposals, monitor, context);
}
+ @Override
+ public char[] getCompletionProposalAutoActivationCharacters() {
+ char[] superAutoActivationCharacters =
super.getCompletionProposalAutoActivationCharacters();
+ if (superAutoActivationCharacters == null)
+ return PROPOSAL_AUTO_ACTIVATION_CHARS;
+
+ String chars = new String(superAutoActivationCharacters);
+ for (char ch : PROPOSAL_AUTO_ACTIVATION_CHARS) {
+ if (chars.indexOf(ch) == -1) {
+ chars += ch;
+ }
+ }
+ return chars.toCharArray();
+ }
};
List<IContentAssistProcessor> processors = new
ArrayList<IContentAssistProcessor>();
Modified:
trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/HTMLTextViewerConfiguration.java
===================================================================
---
trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/HTMLTextViewerConfiguration.java 2010-09-01
13:33:42 UTC (rev 24606)
+++
trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/HTMLTextViewerConfiguration.java 2010-09-01
14:00:21 UTC (rev 24607)
@@ -28,6 +28,7 @@
import org.eclipse.jface.text.hyperlink.IHyperlinkDetector;
import org.eclipse.jface.text.information.IInformationProvider;
import org.eclipse.jface.text.source.ISourceViewer;
+import org.eclipse.jface.util.PropertyChangeEvent;
import org.eclipse.ui.texteditor.AbstractDecoratedTextEditorPreferenceConstants;
import org.eclipse.wst.html.core.text.IHTMLPartitions;
import org.eclipse.wst.html.ui.StructuredTextViewerConfigurationHTML;
@@ -48,6 +49,10 @@
StructuredTextViewerConfigurationHTML implements
ITextViewerConfiguration {
+ private static final char[] PROPOSAL_AUTO_ACTIVATION_CHARS = new char[] {
+ '<', '=', '"', '\'', '.',
'{'
+ };
+
TextViewerConfigurationDelegate configurationDelegate;
private static final String TEMPLATES_CONTENT_ASSISTANT =
"org.jboss.tools.jst.jsp.editorContentAssistent"; //$NON-NLS-1$
@@ -64,7 +69,6 @@
// sourceViewer, partitionType);
IContentAssistProcessor superProcessor = new HTMLStructuredContentAssistProcessor(
this.getContentAssistant(), partitionType, sourceViewer) {
-
@SuppressWarnings({ "rawtypes", "unchecked" })
@Override
protected List filterAndSortProposals(List proposals,
@@ -72,7 +76,21 @@
CompletionProposalInvocationContext context) {
return ProposalSorter.filterAndSortProposals(proposals, monitor, context);
}
-
+
+ @Override
+ public char[] getCompletionProposalAutoActivationCharacters() {
+ char[] superAutoActivationCharacters =
super.getCompletionProposalAutoActivationCharacters();
+ if (superAutoActivationCharacters == null)
+ return PROPOSAL_AUTO_ACTIVATION_CHARS;
+
+ String chars = new String(superAutoActivationCharacters);
+ for (char ch : PROPOSAL_AUTO_ACTIVATION_CHARS) {
+ if (chars.indexOf(ch) == -1) {
+ chars += ch;
+ }
+ }
+ return chars.toCharArray();
+ }
};
List<IContentAssistProcessor> processors = new
ArrayList<IContentAssistProcessor>();
processors.addAll(
Modified:
trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/JSPTextViewerConfiguration.java
===================================================================
---
trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/JSPTextViewerConfiguration.java 2010-09-01
13:33:42 UTC (rev 24606)
+++
trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/JSPTextViewerConfiguration.java 2010-09-01
14:00:21 UTC (rev 24607)
@@ -32,7 +32,10 @@
*/
@SuppressWarnings("restriction")
public class JSPTextViewerConfiguration extends StructuredTextViewerConfigurationJSP
implements ITextViewerConfiguration {
-
+ private static final char[] PROPOSAL_AUTO_ACTIVATION_CHARS = new char[] {
+ '<', '=', '"', '\'', '.',
'{'
+ };
+
private TextViewerConfigurationDelegate configurationDelegate;
public JSPTextViewerConfiguration() {
@@ -95,7 +98,21 @@
CompletionProposalInvocationContext context) {
return ProposalSorter.filterAndSortProposals(proposals, monitor, context);
}
-
+
+ @Override
+ public char[] getCompletionProposalAutoActivationCharacters() {
+ char[] superAutoActivationCharacters =
super.getCompletionProposalAutoActivationCharacters();
+ if (superAutoActivationCharacters == null)
+ return PROPOSAL_AUTO_ACTIVATION_CHARS;
+
+ String chars = new String(superAutoActivationCharacters);
+ for (char ch : PROPOSAL_AUTO_ACTIVATION_CHARS) {
+ if (chars.indexOf(ch) == -1) {
+ chars += ch;
+ }
+ }
+ return chars.toCharArray();
+ }
};
List<IContentAssistProcessor> processors = new
ArrayList<IContentAssistProcessor>();
Show replies by date