From 43b58bd706432116e2d1a65467479580f8dc0823 Mon Sep 17 00:00:00 2001 From: "Liana.Bakradze" Date: Mon, 12 Dec 2016 18:21:52 +0300 Subject: [PATCH] handle src dir correctly in project view --- .../edu/learning/projectView/CourseDirectoryNode.java | 7 ++++++- .../edu/learning/projectView/TaskDirectoryNode.java | 2 +- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/python/educational-core/student/src/com/jetbrains/edu/learning/projectView/CourseDirectoryNode.java b/python/educational-core/student/src/com/jetbrains/edu/learning/projectView/CourseDirectoryNode.java index 2e093c95009a..b10e5e73fba4 100644 --- a/python/educational-core/student/src/com/jetbrains/edu/learning/projectView/CourseDirectoryNode.java +++ b/python/educational-core/student/src/com/jetbrains/edu/learning/projectView/CourseDirectoryNode.java @@ -59,7 +59,12 @@ public class CourseDirectoryNode extends StudyDirectoryNode { if (lessons.size() == 1) { final List tasks = lesson.getTaskList(); if (tasks.size() == 1) { - return new TaskDirectoryNode(myProject, (PsiDirectory)directory.getChildren()[0], myViewSettings, tasks.get(0)); + PsiDirectory taskDirectory = (PsiDirectory)directory.getChildren()[0]; + PsiDirectory srcDir = taskDirectory.findSubdirectory(EduNames.SRC); + if (srcDir != null) { + taskDirectory = srcDir; + } + return new TaskDirectoryNode(myProject, taskDirectory, myViewSettings, tasks.get(0)); } } return new LessonDirectoryNode(myProject, directory, myViewSettings, lesson); diff --git a/python/educational-core/student/src/com/jetbrains/edu/learning/projectView/TaskDirectoryNode.java b/python/educational-core/student/src/com/jetbrains/edu/learning/projectView/TaskDirectoryNode.java index 4957ba30c1f6..abfe3e43a587 100644 --- a/python/educational-core/student/src/com/jetbrains/edu/learning/projectView/TaskDirectoryNode.java +++ b/python/educational-core/student/src/com/jetbrains/edu/learning/projectView/TaskDirectoryNode.java @@ -81,7 +81,7 @@ public class TaskDirectoryNode extends StudyDirectoryNode { @Override public AbstractTreeNode modifyChildNode(AbstractTreeNode childNode) { Object value = childNode.getValue(); - if (value instanceof PsiDirectory) { + if (value instanceof PsiDirectory && !((PsiDirectory)value).getName().equals(EduNames.SRC)) { return createChildDirectoryNode(null, (PsiDirectory)value); } if (value instanceof PsiElement) {