FIR IDE: Move some declarations highlighting to before resolve highlighting pass

This commit is contained in:
Ilya Kirillov
2020-05-24 16:38:09 +03:00
parent f37e313705
commit a8b94b1cca
9 changed files with 106 additions and 108 deletions
@@ -1,5 +1,5 @@
/*
* Copyright 2010-2019 JetBrains s.r.o. and Kotlin Programming Language contributors.
* Copyright 2010-2020 JetBrains s.r.o. and Kotlin Programming Language contributors.
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
*/
@@ -28,21 +28,6 @@ import org.jetbrains.kotlin.utils.addToStdlib.firstNotNullResult
internal class FunctionsHighlightingVisitor(holder: AnnotationHolder, bindingContext: BindingContext) :
AfterAnalysisHighlightingVisitor(holder, bindingContext) {
override fun visitNamedFunction(function: KtNamedFunction) {
function.nameIdentifier?.let { highlightName(it, FUNCTION_DECLARATION) }
super.visitNamedFunction(function)
}
override fun visitSuperTypeCallEntry(call: KtSuperTypeCallEntry) {
val calleeExpression = call.calleeExpression
val typeElement = calleeExpression.typeReference?.typeElement
if (typeElement is KtUserType) {
typeElement.referenceExpression?.let { highlightName(it, CONSTRUCTOR_CALL) }
}
super.visitSuperTypeCallEntry(call)
}
override fun visitBinaryExpression(expression: KtBinaryExpression) {
if (expression.operationReference.getIdentifier() != null) {
val resolvedCall = expression.getResolvedCall(bindingContext)
@@ -1,17 +1,6 @@
/*
* Copyright 2010-2016 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* Copyright 2010-2020 JetBrains s.r.o. and Kotlin Programming Language contributors.
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
*/
package org.jetbrains.kotlin.idea.highlighter
@@ -92,11 +81,6 @@ internal class TypeKindHighlightingVisitor(holder: AnnotationHolder, bindingCont
return TextRange(atSymbol.textRange.startOffset, expression.textRange.endOffset)
}
override fun visitTypeParameter(parameter: KtTypeParameter) {
parameter.nameIdentifier?.let { highlightName(it, TYPE_PARAMETER) }
super.visitTypeParameter(parameter)
}
override fun visitClassOrObject(classOrObject: KtClassOrObject) {
val identifier = classOrObject.nameIdentifier
val classDescriptor = bindingContext.get(BindingContext.CLASS, classOrObject)