[LL] take originalDeclaration when exists to detect module kind
Fixes KTIJ-24609. When completion happens outside the content root, module kind should be detected by the original file. Otherwise, module would not be the same because outside the content root, each file has its own module. Actual #findSourceFirSymbol also does search over originalDeclaration when present. Added FirCompletionOutsideSourceRootTest in IJ monorepo
This commit is contained in:
+1
-1
@@ -101,7 +101,7 @@ internal abstract class LLFirResolvableResolveSession(
|
||||
ktDeclaration: KtDeclaration,
|
||||
phase: FirResolvePhase
|
||||
): FirBasedSymbol<*> {
|
||||
val module = getModule(ktDeclaration)
|
||||
val module = getModule(ktDeclaration.originalDeclaration ?: ktDeclaration)
|
||||
retryOnInvalidSession {
|
||||
return when (getModuleKind(module)) {
|
||||
ModuleKind.RESOLVABLE_MODULE -> findSourceFirSymbol(ktDeclaration, module).also { resolveFirToPhase(it.fir, phase) }
|
||||
|
||||
Reference in New Issue
Block a user