Package org.eclipse.dltk.core

Examples of org.eclipse.dltk.core.ISourceModule


    if (pos >= 0) {

      IResource resource = getResourceFromInput(input);

      Map<String, String> attributes = new HashMap<String, String>();
      ISourceModule modelElement = DLTKUIPlugin
          .getEditorInputModelElement(input);

      if (modelElement != null) {
        attributes.put(IMarker.LOCATION, modelElement.getPath()
            .toString());
      }

      // Calculate secondary ID
      String secondaryId = null;
View Full Code Here


    }
  }

  private void activeJavaEditorChanged(IWorkbenchPart editor) {

    ISourceModule javaElement = null;
    if (editor instanceof PHPStructuredEditor) {
      javaElement = (ISourceModule) ((PHPStructuredEditor) editor)
          .getModelElement();
    }
View Full Code Here

      }
    }

    if (isReconciling) {
      try {
        final ISourceModule activeElement = fReconcilingJavaElement;

        // Wait for AST
        synchronized (fWaitLock) {
          if (DEBUG) {
            System.out
View Full Code Here

  protected String getFilePath(String projectRelativePath) {
    return "/" + PROJECT + "/" + projectRelativePath;
  }

  public void testReferencingFiles() throws Exception {
    ISourceModule sourceModule = getSourceModule(getFilePath("test1/a.php"));
    ReferenceTree tree = FileNetworkUtility.buildReferencingFilesTree(
        sourceModule, null);
    assertContents(getSavedHierarchy("test1"), tree.toString());
  }
View Full Code Here

        sourceModule, null);
    assertContents(getSavedHierarchy("test1"), tree.toString());
  }

  public void testReferencedFiles() throws Exception {
    ISourceModule sourceModule = getSourceModule(getFilePath("test2/a.php"));
    ReferenceTree tree = FileNetworkUtility.buildReferencedFilesTree(
        sourceModule, null);
    assertContents(getSavedHierarchy("test2"), tree.toString());
  }
View Full Code Here

        sourceModule, null);
    assertContents(getSavedHierarchy("test2"), tree.toString());
  }

  public void testCachedReferencedFiles() throws Exception {
    ISourceModule sourceModule = getSourceModule(getFilePath("test2/a.php"));
    HashMap<ISourceModule, Node> cache = new HashMap<ISourceModule, Node>();

    ReferenceTree tree = FileNetworkUtility.buildReferencedFilesTree(
        sourceModule, cache, null);
    tree = FileNetworkUtility.buildReferencedFilesTree(sourceModule, cache,
View Full Code Here

        null);
    assertContents(getSavedHierarchy("test2"), tree.toString());
  }

  public void testSearchMethod() throws Exception {
    ISourceModule sourceModule = getSourceModule(getFilePath("test3/c.php"));
    IType type = sourceModule.getType("Test3");
    IMethod[] method = PHPModelUtils.getTypeHierarchyMethod(type, "foo",
        true, null);

    Assert.assertTrue("Can't find method", method.length > 0);
    Assert.assertEquals("Wrong method was found", "a.php", method[0]
View Full Code Here

    Assert.assertEquals("Wrong method was found", "a.php", method[0]
        .getSourceModule().getElementName());
  }

  public void testSearchMethodBadNetwork() throws Exception {
    ISourceModule sourceModule = getSourceModule(getFilePath("test4/c.php"));
    IType type = sourceModule.getType("Test4");
    IMethod[] method = PHPModelUtils.getTypeHierarchyMethod(type, "foo",
        true, null);

    Assert.assertTrue("There should be two methods found",
        method.length == 2);
View Full Code Here

                    data.getBytes()), true, null);
              }

              waitUntilIndexesReady();

              ISourceModule sourceModule = (ISourceModule) DLTKCore
                  .create(workspaceFile);
              CompletionProposal[] proposals = CodeAssistTests
                  .getProposals(sourceModule, offset);
              CodeAssistTests.compareProposals(proposals,
                  pdttFile);
View Full Code Here

    return flags;
  }

  protected static List<String> getSelection(String data) throws Exception {
    createFile(data);
    ISourceModule sourceModule = DLTKCore.createSourceModuleFrom(testFile);

    IDLTKSearchScope scope = SearchEngine.createSearchScope(sourceModule,
        getSearchFlags(false));
    ISearchEngine searchEngine = ModelAccess.getSearchEngine(scope
        .getLanguageToolkit());
    final List<String> paths = new ArrayList<String>();
    if (searchEngine != null) {
      ISearchRequestor requestor = new ISearchRequestor() {
        public void match(int elementType, int flags, int offset,
            int length, int nameOffset, int nameLength,
            String elementName, String metadata, String doc,
            String qualifier, String parent,
            ISourceModule sourceModule, boolean isReference) {

          paths.add(sourceModule.getPath().toString());
        }
      };

      searchEngine.search(IModelElement.FIELD, null, "$testField", 0, 0,
          0, SearchFor.ALL_OCCURENCES, MatchRule.EXACT, scope,
View Full Code Here

TOP

Related Classes of org.eclipse.dltk.core.ISourceModule

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.