FIR IDE: Only insert FqNames for non-extension non-members properties
This is not completely correct, will be fixed later
This commit is contained in:
+16
-1
@@ -115,7 +115,8 @@ private class VariableLookupElementFactory {
|
||||
if (setterName != null) "$getterName()/$setterName()" else "$getterName()"
|
||||
|
||||
private fun createInsertHandler(symbol: KtVariableLikeSymbol): InsertHandler<LookupElement> {
|
||||
val callableId = symbol.callableIdIfExists ?: return QuotedNamesAwareInsertionHandler(symbol.name)
|
||||
val callableId = symbol.callableIdIfExists
|
||||
if (callableId == null || !symbol.canBeCalledByFqName) return QuotedNamesAwareInsertionHandler(symbol.name)
|
||||
|
||||
return ShorteningVariableInsertionHandler(callableId)
|
||||
}
|
||||
@@ -133,6 +134,20 @@ private class VariableLookupElementFactory {
|
||||
is KtConstructorParameterSymbol,
|
||||
is KtSetterParameterSymbol -> null
|
||||
}
|
||||
|
||||
private val KtVariableLikeSymbol.canBeCalledByFqName: Boolean
|
||||
get() = when (this) {
|
||||
is KtKotlinPropertySymbol -> dispatchType == null && receiverType == null
|
||||
|
||||
is KtEnumEntrySymbol -> true
|
||||
|
||||
is KtJavaFieldSymbol,
|
||||
is KtSyntheticJavaPropertySymbol,
|
||||
is KtLocalVariableSymbol,
|
||||
is KtFunctionParameterSymbol,
|
||||
is KtConstructorParameterSymbol,
|
||||
is KtSetterParameterSymbol -> false
|
||||
}
|
||||
}
|
||||
|
||||
private class FunctionLookupElementFactory {
|
||||
|
||||
Reference in New Issue
Block a user