KotlinCacheService: Correctly deal with code fragments in getLazyResolveSession()
Fix completion in code fragments in context of library source
This commit is contained in:
+3
-2
@@ -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))
|
||||
|
||||
Reference in New Issue
Block a user