[Pydev-cvs] org.python.pydev/src/org/python/pydev/editor/codecompletion/revisited/modules SourceModu
Brought to you by:
fabioz
From: Fabio Z. <fa...@us...> - 2006-04-17 16:25:10
|
Update of /cvsroot/pydev/org.python.pydev/src/org/python/pydev/editor/codecompletion/revisited/modules In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15856/src/org/python/pydev/editor/codecompletion/revisited/modules Modified Files: SourceModule.java Log Message: Index: SourceModule.java =================================================================== RCS file: /cvsroot/pydev/org.python.pydev/src/org/python/pydev/editor/codecompletion/revisited/modules/SourceModule.java,v retrieving revision 1.45 retrieving revision 1.46 diff -C2 -d -r1.45 -r1.46 *** SourceModule.java 11 Apr 2006 23:54:59 -0000 1.45 --- SourceModule.java 17 Apr 2006 16:25:02 -0000 1.46 *************** *** 201,208 **** }else if (d.ast instanceof Name){ - FindDefinitionModelVisitor visitor = new FindDefinitionModelVisitor(actToks[actToks.length-1], d.line, d.col, d.module); ClassDef classDef = d.scope.getClassDef(); if(classDef != null){ classDef.accept(visitor); d = visitor.definitions.get(0); value = d.value; --- 201,211 ---- }else if (d.ast instanceof Name){ ClassDef classDef = d.scope.getClassDef(); if(classDef != null){ + FindDefinitionModelVisitor visitor = new FindDefinitionModelVisitor(actToks[actToks.length-1], d.line, d.col, d.module); classDef.accept(visitor); + if(visitor.definitions.size() == 0){ + return new IToken[0]; + } d = visitor.definitions.get(0); value = d.value; *************** *** 211,215 **** } }else{ ! //TODO: ok, this case has to be further worked on... } --- 214,230 ---- } }else{ ! if(d.module instanceof SourceModule){ ! FullRepIterable.joinFirstParts(actToks); ! SourceModule m = (SourceModule) d.module; ! Definition[] definitions2 = m.findDefinition(FullRepIterable.joinFirstParts(actToks), d.line, d.col,manager.getNature(), null); ! if(definitions2.length == 0){ ! return new IToken[0]; ! } ! d = definitions2[0]; ! value = d.value+"."+actToks[actToks.length-1]; ! if(d instanceof AssignDefinition){ ! return ((SourceModule)d.module).getValueCompletions(initialState, manager, value); ! } ! } } *************** *** 311,314 **** --- 326,332 ---- public Definition[] findDefinition(String rep, int line, int col, IPythonNature nature, List<FindInfo> lFindInfo) throws Exception{ + if(lFindInfo == null){ + lFindInfo = new ArrayList<FindInfo>(); + } //the line passed in starts at 1 and the lines for the visitor start at 0 ArrayList<Definition> toRet = new ArrayList<Definition>(); |