public @Nullable TextRange getVariableRange(String variableName) {
    int segment = getTemplate().getVariableSegmentNumber(variableName);
    if (segment < 0) return null;

    return new TextRange(getSegments().getSegmentStart(segment), getSegments().getSegmentEnd(segment));
  }
public @Nullable TextRange getVariableRange(String variableName)