From 0070377f2a0610a1f8c291a198baefb5a0e84def Mon Sep 17 00:00:00 2001 From: "Pavel V. Talanov" Date: Mon, 20 Oct 2014 19:18:21 +0400 Subject: [PATCH] KotlinCacheService: Correctly deal with code fragments in getLazyResolveSession() Fix completion in code fragments in context of library source --- .../jet/plugin/caches/resolve/KotlinCacheService.kt | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/idea/idea-analysis/src/org/jetbrains/jet/plugin/caches/resolve/KotlinCacheService.kt b/idea/idea-analysis/src/org/jetbrains/jet/plugin/caches/resolve/KotlinCacheService.kt index 523d7a4d61f..e5413eb0573 100644 --- a/idea/idea-analysis/src/org/jetbrains/jet/plugin/caches/resolve/KotlinCacheService.kt +++ b/idea/idea-analysis/src/org/jetbrains/jet/plugin/caches/resolve/KotlinCacheService.kt @@ -171,8 +171,9 @@ public class KotlinCacheService(val project: Project) { public fun getLazyResolveSession(element: JetElement): ResolveSessionForBodies { val file = element.getContainingJetFile() - if (!ProjectRootsUtil.isInProjectSource(file)) { - return getCacheForSyntheticFile(setOf(file)).getLazyResolveSession(file) + val syntheticFiles = findSyntheticFiles(listOf(file)) + if (syntheticFiles.isNotEmpty()) { + return getCacheForSyntheticFile(syntheticFiles).getLazyResolveSession(file) } return getGlobalLazyResolveSession(file, TargetPlatformDetector.getPlatform(file))