Package org.eclipse.dltk.core

Examples of org.eclipse.dltk.core.ISourceModule


    if (!(mdObj instanceof ModuleDeclaration)) {
      return;
    }
    ModuleDeclaration md = (ModuleDeclaration) mdObj;
    IProblemReporter problemReporter = context.getProblemReporter();
    ISourceModule smod = context.getSourceModule();

    // traverse:
    ISourceLineTracker linetracker = context.getLineTracker();
    String fileName = smod.getElementName();
    try {
      ASTVisitor visitor = new EngineAndCallCheckerVisitor(problemReporter, linetracker, fileName);
      md.traverse(visitor);
    } catch (Exception e) {
      e.printStackTrace();
View Full Code Here


    Object mdObj = context.get(IBuildContext.ATTR_MODULE_DECLARATION);
    if (!(mdObj instanceof ModuleDeclaration)) {
      return;
    }
    IProblemReporter problemReporter = context.getProblemReporter();
    ISourceModule smod = context.getSourceModule();
    ISourceLineTracker linetracker = context.getLineTracker();
    RutaCheckerProblemFactory problemFactory = new RutaCheckerProblemFactory(smod.getElementName(), linetracker);
   
    IScriptProject scriptProject = smod.getScriptProject();
    IProject project = scriptProject.getProject();
    IProject[] referencedProjects = project.getReferencedProjects();
    List<IProject> listOfClosedProjects = new ArrayList<IProject>();
    for (IProject each : referencedProjects) {
      if(!each.isOpen()) {
View Full Code Here

    } catch (CoreException e) {
      throw e;
    }
    String fileNameWithoutExtension = path.substring(path.lastIndexOf('.') + 1);
    String fileNameWithExtension = fileNameWithoutExtension + RutaEngine.SCRIPT_FILE_EXTENSION;
    ISourceModule sourceModule = null;
    boolean found = false;
    for (IFolder eachFolder : scriptFolders) {

      IScriptProject sp = DLTKCore.create(eachFolder.getProject());
      IScriptFolder[] scriptFolders2 = sp.getScriptFolders();
      for (IScriptFolder iScriptFolder : scriptFolders2) {
        sourceModule = iScriptFolder.getSourceModule(fileNameWithExtension);
        if (sourceModule.exists() && sourceModule.getResource() != null
                && sourceModule.getResource().exists()) {
          found = true;
          break;
        }
        if (found)
          break;
      }
    }
    IModelElement elements[] = null;
    namespaceStack.push(fileNameWithoutExtension);
    try {
      elements = sourceModule.getChildren();
      for (int i = 0; i < elements.length; i++) {
        IModelElement modelElement = elements[i];
        int elementType = modelElement.getElementType();
        if (elementType == type) {
          if (elementType == IModelElement.METHOD) {
View Full Code Here

    // if ast not declared in context ..
    Object mdObj = context.get(IBuildContext.ATTR_MODULE_DECLARATION);
    if (!(mdObj instanceof ModuleDeclaration)) {
      // ...temporary inefficient hack to get live error msgs
      // TODO refactor
      ISourceModule sourceModule = context.getSourceModule();
      ModuleDeclaration md = SourceParserUtil.getModuleDeclaration(sourceModule, null);
      context.set(IBuildContext.ATTR_MODULE_DECLARATION, md);
    }
    for (IBuildParticipant buildP : buildParticipants) {
      buildP.build(context);
View Full Code Here

      return;
    }
    ModuleDeclaration md = (ModuleDeclaration) mdObj;

    IProblemReporter problemReporter = context.getProblemReporter();
    ISourceModule smod = context.getSourceModule();
    ISourceLineTracker linetracker = context.getLineTracker();
    try {
      Collection<String> dependencies = RutaProjectUtils.getClassPath(smod.getScriptProject()
              .getProject());
      URL[] urls = new URL[dependencies.size()];
      int counter = 0;
      for (String dep : dependencies) {
        urls[counter] = new File(dep).toURI().toURL();
View Full Code Here

    return fSearchResults;
  }

  public IMethod[] findMethods(final String methodName, int argCount, int sourcePosition) {
    final List methods = new ArrayList();
    ISourceModule module = this.method.getSourceModule();
    try {
      IModelElement[] elements = module.codeSelect(sourcePosition, methodName.length());
      for (int i = 0; i < elements.length; ++i) {
        if (elements[i] instanceof IMethod) {
          methods.add(elements[i]);
        }
      }
View Full Code Here

          return;
        }

        if (match.getElement() != null && match.getElement() instanceof IModelElement) {
          IModelElement member = (IModelElement) match.getElement();
          ISourceModule module = (ISourceModule) member.getAncestor(IModelElement.SOURCE_MODULE);
          SimpleReference ref = new SimpleReference(match.getOffset(), match.getOffset()
                  + match.getLength(), "");
          try {
            IModelElement[] e = module.codeSelect(match.getOffset(), 1);
            for (int j = 0; j < e.length; ++j) {
              if (e[j].equals(parent)) {
                elements.put(ref, member);
              }
            }
View Full Code Here

  }

  public void build(IBuildContext context) throws CoreException {
    final ModuleDeclaration ast = (ModuleDeclaration) context
            .get(IBuildContext.ATTR_MODULE_DECLARATION);
    ISourceModule sourceModule = context.getSourceModule();
    generateDescriptorResources(sourceModule, ast);
  }
View Full Code Here

      if (range == null)
        return null;

      IBuffer buf = null;

      ISourceModule compilationUnit = member.getSourceModule();
      if (!compilationUnit.isConsistent()) {
        return null;
      }

      buf = compilationUnit.getBuffer();

      final int start = range.getOffset();

      String contents = buf.getContents();
View Full Code Here

  final DeeScriptElementLabels sel = DeeUILanguageToolkit.getDefault().getScriptElementLabels();
 
  @Test
  public void testBasic() throws Exception { testBasic$(); }
  public void testBasic$() throws Exception {
    ISourceModule srcModule;
   
//    srcModule = getSourceModule(TR_SAMPLE_SRC1, "sampledefs.d");
//    runTest(srcModule, "sampledefs", "");
   
    srcModule = getSourceModule(TR_SAMPLE_SRC1, "packA/sampledefs_inpack.d");
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.