From 8f54dc12f571740556a21dcaf38d8ea424cf7fb9 Mon Sep 17 00:00:00 2001 From: Valerii Date: Mon, 18 Dec 2023 11:38:13 +0100 Subject: [PATCH] add packages --- .../{ => jetbrains/plugindev/course/access}/Main.kt | 2 ++ .../psi/Accessing PSI Elements/task-info.yaml | 2 +- .../{ => jetbrains/plugindev/course/addpsi}/Task.kt | 7 +++++-- courseSection/psi/addPSI/task-info.yaml | 4 ++-- .../{ => jetbrains/plugindev/course/addpsi}/Tests.kt | 3 ++- .../jetbrains/plugindev/course/classcounter}/Task.kt | 2 ++ courseSection/psi/classCounter/task-info.yaml | 10 ++++++++++ .../jetbrains/plugindev/course/classcounter}/Tests.kt | 2 ++ .../{ => jetbrains/plugindev/course/editpsi}/Task.kt | 2 ++ courseSection/psi/editPSI/task-info.yaml | 4 ++-- .../{ => jetbrains/plugindev/course/editpsi}/Tests.kt | 2 ++ courseSection/psi/lesson-info.yaml | 2 +- 12 files changed, 33 insertions(+), 9 deletions(-) rename courseSection/psi/Accessing PSI Elements/src/{ => jetbrains/plugindev/course/access}/Main.kt (52%) rename courseSection/psi/addPSI/src/{ => jetbrains/plugindev/course/addpsi}/Task.kt (96%) rename courseSection/psi/addPSI/test/{ => jetbrains/plugindev/course/addpsi}/Tests.kt (97%) rename courseSection/psi/{Count number of classes/src => classCounter/src/jetbrains/plugindev/course/classcounter}/Task.kt (83%) create mode 100644 courseSection/psi/classCounter/task-info.yaml rename courseSection/psi/{Count number of classes/test => classCounter/test/jetbrains/plugindev/course/classcounter}/Tests.kt (89%) rename courseSection/psi/editPSI/src/{ => jetbrains/plugindev/course/editpsi}/Task.kt (93%) rename courseSection/psi/editPSI/test/{ => jetbrains/plugindev/course/editpsi}/Tests.kt (94%) diff --git a/courseSection/psi/Accessing PSI Elements/src/Main.kt b/courseSection/psi/Accessing PSI Elements/src/jetbrains/plugindev/course/access/Main.kt similarity index 52% rename from courseSection/psi/Accessing PSI Elements/src/Main.kt rename to courseSection/psi/Accessing PSI Elements/src/jetbrains/plugindev/course/access/Main.kt index 2d5aa02..5af6e4c 100644 --- a/courseSection/psi/Accessing PSI Elements/src/Main.kt +++ b/courseSection/psi/Accessing PSI Elements/src/jetbrains/plugindev/course/access/Main.kt @@ -1,3 +1,5 @@ +package jetbrains.plugindev.course.access + fun main() { // Write your solution here } diff --git a/courseSection/psi/Accessing PSI Elements/task-info.yaml b/courseSection/psi/Accessing PSI Elements/task-info.yaml index cc8f611..49a98d6 100644 --- a/courseSection/psi/Accessing PSI Elements/task-info.yaml +++ b/courseSection/psi/Accessing PSI Elements/task-info.yaml @@ -1,4 +1,4 @@ type: theory files: - - name: src/Main.kt + - name: src/jetbrains/plugindev/course/access/Main.kt visible: true diff --git a/courseSection/psi/addPSI/src/Task.kt b/courseSection/psi/addPSI/src/jetbrains/plugindev/course/addpsi/Task.kt similarity index 96% rename from courseSection/psi/addPSI/src/Task.kt rename to courseSection/psi/addPSI/src/jetbrains/plugindev/course/addpsi/Task.kt index 4a2d58c..7265ff7 100644 --- a/courseSection/psi/addPSI/src/Task.kt +++ b/courseSection/psi/addPSI/src/jetbrains/plugindev/course/addpsi/Task.kt @@ -1,3 +1,5 @@ +package jetbrains.plugindev.course.addpsi + import com.intellij.openapi.command.WriteCommandAction import com.intellij.openapi.project.Project import com.intellij.psi.JavaPsiFacade @@ -60,12 +62,13 @@ private fun shouldAddOverrideAnnotation(psiMethod: PsiMethod): Boolean { for (superMethod in superMethods) { if (superMethod.name == methodName && superMethod.parameterList.parameters.map { it.type } == parameterTypes - && isReturnTypeCompatible(superMethod.returnType, psiMethod.returnType)) { + && isReturnTypeCompatible(superMethod.returnType, psiMethod.returnType) + ) { return true } } } - return false; + return false } private fun isReturnTypeCompatible(superReturnType: PsiType?, subReturnType: PsiType?): Boolean { diff --git a/courseSection/psi/addPSI/task-info.yaml b/courseSection/psi/addPSI/task-info.yaml index 3fe721d..6927d9a 100644 --- a/courseSection/psi/addPSI/task-info.yaml +++ b/courseSection/psi/addPSI/task-info.yaml @@ -1,6 +1,6 @@ type: edu files: - - name: src/Task.kt + - name: src/jetbrains/plugindev/course/addpsi/Task.kt visible: true - - name: test/Tests.kt + - name: test/jetbrains/plugindev/course/addpsi/Tests.kt visible: false diff --git a/courseSection/psi/addPSI/test/Tests.kt b/courseSection/psi/addPSI/test/jetbrains/plugindev/course/addpsi/Tests.kt similarity index 97% rename from courseSection/psi/addPSI/test/Tests.kt rename to courseSection/psi/addPSI/test/jetbrains/plugindev/course/addpsi/Tests.kt index 53938f5..c5b7fff 100644 --- a/courseSection/psi/addPSI/test/Tests.kt +++ b/courseSection/psi/addPSI/test/jetbrains/plugindev/course/addpsi/Tests.kt @@ -1,9 +1,10 @@ +package jetbrains.plugindev.course.addpsi + import com.intellij.ide.highlighter.JavaFileType import com.intellij.psi.PsiClass import com.intellij.psi.PsiMethod import com.intellij.psi.util.PsiTreeUtil import com.intellij.testFramework.fixtures.BasePlatformTestCase -import junit.framework.TestCase import org.jetbrains.kotlin.psi.KtClass import org.jetbrains.kotlin.psi.KtNamedFunction diff --git a/courseSection/psi/Count number of classes/src/Task.kt b/courseSection/psi/classCounter/src/jetbrains/plugindev/course/classcounter/Task.kt similarity index 83% rename from courseSection/psi/Count number of classes/src/Task.kt rename to courseSection/psi/classCounter/src/jetbrains/plugindev/course/classcounter/Task.kt index 09ab51e..3ec0236 100644 --- a/courseSection/psi/Count number of classes/src/Task.kt +++ b/courseSection/psi/classCounter/src/jetbrains/plugindev/course/classcounter/Task.kt @@ -1,3 +1,5 @@ +package jetbrains.plugindev.course.classcounter + import com.intellij.psi.PsiFile import com.intellij.psi.util.PsiTreeUtil import org.jetbrains.kotlin.psi.KtClass diff --git a/courseSection/psi/classCounter/task-info.yaml b/courseSection/psi/classCounter/task-info.yaml new file mode 100644 index 0000000..2736283 --- /dev/null +++ b/courseSection/psi/classCounter/task-info.yaml @@ -0,0 +1,10 @@ +type: edu +files: + - name: src/jetbrains/plugindev/course/classcounter/Task.kt + visible: true + placeholders: + - offset: 160 + length: 85 + placeholder_text: TODO() + - name: test/jetbrains/plugindev/course/classcounter/Tests.kt + visible: false diff --git a/courseSection/psi/Count number of classes/test/Tests.kt b/courseSection/psi/classCounter/test/jetbrains/plugindev/course/classcounter/Tests.kt similarity index 89% rename from courseSection/psi/Count number of classes/test/Tests.kt rename to courseSection/psi/classCounter/test/jetbrains/plugindev/course/classcounter/Tests.kt index 060787c..9b1ad89 100644 --- a/courseSection/psi/Count number of classes/test/Tests.kt +++ b/courseSection/psi/classCounter/test/jetbrains/plugindev/course/classcounter/Tests.kt @@ -1,3 +1,5 @@ +package jetbrains.plugindev.course.classcounter + import com.intellij.testFramework.fixtures.BasePlatformTestCase class Test : BasePlatformTestCase() { diff --git a/courseSection/psi/editPSI/src/Task.kt b/courseSection/psi/editPSI/src/jetbrains/plugindev/course/editpsi/Task.kt similarity index 93% rename from courseSection/psi/editPSI/src/Task.kt rename to courseSection/psi/editPSI/src/jetbrains/plugindev/course/editpsi/Task.kt index 7794366..357abf5 100644 --- a/courseSection/psi/editPSI/src/Task.kt +++ b/courseSection/psi/editPSI/src/jetbrains/plugindev/course/editpsi/Task.kt @@ -1,3 +1,5 @@ +package jetbrains.plugindev.course.editpsi + import com.intellij.openapi.command.WriteCommandAction import com.intellij.psi.PsiFile import com.intellij.psi.util.PsiTreeUtil diff --git a/courseSection/psi/editPSI/task-info.yaml b/courseSection/psi/editPSI/task-info.yaml index 3fe721d..f551a04 100644 --- a/courseSection/psi/editPSI/task-info.yaml +++ b/courseSection/psi/editPSI/task-info.yaml @@ -1,6 +1,6 @@ type: edu files: - - name: src/Task.kt + - name: src/jetbrains/plugindev/course/editpsi/Task.kt visible: true - - name: test/Tests.kt + - name: test/jetbrains/plugindev/course/editpsi/Tests.kt visible: false diff --git a/courseSection/psi/editPSI/test/Tests.kt b/courseSection/psi/editPSI/test/jetbrains/plugindev/course/editpsi/Tests.kt similarity index 94% rename from courseSection/psi/editPSI/test/Tests.kt rename to courseSection/psi/editPSI/test/jetbrains/plugindev/course/editpsi/Tests.kt index ad304c4..9cf7146 100644 --- a/courseSection/psi/editPSI/test/Tests.kt +++ b/courseSection/psi/editPSI/test/jetbrains/plugindev/course/editpsi/Tests.kt @@ -1,3 +1,5 @@ +package jetbrains.plugindev.course.editpsi + import com.intellij.psi.util.PsiTreeUtil import com.intellij.testFramework.fixtures.BasePlatformTestCase import org.jetbrains.kotlin.psi.KtNamedFunction diff --git a/courseSection/psi/lesson-info.yaml b/courseSection/psi/lesson-info.yaml index c1a9433..d2cfc68 100644 --- a/courseSection/psi/lesson-info.yaml +++ b/courseSection/psi/lesson-info.yaml @@ -3,6 +3,6 @@ content: - What is PSI - Try PSI Viewer - Accessing PSI Elements - - Count number of classes + - classCounter - editPSI - addPSI