Package dtool.engine.AbstractBundleResolution

Examples of dtool.engine.AbstractBundleResolution.ResolvedModule


    checkGetModule(sm.getStoredResolution(bundlePath), moduleName, expectedModuleName);
  }
 
  protected ResolvedModule checkGetModule(BundleResolution bundleRes, String moduleName,
      String expectedModuleName) throws ParseSourceException {
    ResolvedModule resolvedModule = bundleRes.getBundleResolvedModule(moduleName);
   
    if(expectedModuleName != null) {
      assertNotNull(resolvedModule);
      assertTrue(resolvedModule.getModuleNode().getFullyQualifiedName().equals(expectedModuleName));
      if(!sm.checkIsResolutionStale(bundleRes.bundlePath)) {
        try {
          assertTrue(resolvedModule == sm.getUpdatedResolvedModule(resolvedModule.getModulePath()) );
        } catch (ExecutionException e) {
          assertFail();
        }
      }
    } else {
View Full Code Here


  }
 
  protected void testFindResolvedModule(AbstractBundleResolution bundleRes, String moduleNameStr, Path expectedPath)
      throws ParseSourceException {
    ModuleFullName moduleFullName = new ModuleFullName(moduleNameStr);
    ResolvedModule resolvedModule = bundleRes.findResolvedModule(moduleFullName);
    Path modulePath = resolvedModule == null ? null : resolvedModule.getModulePath();
    assertAreEqual(modulePath, expectedPath);
   
    if(expectedPath != null) {
      assertEquals(bundleRes.findModule(moduleFullName.getPackages(), moduleFullName.getModuleSimpleName()),
        resolvedModule.getModuleNode());
    }
  }
View Full Code Here

 
  /* -----------------  ----------------- */
 
  protected ResolvedModule getUpdatedResolvedModule(Path filePath, String fullName)
      throws ExecutionException {
    ResolvedModule resolvedModule = getUpdatedResolvedModule(filePath);
    assertTrue(resolvedModule == getUpdatedResolvedModule(filePath)); // Check instance remains same.
    assertEquals(resolvedModule.getModuleNode().getFullyQualifiedName(), fullName);
    return resolvedModule;
  }
View Full Code Here

  public void testGetResolvedModule$() throws Exception {
    prepSMTestsWorkingDir();
    sm = ___initSemanticManager();
    sm.getUpdatedResolution(COMPLEX_LIB);
   
    ResolvedModule resolvedModule = getUpdatedResolvedModule(BASIC_LIB_FOO_MODULE);
    assertTrue(resolvedModule.bundleRes == sm.getStoredResolution(BASIC_LIB));
   
    BundleResolution complexLibSR = sm.getUpdatedResolution(COMPLEX_LIB);
    assertTrue(resolvedModule == complexLibSR.findResolvedModule(new ModuleFullName(BASIC_LIB_FOO_MODULE_Name)));
    assertTrue(complexLibSR.getCompilerPath().equals(DEFAULT_DMD_INSTALL_EXE_PATH));
View Full Code Here

    this.filePath = filePath;
    this.offset = offset;
  }
 
  public String perform() {
    ResolvedModule resolvedModule;
    try {
      resolvedModule = filePath == null ? null : getResolvedModule(filePath);
    } catch (ExecutionException e) {
      resolvedModule = null;
    }
    if(resolvedModule == null) {
      return null; /*FIXME: BUG here: show error message. */
    }
    Module module = resolvedModule.getModuleNode();
    ASTNode pickedNode = ASTNodeFinder.findElement(module, offset);
    IModuleResolver mr = resolvedModule.getModuleResolver();
   
    INamedElement relevantElementForDoc = null;
    if(pickedNode instanceof DefSymbol) {
      relevantElementForDoc = ((DefSymbol) pickedNode).getDefUnit();
    } else if(pickedNode instanceof NamedReference) {
View Full Code Here

 
  public FindDefinitionResult findDefinition(Path filePath, final int offset) {
    if(filePath == null) {
      return new FindDefinitionResult("Invalid path for file: " );
    }
    final ResolvedModule resolvedModule;
    try {
      resolvedModule = getResolvedModule(filePath);
    } catch (ExecutionException e) {
      return new FindDefinitionResult("Error awaiting operation result: " + e);
    }
    Module module = resolvedModule.getModuleNode();
    ASTNode node = ASTNodeFinder.findElement(module, offset);
    if(node == null) {
      return new FindDefinitionResult("No node found at offset: " + offset);
    }
    assertEquals(node.getModuleNode().compilationUnitPath, filePath); /*FIXME: BUG here normalization */
 
View Full Code Here

      throws ExecutionException {
    if(filePath == null) {
      throw new ExecutionException(new Exception("Invalid path for content assist source."));
    }
   
    ResolvedModule resolvedModule = getSemanticManager().getUpdatedResolvedModule(filePath, compilerPath);
    return doCodeCompletion(resolvedModule, offset);
  }
View Full Code Here

TOP

Related Classes of dtool.engine.AbstractBundleResolution.ResolvedModule

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.