From 6e243dfb1aba0ff6d2b6ab4ee5ea8b206b0a8afd Mon Sep 17 00:00:00 2001 From: Valentina Kiryushkina Date: Tue, 17 Jan 2017 12:45:40 +0300 Subject: [PATCH] EDU-848 Remove unnecessary check if product is pycharm --- .../PyStudyLanguageLevelInspection.kt | 20 ++++++++----------- 1 file changed, 8 insertions(+), 12 deletions(-) diff --git a/python/educational-python/student-python/src/com/jetbrains/edu/learning/PyStudyLanguageLevelInspection.kt b/python/educational-python/student-python/src/com/jetbrains/edu/learning/PyStudyLanguageLevelInspection.kt index ef06c60fe782..5eb491ae5cb7 100644 --- a/python/educational-python/student-python/src/com/jetbrains/edu/learning/PyStudyLanguageLevelInspection.kt +++ b/python/educational-python/student-python/src/com/jetbrains/edu/learning/PyStudyLanguageLevelInspection.kt @@ -11,7 +11,6 @@ import com.intellij.openapi.project.Project import com.intellij.openapi.project.ProjectUtil import com.intellij.psi.PsiElementVisitor import com.intellij.psi.util.PsiUtilCore -import com.intellij.util.PlatformUtils import com.jetbrains.edu.learning.courseFormat.Course import com.jetbrains.python.inspections.PyInspection import com.jetbrains.python.inspections.PyInspectionVisitor @@ -37,17 +36,14 @@ class PyStudyLanguageLevelInspection : PyInspection() { override fun visitPyFile(node: PyFile) { super.visitPyFile(node) - - if (PlatformUtils.isPyCharm()) { - val module = ModuleUtilCore.findModuleForPsiElement(node) - val virtualFile = PsiUtilCore.getVirtualFile(node) - if (module != null && virtualFile != null) { - val sdk = PythonSdkType.findPythonSdk(module) - val projectLanguageLevel = PythonSdkType.getLanguageLevelForSdk(sdk) - val project = ProjectUtil.guessProjectForContentFile(node.virtualFile) ?: return - val course = StudyTaskManager.getInstance(project).course ?: return - checkIfLanguageLevelSupported(course, projectLanguageLevel, node) - } + val module = ModuleUtilCore.findModuleForPsiElement(node) + val virtualFile = PsiUtilCore.getVirtualFile(node) + if (module != null && virtualFile != null) { + val sdk = PythonSdkType.findPythonSdk(module) + val projectLanguageLevel = PythonSdkType.getLanguageLevelForSdk(sdk) + val project = ProjectUtil.guessProjectForContentFile(node.virtualFile) ?: return + val course = StudyTaskManager.getInstance(project).course ?: return + checkIfLanguageLevelSupported(course, projectLanguageLevel, node) } }