Deprecate PyCallExpression.resolveCallee(PyResolveContext).

This commit is contained in:
Semyon Proshev
2017-10-07 15:47:33 +03:00
parent 89bcf1933e
commit e93ece5ca4
2 changed files with 7 additions and 17 deletions
@@ -169,9 +169,11 @@ 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.
* @see PyCallExpression#multiResolveCallee(PyResolveContext)
* @deprecated Use {@link PyCallExpression#multiResolveCallee(PyResolveContext)} instead.
* This method will be removed in 2018.1.
*/
@Nullable
@Deprecated
default PyMarkedCallee resolveCallee(@NotNull PyResolveContext resolveContext) {
final PyRatedMarkedCallee first = ContainerUtil.getFirstItem(multiResolveRatedCallee(resolveContext, 0));
return first == null ? null : first.getMarkedCallee();
@@ -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.inspections;
import com.google.common.collect.Lists;
@@ -83,7 +71,7 @@ public class PyArgumentListInspection extends PyInspection {
final PyDecorator[] decorators = node.getDecorators();
for (PyDecorator deco : decorators) {
if (deco.hasArgumentList()) continue;
final PyCallExpression.PyMarkedCallee markedCallee = deco.resolveCallee(getResolveContext());
final PyCallExpression.PyMarkedCallee markedCallee = ContainerUtil.getFirstItem(deco.multiResolveCallee(getResolveContext()));
if (markedCallee != null && !markedCallee.isImplicitlyResolved()) {
final PyCallable callable = markedCallee.getCallable();
if (callable == null) return;