Minor. Method replaced by a more convenient one from the same class
This commit is contained in:
@@ -26,12 +26,6 @@ public class KotlinCacheManagerUtil {
|
|||||||
private KotlinCacheManagerUtil() {
|
private KotlinCacheManagerUtil() {
|
||||||
}
|
}
|
||||||
|
|
||||||
@NotNull
|
|
||||||
public static KotlinDeclarationsCache getDeclarationsFromProject(@NotNull JetElement element) {
|
|
||||||
JetFile jetFile = element.getContainingJetFile();
|
|
||||||
return KotlinCacheManager.getInstance(jetFile.getProject()).getDeclarationsFromProject(TargetPlatformDetector.getPlatform(jetFile));
|
|
||||||
}
|
|
||||||
|
|
||||||
@NotNull
|
@NotNull
|
||||||
public static BindingContext getDeclarationsBindingContext(@NotNull JetElement element) {
|
public static BindingContext getDeclarationsBindingContext(@NotNull JetElement element) {
|
||||||
JetFile jetFile = element.getContainingJetFile();
|
JetFile jetFile = element.getContainingJetFile();
|
||||||
|
|||||||
@@ -52,7 +52,7 @@ public class AddFunctionToSupertypeFix extends JetHintAction<JetNamedFunction> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private static List<FunctionDescriptor> generateFunctionsToAdd(JetNamedFunction functionElement) {
|
private static List<FunctionDescriptor> generateFunctionsToAdd(JetNamedFunction functionElement) {
|
||||||
BindingContext context = KotlinCacheManagerUtil.getDeclarationsFromProject(functionElement).getBindingContext();
|
BindingContext context = KotlinCacheManagerUtil.getDeclarationsBindingContext(functionElement);
|
||||||
|
|
||||||
FunctionDescriptor functionDescriptor = context.get(BindingContext.FUNCTION, functionElement);
|
FunctionDescriptor functionDescriptor = context.get(BindingContext.FUNCTION, functionElement);
|
||||||
if (functionDescriptor == null) return Collections.emptyList();
|
if (functionDescriptor == null) return Collections.emptyList();
|
||||||
@@ -154,7 +154,7 @@ public class AddFunctionToSupertypeFix extends JetHintAction<JetNamedFunction> {
|
|||||||
|
|
||||||
@NotNull
|
@NotNull
|
||||||
private JetAddFunctionToClassifierAction createAction(Project project, Editor editor) {
|
private JetAddFunctionToClassifierAction createAction(Project project, Editor editor) {
|
||||||
BindingContext bindingContext = KotlinCacheManagerUtil.getDeclarationsFromProject(element).getBindingContext();
|
BindingContext bindingContext = KotlinCacheManagerUtil.getDeclarationsBindingContext(element);
|
||||||
return new JetAddFunctionToClassifierAction(project, editor, bindingContext, functionsToAdd);
|
return new JetAddFunctionToClassifierAction(project, editor, bindingContext, functionsToAdd);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -108,7 +108,7 @@ public class ChangeMemberFunctionSignatureFix extends JetHintAction<JetNamedFunc
|
|||||||
*/
|
*/
|
||||||
@NotNull
|
@NotNull
|
||||||
private static List<FunctionDescriptor> computePossibleSignatures(JetNamedFunction functionElement) {
|
private static List<FunctionDescriptor> computePossibleSignatures(JetNamedFunction functionElement) {
|
||||||
BindingContext context = KotlinCacheManagerUtil.getDeclarationsFromProject(functionElement).getBindingContext();
|
BindingContext context = KotlinCacheManagerUtil.getDeclarationsBindingContext(functionElement);
|
||||||
FunctionDescriptor functionDescriptor = context.get(BindingContext.FUNCTION, functionElement);
|
FunctionDescriptor functionDescriptor = context.get(BindingContext.FUNCTION, functionElement);
|
||||||
if (functionDescriptor == null) return Lists.newArrayList();
|
if (functionDescriptor == null) return Lists.newArrayList();
|
||||||
List<FunctionDescriptor> superFunctions = getPossibleSuperFunctionsDescriptors(functionDescriptor);
|
List<FunctionDescriptor> superFunctions = getPossibleSuperFunctionsDescriptors(functionDescriptor);
|
||||||
|
|||||||
Reference in New Issue
Block a user