<T extends EObject> T find(String text, int count, Class<T> type, List<SearchOption> options) {
int offset = protoAsText.indexOf(text);
String name = text.substring(0, count);
Iterator<AbstractNode> iterator = root.basicIterator();
while (iterator.hasNext()) {
AbstractNode node = iterator.next();
int nodeOffset = node.getOffset();
if (nodeOffset > offset || (nodeOffset + node.getLength()) <= offset) {
continue;
}
EObject e = node.getSemanticElement();
if (isDefaultValueFieldOption(name, type, e)) {
return type.cast(e);
}
if (type.isInstance(e)) {
if (areNamesEqual(name, e, options)) {