Skip to content

Commit

Permalink
change packets names
Browse files Browse the repository at this point in the history
  • Loading branch information
Valerii committed Jan 9, 2024
1 parent 33de2c3 commit 5e59fab
Show file tree
Hide file tree
Showing 33 changed files with 57 additions and 56 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package jetbrains.academy.plugin.course.dev.access
package org.jetbrains.academy.plugin.course.dev.access

import com.intellij.openapi.command.WriteCommandAction
import com.intellij.openapi.project.Project
Expand All @@ -19,8 +19,8 @@ fun addAnnotations(psiFile: PsiFile){
val psiMethods = PsiTreeUtil.findChildrenOfType(psiFile, PsiMethod::class.java)

for (psiMethod in psiMethods) {
if (jetbrains.academy.plugin.course.dev.access.shouldAddOverrideAnnotation(psiMethod)) {
jetbrains.academy.plugin.course.dev.access.addOverrideAnnotation(psiMethod, project)
if (shouldAddOverrideAnnotation(psiMethod)) {
addOverrideAnnotation(psiMethod, project)
}
}
}
Expand All @@ -39,7 +39,7 @@ private fun shouldAddOverrideAnnotation(psiMethod: PsiMethod): Boolean {
for (superMethod in superMethods) {
if (superMethod.name == methodName
&& superMethod.parameterList.parameters.map { it.type } == parameterTypes
&& jetbrains.academy.plugin.course.dev.access.isReturnTypeCompatible(
&& isReturnTypeCompatible(
superMethod.returnType,
psiMethod.returnType
)
Expand All @@ -54,4 +54,4 @@ private fun shouldAddOverrideAnnotation(psiMethod: PsiMethod): Boolean {
private fun isReturnTypeCompatible(superReturnType: PsiType?, subReturnType: PsiType?): Boolean {
if (superReturnType == null || subReturnType == null) return false
return TypeConversionUtil.isAssignable(superReturnType, subReturnType)
}
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package jetbrains.academy.plugin.course.dev.access
package org.jetbrains.academy.plugin.course.dev.access

import com.intellij.psi.PsiFile

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package jetbrains.academy.plugin.course.dev.access
package org.jetbrains.academy.plugin.course.dev.access

import org.jetbrains.kotlin.psi.KtNamedFunction

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package jetbrains.academy.plugin.course.dev.access
package org.jetbrains.academy.plugin.course.dev.access

import org.jetbrains.kotlin.psi.KtClass

Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
type: theory
custom_name: How to Access PSI Elements
files:
- name: src/main/kotlin/jetbrains/academy/plugin/course/dev/access/ElementsCounter.kt
- name: src/main/kotlin/org/jetbrains/academy/plugin/course/dev/access/AnnotationBuilder.kt
visible: true
- name: src/main/kotlin/jetbrains/academy/plugin/course/dev/access/AnnotationBuilder.kt
- name: src/main/kotlin/org/jetbrains/academy/plugin/course/dev/access/ElementsCounter.kt
visible: true
- name: src/main/kotlin/jetbrains/academy/plugin/course/dev/access/FunctionNameChanger.kt
- name: src/main/kotlin/org/jetbrains/academy/plugin/course/dev/access/FunctionNameChanger.kt
visible: true
- name: src/main/kotlin/jetbrains/academy/plugin/course/dev/access/PsiElementsSorter.kt
- name: src/main/kotlin/org/jetbrains/academy/plugin/course/dev/access/PsiElementsSorter.kt
visible: true
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package jetbrains.academy.plugin.course.dev.access
package org.jetbrains.academy.plugin.course.dev.access

import com.intellij.openapi.command.WriteCommandAction
import com.intellij.openapi.project.Project
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package jetbrains.academy.plugin.course.dev.access
package org.jetbrains.academy.plugin.course.dev.access

import com.intellij.psi.PsiFile
import com.intellij.psi.util.PsiTreeUtil
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package jetbrains.academy.plugin.course.dev.access
package org.jetbrains.academy.plugin.course.dev.access

import com.intellij.openapi.command.WriteCommandAction
import org.jetbrains.kotlin.psi.KtNamedFunction
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package jetbrains.academy.plugin.course.dev.access
package org.jetbrains.academy.plugin.course.dev.access

import com.intellij.openapi.command.WriteCommandAction
import com.intellij.psi.PsiFile
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
type: edu
custom_name: Psi Manipulation Advanced
files:
- name: src/main/kotlin/jetbrains/academy/plugin/course/dev/access/AnnotationBuilder.kt
visible: true
- name: test/Tests.kt
visible: false
- name: src/main/kotlin/jetbrains/academy/plugin/course/dev/access/ElementsCounter.kt
- name: src/main/kotlin/org/jetbrains/academy/plugin/course/dev/access/AnnotationBuilder.kt
visible: true
- name: src/main/kotlin/org/jetbrains/academy/plugin/course/dev/access/ElementsCounter.kt
visible: true
- name: src/main/kotlin/jetbrains/academy/plugin/course/dev/access/FunctionNameChanger.kt
- name: src/main/kotlin/org/jetbrains/academy/plugin/course/dev/access/FunctionNameChanger.kt
visible: true
- name: src/main/kotlin/jetbrains/academy/plugin/course/dev/access/PsiElementsSorter.kt
- name: src/main/kotlin/org/jetbrains/academy/plugin/course/dev/access/PsiElementsSorter.kt
visible: true
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import com.intellij.psi.PsiClass
import com.intellij.psi.PsiMethod
import com.intellij.psi.util.PsiTreeUtil
import com.intellij.testFramework.fixtures.BasePlatformTestCase
import jetbrains.academy.plugin.course.dev.access.addAnnotations
import org.jetbrains.academy.plugin.course.dev.access.addAnnotations

class Test : BasePlatformTestCase() {

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package jetbrains.academy.plugin.course.dev.access
package org.jetbrains.academy.plugin.course.dev.access

import com.intellij.openapi.command.WriteCommandAction
import com.intellij.openapi.project.Project
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package jetbrains.academy.plugin.course.dev.access
package org.jetbrains.academy.plugin.course.dev.access

import com.intellij.psi.PsiFile
import com.intellij.psi.util.PsiTreeUtil
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package jetbrains.academy.plugin.course.dev.access
package org.jetbrains.academy.plugin.course.dev.access

import org.jetbrains.kotlin.psi.KtNamedFunction

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package jetbrains.academy.plugin.course.dev.access
package org.jetbrains.academy.plugin.course.dev.access

import org.jetbrains.kotlin.psi.KtClass

Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
type: edu
custom_name: Count number of classes
files:
- name: src/main/kotlin/jetbrains/academy/plugin/course/dev/access/ElementsCounter.kt
visible: true
- name: test/Tests.kt
visible: false
- name: src/main/kotlin/jetbrains/academy/plugin/course/dev/access/AnnotationBuilder.kt
- name: src/main/kotlin/org/jetbrains/academy/plugin/course/dev/access/AnnotationBuilder.kt
visible: true
- name: src/main/kotlin/org/jetbrains/academy/plugin/course/dev/access/ElementsCounter.kt
visible: true
- name: src/main/kotlin/jetbrains/academy/plugin/course/dev/access/FunctionNameChanger.kt
- name: src/main/kotlin/org/jetbrains/academy/plugin/course/dev/access/FunctionNameChanger.kt
visible: true
- name: src/main/kotlin/jetbrains/academy/plugin/course/dev/access/PsiElementsSorter.kt
- name: src/main/kotlin/org/jetbrains/academy/plugin/course/dev/access/PsiElementsSorter.kt
visible: true
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import com.intellij.testFramework.fixtures.BasePlatformTestCase
import jetbrains.academy.plugin.course.dev.access.countKtClasses
import org.jetbrains.academy.plugin.course.dev.access.countKtClasses

class Test : BasePlatformTestCase() {

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package jetbrains.academy.plugin.course.dev.access
package org.jetbrains.academy.plugin.course.dev.access

import com.intellij.openapi.command.WriteCommandAction
import com.intellij.openapi.project.Project
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package jetbrains.academy.plugin.course.dev.access
package org.jetbrains.academy.plugin.course.dev.access

import com.intellij.psi.PsiFile
import com.intellij.psi.util.PsiTreeUtil
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package jetbrains.academy.plugin.course.dev.access
package org.jetbrains.academy.plugin.course.dev.access

import com.intellij.openapi.command.WriteCommandAction
import org.jetbrains.kotlin.psi.KtNamedFunction
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package jetbrains.academy.plugin.course.dev.access
package org.jetbrains.academy.plugin.course.dev.access

import org.jetbrains.kotlin.psi.KtClass

Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
type: edu
custom_name: Rename function using PSI
files:
- name: src/main/kotlin/jetbrains/academy/plugin/course/dev/access/FunctionNameChanger.kt
visible: true
- name: test/Tests.kt
visible: false
- name: src/main/kotlin/jetbrains/academy/plugin/course/dev/access/AnnotationBuilder.kt
- name: src/main/kotlin/org/jetbrains/academy/plugin/course/dev/access/AnnotationBuilder.kt
visible: true
- name: src/main/kotlin/org/jetbrains/academy/plugin/course/dev/access/ElementsCounter.kt
visible: true
- name: src/main/kotlin/jetbrains/academy/plugin/course/dev/access/ElementsCounter.kt
- name: src/main/kotlin/org/jetbrains/academy/plugin/course/dev/access/FunctionNameChanger.kt
visible: true
- name: src/main/kotlin/jetbrains/academy/plugin/course/dev/access/PsiElementsSorter.kt
- name: src/main/kotlin/org/jetbrains/academy/plugin/course/dev/access/PsiElementsSorter.kt
visible: true
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import com.intellij.psi.util.PsiTreeUtil
import com.intellij.testFramework.fixtures.BasePlatformTestCase
import jetbrains.academy.plugin.course.dev.access.editFunctionName
import org.jetbrains.academy.plugin.course.dev.access.editFunctionName
import org.jetbrains.kotlin.psi.KtNamedFunction
class Test : BasePlatformTestCase() {

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package jetbrains.academy.plugin.course.dev.access
package org.jetbrains.academy.plugin.course.dev.access

import com.intellij.openapi.command.WriteCommandAction
import com.intellij.openapi.project.Project
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package jetbrains.academy.plugin.course.dev.access
package org.jetbrains.academy.plugin.course.dev.access

import com.intellij.psi.PsiFile
import com.intellij.psi.util.PsiTreeUtil
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package jetbrains.academy.plugin.course.dev.access
package org.jetbrains.academy.plugin.course.dev.access

import com.intellij.openapi.command.WriteCommandAction
import org.jetbrains.kotlin.psi.KtNamedFunction
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package jetbrains.academy.plugin.course.dev.access
package org.jetbrains.academy.plugin.course.dev.access

import com.intellij.openapi.command.WriteCommandAction
import com.intellij.psi.PsiFile
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
type: edu
custom_name: Psi Manipulation Basics
files:
- name: src/main/kotlin/jetbrains/academy/plugin/course/dev/access/PsiElementsSorter.kt
visible: true
- name: test/Tests.kt
visible: false
- name: src/main/kotlin/jetbrains/academy/plugin/course/dev/access/AnnotationBuilder.kt
- name: src/main/kotlin/org/jetbrains/academy/plugin/course/dev/access/AnnotationBuilder.kt
visible: true
- name: src/main/kotlin/org/jetbrains/academy/plugin/course/dev/access/ElementsCounter.kt
visible: true
- name: src/main/kotlin/jetbrains/academy/plugin/course/dev/access/ElementsCounter.kt
- name: src/main/kotlin/org/jetbrains/academy/plugin/course/dev/access/FunctionNameChanger.kt
visible: true
- name: src/main/kotlin/jetbrains/academy/plugin/course/dev/access/FunctionNameChanger.kt
- name: src/main/kotlin/org/jetbrains/academy/plugin/course/dev/access/PsiElementsSorter.kt
visible: true
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import com.intellij.psi.util.PsiTreeUtil
import com.intellij.testFramework.fixtures.BasePlatformTestCase
import jetbrains.academy.plugin.course.dev.access.sortMethods
import org.jetbrains.academy.plugin.course.dev.access.sortMethods
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,4 +1,4 @@
package jetbrains.academy.plugind.course.dev.intro
package org.jetbrains.academy.plugin.course.dev.intro

class Person(private val name: String, private val age: Int) {

Expand Down
2 changes: 1 addition & 1 deletion courseSection/psi/IntroToPsi/task-info.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
type: theory
custom_name: What is PSI?
files:
- name: src/main/kotlin/jetbrains/academy/plugind/course/dev/intro/Person.kt
- name: src/main/kotlin/org/jetbrains/academy/plugin/course/dev/intro/Person.kt
visible: true
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package jetbrains.academy.plugind.course.dev.intro
package org.jetbrains.academy.plugin.course.dev.intro

class Person(private val name: String, private val age: Int) {

Expand Down
3 changes: 2 additions & 1 deletion courseSection/psi/TryPsiViewer/task-info.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ options:
- text: org.jetbrains.kotlin.psi.KtNamedReferenceExpression
is_correct: true
files:
- name: src/main/kotlin/jetbrains/academy/plugind/course/dev/intro/Person.kt
- name: src/main/kotlin/org/jetbrains/academy/plugin/course/dev/intro/Person.kt
visible: true
custom_name: Try Psi Viewer
local_check: true

0 comments on commit 5e59fab

Please sign in to comment.