Smart completion: minor changes
This commit is contained in:
@@ -62,7 +62,7 @@ class StaticMembers(val bindingContext: BindingContext, val resolveSession: Reso
|
||||
else if (DescriptorUtils.isEnumEntry(descriptor)) {
|
||||
classifier = { ExpectedInfoClassification.MATCHES } /* we do not need to check type of enum entry because it's taken from proper enum */
|
||||
}
|
||||
else{
|
||||
else {
|
||||
return
|
||||
}
|
||||
|
||||
|
||||
@@ -96,38 +96,34 @@ fun MutableCollection<LookupElement>.addLookupElements(expectedInfos: Collection
|
||||
}
|
||||
|
||||
fun MutableCollection<LookupElement>.addLookupElementsForNullable(factory: () -> LookupElement?, matchedInfos: Collection<ExpectedInfo>) {
|
||||
run {
|
||||
var lookupElement = factory()
|
||||
if (lookupElement != null) {
|
||||
lookupElement = object: LookupElementDecorator<LookupElement>(lookupElement!!) {
|
||||
override fun renderElement(presentation: LookupElementPresentation) {
|
||||
super.renderElement(presentation)
|
||||
presentation.setItemText("!! " + presentation.getItemText())
|
||||
}
|
||||
override fun handleInsert(context: InsertionContext) {
|
||||
WithTailStringInsertHandler("!!").handleInsert(context, getDelegate())
|
||||
}
|
||||
var lookupElement = factory()
|
||||
if (lookupElement != null) {
|
||||
lookupElement = object: LookupElementDecorator<LookupElement>(lookupElement!!) {
|
||||
override fun renderElement(presentation: LookupElementPresentation) {
|
||||
super.renderElement(presentation)
|
||||
presentation.setItemText("!! " + presentation.getItemText())
|
||||
}
|
||||
override fun handleInsert(context: InsertionContext) {
|
||||
WithTailStringInsertHandler("!!").handleInsert(context, getDelegate())
|
||||
}
|
||||
lookupElement = lookupElement!!.suppressAutoInsertion()
|
||||
add(lookupElement!!.addTail(matchedInfos))
|
||||
}
|
||||
lookupElement = lookupElement!!.suppressAutoInsertion()
|
||||
add(lookupElement!!.addTail(matchedInfos))
|
||||
}
|
||||
|
||||
run {
|
||||
var lookupElement = factory()
|
||||
if (lookupElement != null) {
|
||||
lookupElement = object: LookupElementDecorator<LookupElement>(lookupElement!!) {
|
||||
override fun renderElement(presentation: LookupElementPresentation) {
|
||||
super.renderElement(presentation)
|
||||
presentation.setItemText("?: " + presentation.getItemText())
|
||||
}
|
||||
override fun handleInsert(context: InsertionContext) {
|
||||
WithTailStringInsertHandler(" ?: ").handleInsert(context, getDelegate()) //TODO: code style
|
||||
}
|
||||
lookupElement = factory()
|
||||
if (lookupElement != null) {
|
||||
lookupElement = object: LookupElementDecorator<LookupElement>(lookupElement!!) {
|
||||
override fun renderElement(presentation: LookupElementPresentation) {
|
||||
super.renderElement(presentation)
|
||||
presentation.setItemText("?: " + presentation.getItemText())
|
||||
}
|
||||
override fun handleInsert(context: InsertionContext) {
|
||||
WithTailStringInsertHandler(" ?: ").handleInsert(context, getDelegate()) //TODO: code style
|
||||
}
|
||||
lookupElement = lookupElement!!.suppressAutoInsertion()
|
||||
add(lookupElement!!.addTail(matchedInfos))
|
||||
}
|
||||
lookupElement = lookupElement!!.suppressAutoInsertion()
|
||||
add(lookupElement!!.addTail(matchedInfos))
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user