ModTemplateBuilder (@NotNull PsiElement element, @NotNull String varName, @NotNull String dependantVariableName, boolean alwaysStopAt) { TextRange elementRange = getRange(element); if (elementRange == null) { throw new IllegalStateException("Unable to restore element for template"); } TextRange range = mapRange(elementRange); myTemplateFields.add(new ModStartTemplate.DependantVariableField(range, varName, dependantVariableName, alwaysStopAt)); return this; }