{
// get the current line of code
String line = docDisplay.getCurrentLine();
// get the cursor position
Position position = docDisplay.getCursorPosition();
// is there already a C++ identifier character at this position?
// if so then bail
if ((position.getColumn() < line.length()) &&
CppCompletionUtils.isCppIdentifierChar(
line.charAt(position.getColumn())))
{
return null;
}
// determine the column right before this one
int inputCol = position.getColumn() - 1;
// walk backwards across C++ identifer symbols
int col = inputCol;
while ((col >= 0) &&
CppCompletionUtils.isCppIdentifierChar(line.charAt(col)))
{
col--;
}
// record source position
Position startPos = Position.create(position.getRow(), col + 1);
// check for a completion triggering sequence
char ch = line.charAt(col);
char prefixCh = line.charAt(col - 1);