mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
Deprecate PyCallExpression.multiResolveCallee(PyResolveContext, int).
This commit is contained in:
@@ -169,7 +169,7 @@ public interface PyCallExpression extends PyCallSiteExpression {
|
||||
* @param resolveContext resolve context
|
||||
* @return an object which contains callable, modifier, implicit offset and "implicitly resolved" flag.
|
||||
* Returns null if the callee cannot be resolved.
|
||||
* @deprecated Use {@link PyCallExpression#multiResolveCallee(PyResolveContext, int)} instead.
|
||||
* @deprecated Use {@link PyCallExpression#multiResolveRatedCallee(PyResolveContext)} instead.
|
||||
* This method will be removed in 2018.1.
|
||||
*/
|
||||
@Nullable
|
||||
@@ -186,7 +186,7 @@ public interface PyCallExpression extends PyCallSiteExpression {
|
||||
* @param implicitOffset implicit offset which is known from the context
|
||||
* @return an object which contains callable, modifier, implicit offset and "implicitly resolved" flag.
|
||||
* Returns null if the callee cannot be resolved.
|
||||
* @deprecated Use {@link PyCallExpression#multiResolveCallee(PyResolveContext, int)} instead.
|
||||
* @deprecated Use {@link PyCallExpression#multiResolveRatedCallee(PyResolveContext, int)} instead.
|
||||
* This method will be removed in 2018.1.
|
||||
*/
|
||||
@Nullable
|
||||
@@ -216,7 +216,7 @@ public interface PyCallExpression extends PyCallSiteExpression {
|
||||
* @param resolveContext resolve context
|
||||
* @return objects which contains callable, modifier, implicit offset and "implicitly resolved" flag.
|
||||
* <i>Note: the returned list does not contain null values.</i>
|
||||
* @deprecated Use {@link PyCallExpression#multiResolveCallee(PyResolveContext, int)} instead.
|
||||
* @deprecated Use {@link PyCallExpression#multiResolveRatedCallee(PyResolveContext)} instead.
|
||||
* This method will be removed in 2018.1.
|
||||
*/
|
||||
@NotNull
|
||||
@@ -232,8 +232,11 @@ public interface PyCallExpression extends PyCallSiteExpression {
|
||||
* @param implicitOffset implicit offset which is known from the context
|
||||
* @return objects which contains callable, modifier, implicit offset and "implicitly resolved" flag.
|
||||
* <i>Note: the returned list does not contain null values.</i>
|
||||
* @deprecated Use {@link PyCallExpression#multiResolveRatedCallee(PyResolveContext, int)} instead.
|
||||
* This method will be removed in 2018.1.
|
||||
*/
|
||||
@NotNull
|
||||
@Deprecated
|
||||
default List<PyMarkedCallee> multiResolveCallee(@NotNull PyResolveContext resolveContext, int implicitOffset) {
|
||||
return ContainerUtil.map(multiResolveRatedCallee(resolveContext, implicitOffset), PyRatedMarkedCallee::getMarkedCallee);
|
||||
}
|
||||
|
||||
@@ -71,7 +71,10 @@ public class PyArgumentListInspection extends PyInspection {
|
||||
final PyDecorator[] decorators = node.getDecorators();
|
||||
for (PyDecorator deco : decorators) {
|
||||
if (deco.hasArgumentList()) continue;
|
||||
final PyCallExpression.PyMarkedCallee markedCallee = ContainerUtil.getFirstItem(deco.multiResolveCallee(getResolveContext(), 0));
|
||||
final List<PyCallExpression.PyRatedMarkedCallee> ratedMarkedCallees = deco.multiResolveRatedCallee(getResolveContext());
|
||||
final PyCallExpression.PyRatedMarkedCallee ratedMarkedCallee = ContainerUtil.getFirstItem(ratedMarkedCallees);
|
||||
final PyCallExpression.PyMarkedCallee markedCallee = ratedMarkedCallee == null ? null : ratedMarkedCallee.getMarkedCallee();
|
||||
|
||||
if (markedCallee != null && !markedCallee.isImplicitlyResolved()) {
|
||||
final PyCallable callable = markedCallee.getCallable();
|
||||
if (callable == null) return;
|
||||
|
||||
@@ -1,18 +1,6 @@
|
||||
/*
|
||||
* Copyright 2000-2017 JetBrains s.r.o.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
// Copyright 2000-2017 JetBrains s.r.o.
|
||||
// Use of this source code is governed by the Apache 2.0 license that can be
|
||||
// found in the LICENSE file.
|
||||
package com.jetbrains.python.psi.impl;
|
||||
|
||||
import com.intellij.codeInsight.completion.CompletionUtil;
|
||||
@@ -712,8 +700,8 @@ public class PyCallExpressionHelper {
|
||||
}
|
||||
|
||||
final TypeEvalContext context = resolveContext.getTypeEvalContext();
|
||||
return ContainerUtil.map(callExpression.multiResolveCallee(resolveContext, implicitOffset),
|
||||
markedCallee -> mapArguments(callExpression, argumentList, markedCallee, context));
|
||||
return ContainerUtil.map(callExpression.multiResolveRatedCallee(resolveContext, implicitOffset),
|
||||
ratedMarkedCallee -> mapArguments(callExpression, argumentList, ratedMarkedCallee.getMarkedCallee(), context));
|
||||
}
|
||||
|
||||
@NotNull
|
||||
|
||||
@@ -24,10 +24,10 @@ public class PyResolveCalleeTest extends PyTestCase {
|
||||
final TypeEvalContext context = TypeEvalContext.codeAnalysis(myFixture.getProject(), myFixture.getFile());
|
||||
final PyResolveContext resolveContext = PyResolveContext.noImplicits().withTypeEvalContext(context);
|
||||
|
||||
final List<PyCallExpression.PyMarkedCallee> callees = call.multiResolveCallee(resolveContext, 0);
|
||||
final List<PyCallExpression.PyRatedMarkedCallee> callees = call.multiResolveRatedCallee(resolveContext);
|
||||
assertEquals(1, callees.size());
|
||||
|
||||
return callees.get(0);
|
||||
return callees.get(0).getMarkedCallee();
|
||||
}
|
||||
|
||||
public void testInstanceCall() {
|
||||
|
||||
Reference in New Issue
Block a user