code_samples/simple_language_plugin/src/main/java/org/intellij/sdk/language/SimpleUtil.java
public static List<SimpleProperty> findProperties(Project project, String key) {
    List<SimpleProperty> result = new ArrayList<>();
    Collection<VirtualFile> virtualFiles =
          FileTypeIndex.getFiles(SimpleFileType.INSTANCE, GlobalSearchScope.allScope(project));
    for (VirtualFile virtualFile : virtualFiles) {
      SimpleFile simpleFile = (SimpleFile) PsiManager.getInstance(project).findFile(virtualFile);
      if (simpleFile != null) {
        SimpleProperty[] properties = PsiTreeUtil.getChildrenOfType(simpleFile, SimpleProperty.class);
        if (properties != null) {
          for (SimpleProperty property : properties) {
            if (key.equals(property.getKey())) {
               result.add(property);
            }
          }
        }
      }
    }
    return result;
  }
// 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
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) {
    List<SimpleProperty> result = new ArrayList<>();
    Collection<VirtualFile> virtualFiles =
          FileTypeIndex.getFiles(SimpleFileType.INSTANCE, GlobalSearchScope.allScope(project));
    for (VirtualFile virtualFile : virtualFiles) {
      SimpleFile simpleFile = (SimpleFile) PsiManager.getInstance(project).findFile(virtualFile);
      if (simpleFile != null) {
        SimpleProperty[] properties = PsiTreeUtil.getChildrenOfType(simpleFile, SimpleProperty.class);
        if (properties != null) {
          for (SimpleProperty property : properties) {
            if (key.equals(property.getKey())) {
               result.add(property);
            }
          }
        }
      }
    }
    return result;
  }
public static List < SimpleProperty > findProperties ( Project project , String key ) { List < SimpleProperty > result = new ArrayList < > ( ) ; Collection < VirtualFile > virtualFiles = FileTypeIndex . getFiles ( SimpleFileType . INSTANCE , GlobalSearchScope . allScope ( project ) ) ; for ( VirtualFile virtualFile : virtualFiles ) { SimpleFile simpleFile = ( SimpleFile ) PsiManager . getInstance ( project ) . findFile ( virtualFile ) ; if ( simpleFile != null ) { SimpleProperty [ ] properties = PsiTreeUtil . getChildrenOfType ( simpleFile , SimpleProperty . class ) ; if ( properties != null ) { for ( SimpleProperty property : properties ) { if ( key . equals ( property . getKey ( ) ) ) { result . add ( property ) ; } } } } } return result ; }
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