Tuple2<String, String> nameAndLocation(Locatable locatable)

Returns colon-stripped name and location of the given locatable.

Source

static Tuple2<String, String> nameAndLocation(Locatable locatable) {
  String locatableName = '<unknown>';
  String locatableLocation = '';
  if (locatable != null) {
    locatableName = locatable.fullyQualifiedName.replaceFirst(':', '-');
    locatableLocation = locatable.elementLocation;
  }
  return new Tuple2(locatableName, locatableLocation);
}