From e93ece5ca4be91341c3a88281930c9b20d76c363 Mon Sep 17 00:00:00 2001 From: Semyon Proshev Date: Wed, 27 Sep 2017 19:31:32 +0300 Subject: [PATCH] Deprecate PyCallExpression.resolveCallee(PyResolveContext). --- .../python/psi/PyCallExpression.java | 4 +++- .../inspections/PyArgumentListInspection.java | 20 ++++--------------- 2 files changed, 7 insertions(+), 17 deletions(-) diff --git a/python/psi-api/src/com/jetbrains/python/psi/PyCallExpression.java b/python/psi-api/src/com/jetbrains/python/psi/PyCallExpression.java index 28f32b015988..45387286ab5d 100644 --- a/python/psi-api/src/com/jetbrains/python/psi/PyCallExpression.java +++ b/python/psi-api/src/com/jetbrains/python/psi/PyCallExpression.java @@ -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(); diff --git a/python/src/com/jetbrains/python/inspections/PyArgumentListInspection.java b/python/src/com/jetbrains/python/inspections/PyArgumentListInspection.java index f6d4e59543e7..076fe4ba2db4 100644 --- a/python/src/com/jetbrains/python/inspections/PyArgumentListInspection.java +++ b/python/src/com/jetbrains/python/inspections/PyArgumentListInspection.java @@ -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;