mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
PY-24987/PY-22496: Remove now unused PyInstanceAttributeIndex
This commit is contained in:
committed by
Andrey Vlasovskikh
parent
0c926bb617
commit
9b8ee499e9
@@ -120,7 +120,6 @@
|
||||
<stubIndex implementation="com.jetbrains.python.psi.stubs.PyFunctionNameIndex"/>
|
||||
<stubIndex implementation="com.jetbrains.python.psi.stubs.PySuperClassIndex"/>
|
||||
<stubIndex implementation="com.jetbrains.python.psi.stubs.PyVariableNameIndex"/>
|
||||
<stubIndex implementation="com.jetbrains.python.psi.stubs.PyInstanceAttributeIndex"/>
|
||||
<stubIndex implementation="com.jetbrains.python.psi.stubs.PyDecoratorStubIndex"/>
|
||||
<stubIndex implementation="com.jetbrains.python.psi.stubs.PyClassAttributesIndex"/>
|
||||
<fileBasedIndex implementation="com.jetbrains.python.psi.stubs.PyModuleNameIndex"/>
|
||||
|
||||
@@ -168,17 +168,9 @@ public class PyTargetExpressionElementType extends PyStubElementType<PyTargetExp
|
||||
if (stub.getParentStub() instanceof PyFileStub) {
|
||||
sink.occurrence(PyVariableNameIndex.KEY, name);
|
||||
}
|
||||
else if (isInstanceAttributeStub(stub)) {
|
||||
sink.occurrence(PyInstanceAttributeIndex.KEY, name);
|
||||
}
|
||||
}
|
||||
for (CustomTargetExpressionStubType stubType : getCustomStubTypes()) {
|
||||
stubType.indexStub(stub, sink);
|
||||
}
|
||||
}
|
||||
|
||||
private static boolean isInstanceAttributeStub(PyTargetExpressionStub stub) {
|
||||
final StubElement parent = stub.getParentStub();
|
||||
return parent instanceof PyFunctionStub; // otherwise we wouldn't create the stub (see shouldCreateStub() implementation)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,48 +0,0 @@
|
||||
/*
|
||||
* Copyright 2000-2014 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.
|
||||
*/
|
||||
package com.jetbrains.python.psi.stubs;
|
||||
|
||||
import com.intellij.openapi.project.Project;
|
||||
import com.intellij.psi.search.GlobalSearchScope;
|
||||
import com.intellij.psi.stubs.StringStubIndexExtension;
|
||||
import com.intellij.psi.stubs.StubIndex;
|
||||
import com.intellij.psi.stubs.StubIndexKey;
|
||||
import com.jetbrains.python.psi.PyTargetExpression;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
import java.util.Collection;
|
||||
|
||||
/**
|
||||
* @author yole
|
||||
*/
|
||||
public class PyInstanceAttributeIndex extends StringStubIndexExtension<PyTargetExpression> {
|
||||
public static final StubIndexKey<String, PyTargetExpression> KEY = StubIndexKey.createIndexKey("Py.instanceAttribute.name");
|
||||
|
||||
@Override
|
||||
public int getVersion() {
|
||||
return super.getVersion() + 1;
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
public StubIndexKey<String, PyTargetExpression> getKey() {
|
||||
return KEY;
|
||||
}
|
||||
|
||||
public static Collection<PyTargetExpression> find(String name, Project project, GlobalSearchScope scope) {
|
||||
return StubIndex.getElements(KEY, name, project, scope, PyTargetExpression.class);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user