Examples of findDefinition()


Examples of com.python.pydev.refactoring.IPyRefactoring2.findDefinition()

      }

    // find declaration
    }else{
      IPyRefactoring pyRefactoring = AbstractPyRefactoring.getPyRefactoring();
      ItemPointer[] defs = pyRefactoring.findDefinition(request);

      for (ItemPointer item : defs){
        if (item.file == null || item.file.toString().endsWith(".so")){
          continue;
        }
View Full Code Here

Examples of net.sourceforge.veditor.parser.OutlineDatabase.findDefinition()

          if (element instanceof VerilogInstanceElement) {
            VerilogInstanceElement instance = (VerilogInstanceElement) element;
            OutlineDatabase database = getOutlineDatabase();
            if (database != null) {
              OutlineElement module = database.findDefinition(instance);
              if (module != null)
                m_Editor.showElement(module);
            }

          } else if (element instanceof OutlineElement) {
View Full Code Here

Examples of org.python.pydev.core.IModule.findDefinition()

                SimpleNode n = NodeUtils.getNodeFromPath(classDef, "__init__");
                if (n instanceof FunctionDef) {
                    initNode = n;

                } else {
                    IDefinition[] definition = mod.findDefinition(CompletionStateFactory.getEmptyCompletionState(
                            className + ".__init__", this.nature, this.completionCache), -1, -1, this.nature);
                    for (IDefinition iDefinition : definition) {
                        Definition d = (Definition) iDefinition;
                        if (d.ast instanceof FunctionDef) {
                            initNode = d.ast;
View Full Code Here

Examples of org.python.pydev.core.IModule.findDefinition()

                        String moduleName = nature.resolveModule(file);
                        if (moduleName != null) {
                            IModule mod = nature.getAstManager().getModule(moduleName, nature, true);
                            if (mod != null) {
                                ICompletionCache completionCache = new CompletionCache();
                                IDefinition[] definitions = mod.findDefinition(CompletionStateFactory
                                        .getEmptyCompletionState(testPath, nature, completionCache), -1, -1, nature);

                                if (definitions != null && definitions.length > 0) {
                                    List<ItemPointer> pointers = new ArrayList<ItemPointer>();
                                    PyRefactoringFindDefinition.getAsPointers(pointers, (Definition[]) definitions);
View Full Code Here

Examples of org.python.pydev.core.IModule.findDefinition()

            if (path != null && path.length() > 0) {
                tok = path + ".";
            }
            tok += info.getName();
            try {
                IDefinition[] definitions = mod.findDefinition(
                        CompletionStateFactory.getEmptyCompletionState(tok, nature, completionCache), -1, -1, nature);

                if ((definitions == null || definitions.length == 0) && path != null && path.length() > 0) {
                    //this can happen if we have something as an attribute in the path:
View Full Code Here

Examples of org.python.pydev.core.IModule.findDefinition()

                    //        self.xxx = 10
                    //
                    //so, we'de get a find definition for Bar.__init__.xxx which is something we won't find
                    //for now, let's simply return a match in the correct context (although the correct way of doing
                    //it would be analyzing that context to find the match)
                    definitions = mod.findDefinition(
                            CompletionStateFactory.getEmptyCompletionState(path, nature, completionCache), -1, -1,
                            nature);

                }
                PyRefactoringFindDefinition.getAsPointers(pointers, (Definition[]) definitions);
View Full Code Here

Examples of org.python.pydev.core.IModule.findDefinition()

                        finalRep = parentPackage.substring(length + 1) + '.';
                    }
                    finalRep += token.getRepresentation();

                    try {
                        IDefinition[] definitions = module.findDefinition(state.getCopyWithActTok(finalRep), -1, -1,
                                nature);
                        if (definitions.length > 0) {
                            return (Definition) definitions[0];
                        }
                    } catch (Exception e) {
View Full Code Here

Examples of org.python.pydev.core.IModule.findDefinition()

                //TODO: The nature (and so the grammar to be used) must be defined by the file we'll parse
                //(so, we need to know the system modules manager that actually created it to know the actual nature)
                IModule sourceMod = AbstractModule.createModuleFromDoc(mod.getName(), f,
                        new Document(FileUtils.getPyFileContents(f)), nature, true);
                if (sourceMod instanceof SourceModule) {
                    Definition[] definitions = (Definition[]) sourceMod.findDefinition(
                            state.getCopyWithActTok(foundAs), -1, -1, nature);
                    if (definitions.length > 0) {
                        this.definitionsFoundCache.add(token, definitions);
                        return definitions;
                    }
View Full Code Here

Examples of org.python.pydev.core.IModule.findDefinition()

                "        self.c.";

        Document doc = new Document(d);
        IModule module = AbstractModule.createModuleFromDoc("", null, doc, nature, true);
        //self.c is found as an assign
        Definition[] defs = (Definition[]) module.findDefinition(
                CompletionStateFactory.getEmptyCompletionState("self.c", nature, new CompletionCache()), 10, 9, nature);

        assertEquals(1, defs.length);
        assertEquals("self.c", ((AssignDefinition) defs[0]).target);
        assertEquals("C", defs[0].value);
View Full Code Here

Examples of org.python.pydev.core.IModule.findDefinition()

        assertEquals(1, defs.length);
        assertEquals("self.c", ((AssignDefinition) defs[0]).target);
        assertEquals("C", defs[0].value);
        assertSame(module, defs[0].module);

        defs = (Definition[]) module.findDefinition(
                CompletionStateFactory.getEmptyCompletionState("C", nature, new CompletionCache()), 7, 18, nature);
        assertEquals(1, defs.length);
        assertEquals("C", defs[0].value);
        assertSame(module, defs[0].module);
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.