Migration: PlatformHeaderAnnotator -> PlatformExpectedAnnotator
This commit is contained in:
+3
-3
@@ -53,10 +53,10 @@ val ModuleDescriptor.allImplementingCompatibleModules
|
|||||||
other.sourceKind == this.sourceKind
|
other.sourceKind == this.sourceKind
|
||||||
}
|
}
|
||||||
|
|
||||||
class PlatformHeaderAnnotator : Annotator {
|
class PlatformExpectedAnnotator : Annotator {
|
||||||
override fun annotate(element: PsiElement, holder: AnnotationHolder) {
|
override fun annotate(element: PsiElement, holder: AnnotationHolder) {
|
||||||
val declaration = element as? KtDeclaration ?: return
|
val declaration = element as? KtDeclaration ?: return
|
||||||
if (!isExpectDeclaration(declaration)) return
|
if (!isExpectedDeclaration(declaration)) return
|
||||||
|
|
||||||
if (TargetPlatformDetector.getPlatform(declaration.containingKtFile) !is TargetPlatform.Common) return
|
if (TargetPlatformDetector.getPlatform(declaration.containingKtFile) !is TargetPlatform.Common) return
|
||||||
|
|
||||||
@@ -80,7 +80,7 @@ class PlatformHeaderAnnotator : Annotator {
|
|||||||
KotlinPsiChecker().annotateElement(declaration, holder, SimpleDiagnostics(filteredList))
|
KotlinPsiChecker().annotateElement(declaration, holder, SimpleDiagnostics(filteredList))
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun isExpectDeclaration(declaration: KtDeclaration): Boolean {
|
private fun isExpectedDeclaration(declaration: KtDeclaration): Boolean {
|
||||||
return declaration.hasExpectModifier() ||
|
return declaration.hasExpectModifier() ||
|
||||||
declaration is KtClassOrObject && KtPsiUtil.getOutermostClassOrObject(declaration)?.hasExpectModifier() == true
|
declaration is KtClassOrObject && KtPsiUtil.getOutermostClassOrObject(declaration)?.hasExpectModifier() == true
|
||||||
}
|
}
|
||||||
@@ -590,7 +590,7 @@
|
|||||||
|
|
||||||
<annotator language="kotlin" implementationClass="org.jetbrains.kotlin.idea.highlighter.DebugInfoAnnotator"/>
|
<annotator language="kotlin" implementationClass="org.jetbrains.kotlin.idea.highlighter.DebugInfoAnnotator"/>
|
||||||
<annotator language="kotlin" implementationClass="org.jetbrains.kotlin.idea.highlighter.DuplicateJvmSignatureAnnotator"/>
|
<annotator language="kotlin" implementationClass="org.jetbrains.kotlin.idea.highlighter.DuplicateJvmSignatureAnnotator"/>
|
||||||
<annotator language="kotlin" implementationClass="org.jetbrains.kotlin.idea.highlighter.PlatformHeaderAnnotator"/>
|
<annotator language="kotlin" implementationClass="org.jetbrains.kotlin.idea.highlighter.PlatformExpectedAnnotator"/>
|
||||||
<problemHighlightFilter implementation="org.jetbrains.kotlin.idea.highlighter.KotlinProblemHighlightFilter"/>
|
<problemHighlightFilter implementation="org.jetbrains.kotlin.idea.highlighter.KotlinProblemHighlightFilter"/>
|
||||||
|
|
||||||
<highlightVisitor implementation="org.jetbrains.kotlin.idea.highlighter.KotlinRainbowVisitor"/>
|
<highlightVisitor implementation="org.jetbrains.kotlin.idea.highlighter.KotlinRainbowVisitor"/>
|
||||||
|
|||||||
Reference in New Issue
Block a user