private static Pair <IT4File, IFile> GetFiles([NotNull] IPsiSourceFile sourceFile, DocumentRange documentRange) { IT4File primaryFile = null; IFile secondaryFile = null; foreach (IFile file in sourceFile.EnumeratePsiFiles(documentRange)) { var t4File = file as IT4File; if (t4File != null) { primaryFile = t4File; } else { secondaryFile = file; } } return(Pair.Of(primaryFile, secondaryFile)); }