Author: scabanovich
Date: 2008-09-29 11:29:44 -0400 (Mon, 29 Sep 2008)
New Revision: 10541
Modified:
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/actions/FindSeamAction.java
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/actions/SeamFindQuickAssistProcessor.java
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/search/SeamSearchEngine.java
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/search/SeamSearchQuery.java
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/search/SeamSearchVisitor.java
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/text/java/SeamELProposalComputer.java
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/text/java/SeamELProposalProcessor.java
Log:
JBIDE-1497.
Refactoring for usage of ELOperandToken
Modified:
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/actions/FindSeamAction.java
===================================================================
---
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/actions/FindSeamAction.java 2008-09-29
15:29:27 UTC (rev 10540)
+++
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/actions/FindSeamAction.java 2008-09-29
15:29:44 UTC (rev 10541)
@@ -48,14 +48,13 @@
import org.eclipse.ui.part.MultiPageEditorPart;
import org.eclipse.ui.progress.IProgressService;
import org.eclipse.ui.texteditor.AbstractTextEditor;
+import org.jboss.tools.common.el.core.model.ELInvocationExpression;
import org.jboss.tools.common.model.ui.editor.EditorPartWrapper;
import org.jboss.tools.common.model.ui.texteditors.xmleditor.XMLTextEditor;
import org.jboss.tools.jst.jsp.jspeditor.JSPMultiPageEditor;
import org.jboss.tools.seam.core.ISeamContextVariable;
import org.jboss.tools.seam.core.ISeamProject;
import org.jboss.tools.seam.core.SeamCorePlugin;
-import org.jboss.tools.seam.internal.core.el.ELOperandToken;
-import org.jboss.tools.seam.internal.core.el.SeamELCompletionEngine;
import org.jboss.tools.seam.ui.SeamGuiPlugin;
import org.jboss.tools.seam.ui.search.SeamSearchQuery;
import org.jboss.tools.seam.ui.search.SeamSearchScope;
@@ -187,8 +186,10 @@
if (seamProject == null)
return;
- List<ELOperandToken> tokens = SeamELCompletionEngine.findTokensAtOffset(document,
selectionOffset);
+// List<ELOperandToken> tokens =
SeamELCompletionEngine.findTokensAtOffset(document, selectionOffset);
+ ELInvocationExpression tokens = null; //TODO
+
if (tokens == null)
return; // No EL Operand found
@@ -210,19 +211,17 @@
* @param tokens
* @return
*/
- public static String[] findVariableNames(ISeamProject seamProject, IDocument document,
List<ELOperandToken> tokens) {
+ public static String[] findVariableNames(ISeamProject seamProject, IDocument document,
ELInvocationExpression tokens) {
String[] varNames = null;
+ if(tokens == null) return varNames;
- List<List<ELOperandToken>> variations =
SeamELCompletionEngine.getPossibleVarsFromPrefix(tokens);
-
// Define the Seam project variables to search for declarations
List<ISeamContextVariable> variables = new
ArrayList<ISeamContextVariable>();
- for (List<ELOperandToken> variation : variations) {
+ while(tokens != null) {
try {
- int start = variation.get(0).getStart();
- int end = variation.get(variation.size() - 1).getStart() +
- variation.get(variation.size() - 1).getLength();
+ int start = tokens.getStartPosition();
+ int end = tokens.getEndPosition();
String variationText = document.get(start, end - start);
Set<ISeamContextVariable> vars =
seamProject.getVariablesByName(variationText);
@@ -232,6 +231,7 @@
} catch (BadLocationException e1) {
SeamGuiPlugin.getPluginLog().logError(e1);
}
+ tokens = tokens.getLeft();
}
if (variables.size() != 0) {
@@ -291,7 +291,7 @@
fDelegatorAction = action;
}
- private SeamSearchQuery createQuery(List<ELOperandToken> tokens, IFile sourceFile)
throws JavaModelException, InterruptedException {
+ private SeamSearchQuery createQuery(ELInvocationExpression tokens, IFile sourceFile)
throws JavaModelException, InterruptedException {
SeamSearchScope scope = new SeamSearchScope(new IProject[] {sourceFile.getProject()},
getLimitTo());
@@ -306,7 +306,7 @@
*/
abstract protected int getLimitTo();
- private void performNewSearch(List<ELOperandToken> tokens, IFile sourceFile)
throws JavaModelException, InterruptedException {
+ private void performNewSearch(ELInvocationExpression tokens, IFile sourceFile) throws
JavaModelException, InterruptedException {
SeamSearchQuery query= createQuery(tokens, sourceFile);
if (query.canRunInBackground()) {
/*
Modified:
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/actions/SeamFindQuickAssistProcessor.java
===================================================================
---
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/actions/SeamFindQuickAssistProcessor.java 2008-09-29
15:29:27 UTC (rev 10540)
+++
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/actions/SeamFindQuickAssistProcessor.java 2008-09-29
15:29:44 UTC (rev 10541)
@@ -11,13 +11,12 @@
package org.jboss.tools.seam.ui.actions;
-import java.util.List;
-
import org.eclipse.core.resources.IFile;
import org.eclipse.core.resources.IResource;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.jdt.core.ICompilationUnit;
import org.eclipse.jdt.core.JavaModelException;
+import org.eclipse.jdt.core.dom.ASTNode;
import org.eclipse.jdt.ui.JavaUI;
import org.eclipse.jdt.ui.text.java.IInvocationContext;
import org.eclipse.jdt.ui.text.java.IJavaCompletionProposal;
@@ -33,9 +32,9 @@
import org.eclipse.swt.graphics.Image;
import org.eclipse.swt.graphics.Point;
import org.eclipse.ui.part.FileEditorInput;
+import org.jboss.tools.common.el.core.model.ELInvocationExpression;
import org.jboss.tools.seam.core.ISeamProject;
import org.jboss.tools.seam.core.SeamCorePlugin;
-import org.jboss.tools.seam.internal.core.el.ELOperandToken;
import org.jboss.tools.seam.internal.core.el.SeamELCompletionEngine;
import org.jboss.tools.seam.ui.SeamGuiPlugin;
import org.jboss.tools.seam.ui.SeamUIMessages;
@@ -62,8 +61,16 @@
return false;
IDocument document = getDocument( context.getCompilationUnit() );
+
+ //TODO compute region start and end
+ int start = 0;
+ int end = document.getLength();
+
+ ASTNode node = context.getCoveringNode();
+
+ System.out.println("Covering node=" + node);
- String[] varNames = getVariableNames(seamProject, document,
context.getSelectionOffset());
+ String[] varNames = getVariableNames(seamProject, document,
context.getSelectionOffset(), start, end);
return (varNames != null && varNames.length != 0);
}
@@ -80,10 +87,10 @@
return SeamCorePlugin.getSeamProject(javaFile.getProject(), true);
}
- private String[] getVariableNames(ISeamProject seamProject, IDocument document, int
offset) {
- List<ELOperandToken> tokens = SeamELCompletionEngine.findTokensAtOffset(
- document,
- offset);
+ private String[] getVariableNames(ISeamProject seamProject, IDocument document, int
offset,
+ int start, int end) {
+ ELInvocationExpression tokens = SeamELCompletionEngine.findExpressionAtOffset(
+ document, offset, start, end);
if (tokens == null)
return null;
@@ -110,18 +117,16 @@
if (seamProject == null)
return result;
- List<ELOperandToken> tokens = SeamELCompletionEngine.findTokensAtOffset(
+ ELInvocationExpression tokens = SeamELCompletionEngine.findExpressionAtOffset(
document,
- context.getSelectionOffset());
- if (tokens == null || tokens.size() == 0)
+ context.getSelectionOffset(),
+ 0, //TODO compute region start
+ document.getLength() //TODO compute region end
+ );
+ if (tokens == null /*|| tokens.size() == 0*/)
return result;
-
- StringBuffer buf= new StringBuffer();
- for (int i= 0; i < tokens.size(); i++) {
- buf.append(tokens.get(i).getText()); //$NON-NLS-1$
- }
- searchString = buf.toString();
+ searchString = tokens.getText();
result = new IJavaCompletionProposal[2];
Modified:
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/search/SeamSearchEngine.java
===================================================================
---
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/search/SeamSearchEngine.java 2008-09-29
15:29:27 UTC (rev 10540)
+++
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/search/SeamSearchEngine.java 2008-09-29
15:29:44 UTC (rev 10541)
@@ -36,10 +36,10 @@
import org.eclipse.jdt.internal.core.JavaModelManager;
import org.eclipse.jface.text.BadLocationException;
import org.eclipse.search.core.text.TextSearchEngine;
+import org.jboss.tools.common.el.core.model.ELInvocationExpression;
import org.jboss.tools.seam.core.ISeamContextVariable;
import org.jboss.tools.seam.core.ISeamProject;
import org.jboss.tools.seam.core.SeamCorePlugin;
-import org.jboss.tools.seam.internal.core.el.ELOperandToken;
import org.jboss.tools.seam.internal.core.el.ElVarSearcher;
import org.jboss.tools.seam.internal.core.el.SeamELCompletionEngine;
import org.jboss.tools.seam.internal.core.el.Var;
@@ -83,10 +83,10 @@
public IStatus search(SeamSearchScope javaScope,
SeamSearchRequestor requestor,
IFile sourceFile,
- List<ELOperandToken> tokens,
+ ELInvocationExpression tokens,
IProgressMonitor monitor) {
- if (tokens == null || tokens.size() == 0) {
+ if (tokens == null /*|| tokens.size() == 0*/) {
return Status.OK_STATUS;
}
@@ -102,7 +102,7 @@
//Find Seam variable names
// - if the tokens are the variable name only - search for variable declaration in
Seam project
- String variableName = SeamSearchVisitor.tokensToString(tokens);
+ String variableName = tokens.getText();
//SeamSearchVisitor.tokensToString(tokens);
Set<ISeamContextVariable> variables =
seamProject.getVariablesByName(variableName);
if (variables != null && variables.size() > 0) {
@@ -128,31 +128,25 @@
// Try to find a local Var (a pair of variable-value attributes)
ElVarSearcher varSearcher = new ElVarSearcher(seamProject, sourceFile, new
SeamELCompletionEngine());
// Find a Var in the EL
- int start = tokens.get(0).getStart();
- int end = tokens.get(tokens.size() - 1).getStart() +
- tokens.get(tokens.size() - 1).getLength();
+ int start = tokens.getStartPosition();
+ int end = tokens.getEndPosition();
StringBuffer elText = new StringBuffer();
- for (ELOperandToken token : tokens) {
- if (elText.length() > 0) {
- elText.append(".");
- }
- elText.append(token.getText());
- }
+ elText.append(tokens.toString());
if (elText == null || elText.length() == 0)
return Status.OK_STATUS;
- List<Var> allVars= ElVarSearcher.findAllVars(sourceFile,
tokens.get(0).getStart());
+ List<Var> allVars= ElVarSearcher.findAllVars(sourceFile,
tokens.getStartPosition());
Var var = varSearcher.findVarForEl(elText.toString(), allVars, true);
if (var == null) {
// Find a Var in the current offset assuming that it's a node with var/value
attribute pair
- var = ElVarSearcher.findVar(sourceFile, tokens.get(0).getStart());
+ var = ElVarSearcher.findVar(sourceFile, tokens.getStartPosition());
}
if (var == null)
return Status.OK_STATUS;
- if (tokens.size() == 1) {
+ if (tokens.getLeft() == null) {
// The only Var is selected to search for
if (isSearchForDeclarations(javaScope.getLimitTo())) {
@@ -230,7 +224,7 @@
* @return the status containing information about problems in resources searched.
*/
public abstract IStatus search(SeamSearchScope scope, SeamSearchRequestor requestor,
- IFile sourceFile, List<ELOperandToken> tokens, IProgressMonitor monitor);
+ IFile sourceFile, ELInvocationExpression tokens, IProgressMonitor monitor);
/**
* Uses a given IJavaElement-s to find matches in the content of
Modified:
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/search/SeamSearchQuery.java
===================================================================
---
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/search/SeamSearchQuery.java 2008-09-29
15:29:27 UTC (rev 10540)
+++
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/search/SeamSearchQuery.java 2008-09-29
15:29:44 UTC (rev 10541)
@@ -1,5 +1,4 @@
/*******************************************************************************
- * Copyright (c) 2007 Red Hat, Inc.
* Distributed under license by Red Hat, Inc. All rights reserved.
* This program is made available under the terms of the
* Eclipse Public License v1.0 which accompanies this distribution,
@@ -33,11 +32,11 @@
import org.eclipse.search.ui.ISearchResult;
import org.eclipse.search.ui.text.AbstractTextSearchResult;
import org.eclipse.search.ui.text.Match;
+import org.jboss.tools.common.el.core.model.ELInvocationExpression;
import org.jboss.tools.seam.core.ISeamDeclaration;
import org.jboss.tools.seam.core.ISeamJavaSourceReference;
import org.jboss.tools.seam.core.ISeamProject;
import org.jboss.tools.seam.core.SeamCorePlugin;
-import org.jboss.tools.seam.internal.core.el.ELOperandToken;
import org.jboss.tools.seam.internal.core.el.SeamELCompletionEngine;
import org.jboss.tools.seam.ui.SeamUIMessages;
@@ -174,7 +173,7 @@
}
- private List<ELOperandToken> fTokens;
+ private ELInvocationExpression fTokens;
private IJavaElement[] fJavaElements;
private final SeamSearchScope fScope;
private SeamSearchResult fResult;
@@ -182,13 +181,13 @@
private ISearchRequestor fParentRequestor;
/**
- * Constructs Seam search query for a given {@link ELOperandToken} objects list
+ * Constructs Seam search query for a given {@link ELInvocationExpression} objects list
*
* @param tokens
* @param sourceFile
* @param scope
*/
- public SeamSearchQuery(List<ELOperandToken> tokens, IFile sourceFile,
SeamSearchScope scope) {
+ public SeamSearchQuery(ELInvocationExpression tokens, IFile sourceFile, SeamSearchScope
scope) {
fTokens = tokens;
fJavaElements = null;
fSourceFile = sourceFile;
@@ -329,11 +328,7 @@
}
searchString = buf.toString();
} else if (fTokens != null) {
- StringBuffer buf= new StringBuffer();
- for (int i= 0; i < fTokens.size(); i++) {
- buf.append(fTokens.get(i).getText());
- }
- searchString = buf.toString();
+ searchString = fTokens.getText();
}
return searchString;
}
Modified:
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/search/SeamSearchVisitor.java
===================================================================
---
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/search/SeamSearchVisitor.java 2008-09-29
15:29:27 UTC (rev 10540)
+++
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/search/SeamSearchVisitor.java 2008-09-29
15:29:44 UTC (rev 10541)
@@ -113,7 +113,6 @@
import org.jboss.tools.seam.core.SeamCorePlugin;
import org.jboss.tools.seam.internal.core.AbstractSeamDeclaration;
import org.jboss.tools.seam.internal.core.SeamComponent;
-import org.jboss.tools.seam.internal.core.el.ELOperandToken;
import org.jboss.tools.seam.internal.core.el.ElVarSearcher;
import org.jboss.tools.seam.internal.core.el.SeamELCompletionEngine;
import org.jboss.tools.seam.internal.core.el.Var;
@@ -1236,26 +1235,7 @@
return false;
}
-
/**
- * Returns the text for a given {@link ELOperandToken} list
- *
- * @param tokens
- * @return
- */
- public static String tokensToString(List<ELOperandToken> tokens) {
- StringBuffer text = new StringBuffer();
- if (tokens != null) {
- for (ELOperandToken token : tokens) {
- text = text.append(token.getText());
- }
- }
-
- return text.toString();
- }
-
-
- /**
* Evaluates all files in this scope.
*
* @param status a {@link MultiStatus} to collect the error status that occurred while
collecting resources.
Modified:
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/text/java/SeamELProposalComputer.java
===================================================================
---
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/text/java/SeamELProposalComputer.java 2008-09-29
15:29:27 UTC (rev 10540)
+++
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/text/java/SeamELProposalComputer.java 2008-09-29
15:29:44 UTC (rev 10541)
@@ -17,6 +17,7 @@
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.jdt.ui.text.java.ContentAssistInvocationContext;
import org.eclipse.jdt.ui.text.java.IJavaCompletionProposalComputer;
+import org.eclipse.jdt.ui.text.java.JavaContentAssistInvocationContext;
import org.eclipse.jface.text.contentassist.ICompletionProposal;
import org.eclipse.jface.text.contentassist.IContextInformation;
@@ -39,6 +40,13 @@
* @see
org.eclipse.jface.text.contentassist.ICompletionProposalComputer#computeCompletionProposals(org.eclipse.jface.text.contentassist.TextContentAssistInvocationContext,
org.eclipse.core.runtime.IProgressMonitor)
*/
public List<ICompletionProposal>
computeCompletionProposals(ContentAssistInvocationContext context, IProgressMonitor
monitor) {
+ if(context instanceof JavaContentAssistInvocationContext) {
+ int start =
((JavaContentAssistInvocationContext)context).getCoreContext().getTokenStart();
+ int end =
((JavaContentAssistInvocationContext)context).getCoreContext().getTokenEnd();
+ if(start >= 0 && end >= start) {
+ return Arrays.asList(fProcessor.computeCompletionProposals(context.getViewer(),
context.getInvocationOffset(), start, end));
+ }
+ }
return Arrays.asList(fProcessor.computeCompletionProposals(context.getViewer(),
context.getInvocationOffset()));
}
Modified:
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/text/java/SeamELProposalProcessor.java
===================================================================
---
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/text/java/SeamELProposalProcessor.java 2008-09-29
15:29:27 UTC (rev 10540)
+++
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/text/java/SeamELProposalProcessor.java 2008-09-29
15:29:44 UTC (rev 10541)
@@ -42,24 +42,31 @@
import org.eclipse.ui.PlatformUI;
import org.eclipse.ui.editors.text.EditorsUI;
import org.eclipse.ui.texteditor.ITextEditor;
+import org.eclipse.wst.sse.core.internal.provisional.IStructuredModel;
import org.eclipse.wst.sse.core.internal.provisional.IndexedRegion;
+import org.eclipse.wst.sse.core.internal.provisional.StructuredModelManager;
import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocument;
import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocumentRegion;
import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegion;
import org.eclipse.wst.sse.ui.internal.contentassist.ContentAssistUtils;
+import org.eclipse.wst.xml.core.internal.provisional.document.IDOMModel;
import org.eclipse.wst.xml.core.internal.provisional.document.IDOMNode;
import org.eclipse.wst.xml.core.internal.regions.DOMRegionContext;
import org.eclipse.wst.xml.ui.internal.contentassist.AbstractContentAssistProcessor;
import org.eclipse.wst.xml.ui.internal.util.SharedXMLEditorPluginImageHelper;
import org.jboss.tools.common.model.ui.texteditors.xmleditor.XMLTextEditor;
import org.jboss.tools.common.text.ext.IEditorWrapper;
+import org.jboss.tools.common.text.ext.util.Utils;
import org.jboss.tools.seam.core.ISeamProject;
import org.jboss.tools.seam.core.SeamCorePlugin;
import org.jboss.tools.seam.internal.core.el.ElVarSearcher;
import org.jboss.tools.seam.internal.core.el.SeamELCompletionEngine;
import org.jboss.tools.seam.internal.core.el.Var;
import org.jboss.tools.seam.ui.SeamGuiPlugin;
+import org.w3c.dom.Attr;
+import org.w3c.dom.Document;
import org.w3c.dom.Node;
+import org.w3c.dom.Text;
/**
* Content assist proposal processor.
@@ -268,7 +275,61 @@
* @see
org.eclipse.jface.text.contentassist.IContentAssistProcessor#computeCompletionProposals(org.eclipse.jface.text.ITextViewer,
int)
*/
public ICompletionProposal[] computeCompletionProposals(ITextViewer viewer, int offset)
{
+ if(viewer == null) {
+ return NO_PROPOSALS;
+ }
+ IDocument document = viewer.getDocument();
+ int start = 0;
+ int end = document.getLength();
+
+ int[] region = getRegion(document, offset);
+ if(region != null) {
+ start = region[0];
+ end = region[1];
+ }
+
+ return computeCompletionProposals(viewer, offset, start, end);
+ }
+
+ private int[] getRegion(IDocument document, int offset) {
+ IStructuredModel model =
StructuredModelManager.getModelManager().getExistingModelForRead(document);
+
try {
+ Document xmlDocument = (model instanceof IDOMModel) ? ((IDOMModel) model)
+ .getDocument()
+ : null;
+ if (xmlDocument == null)
+ return null;
+
+ Node n = Utils.findNodeForOffset(xmlDocument, offset);
+
+ if (n == null || !(n instanceof Attr || n instanceof Text))
+ return null;
+
+ int start = 0;
+ int end = document.getLength();
+ if (n instanceof IDOMNode) {
+ start = ((IDOMNode) n).getStartOffset();
+ end = ((IDOMNode) n).getEndOffset();
+ }
+ return new int[]{start, end};
+ } finally {
+ if(model != null) {
+ model.releaseFromRead();
+ model = null;
+ }
+ }
+
+ }
+ /**
+ *
+ * @param start start of relevant region in document
+ * @param end end of relevant region in document
+ *
+ * @see
org.eclipse.jface.text.contentassist.IContentAssistProcessor#computeCompletionProposals(org.eclipse.jface.text.ITextViewer,
int)
+ */
+ public ICompletionProposal[] computeCompletionProposals(ITextViewer viewer, int offset,
int start, int end) {
+ try {
ITextEditor part = getActiveEditor();
if (part == null) {
return NO_PROPOSALS;
@@ -287,7 +348,9 @@
return NO_PROPOSALS;
}
- String prefix= SeamELCompletionEngine.getPrefix(viewer, offset);
+ //TODO Now this will work only for EL.
+ // If we need CA for expressions/variables without #{}, it should be handled
separately.
+ String prefix= SeamELCompletionEngine.getPrefix(viewer, offset, start, end);
prefix = (prefix == null ? "" : prefix); //$NON-NLS-1$
String proposalPrefix = "";
@@ -326,7 +389,10 @@
}
List<Var> vars = ElVarSearcher.findAllVars(viewer, offset);
- List<String> suggestions = fEngine.getCompletions(seamProject, file,
documentContent, prefix, offset + proposalPrefix.length() - prefix.length(), false,
vars);
+
+ //TODO
+
+ List<String> suggestions = fEngine.getCompletions(seamProject, file, document,
prefix, offset + proposalPrefix.length() - prefix.length(), false, vars, start, end);
List<String> uniqueSuggestions = fEngine.makeUnique(suggestions);
List<ICompletionProposal> result= new ArrayList<ICompletionProposal>();