FIR Completion: Drop originalPosition parameter from getScopeContextForPosition

- It is easier to retrieve the original enclosing function by the fake
enclosing function than trying to correct the `originalPosition` in
different situations
This commit is contained in:
Roman Golyshev
2020-09-02 13:13:25 +03:00
parent ab5059e08e
commit 1ab246f71e
4 changed files with 10 additions and 40 deletions
@@ -69,8 +69,8 @@ abstract class KtAnalysisSession(override val token: ValidityToken) : ValidityTo
fun KtType.getTypeScope(): KtScope? = scopeProvider.getTypeScope(this)
fun KtFile.getScopeContextForPosition(originalPosition: PsiElement, positionInFakeFile: KtElement): KtScopeContext =
scopeProvider.getScopeContextForPosition(this, originalPosition, positionInFakeFile)
fun KtFile.getScopeContextForPosition(positionInFakeFile: KtElement): KtScopeContext =
scopeProvider.getScopeContextForPosition(this, positionInFakeFile)
fun KtDeclaration.getSymbol(): KtSymbol = symbolProvider.getSymbol(this)
@@ -23,7 +23,6 @@ abstract class KtScopeProvider : KtAnalysisSessionComponent() {
abstract fun getScopeContextForPosition(
originalFile: KtFile,
originalPosition: PsiElement,
positionInFakeFile: KtElement
): KtScopeContext
}