-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: Indexers touching extension points
- Loading branch information
Oliver Nybroe
committed
May 31, 2023
1 parent
1ead810
commit dddf687
Showing
3 changed files
with
5 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
10 changes: 1 addition & 9 deletions
10
src/main/kotlin/com/pestphp/pest/PhpTestFolderInputFilter.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,11 @@ | ||
package com.pestphp.pest | ||
|
||
import com.intellij.openapi.project.ProjectManager | ||
import com.intellij.openapi.roots.TestSourcesFilter | ||
import com.intellij.openapi.vfs.VirtualFile | ||
import com.intellij.util.indexing.DefaultFileTypeSpecificInputFilter | ||
import com.jetbrains.php.lang.PhpFileType | ||
|
||
open class PhpTestFolderInputFilter : DefaultFileTypeSpecificInputFilter(PhpFileType.INSTANCE) { | ||
override fun acceptInput(file: VirtualFile): Boolean { | ||
if (file.path.contains(""".*?test.*?/.*\..*""".toRegex())) { | ||
return true | ||
} | ||
|
||
return ProjectManager.getInstance().openProjects.any { | ||
TestSourcesFilter.isTestSources(file, it) | ||
} | ||
return file.path.contains(""".*?test.*?/.*\..*""".toRegex()); | ||
} | ||
} |