Fix a number of compiler/IDE warnings in IDE and kapt modules

This commit is contained in:
Yan Zhulanow
2019-08-07 16:45:20 +09:00
parent 9fb622e148
commit f93549748a
22 changed files with 98 additions and 58 deletions
@@ -22,6 +22,7 @@ interface BuildSystemTypeDetector {
}
fun Module.getBuildSystemType(): BuildSystemType {
@Suppress("DEPRECATION")
for (extension in Extensions.getExtensions(BuildSystemTypeDetector.EP_NAME)) {
val result = extension.detectBuildSystemType(this)
if (result != null) {
@@ -31,15 +31,18 @@ abstract class AfterAnalysisHighlightingVisitor protected constructor(
holder: AnnotationHolder, protected var bindingContext: BindingContext
) : HighlightingVisitor(holder) {
protected fun attributeKeyForDeclarationFromExtensions(element: PsiElement, descriptor: DeclarationDescriptor) =
Extensions.getExtensions(HighlighterExtension.EP_NAME).firstNotNullResult { extension ->
protected fun attributeKeyForDeclarationFromExtensions(element: PsiElement, descriptor: DeclarationDescriptor): TextAttributesKey? {
@Suppress("DEPRECATION")
return Extensions.getExtensions(HighlighterExtension.EP_NAME).firstNotNullResult { extension ->
extension.highlightDeclaration(element, descriptor)
}
}
protected fun attributeKeyForCallFromExtensions(
expression: KtSimpleNameExpression,
resolvedCall: ResolvedCall<out CallableDescriptor>
): TextAttributesKey? {
@Suppress("DEPRECATION")
return Extensions.getExtensions(HighlighterExtension.EP_NAME).firstNotNullResult { extension ->
extension.highlightCall(expression, resolvedCall)
}
@@ -77,7 +77,10 @@ internal class FunctionsHighlightingVisitor(holder: AnnotationHolder, bindingCon
private fun highlightCall(callee: PsiElement, resolvedCall: ResolvedCall<out CallableDescriptor>) {
val calleeDescriptor = resolvedCall.resultingDescriptor
val key = Extensions.getExtensions(HighlighterExtension.EP_NAME).firstNotNullResult { extension ->
@Suppress("DEPRECATION")
val extensions = Extensions.getExtensions(HighlighterExtension.EP_NAME)
val key = extensions.firstNotNullResult { extension ->
extension.highlightCall(callee, resolvedCall)
} ?: when {
calleeDescriptor.fqNameOrNull() == KOTLIN_SUSPEND_BUILT_IN_FUNCTION_FQ_NAME -> KEYWORD
@@ -42,6 +42,7 @@ internal class PropertiesHighlightingVisitor(holder: AnnotationHolder, bindingCo
val resolvedCall = expression.getResolvedCall(bindingContext)
val attributesKey = resolvedCall?.let { call ->
@Suppress("DEPRECATION")
Extensions.getExtensions(HighlighterExtension.EP_NAME).firstNotNullResult { extension ->
extension.highlightCall(expression, call)
}
@@ -29,6 +29,7 @@ class QuickFixes {
private val actions: Multimap<DiagnosticFactory<*>, IntentionAction> = HashMultimap.create<DiagnosticFactory<*>, IntentionAction>()
init {
@Suppress("DEPRECATION")
Extensions.getExtensions(QuickFixContributor.EP_NAME).forEach { it.registerQuickFixes(this) }
}