UAST: split KotlinUastResolveProviderService into a separate file
This commit is contained in:
committed by
Ilya Kirillov
parent
f16f9a13fd
commit
0395294933
@@ -31,10 +31,7 @@ import org.jetbrains.kotlin.asJava.classes.KtLightClassForFacade
|
|||||||
import org.jetbrains.kotlin.asJava.elements.*
|
import org.jetbrains.kotlin.asJava.elements.*
|
||||||
import org.jetbrains.kotlin.asJava.findFacadeClass
|
import org.jetbrains.kotlin.asJava.findFacadeClass
|
||||||
import org.jetbrains.kotlin.asJava.toLightClass
|
import org.jetbrains.kotlin.asJava.toLightClass
|
||||||
import org.jetbrains.kotlin.codegen.state.KotlinTypeMapper
|
|
||||||
import org.jetbrains.kotlin.config.LanguageVersionSettings
|
|
||||||
import org.jetbrains.kotlin.descriptors.ConstructorDescriptor
|
import org.jetbrains.kotlin.descriptors.ConstructorDescriptor
|
||||||
import org.jetbrains.kotlin.descriptors.DeclarationDescriptor
|
|
||||||
import org.jetbrains.kotlin.descriptors.FunctionDescriptor
|
import org.jetbrains.kotlin.descriptors.FunctionDescriptor
|
||||||
import org.jetbrains.kotlin.idea.KotlinLanguage
|
import org.jetbrains.kotlin.idea.KotlinLanguage
|
||||||
import org.jetbrains.kotlin.lexer.KtTokens
|
import org.jetbrains.kotlin.lexer.KtTokens
|
||||||
@@ -53,21 +50,6 @@ import org.jetbrains.uast.kotlin.declarations.KotlinUMethodWithFakeLightDelegate
|
|||||||
import org.jetbrains.uast.kotlin.expressions.*
|
import org.jetbrains.uast.kotlin.expressions.*
|
||||||
import org.jetbrains.uast.kotlin.psi.*
|
import org.jetbrains.uast.kotlin.psi.*
|
||||||
|
|
||||||
interface KotlinUastResolveProviderService : BaseKotlinUastResolveProviderService {
|
|
||||||
fun getBindingContext(element: KtElement): BindingContext
|
|
||||||
fun getTypeMapper(element: KtElement): KotlinTypeMapper?
|
|
||||||
fun getLanguageVersionSettings(element: KtElement): LanguageVersionSettings
|
|
||||||
fun getReferenceVariants(ktElement: KtElement, nameHint: String): Sequence<DeclarationDescriptor>
|
|
||||||
|
|
||||||
override fun convertParent(uElement: UElement): UElement? {
|
|
||||||
return convertParentImpl(uElement)
|
|
||||||
}
|
|
||||||
|
|
||||||
override fun resolveToDeclaration(ktExpression: KtExpression): PsiElement? {
|
|
||||||
return resolveToDeclarationImpl(ktExpression)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
var PsiElement.destructuringDeclarationInitializer: Boolean? by UserDataProperty(Key.create("kotlin.uast.destructuringDeclarationInitializer"))
|
var PsiElement.destructuringDeclarationInitializer: Boolean? by UserDataProperty(Key.create("kotlin.uast.destructuringDeclarationInitializer"))
|
||||||
|
|
||||||
class KotlinUastLanguagePlugin : UastLanguagePlugin {
|
class KotlinUastLanguagePlugin : UastLanguagePlugin {
|
||||||
|
|||||||
@@ -0,0 +1,30 @@
|
|||||||
|
/*
|
||||||
|
* Copyright 2010-2021 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.uast.kotlin
|
||||||
|
|
||||||
|
import com.intellij.psi.PsiElement
|
||||||
|
import org.jetbrains.kotlin.codegen.state.KotlinTypeMapper
|
||||||
|
import org.jetbrains.kotlin.config.LanguageVersionSettings
|
||||||
|
import org.jetbrains.kotlin.descriptors.DeclarationDescriptor
|
||||||
|
import org.jetbrains.kotlin.psi.KtElement
|
||||||
|
import org.jetbrains.kotlin.psi.KtExpression
|
||||||
|
import org.jetbrains.kotlin.resolve.BindingContext
|
||||||
|
import org.jetbrains.uast.UElement
|
||||||
|
|
||||||
|
interface KotlinUastResolveProviderService : BaseKotlinUastResolveProviderService {
|
||||||
|
fun getBindingContext(element: KtElement): BindingContext
|
||||||
|
fun getTypeMapper(element: KtElement): KotlinTypeMapper?
|
||||||
|
fun getLanguageVersionSettings(element: KtElement): LanguageVersionSettings
|
||||||
|
fun getReferenceVariants(ktElement: KtElement, nameHint: String): Sequence<DeclarationDescriptor>
|
||||||
|
|
||||||
|
override fun convertParent(uElement: UElement): UElement? {
|
||||||
|
return convertParentImpl(uElement)
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun resolveToDeclaration(ktExpression: KtExpression): PsiElement? {
|
||||||
|
return resolveToDeclarationImpl(ktExpression)
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user