Package com.jetbrains.lang.dart.resolve

Examples of com.jetbrains.lang.dart.resolve.DartResolveProcessor


  @NotNull
  public static DartClassResolveResult findCoreClass(PsiElement context, String className) {
    final List<VirtualFile> libraryFile = DartLibraryIndex.findLibraryClass(context, "dart:core");
    final List<DartComponentName> result = new ArrayList<DartComponentName>();
    processTopLevelDeclarations(context, new DartResolveProcessor(result, className), libraryFile, className);
    final PsiElement parent = result.isEmpty() ? null : result.iterator().next().getParent();
    return DartClassResolveResult.create(parent instanceof DartClass ? (DartClass)parent : null);
  }
View Full Code Here


                                                                        String libraryPrefix,
                                                                        String componentName) {
    final VirtualFile virtualFile = getImportedFileByImportPrefix(contextToSearch.getContainingFile(), libraryPrefix);
    if (virtualFile != null) {
      final List<DartComponentName> result = new ArrayList<DartComponentName>();
      processTopLevelDeclarations(contextToSearch, new DartResolveProcessor(result, componentName),
                                  virtualFile, componentName);
      return result;
    }
    return Collections.emptyList();
  }
View Full Code Here

  @Nullable
  public static DartFunctionDeclarationWithBodyOrNative getMainFunction(final @Nullable PsiFile file) {
    if (!(file instanceof DartFile)) return null;

    final ArrayList<DartComponentName> result = new ArrayList<DartComponentName>();
    DartPsiCompositeElementImpl.processDeclarationsImpl(file, new DartResolveProcessor(result, "main"), ResolveState.initial(), null);

    for (DartComponentName componentName : result) {
      final PsiElement parent = componentName.getParent();
      if (parent instanceof DartFunctionDeclarationWithBodyOrNative) {
        return (DartFunctionDeclarationWithBodyOrNative)parent;
View Full Code Here

    final String typeName = expression.getText();
    if (typeName.indexOf('.') != -1) {
      return ((DartReference)expression).resolve();
    }
    List<DartComponentName> result = new ArrayList<DartComponentName>();
    final DartResolveProcessor dartResolveProcessor = new DartResolveProcessor(result, typeName);

    final VirtualFile virtualFile = DartResolveUtil.getRealVirtualFile(dartType.getContainingFile());
    if (virtualFile != null) {
      DartResolveUtil.processTopLevelDeclarations(dartType, dartResolveProcessor, virtualFile, typeName);
    }
View Full Code Here

TOP

Related Classes of com.jetbrains.lang.dart.resolve.DartResolveProcessor

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.