mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
access property stubs safely (EA-72410 - CCE: UnusedPropertyInspection.getWidestUseScope)
This commit is contained in:
+10
@@ -19,10 +19,15 @@
|
||||
*/
|
||||
package com.intellij.lang.properties.psi;
|
||||
|
||||
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 org.jetbrains.annotations.NotNull;
|
||||
|
||||
import java.util.Collection;
|
||||
|
||||
public class PropertyKeyIndex extends StringStubIndexExtension<Property> {
|
||||
public static final StubIndexKey<String, Property> KEY = StubIndexKey.createIndexKey("properties.index");
|
||||
|
||||
@@ -36,4 +41,9 @@ public class PropertyKeyIndex extends StringStubIndexExtension<Property> {
|
||||
public StubIndexKey<String, Property> getKey() {
|
||||
return KEY;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Collection<Property> get(@NotNull String s, @NotNull Project project, @NotNull GlobalSearchScope scope) {
|
||||
return StubIndex.getElements(getKey(), s, project, scope, Property.class);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user