Package dtool.engine.operations.FindDefinitionResult

Examples of dtool.engine.operations.FindDefinitionResult.FindDefinitionResultEntry


  @Test
  public void testALL() throws Exception { testALL$(); }
  public void testALL$() throws Exception {
   
    testFindDefinition(BASIC_FOO_FilePath, indexOf(BASIC_FOO_Contents, "/*defA_REF1*/"),
      new FindDefinitionResultEntry(
        "defA", false, BASIC_FOO_FilePath, new SourceRange(indexOf(BASIC_FOO_Contents, "defA/*DEF*/"), 4))
    );
   
    // Test implicit source module
    testFindDefinition(BASIC_FOO_FilePath, indexOf(BASIC_FOO_Contents, "implicit_name/*MARKER*/"),
      new FindDefinitionResultEntry(
        "implicit_name", false, BUNDLE_FOO__SRC_FOLDER.resolve("basic_pack/implicit_name.d"),
        new SourceRange(0, 0))
    );
   
    // Test intrinsic
    testFindDefinition(BASIC_FOO_FilePath, indexOf(BASIC_FOO_Contents, "int/*int_ref*/"),
      new FindDefinitionResultEntry(
        "int", true, null, null)
    );
   
    // Test error cases
    testFindDefinition(BASIC_FOO_FilePath, indexOf(BASIC_FOO_Contents, "intvar ="),
View Full Code Here


    }
   
    assertTrue(expectedResults.length == opResult.results.size());
   
    for (int i = 0; i < expectedResults.length; i++) {
      FindDefinitionResultEntry expected = expectedResults[i];
      FindDefinitionResultEntry nameResult = opResult.results.get(i);
     
      assertAreEqual(nameResult.extendedName, expected.extendedName);
      assertAreEqual(nameResult.modulePath, expected.modulePath);
      assertAreEqual(nameResult.sourceRange, expected.sourceRange);
      assertAreEqual(nameResult.isLanguageIntrinsic, expected.isLanguageIntrinsic);
View Full Code Here

    if(results.size() > 1) {
      dialogInfo("Multiple definitions found: \n"
          + namedResultsToString(results, "\n") + "\nOpening the first one.");
    }
   
    FindDefinitionResultEntry fdResultEntry = results.get(0);
   
    if(fdResultEntry == null || fdResultEntry.isLanguageIntrinsic()) {
      dialogInfo("Cannot open definition, "
          + "symbol \"" +fdResultEntry.extendedName + "\" is a language intrinsic.");
      return;
    }
    final SourceRange sourceRange = fdResultEntry.sourceRange;
View Full Code Here

        if(defUnit.getArcheType() == EArcheType.Module && sourceRange == null) {
          sourceRange = new SourceRange(0, 0);
        }
      }
     
      results.add(new FindDefinitionResultEntry(
        namedElement.getExtendedName(),
        namedElement.isLanguageIntrinsic(),
        compilationUnitPath,
        sourceRange));
    }
View Full Code Here

      Integer offset = getIntegerOrNull(resultEntry, "offset");
      if(offset != null) {
        sr = new SourceRange(offset, getInt(resultEntry, "length"));
      }
     
      return new FindDefinitionResultEntry(
        getString(resultEntry, "extendedName"),
        getBoolean(resultEntry, "isIntrinsic"),
        getPathOrNull(resultEntry, "modulePath"),
        sr);
    }
View Full Code Here

TOP

Related Classes of dtool.engine.operations.FindDefinitionResult.FindDefinitionResultEntry

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.