Skip to content

Commit

Permalink
Eh...types are different in PhpStorm 2020.2 for some reason
Browse files Browse the repository at this point in the history
  • Loading branch information
dmeybohm committed Dec 14, 2020
1 parent 95d0382 commit 2ee9c22
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions src/main/kotlin/controller/ControllerMethodLineMarker.kt
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ class ControllerMethodLineMarker : LineMarkerProvider {

override fun getLineMarkerInfo(psiElement: PsiElement): LineMarkerInfo<*>? = null

private fun getRelatedFiles(file: PsiFile, controllerName: String, element: PsiElement): LineMarkerInfo<PsiElement>? {
private fun getRelatedFiles(file: PsiFile, controllerName: String, element: PsiElement): LineMarkerInfo<*>? {
if (element !is Method) {
return null
}
Expand All @@ -37,8 +37,8 @@ class ControllerMethodLineMarker : LineMarkerProvider {
}

private fun addLineMarkerUnique(
collection: MutableCollection<LineMarkerInfo<PsiElement>>,
newMarker: LineMarkerInfo<PsiElement>?
collection: MutableCollection<LineMarkerInfo<*>>,
newMarker: LineMarkerInfo<*>?
) {
if (newMarker == null) {
return
Expand All @@ -55,10 +55,10 @@ class ControllerMethodLineMarker : LineMarkerProvider {
}

override fun collectSlowLineMarkers(
list: List<PsiElement>,
collection: MutableCollection<LineMarkerInfo<PsiElement>>
elements: MutableList<PsiElement>,
result: MutableCollection<LineMarkerInfo<*>>
) {
for (element in list) {
for (element in elements) {
val settings = Settings.getInstance(element.project)
if (!settings.enabled) {
return
Expand All @@ -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)
}
}

}

0 comments on commit 2ee9c22

Please sign in to comment.