Compatibility with IJ 2021.2
MatchOptions require the fileType property to be set so that a
search profile can be derived from the file type. This is required in IJ
2021.2.
Unfortunately the Kotlin properties syntax cannot be used for file
types!
diff --git a/org.eclipse.scout.sdk.s2i/src/main/kotlin/org/eclipse/scout/sdk/s2i/Extensions.kt b/org.eclipse.scout.sdk.s2i/src/main/kotlin/org/eclipse/scout/sdk/s2i/Extensions.kt
index a4a0c06..3aa657d 100644
--- a/org.eclipse.scout.sdk.s2i/src/main/kotlin/org/eclipse/scout/sdk/s2i/Extensions.kt
+++ b/org.eclipse.scout.sdk.s2i/src/main/kotlin/org/eclipse/scout/sdk/s2i/Extensions.kt
@@ -278,12 +278,13 @@
*/
fun Project.findAllTypesAnnotatedWith(annotation: String, scope: SearchScope, indicator: ProgressIndicator? = null): Sequence<PsiClass> {
val options = MatchOptions()
+ @Suppress("UsePropertyAccessSyntax") // not supported by Kotlin 1.5
+ options.setFileType(JavaFileType.INSTANCE)
options.dialect = JavaLanguage.INSTANCE
options.isCaseSensitiveMatch = true
options.isRecursiveSearch = true
options.scope = scope
options.searchPattern = "@$annotation( )\nclass \$Class\$ {}"
- options.fileType = JavaFileType.INSTANCE
val constraint = MatchVariableConstraint()
constraint.name = "Class"