mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
fixed target references in static method inspection
This commit is contained in:
@@ -57,6 +57,7 @@ public class PyMethodMayBeStaticInspection extends PyInspection {
|
||||
PyRecursiveElementVisitor visitor = new PyRecursiveElementVisitor() {
|
||||
@Override
|
||||
public void visitPyReferenceExpression(PyReferenceExpression node) {
|
||||
super.visitPyReferenceExpression(node);
|
||||
if (PyNames.CANONICAL_SELF.equals(node.getName())) {
|
||||
mayBeStatic[0] = false;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,6 @@
|
||||
__author__ = 'ktisha'
|
||||
|
||||
class Child(Base):
|
||||
|
||||
def f(self):
|
||||
print self.f()
|
||||
@@ -23,6 +23,10 @@ public class PyMethodMayBeStaticInspectionTest extends PyTestCase {
|
||||
doTest();
|
||||
}
|
||||
|
||||
public void testWithQualifier() {
|
||||
doTest();
|
||||
}
|
||||
|
||||
private void doTest() {
|
||||
myFixture.configureByFile("inspections/PyMethodMayBeStaticInspection/" + getTestName(true) + ".py");
|
||||
myFixture.enableInspections(PyMethodMayBeStaticInspection.class);
|
||||
|
||||
Reference in New Issue
Block a user