mirror of
https://github.com/JetBrains/intellij-sdk-code-samples.git
synced 2025-07-30 02:07:50 +08:00
Incorporate PR247
This commit is contained in:
parent
335974458e
commit
5965b1dcb7
@ -14,7 +14,7 @@ public class SimpleUtil {
|
|||||||
|
|
||||||
// Searches the entire project for Simple language files with instances of the Simple property with the given key
|
// Searches the entire project for Simple language files with instances of the Simple property with the given key
|
||||||
public static List<SimpleProperty> findProperties(Project project, String key) {
|
public static List<SimpleProperty> findProperties(Project project, String key) {
|
||||||
List<SimpleProperty> result = null;
|
List<SimpleProperty> result = new ArrayList<>();
|
||||||
Collection<VirtualFile> virtualFiles =
|
Collection<VirtualFile> virtualFiles =
|
||||||
FileTypeIndex.getFiles(SimpleFileType.INSTANCE, GlobalSearchScope.allScope(project));
|
FileTypeIndex.getFiles(SimpleFileType.INSTANCE, GlobalSearchScope.allScope(project));
|
||||||
for (VirtualFile virtualFile : virtualFiles) {
|
for (VirtualFile virtualFile : virtualFiles) {
|
||||||
@ -24,16 +24,13 @@ public class SimpleUtil {
|
|||||||
if (properties != null) {
|
if (properties != null) {
|
||||||
for (SimpleProperty property : properties) {
|
for (SimpleProperty property : properties) {
|
||||||
if (key.equals(property.getKey())) {
|
if (key.equals(property.getKey())) {
|
||||||
if (result == null) {
|
|
||||||
result = new ArrayList<SimpleProperty>();
|
|
||||||
}
|
|
||||||
result.add(property);
|
result.add(property);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return result != null ? result : Collections.<SimpleProperty>emptyList();
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static List<SimpleProperty> findProperties(Project project) {
|
public static List<SimpleProperty> findProperties(Project project) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user