// The position is after the last dot, check for enum constants
if (position > lastDotIndex) {
// Retrieve the enum type if the path up to the last dot is a fully qualified enum type
String enumType = expression.toParsedText().substring(0, lastDotIndex);
IType type = queryContext.getType(enumType);
// The path expression before the last dot is an enum type
if (type.isResolvable() && type.isEnum()) {
enumConstant = true;
// Now retrieve the portion of the enum constant based on the cursor position
String word = text.substring(lastDotIndex + 1, position);