}
try {
String invoker = viewer.getDocument().get(documentOffset-1,1);
ICFDocument document = (ICFDocument) viewer.getDocument();
CFDocument doc = document.getCFDocument();
int start = document.getPartition(documentOffset).getOffset();
String scanData = document.get(start, documentOffset - start);
scanData = scanData.replace('\n',' '); // Eliminate any non-character characters
scanData = scanData.replace('\r',' '); // as this allows us to treat the buffer as
scanData = scanData.replace('\t',' '); // one long string
if (invoker.equals(" ")) {
return null;
}
if (!",".equals(invoker)
&& !"(".equals(invoker) && !"<".equals(invoker) && !".".equals(invoker)) {
String toBeMatched = extractPrefix(viewer,documentOffset).replaceAll("[\r\n\t]", " ").trim();
Set allPoss = SyntaxDictionary.limitSet(doc.getFunctions(), toBeMatched);
Set poss = SyntaxDictionary.limitSet(
DictionaryManager.getDictionary(DictionaryToUse).getAllFunctions(),
toBeMatched
);
Iterator it = poss.iterator();
while(it.hasNext())
{
allPoss.add(it.next());
}
ICompletionProposal[] funks = makeSetToProposal(allPoss, documentOffset, TAGTYPE, toBeMatched.length());
return funks;
}
//String originalData = scanData; // This should never be changed.
char lastChar = (scanData.length() > 0) ? scanData.charAt(scanData.length() - 1) : scanData.charAt(0);
// Gonna allow debug by entering the tilde character. Entering this will cause
// my debug function to run...
if(lastChar == '~')
{
DebugFunction(viewer, documentOffset);
}
int triggerPos = scanData.length()-1;
//int closerCharMatch = closerChars.indexOf(lastChar);
// First test to see whether the last two characters are "it"... if so then we'll
// quit out of this
if(lastChar == '\'' && document.getChar(documentOffset-1) == 't' &&
document.getChar(documentOffset-2) == 'i')
{
//System.out.println("hit IT");
return null;
}