From 15f89c35e2bc4ae2c20604dc029d64f45b024477 Mon Sep 17 00:00:00 2001 From: David Meybohm Date: Mon, 14 Dec 2020 11:06:35 -0500 Subject: [PATCH 1/3] Update version --- build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.gradle b/build.gradle index 3943308c..f73930aa 100644 --- a/build.gradle +++ b/build.gradle @@ -5,7 +5,7 @@ plugins { } group 'com.daveme.chocolateCakePHP' -version '0.6.2' +version '0.6.3' sourceCompatibility = 1.8 From 95d03820870b0f3421acfe2a1707009dac73854b Mon Sep 17 00:00:00 2001 From: David Meybohm Date: Mon, 14 Dec 2020 11:14:01 -0500 Subject: [PATCH 2/3] Fix types --- .../kotlin/controller/ControllerMethodLineMarker.kt | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/main/kotlin/controller/ControllerMethodLineMarker.kt b/src/main/kotlin/controller/ControllerMethodLineMarker.kt index 84b719ec..c9bd59dc 100644 --- a/src/main/kotlin/controller/ControllerMethodLineMarker.kt +++ b/src/main/kotlin/controller/ControllerMethodLineMarker.kt @@ -13,7 +13,7 @@ class ControllerMethodLineMarker : LineMarkerProvider { override fun getLineMarkerInfo(psiElement: PsiElement): LineMarkerInfo<*>? = null - private fun getRelatedFiles(file: PsiFile, controllerName: String, element: PsiElement): LineMarkerInfo<*>? { + private fun getRelatedFiles(file: PsiFile, controllerName: String, element: PsiElement): LineMarkerInfo? { if (element !is Method) { return null } @@ -36,7 +36,10 @@ class ControllerMethodLineMarker : LineMarkerProvider { .createLineMarkerInfo(nameIdentifier) } - private fun addLineMarkerUnique(collection: MutableCollection>, newMarker: LineMarkerInfo<*>?) { + private fun addLineMarkerUnique( + collection: MutableCollection>, + newMarker: LineMarkerInfo? + ) { if (newMarker == null) { return } @@ -52,8 +55,8 @@ class ControllerMethodLineMarker : LineMarkerProvider { } override fun collectSlowLineMarkers( - list: MutableList, - collection: MutableCollection> + list: List, + collection: MutableCollection> ) { for (element in list) { val settings = Settings.getInstance(element.project) From 2ee9c22c0052bb15190e900d72859f44d0d14741 Mon Sep 17 00:00:00 2001 From: David Meybohm Date: Mon, 14 Dec 2020 11:28:14 -0500 Subject: [PATCH 3/3] Eh...types are different in PhpStorm 2020.2 for some reason --- .../controller/ControllerMethodLineMarker.kt | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/src/main/kotlin/controller/ControllerMethodLineMarker.kt b/src/main/kotlin/controller/ControllerMethodLineMarker.kt index c9bd59dc..d1c68264 100644 --- a/src/main/kotlin/controller/ControllerMethodLineMarker.kt +++ b/src/main/kotlin/controller/ControllerMethodLineMarker.kt @@ -13,7 +13,7 @@ class ControllerMethodLineMarker : LineMarkerProvider { override fun getLineMarkerInfo(psiElement: PsiElement): LineMarkerInfo<*>? = null - private fun getRelatedFiles(file: PsiFile, controllerName: String, element: PsiElement): LineMarkerInfo? { + private fun getRelatedFiles(file: PsiFile, controllerName: String, element: PsiElement): LineMarkerInfo<*>? { if (element !is Method) { return null } @@ -37,8 +37,8 @@ class ControllerMethodLineMarker : LineMarkerProvider { } private fun addLineMarkerUnique( - collection: MutableCollection>, - newMarker: LineMarkerInfo? + collection: MutableCollection>, + newMarker: LineMarkerInfo<*>? ) { if (newMarker == null) { return @@ -55,10 +55,10 @@ class ControllerMethodLineMarker : LineMarkerProvider { } override fun collectSlowLineMarkers( - list: List, - collection: MutableCollection> + elements: MutableList, + result: MutableCollection> ) { - for (element in list) { + for (element in elements) { val settings = Settings.getInstance(element.project) if (!settings.enabled) { return @@ -67,7 +67,8 @@ class ControllerMethodLineMarker : LineMarkerProvider { val virtualFile = file.virtualFile ?: continue val controllerName = virtualFile.nameWithoutExtension.controllerBaseName() ?: continue val info = getRelatedFiles(file, controllerName, element) - addLineMarkerUnique(collection, info) + addLineMarkerUnique(result, info) } } + }