Allow to turn the first parameter of a SAM-converted lambda into the receiver (KT-12848)

This commit is contained in:
Yan Zhulanow
2016-12-06 20:03:27 +03:00
parent fc8cc217dc
commit cbef0250aa
57 changed files with 935 additions and 148 deletions
@@ -40,11 +40,12 @@ class IdeAllOpenDeclarationAttributeAltererExtension(val project: Project) : Abs
CachedValueProvider.Result.create(WeakHashMap<Module, List<String>>(), ProjectRootModificationTracker.getInstance(project))
}
override fun getAnnotationFqNames(modifierListOwner: KtModifierListOwner): List<String> {
override fun getAnnotationFqNames(modifierListOwner: KtModifierListOwner?): List<String> {
if (ApplicationManager.getApplication().isUnitTestMode) {
return ANNOTATIONS_FOR_TESTS
}
if (modifierListOwner == null) return emptyList()
val module = ModuleUtilCore.findModuleForPsiElement(modifierListOwner) ?: return emptyList()
return cache.value.getOrPut(module) {