Skip to content

Commit

Permalink
fix(icon-provider): Fix wrong icon for some files
Browse files Browse the repository at this point in the history
  • Loading branch information
olivernybroe committed Jul 15, 2020
1 parent 03ad920 commit b976cd8
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
8 changes: 5 additions & 3 deletions src/main/kotlin/com/pestphp/pest/PestIconProvider.kt
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,10 @@ import javax.swing.Icon

class PestIconProvider : IconProvider() {
override fun getIcon(element: PsiElement, flags: Int): Icon? {
return (element as? PsiFile)
?.isPestTestFile()
.let { PestIcons.FILE }
if (element is PsiFile && element.isPestTestFile()) {
return PestIcons.FILE
}

return null
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ class PestIconProviderTest: PestLightCodeFixture() {
val file = myFixture.configureByFile("SimpleScript.php")

assertNotEquals(
PestIconProvider().getIcon(file, ICON_FLAG_VISIBILITY),
PestIcons.FILE
PestIcons.FILE,
PestIconProvider().getIcon(file, ICON_FLAG_VISIBILITY)
)
}
}

0 comments on commit b976cd8

Please sign in to comment.