Rename and deprecate ad-hoc IsNullOrEmpty.

This commit is contained in:
Ilya Gorbunov
2015-04-01 01:06:29 +03:00
parent 850d79e61a
commit d81895df77
2 changed files with 3 additions and 2 deletions
@@ -122,7 +122,7 @@ class StaticMembers(
presentation.setTailText(tailText, true) presentation.setTailText(tailText, true)
} }
if (presentation.getTypeText().isNullOrEmpty()) { if (presentation.getTypeText().isNullOrEmptyDeprecated()) {
presentation.setTypeText(DescriptorRenderer.SHORT_NAMES_IN_TYPES.renderType(classDescriptor.getDefaultType())) presentation.setTypeText(DescriptorRenderer.SHORT_NAMES_IN_TYPES.renderType(classDescriptor.getDefaultType()))
} }
} }
@@ -261,7 +261,8 @@ fun LookupElementFactory.createLookupElement(
fun <T : Any> T?.toList(): List<T> = if (this != null) listOf(this) else listOf() fun <T : Any> T?.toList(): List<T> = if (this != null) listOf(this) else listOf()
fun <T : Any> T?.toSet(): Set<T> = if (this != null) setOf(this) else setOf() fun <T : Any> T?.toSet(): Set<T> = if (this != null) setOf(this) else setOf()
fun String?.isNullOrEmpty() = this == null || this.isEmpty() deprecated("Use String?.isNullOrEmpty() from stdlib when available")
fun String?.isNullOrEmptyDeprecated() = this == null || this.isEmpty()
enum class SmartCompletionItemPriority { enum class SmartCompletionItemPriority {
IT IT