Avoid computing AST for IdentifierChecker
Basically, it's unnecessary to check anything when analysing stubs, but it's complicated now to avoid that, so we just postpone computing AST until reporting happens
This commit is contained in:
@@ -16,16 +16,16 @@
|
||||
|
||||
package org.jetbrains.kotlin.resolve
|
||||
|
||||
import com.intellij.psi.PsiElement
|
||||
import org.jetbrains.kotlin.diagnostics.DiagnosticSink
|
||||
import org.jetbrains.kotlin.psi.KtDeclaration
|
||||
import org.jetbrains.kotlin.psi.KtSimpleNameExpression
|
||||
|
||||
interface IdentifierChecker {
|
||||
fun checkIdentifier(identifier: PsiElement?, diagnosticHolder: DiagnosticSink)
|
||||
fun checkIdentifier(simpleNameExpression: KtSimpleNameExpression, diagnosticHolder: DiagnosticSink)
|
||||
fun checkDeclaration(declaration: KtDeclaration, diagnosticHolder: DiagnosticSink)
|
||||
|
||||
object Default : IdentifierChecker {
|
||||
override fun checkIdentifier(identifier: PsiElement?, diagnosticHolder: DiagnosticSink) {}
|
||||
override fun checkIdentifier(simpleNameExpression: KtSimpleNameExpression, diagnosticHolder: DiagnosticSink) {}
|
||||
override fun checkDeclaration(declaration: KtDeclaration, diagnosticHolder: DiagnosticSink) {}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -102,7 +102,7 @@ class LazyTopDownAnalyzer(
|
||||
}
|
||||
|
||||
override fun visitPackageDirective(directive: KtPackageDirective) {
|
||||
directive.packageNames.forEach { identifierChecker.checkIdentifier(it.getIdentifier(), trace) }
|
||||
directive.packageNames.forEach { identifierChecker.checkIdentifier(it, trace) }
|
||||
qualifiedExpressionResolver.resolvePackageHeader(directive, moduleDescriptor, trace)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user