Update of /cvsroot/pydev/org.python.pydev/src_completions/org/python/pydev/editor/codecompletion/revisited
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28475/src_completions/org/python/pydev/editor/codecompletion/revisited
Modified Files:
AbstractASTManager.java PythonPathHelper.java
Log Message:
Created structure to help dealing with imports in files, even if the file does not have a correct AST
Refactor: Moved methods from FullRepIterable to StringUtils
Index: AbstractASTManager.java
===================================================================
RCS file: /cvsroot/pydev/org.python.pydev/src_completions/org/python/pydev/editor/codecompletion/revisited/AbstractASTManager.java,v
retrieving revision 1.15
retrieving revision 1.16
diff -C2 -d -r1.15 -r1.16
*** AbstractASTManager.java 5 May 2008 01:31:21 -0000 1.15
--- AbstractASTManager.java 18 May 2008 20:02:16 -0000 1.16
***************
*** 30,33 ****
--- 30,34 ----
import org.python.pydev.core.Tuple3;
import org.python.pydev.core.TupleN;
+ import org.python.pydev.core.docutils.StringUtils;
import org.python.pydev.core.log.Log;
import org.python.pydev.core.structure.CompletionRecursionException;
***************
*** 131,135 ****
if(level > 0){
//ok, it is the import added on python 2.5 (from .. import xxx)
! String[] moduleParts = FullRepIterable.dotSplit(moduleName);
if(moduleParts.length > level){
relative = FullRepIterable.joinParts(moduleParts, moduleParts.length-level);
--- 132,136 ----
if(level > 0){
//ok, it is the import added on python 2.5 (from .. import xxx)
! String[] moduleParts = StringUtils.dotSplit(moduleName);
if(moduleParts.length > level){
relative = FullRepIterable.joinParts(moduleParts, moduleParts.length-level);
***************
*** 235,239 ****
if (element.length() > 0 && goForIt) {
! String[] splitted = FullRepIterable.dotSplit(element);
if (splitted.length > 0) {
//this is the completion
--- 236,240 ----
if (element.length() > 0 && goForIt) {
! String[] splitted = StringUtils.dotSplit(element);
if (splitted.length > 0) {
//this is the completion
***************
*** 1052,1056 ****
String parentPackage = token.getParentPackage();
! String[] moduleParts = FullRepIterable.dotSplit(parentPackage);
String relative = null;
if(moduleParts.length > level){
--- 1053,1057 ----
String parentPackage = token.getParentPackage();
! String[] moduleParts = StringUtils.dotSplit(parentPackage);
String relative = null;
if(moduleParts.length > level){
Index: PythonPathHelper.java
===================================================================
RCS file: /cvsroot/pydev/org.python.pydev/src_completions/org/python/pydev/editor/codecompletion/revisited/PythonPathHelper.java,v
retrieving revision 1.9
retrieving revision 1.10
diff -C2 -d -r1.9 -r1.10
*** PythonPathHelper.java 13 Apr 2008 16:55:23 -0000 1.9
--- PythonPathHelper.java 18 May 2008 20:02:16 -0000 1.10
***************
*** 269,273 ****
//this means that more than 1 module is specified, so, in order to get it,
//we have to go and see if all the folders to that module have __init__.py in it...
! String[] modulesParts = FullRepIterable.dotSplit(s);
if (modulesParts.length > 1 && isFile) {
--- 269,273 ----
//this means that more than 1 module is specified, so, in order to get it,
//we have to go and see if all the folders to that module have __init__.py in it...
! String[] modulesParts = StringUtils.dotSplit(s);
if (modulesParts.length > 1 && isFile) {
|