*/
public ICompletionProposal[] getTagProposals(IAssistState state) {
Set<Parameter> params = null;
if (state.getDataSoFar().toLowerCase().matches(".*?arguments\\.[\\w]*$")) {
CFDocument doc = ((ICFDocument) state.getIDocument()).getCFDocument();
// get a reference to the containing function
CfmlTagItem cti = getPreviousFunctionTag(state);
Function func = doc.getFunctionByName(cti.getAttributeValue("name"));
if (func != null) {
params = func.getParameters();
return prepareProposals(state, params);
} else {
return null;
}
} else {
try {
if (state.getIDocument().getPartition(state.getOffset()).getType().equals(CFPartitionScanner.CF_SCRIPT)) {
CFDocument doc = ((ICFDocument) state.getIDocument()).getCFDocument();
CFNodeList funknodes = doc.getDocumentRoot().selectNodes(
"//ASTFunctionDeclaration[#startpos<" + state.getOffset() + "]");
if (funknodes.size() > 0) {
FunctionInfo funknode = (FunctionInfo) funknodes.get(funknodes.size() - 1);
Function func = doc.getFunctionByName(funknode.getFunctionName());
if (func != null) {
params = func.getParameters();
return prepareProposals(state, params);
} else {
return null;