use of org.eclipse.titan.designer.declarationsearch.IdentifierFinderVisitor in project titan.EclipsePlug-ins by eclipse.
the class RenameRefactoring method findOccurrencesLocationBased.
/**
* Finds the occurrences of the element located on the given offset.
* This search is based on the {@link ASTLocationChainVisitor}.
*
* @param module
* The module to search the occurrences in
* @param offset
* An offset in the module
* @return The referencefinder
*/
protected static ReferenceFinder findOccurrencesLocationBased(final Module module, final int offset) {
final IdentifierFinderVisitor visitor = new IdentifierFinderVisitor(offset);
module.accept(visitor);
// It works for fields as well
final Declaration def = visitor.getReferencedDeclaration();
if (def == null || !def.shouldMarkOccurrences()) {
return null;
}
return def.getReferenceFinder(module);
}
Aggregations