Body elements resolution in KotlinDebuggerCache added / analyzeWithContentAndGetResult
While we trying to find an inlined SourcePosition, the body should be resolved KotlinPositionManager.getLambdaOrFunIfInside / InlineUtil.isInlinedArgument to make shure the lambda is an argument for a call. #KT-39309 fixed #KT-39435 fixed
This commit is contained in:
+7
-3
@@ -96,9 +96,13 @@ fun KtElement.analyze(
|
||||
): BindingContext =
|
||||
resolutionFacade.analyze(this, bodyResolveMode)
|
||||
|
||||
fun KtElement.analyzeAndGetResult(resolutionFacade: ResolutionFacade): AnalysisResult {
|
||||
return AnalysisResult.success(resolutionFacade.analyze(this), resolutionFacade.moduleDescriptor)
|
||||
}
|
||||
fun KtElement.analyzeAndGetResult(resolutionFacade: ResolutionFacade): AnalysisResult =
|
||||
AnalysisResult.success(resolutionFacade.analyze(this), resolutionFacade.moduleDescriptor)
|
||||
|
||||
// This function is used on declarations to make analysis not only declaration itself but also it content:
|
||||
// body for declaration with body, initializer & accessors for properties
|
||||
fun KtElement.analyzeWithContentAndGetResult(resolutionFacade: ResolutionFacade): AnalysisResult =
|
||||
resolutionFacade.analyzeWithAllCompilerChecks(listOf(this))
|
||||
|
||||
// This function is used on declarations to make analysis not only declaration itself but also it content:
|
||||
// body for declaration with body, initializer & accessors for properties
|
||||
|
||||
@@ -132,6 +132,12 @@ fun KtElement.analyzeAndGetResult(): AnalysisResult {
|
||||
return analyzeAndGetResult(getResolutionFacade())
|
||||
}
|
||||
|
||||
/**
|
||||
* **Please, use overload with providing resolutionFacade for stable results of subsequent calls**
|
||||
*/
|
||||
fun KtElement.analyzeWithContentAndGetResult(): AnalysisResult =
|
||||
analyzeWithContentAndGetResult(getResolutionFacade())
|
||||
|
||||
fun KtElement.findModuleDescriptor(): ModuleDescriptor = getResolutionFacade().moduleDescriptor
|
||||
|
||||
// This function is used on declarations to make analysis not only declaration itself but also it content:
|
||||
|
||||
Reference in New Issue
Block a user