Expanded workaround for EA-64030 (IDEA doesn't allow keywords in cls annotations).
This commit is contained in:
@@ -125,9 +125,7 @@ public class UnusedSymbolInspection : AbstractKotlinInspection() {
|
|||||||
private fun isEntryPoint(declaration: JetNamedDeclaration): Boolean {
|
private fun isEntryPoint(declaration: JetNamedDeclaration): Boolean {
|
||||||
// TODO Workaround for EA-64030 - IOE: PsiJavaParserFacadeImpl.createAnnotationFromText
|
// TODO Workaround for EA-64030 - IOE: PsiJavaParserFacadeImpl.createAnnotationFromText
|
||||||
// This should be fixed on IDEA side: ClsAnnotation should not throw exceptions when annotation class has Java keyword
|
// This should be fixed on IDEA side: ClsAnnotation should not throw exceptions when annotation class has Java keyword
|
||||||
if (declaration is JetNamedFunction) {
|
if (declaration.getAnnotationEntries().any { it.getTypeReference().getText().endsWith("native") }) return false
|
||||||
if (declaration.getAnnotationEntries().any { it.getTypeReference().getText().endsWith("native") }) return false
|
|
||||||
}
|
|
||||||
|
|
||||||
val lightElement: PsiElement? = when (declaration) {
|
val lightElement: PsiElement? = when (declaration) {
|
||||||
is JetClassOrObject -> declaration.toLightClass()
|
is JetClassOrObject -> declaration.toLightClass()
|
||||||
|
|||||||
@@ -60,4 +60,13 @@
|
|||||||
<problem_class severity="WARNING" attribute_key="NOT_USED_ELEMENT_ATTRIBUTES">Unused Symbol</problem_class>
|
<problem_class severity="WARNING" attribute_key="NOT_USED_ELEMENT_ATTRIBUTES">Unused Symbol</problem_class>
|
||||||
<description>Function 'withNativeAnnotation' is never used</description>
|
<description>Function 'withNativeAnnotation' is never used</description>
|
||||||
</problem>
|
</problem>
|
||||||
|
|
||||||
|
<problem>
|
||||||
|
<file>withNativeAnnotation.kt</file>
|
||||||
|
<line>7</line>
|
||||||
|
<module>light_idea_test_case</module>
|
||||||
|
<entry_point TYPE="file" FQNAME="temp:///src/withNativeAnnotation.kt" />
|
||||||
|
<problem_class severity="WARNING" attribute_key="NOT_USED_ELEMENT_ATTRIBUTES">Unused Symbol</problem_class>
|
||||||
|
<description>Class 'WithNativeAnnotation' is never used</description>
|
||||||
|
</problem>
|
||||||
</problems>
|
</problems>
|
||||||
|
|||||||
@@ -2,4 +2,6 @@ annotation class native
|
|||||||
|
|
||||||
native fun withNativeAnnotation() {
|
native fun withNativeAnnotation() {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
native class WithNativeAnnotation
|
||||||
|
|||||||
Reference in New Issue
Block a user