Skip to content

Commit

Permalink
add packages
Browse files Browse the repository at this point in the history
  • Loading branch information
Valerii committed Dec 18, 2023
1 parent c2e562c commit 8f54dc1
Show file tree
Hide file tree
Showing 12 changed files with 33 additions and 9 deletions.
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
package jetbrains.plugindev.course.access

fun main() {
// Write your solution here
}
2 changes: 1 addition & 1 deletion courseSection/psi/Accessing PSI Elements/task-info.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
type: theory
files:
- name: src/Main.kt
- name: src/jetbrains/plugindev/course/access/Main.kt
visible: true
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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 {
Expand Down
4 changes: 2 additions & 2 deletions courseSection/psi/addPSI/task-info.yaml
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -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

Expand Down
Original file line number Diff line number Diff line change
@@ -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
Expand Down
10 changes: 10 additions & 0 deletions courseSection/psi/classCounter/task-info.yaml
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
package jetbrains.plugindev.course.classcounter

import com.intellij.testFramework.fixtures.BasePlatformTestCase

class Test : BasePlatformTestCase() {
Expand Down
Original file line number Diff line number Diff line change
@@ -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
Expand Down
4 changes: 2 additions & 2 deletions courseSection/psi/editPSI/task-info.yaml
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -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
Expand Down
2 changes: 1 addition & 1 deletion courseSection/psi/lesson-info.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@ content:
- What is PSI
- Try PSI Viewer
- Accessing PSI Elements
- Count number of classes
- classCounter
- editPSI
- addPSI

0 comments on commit 8f54dc1

Please sign in to comment.