Add commentary about inserting type for lateinit var in completion

- Also, use dedicated method to check modifier
This commit is contained in:
Roman Golyshev
2020-01-16 17:38:01 +03:00
committed by Roman Golyshev
parent 4f74515508
commit 9f15c0f4d7
@@ -189,7 +189,9 @@ class BasicCompletionSession(
completeDeclarationNameFromUnresolvedOrOverride(declaration)
if (declaration is KtProperty) {
completeParameterOrVarNameAndType(declaration.modifierList?.hasModifier(KtTokens.LATEINIT_KEYWORD) == true)
// we want to insert type only if the property is lateinit,
// because lateinit var cannot have its type deduced from initializer
completeParameterOrVarNameAndType(withType = declaration.hasModifier(KtTokens.LATEINIT_KEYWORD))
}
// no auto-popup on typing after "val", "var" and "fun" because it's likely the name of the declaration which is being typed by user