Posted by Andrey Tarantsov Fri 2nd Mar 2007 09:20 - Syntax is Diff - 28 views
Download | New Post | Modify | Hide line numbers
Download | New Post | Modify | Hide line numbers
-
diff -rNu orig/org.eclipse.dltk.core/model/org/eclipse/dltk/internal/core/ExternalSourceModule.java modif/org.eclipse.dltk.core/model/org/eclipse/dltk/internal/core/ExternalSourceModule.java
-
--- orig/org.eclipse.dltk.core/model/org/eclipse/dltk/internal/core/ExternalSourceModule.java 2007-03-01 17:56:000 +0600
-
+++ modif/org.eclipse.dltk.core/model/org/eclipse/dltk/internal/core/ExternalSourceModule.java 2007-03-02 02:29:000 +0600
-
@@ -34,6 +34,7 @@
-
import org.eclipse.dltk.core.IProjectFragment;
-
import org.eclipse.dltk.core.ISourceElementParser;
-
import org.eclipse.dltk.core.ISourceModule;
-
+import org.eclipse.dltk.core.ISourceModuleInfoCache;
-
import org.eclipse.dltk.core.ISourceRange;
-
import org.eclipse.dltk.core.IType;
-
import org.eclipse.dltk.core.ModelException;
-
@@ -126,7 +127,12 @@
-
throw new ModelException(new ModelStatus(ModelStatus.INVALID_NAME));
-
}
-
ISourceElementParser parser = toolkit.createSourceElementParser(requestor, null, Collections.EMPTY_MAP);
-
- parser.parseSourceModule(contents, null);
-
+
-
+ ISourceModuleInfoCache sourceModuleInfoCache = ModelManager.getModelManager().getSourceModuleInfoCache();
-
+// sourceModuleInfoCache.remove(this);
-
+ parser.parseSourceModule(contents, sourceModuleInfoCache.get(this));
-
+
-
+// parser.parseSourceModule(contents, null);
-
if (ExternalSourceModule.DEBUG_PRINT_MODEL) {
-
System.out.println("Source Module Debug print:");
-
CorePrinter printer = new CorePrinter(System.out);
-
diff -rNu orig/org.eclipse.dltk.core/model/org/eclipse/dltk/internal/core/SourceModuleInfoCache.java modif/org.eclipse.dltk.core/model/org/eclipse/dltk/internal/core/SourceModuleInfoCache.java
-
--- orig/org.eclipse.dltk.core/model/org/eclipse/dltk/internal/core/SourceModuleInfoCache.java 2007-03-02 00:10:000 +0600
-
+++ modif/org.eclipse.dltk.core/model/org/eclipse/dltk/internal/core/SourceModuleInfoCache.java 2007-03-02 02:41:000 +0600
-
@@ -28,7 +28,7 @@
-
// if max memory is infinite, set the ratio to 4d which corresponds to
-
// the 256MB that Eclipse defaults to
-
// (see https://bugs.eclipse.org/bugs/show_bug.cgi?id=111299)
-
- double ratio = 1000; // 64000000
-
+ double ratio = 10; // 64000000
-
-
this.cache = new ElementCache(
-
(int) (ModelCache.DEFAULT_ROOT_SIZE * ratio));
-
@@ -41,11 +41,11 @@
-
-
public ISourceModuleInfo get(ISourceModule module) {
-
Object object = this.cache.get(module);
-
+ System.out.println("Filling ratio:" + this.cache.fillingRatio());
-
if (object == null) {
-
- System.out.print("$");
-
return returnAdd(module);
-
}
-
- System.out.print("!");
-
+ this.cache.printStats();
-
return (ISourceModuleInfo) object;
-
}
-
-
diff -rNu orig/org.eclipse.dltk.core/search/org/eclipse/dltk/core/search/indexing/SourceIndexer.java modif/org.eclipse.dltk.core/search/org/eclipse/dltk/core/search/indexing/SourceIndexer.java
-
--- orig/org.eclipse.dltk.core/search/org/eclipse/dltk/core/search/indexing/SourceIndexer.java 2007-03-01 17:56:000 +0600
-
+++ modif/org.eclipse.dltk.core/search/org/eclipse/dltk/core/search/indexing/SourceIndexer.java 2007-03-02 05:04:000 +0600
-
@@ -22,6 +22,8 @@
-
import org.eclipse.dltk.core.IScriptFolder;
-
import org.eclipse.dltk.core.ISourceElementParser;
-
import org.eclipse.dltk.core.ISourceModule;
-
+import org.eclipse.dltk.core.ISourceModuleInfoCache;
-
+import org.eclipse.dltk.core.ISourceModuleInfoCache.ISourceModuleInfo;
-
import org.eclipse.dltk.core.search.IDLTKSearchScope;
-
import org.eclipse.dltk.core.search.SearchDocument;
-
import org.eclipse.dltk.internal.core.ModelManager;
-
@@ -67,9 +69,11 @@
-
}
-
String pkgName = "";
-
IFile file = ResourcesPlugin.getWorkspace().getRoot().getFile(path);
-
+ ISourceModule sourceModule = null;
-
if (file.exists()) {
-
ISourceModule module = (ISourceModule) DLTKCore.create(file);
-
if (module != null) {
-
+ sourceModule = module;
-
IScriptFolder folder = (IScriptFolder) module.getParent();
-
pkgName = folder.getElementName();
-
}
-
@@ -87,7 +91,15 @@
-
if (source == null || name == null)
-
return; // could not retrieve document info (e.g. resource was
-
// discarded)
-
+// parser.parseSourceModule(source, null);
-
+// ISourceModuleInfo info = null;
-
+// if( sourceModule != null ) {
-
+// ISourceModuleInfoCache sourceModuleInfoCache = ModelManager.getModelManager().getSourceModuleInfoCache();
-
+// sourceModuleInfoCache.remove(sourceModule);
-
+// info = sourceModuleInfoCache.get(sourceModule);
-
+// }
-
parser.parseSourceModule(source, null);
-
+
-
} else { // This is for external documents
-
if (parser == null || requestor == null ) {
-
//parser = ModelManager.getModelManager().indexManager.getSourceElementParser(dltkProject, requestor);
-
diff -rNu orig/org.eclipse.dltk.core/typeinference/org/eclipse/dltk/ddp/CVS/Entries modif/org.eclipse.dltk.core/typeinference/org/eclipse/dltk/ddp/CVS/Entries
-
--- orig/org.eclipse.dltk.core/typeinference/org/eclipse/dltk/ddp/CVS/Entries 2007-03-01 23:48:000 +0600
-
+++ modif/org.eclipse.dltk.core/typeinference/org/eclipse/dltk/ddp/CVS/Entries 2007-03-02 14:46:000 +0600
-
@@ -7,4 +7,4 @@
-
/IGoalEvaluatorFactory.java/1.2/Sat Feb 24 13:52:32 2007//
-
/ISourceModuleContext.java/1.1/Sun Feb 25 10:35:37 2007//
-
/ITypeInferencer.java/1.1/Fri Feb 23 14:22:15 2007//
-
-/TypeInferencer.java/1.4/Thu Mar 1 17:48:23 2007//
-
+/TypeInferencer.java/1.5/Fri Mar 2 08:46:54 2007//
-
diff -rNu orig/org.eclipse.dltk.core/typeinference/org/eclipse/dltk/ddp/TypeInferencer.java modif/org.eclipse.dltk.core/typeinference/org/eclipse/dltk/ddp/TypeInferencer.java
-
--- orig/org.eclipse.dltk.core/typeinference/org/eclipse/dltk/ddp/TypeInferencer.java 2007-03-01 23:48:000 +0600
-
+++ modif/org.eclipse.dltk.core/typeinference/org/eclipse/dltk/ddp/TypeInferencer.java 2007-03-02 14:46:000 +0600
-
@@ -90,6 +90,8 @@
-
-
long endTime = System.currentTimeMillis() + timeLimit;
-
GoalEvaluator rootEvaluator = evaluatorFactory.createEvaluator(rootGoal);
-
+ if (rootEvaluator == null)
-
+ return null;
-
int emptyStackSize = stackSize; // there might already be some elements there
-
pushToStack(rootEvaluator);
-
IGoal lastFullyEvaluatedGoal = null;
-
diff -rNu orig/org.eclipse.dltk.ruby.core/src/org/eclipse/dltk/ruby/ast/CVS/Entries modif/org.eclipse.dltk.ruby.core/src/org/eclipse/dltk/ruby/ast/CVS/Entries
-
--- orig/org.eclipse.dltk.ruby.core/src/org/eclipse/dltk/ruby/ast/CVS/Entries 2007-03-01 22:20:000 +0600
-
+++ modif/org.eclipse.dltk.ruby.core/src/org/eclipse/dltk/ruby/ast/CVS/Entries 2007-03-02 14:46:000 +0600
-
@@ -2,6 +2,7 @@
-
/ConstantDeclaration.java/1.1/Fri Feb 16 07:46:05 2007//
-
/OrExpression.java/1.1/Fri Feb 23 12:26:15 2007//
-
/ReturnStatement.java/1.2/Wed Feb 28 15:25:03 2007//
-
+/RubyArrayExpression.java/1.1/Fri Mar 2 08:16:13 2007//
-
/RubyMethodArgument.java/1.1/Wed Feb 21 06:03:40 2007//
-
/RubySingletonClassDeclaration.java/1.1/Thu Mar 1 09:07:08 2007//
-
/RubySingletonMethodDeclaration.java/1.2/Wed Feb 28 15:25:06 2007//
-
diff -rNu orig/org.eclipse.dltk.ruby.core/src/org/eclipse/dltk/ruby/ast/RubyArrayExpression.java modif/org.eclipse.dltk.ruby.core/src/org/eclipse/dltk/ruby/ast/RubyArrayExpression.java
-
--- orig/org.eclipse.dltk.ruby.core/src/org/eclipse/dltk/ruby/ast/RubyArrayExpression.java 1970-01-01 07:00:000 +0700
-
+++ modif/org.eclipse.dltk.ruby.core/src/org/eclipse/dltk/ruby/ast/RubyArrayExpression.java 2007-03-02 14:16:000 +0600
-
@@ -0,0 +1,7 @@
-
+package org.eclipse.dltk.ruby.ast;
-
+
-
+import org.eclipse.dltk.ast.expressions.ExpressionList;
-
+
-
+public class RubyArrayExpression extends ExpressionList {
-
+
-
+}
-
diff -rNu orig/org.eclipse.dltk.ruby.core/src/org/eclipse/dltk/ruby/core/RubyLanguageToolkit.java modif/org.eclipse.dltk.ruby.core/src/org/eclipse/dltk/ruby/core/RubyLanguageToolkit.java
-
--- orig/org.eclipse.dltk.ruby.core/src/org/eclipse/dltk/ruby/core/RubyLanguageToolkit.java 2007-03-01 18:36:000 +0600
-
+++ modif/org.eclipse.dltk.ruby.core/src/org/eclipse/dltk/ruby/core/RubyLanguageToolkit.java 2007-03-02 10:40:000 +0600
-
@@ -48,6 +48,8 @@
-
import org.eclipse.dltk.core.search.indexing.SourceIndexerRequestor;
-
import org.eclipse.dltk.core.search.matching.MatchLocator;
-
import org.eclipse.dltk.internal.core.util.Messages;
-
+import org.eclipse.dltk.ruby.internal.callhierarchy.RubyCallProcessor;
-
+import org.eclipse.dltk.ruby.internal.callhierarchy.RubyCalleeProcessor;
-
import org.eclipse.dltk.ruby.internal.core.codeassist.RubyCompletionEngine;
-
import org.eclipse.dltk.ruby.internal.core.codeassist.RubySelectionEngine;
-
import org.eclipse.dltk.ruby.internal.core.search.RubyMatchLocator;
-
@@ -224,13 +226,11 @@
-
-
public ICalleeProcessor createCalleeProcessor(IMethod method,
-
IProgressMonitor monitor, IDLTKSearchScope scope) {
-
- // TODO Auto-generated method stub
-
- return null;
-
+ return new RubyCalleeProcessor( method, monitor, scope );
-
}
-
-
public ICallProcessor createCallProcessor() {
-
- // TODO Auto-generated method stub
-
- return null;
-
+ return new RubyCallProcessor();
-
}
-
-
public String getDelimeterReplacerString() {
-
diff -rNu orig/org.eclipse.dltk.ruby.core/src/org/eclipse/dltk/ruby/core/utils/CVS/Entries modif/org.eclipse.dltk.ruby.core/src/org/eclipse/dltk/ruby/core/utils/CVS/Entries
-
--- orig/org.eclipse.dltk.ruby.core/src/org/eclipse/dltk/ruby/core/utils/CVS/Entries 2007-02-23 19:44:000 +0600
-
+++ modif/org.eclipse.dltk.ruby.core/src/org/eclipse/dltk/ruby/core/utils/CVS/Entries 2007-03-02 13:35:000 +0600
-
@@ -1 +1 @@
-
-/RubySyntaxUtils.java/1.2/Fri Feb 23 13:44:39 2007//
-
+/RubySyntaxUtils.java/1.3/Fri Mar 2 07:35:10 2007//
-
diff -rNu orig/org.eclipse.dltk.ruby.core/src/org/eclipse/dltk/ruby/core/utils/RubySyntaxUtils.java modif/org.eclipse.dltk.ruby.core/src/org/eclipse/dltk/ruby/core/utils/RubySyntaxUtils.java
-
--- orig/org.eclipse.dltk.ruby.core/src/org/eclipse/dltk/ruby/core/utils/RubySyntaxUtils.java 2007-02-23 19:44:000 +0600
-
+++ modif/org.eclipse.dltk.ruby.core/src/org/eclipse/dltk/ruby/core/utils/RubySyntaxUtils.java 2007-03-02 13:35:000 +0600
-
@@ -58,7 +58,7 @@
-
*/
-
public static ISourceRange getEnclosingName (CharSequence contents, int pos) {
-
if (pos < 0 || pos >= contents.length())
-
- throw new IllegalArgumentException();
-
+ return null;
-
-
int start = pos - 1;
-
int end = pos;
-
diff -rNu orig/org.eclipse.dltk.ruby.core/src/org/eclipse/dltk/ruby/internal/callhierarchy/RubyCalleeProcessor.java modif/org.eclipse.dltk.ruby.core/src/org/eclipse/dltk/ruby/internal/callhierarchy/RubyCalleeProcessor.java
-
--- orig/org.eclipse.dltk.ruby.core/src/org/eclipse/dltk/ruby/internal/callhierarchy/RubyCalleeProcessor.java 1970-01-01 07:00:000 +0700
-
+++ modif/org.eclipse.dltk.ruby.core/src/org/eclipse/dltk/ruby/internal/callhierarchy/RubyCalleeProcessor.java 2007-03-02 11:27:000 +0600
-
@@ -0,0 +1,199 @@
-
+package org.eclipse.dltk.ruby.internal.callhierarchy;
-
+
-
+import java.util.ArrayList;
-
+import java.util.HashMap;
-
+import java.util.List;
-
+import java.util.Map;
-
+
-
+import org.eclipse.core.runtime.CoreException;
-
+import org.eclipse.core.runtime.IProgressMonitor;
-
+import org.eclipse.dltk.ast.references.SimpleReference;
-
+import org.eclipse.dltk.compiler.ISourceElementRequestor;
-
+import org.eclipse.dltk.core.ICalleeProcessor;
-
+import org.eclipse.dltk.core.IMethod;
-
+import org.eclipse.dltk.core.IModelElement;
-
+import org.eclipse.dltk.core.ISourceModule;
-
+import org.eclipse.dltk.core.ISourceModuleInfoCache;
-
+import org.eclipse.dltk.core.ModelException;
-
+import org.eclipse.dltk.core.search.IDLTKSearchScope;
-
+import org.eclipse.dltk.core.search.SearchEngine;
-
+import org.eclipse.dltk.core.search.SearchParticipant;
-
+import org.eclipse.dltk.core.search.SearchPattern;
-
+import org.eclipse.dltk.core.search.SearchRequestor;
-
+import org.eclipse.dltk.internal.core.ModelManager;
-
+import org.eclipse.dltk.ruby.internal.parser.RubySourceElementParser;
-
+
-
+
-
+public class RubyCalleeProcessor implements ICalleeProcessor {
-
+ protected static int EXACT_RULE = SearchPattern.R_EXACT_MATCH | SearchPattern.R_CASE_SENSITIVE;
-
+
-
+ private Map fSearchResults = new HashMap();
-
+
-
+ private IMethod method;
-
+
-
+ //private IDLTKSearchScope scope;
-
+
-
+ public RubyCalleeProcessor(IMethod method, IProgressMonitor monitor, IDLTKSearchScope scope) {
-
+ this.method = method;
-
+ //this.scope = scope;
-
+ }
-
+
-
+ private class CaleeSourceElementRequestor implements ISourceElementRequestor {
-
+ public void acceptFieldReference(char[] fieldName, int sourcePosition) {
-
+ }
-
+
-
+ public void acceptMethodReference(char[] methodName, int argCount, int sourcePosition, int sourceEndPosition) {
-
+ String name = new String(methodName);
-
+ int off = 0;
-
+ try {
-
+ off = method.getSourceRange().getOffset();
-
+ } catch (ModelException e) {
-
+ e.printStackTrace();
-
+ }
-
+ SimpleReference ref = new SimpleReference(off + sourcePosition, off + sourceEndPosition, name);
-
+ IMethod[] methods = findMethods(name, argCount, off + sourceEndPosition - 1);
-
+ fSearchResults.put(ref, methods);
-
+ }
-
+
-
+ public void acceptPackage(int declarationStart, int declarationEnd, char[] name) {
-
+ // TODO Auto-generated method stub
-
+
-
+ }
-
+
-
+ public void acceptTypeReference(char[][] typeName, int sourceStart, int sourceEnd) {
-
+ // TODO Auto-generated method stub
-
+
-
+ }
-
+
-
+ public void acceptTypeReference(char[] typeName, int sourcePosition) {
-
+ // TODO Auto-generated method stub
-
+
-
+ }
-
+
-
+ public void enterField(FieldInfo info) {
-
+ // TODO Auto-generated method stub
-
+
-
+ }
-
+
-
+ public boolean enterFieldCheckDuplicates(FieldInfo info) {
-
+ // TODO Auto-generated method stub
-
+ return false;
-
+ }
-
+
-
+ public void enterMethod(MethodInfo info) {
-
+ // TODO Auto-generated method stub
-
+
-
+ }
-
+
-
+ public void enterMethodRemoveSame(MethodInfo info) {
-
+ // TODO Auto-generated method stub
-
+
-
+ }
-
+
-
+ public boolean enterMethodWithParentType(MethodInfo info, String parentName, String delimiter) {
-
+ // TODO Auto-generated method stub
-
+ return false;
-
+ }
-
+
-
+ public boolean enterFieldWithParentType(FieldInfo info, String parentName, String delimiter) {
-
+ // TODO Auto-generated method stub
-
+ return false;
-
+ }
-
+
-
+ public void enterModule() {
-
+ // TODO Auto-generated method stub
-
+
-
+ }
-
+
-
+ public void enterType(TypeInfo info) {
-
+ // TODO Auto-generated method stub
-
+
-
+ }
-
+
-
+ public boolean enterTypeAppend(TypeInfo info, String fullName, String delimiter) {
-
+ // TODO Auto-generated method stub
-
+ return false;
-
+ }
-
+
-
+ public void exitField(int declarationEnd) {
-
+ // TODO Auto-generated method stub
-
+
-
+ }
-
+
-
+ public void exitMethod(int declarationEnd) {
-
+ // TODO Auto-generated method stub
-
+
-
+ }
-
+
-
+ public void exitModule(int declarationEnd) {
-
+ // TODO Auto-generated method stub
-
+
-
+ }
-
+
-
+ public void exitType(int declarationEnd) {
-
+ }
-
+
-
+ public void enterModuleRoot() {
-
+ // TODO Auto-generated method stub
-
+
-
+ }
-
+
-
+ public boolean enterTypeAppend(String fullName, String delimiter) {
-
+ // TODO Auto-generated method stub
-
+ return false;
-
+ }
-
+
-
+ public void exitModuleRoot() {
-
+ // TODO Auto-generated method stub
-
+
-
+ }
-
+ }
-
+
-
+ public Map doOperation() {
-
+ try {
-
+ String methodSource = method.getSource();
-
+ CaleeSourceElementRequestor requestor = new CaleeSourceElementRequestor();
-
+ RubySourceElementParser parser = new RubySourceElementParser(requestor, null);
-
+
-
+// parser.parseModule(null, methodSource, null );
-
+ parser.parseSourceModule(methodSource.toCharArray(), null);
-
+
-
+ return fSearchResults;
-
+ } catch (ModelException e) {
-
+ // TODO Auto-generated catch block
-
+ e.printStackTrace();
-
+ }
-
+ 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()*/1);
-
+ for( int i = 0; i < elements.length; ++i ) {
-
+ if( elements[i] instanceof IMethod ) {
-
+ methods.add(elements[i]);
-
+ }
-
+ }
-
+ } catch (ModelException e) {
-
+ e.printStackTrace();
-
+ }
-
+
-
+ return (IMethod[])methods.toArray(new IMethod[methods.size()]);
-
+ }
-
+
-
+ protected void search(String patternString, int searchFor, int limitTo, IDLTKSearchScope scope, SearchRequestor resultCollector)
-
+ throws CoreException {
-
+ search(patternString, searchFor, limitTo, EXACT_RULE, scope, resultCollector);
-
+ }
-
+
-
+ protected void search(String patternString, int searchFor, int limitTo, int matchRule, IDLTKSearchScope scope, SearchRequestor requestor)
-
+ throws CoreException {
-
+ if (patternString.indexOf('*') != -1 || patternString.indexOf('?') != -1) {
-
+ matchRule |= SearchPattern.R_PATTERN_MATCH;
-
+ }
-
+ SearchPattern pattern = SearchPattern.createPattern(patternString, searchFor, limitTo, matchRule);
-
+ new SearchEngine().search(pattern, new SearchParticipant[] { SearchEngine.getDefaultSearchParticipant() }, scope, requestor, null);
-
+ }
-
+}
-
diff -rNu orig/org.eclipse.dltk.ruby.core/src/org/eclipse/dltk/ruby/internal/callhierarchy/RubyCallProcessor.java modif/org.eclipse.dltk.ruby.core/src/org/eclipse/dltk/ruby/internal/callhierarchy/RubyCallProcessor.java
-
--- orig/org.eclipse.dltk.ruby.core/src/org/eclipse/dltk/ruby/internal/callhierarchy/RubyCallProcessor.java 1970-01-01 07:00:000 +0700
-
+++ modif/org.eclipse.dltk.ruby.core/src/org/eclipse/dltk/ruby/internal/callhierarchy/RubyCallProcessor.java 2007-03-02 11:40:000 +0600
-
@@ -0,0 +1,77 @@
-
+package org.eclipse.dltk.ruby.internal.callhierarchy;
-
+
-
+import java.util.HashMap;
-
+import java.util.Map;
-
+
-
+import org.eclipse.core.runtime.CoreException;
-
+import org.eclipse.core.runtime.IProgressMonitor;
-
+import org.eclipse.dltk.ast.references.SimpleReference;
-
+import org.eclipse.dltk.core.ICallProcessor;
-
+import org.eclipse.dltk.core.IModelElement;
-
+import org.eclipse.dltk.core.ISourceModule;
-
+import org.eclipse.dltk.core.ModelException;
-
+import org.eclipse.dltk.core.search.IDLTKSearchConstants;
-
+import org.eclipse.dltk.core.search.IDLTKSearchScope;
-
+import org.eclipse.dltk.core.search.SearchEngine;
-
+import org.eclipse.dltk.core.search.SearchMatch;
-
+import org.eclipse.dltk.core.search.SearchParticipant;
-
+import org.eclipse.dltk.core.search.SearchPattern;
-
+import org.eclipse.dltk.core.search.SearchRequestor;
-
+
-
+public class RubyCallProcessor implements ICallProcessor {
-
+ public final static int GENERICS_AGNOSTIC_MATCH_RULE = SearchPattern.R_EXACT_MATCH
-
+ | SearchPattern.R_CASE_SENSITIVE | SearchPattern.R_ERASURE_MATCH;
-
+
-
+ private SearchEngine searchEngine = new SearchEngine();
-
+
-
+ public Map process(final IModelElement parent, IModelElement element,
-
+ IDLTKSearchScope scope, IProgressMonitor monitor) {
-
+ final Map elements = new HashMap();
-
+ SearchRequestor requestor = new SearchRequestor() {
-
+
-
+ public void acceptSearchMatch(SearchMatch match) {
-
+ if ((match.getAccuracy() != SearchMatch.A_ACCURATE)) {
-
+ return;
-
+ }
-
+
-
+ if (match.isInsideDocComment()) {
-
+ 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(), match.getLength());
-
+// for (int j = 0; j < e.length; ++j) {
-
+// if (e[j].equals(parent)) {
-
+ elements.put(ref, member);
-
+// }
-
+// }
-
+//
-
+// } catch (ModelException e) {
-
+// e.printStackTrace();
-
+// }
-
+ }
-
+ }
-
+ };
-
+
-
+ SearchPattern pattern = SearchPattern.createPattern(element,
-
+ IDLTKSearchConstants.REFERENCES, GENERICS_AGNOSTIC_MATCH_RULE);
-
+ try {
-
+ searchEngine
-
+ .search(pattern, new SearchParticipant[] { SearchEngine
-
+ .getDefaultSearchParticipant() }, scope, requestor,
-
+ monitor);
-
+ } catch (CoreException e) {
-
+ e.printStackTrace();
-
+ }
-
+ return elements;
-
+ }
-
+}
-
diff -rNu orig/org.eclipse.dltk.ruby.core/src/org/eclipse/dltk/ruby/internal/core/codeassist/CVS/Entries modif/org.eclipse.dltk.ruby.core/src/org/eclipse/dltk/ruby/internal/core/codeassist/CVS/Entries
-
--- orig/org.eclipse.dltk.ruby.core/src/org/eclipse/dltk/ruby/internal/core/codeassist/CVS/Entries 2007-03-01 23:50:000 +0600
-
+++ modif/org.eclipse.dltk.ruby.core/src/org/eclipse/dltk/ruby/internal/core/codeassist/CVS/Entries 2007-03-02 14:46:000 +0600
-
@@ -1,6 +1,6 @@
-
/IRubySelectionRequestor.java/1.1/Mon Feb 12 06:36:08 2007//
-
/NewTICompletionEngine.java/1.1/Thu Feb 15 12:55:33 2007//
-
/RubyAssistParser.java/1.2/Thu Mar 1 13:09:59 2007//
-
-/RubyCompletionEngine.java/1.19/Thu Mar 1 17:50:52 2007//
-
-/RubySelectionEngine.java/1.16/Thu Mar 1 14:59:51 2007//
-
+/RubyCompletionEngine.java/1.20/Thu Mar 1 17:50:52 2007//
-
+/RubySelectionEngine.java/1.18/Fri Mar 2 08:46:53 2007//
-
/RubySelectionParser.java/1.1/Mon Feb 12 06:37:07 2007//
-
diff -rNu orig/org.eclipse.dltk.ruby.core/src/org/eclipse/dltk/ruby/internal/core/codeassist/RubyCompletionEngine.java modif/org.eclipse.dltk.ruby.core/src/org/eclipse/dltk/ruby/internal/core/codeassist/RubyCompletionEngine.java
-
--- orig/org.eclipse.dltk.ruby.core/src/org/eclipse/dltk/ruby/internal/core/codeassist/RubyCompletionEngine.java 2007-03-01 23:54:000 +0600
-
+++ modif/org.eclipse.dltk.ruby.core/src/org/eclipse/dltk/ruby/internal/core/codeassist/RubyCompletionEngine.java 2007-03-02 14:46:000 +0600
-
@@ -31,6 +31,7 @@
-
import org.eclipse.dltk.evaluation.types.SimpleType;
-
import org.eclipse.dltk.internal.core.ModelElement;
-
import org.eclipse.dltk.ruby.ast.ColonExpression;
-
+import org.eclipse.dltk.ruby.ast.RubyArrayExpression;
-
import org.eclipse.dltk.ruby.core.model.FakeMethod;
-
import org.eclipse.dltk.ruby.core.utils.RubySyntaxUtils;
-
import org.eclipse.dltk.ruby.internal.parser.JRubySourceParser;
-
@@ -167,6 +168,9 @@
-
case SimpleType.TYPE_STRING:
-
meth = RubyModelUtils.getFakeMethods((ModelElement) modelModule, "String");
-
break;
-
+ case SimpleType.TYPE_ARRAY:
-
+ meth = RubyModelUtils.getFakeMethods((ModelElement) modelModule, "Array");
-
+ break;
-
}
-
return meth;
-
}
-
@@ -296,6 +300,15 @@
-
int relevance = 424242;
-
-
if (receiver != null) {
-
+ if (receiver instanceof RubyArrayExpression) {
-
+ int st = position;
-
+ while (st >= 0 && content.charAt(st) != '.')
-
+ st--;
-
+ if (st > 0) {
-
+ starting = content.substring(st + 1, position).trim();
-
+ this.setSourceRange(position - starting.length(), position);
-
+ }
-
+ }
-
methods = getMethodsForReceiver(module, moduleDeclaration, receiver);
-
} else {
-
IClassType self = RubyTypeInferencingUtils.determineSelfClass(
-
diff -rNu orig/org.eclipse.dltk.ruby.core/src/org/eclipse/dltk/ruby/internal/core/codeassist/RubySelectionEngine.java modif/org.eclipse.dltk.ruby.core/src/org/eclipse/dltk/ruby/internal/core/codeassist/RubySelectionEngine.java
-
--- orig/org.eclipse.dltk.ruby.core/src/org/eclipse/dltk/ruby/internal/core/codeassist/RubySelectionEngine.java 2007-03-01 20:59:000 +0600
-
+++ modif/org.eclipse.dltk.ruby.core/src/org/eclipse/dltk/ruby/internal/core/codeassist/RubySelectionEngine.java 2007-03-02 14:46:000 +0600
-
@@ -410,7 +410,7 @@
-
RubyClassType rubyClassType = RubyTypeInferencingUtils.resolveMethods(modelModule.getScriptProject(), (RubyClassType) type);
-
availableMethods = rubyClassType.getAllMethods();
-
} else if (type instanceof RubyMetaClassType) {
-
- RubyMetaClassType metaClassType = (RubyMetaClassType) type;
-
+ RubyMetaClassType metaClassType = RubyTypeInferencingUtils.resolveMethods(modelModule, (RubyMetaClassType) type);
-
availableMethods = metaClassType.getMethods();
-
}
-
} else {
-
@@ -434,6 +434,9 @@
-
case SimpleType.TYPE_STRING:
-
meth = RubyModelUtils.getFakeMethods((ModelElement) modelModule, "String");
-
break;
-
+ case SimpleType.TYPE_ARRAY:
-
+ meth = RubyModelUtils.getFakeMethods((ModelElement) modelModule, "Array");
-
+ break;
-
}
-
availableMethods = meth;
-
}
-
diff -rNu orig/org.eclipse.dltk.ruby.core/src/org/eclipse/dltk/ruby/internal/parser/JRubySourceParser.java modif/org.eclipse.dltk.ruby.core/src/org/eclipse/dltk/ruby/internal/parser/JRubySourceParser.java
-
--- orig/org.eclipse.dltk.ruby.core/src/org/eclipse/dltk/ruby/internal/parser/JRubySourceParser.java 2007-03-01 18:32:000 +0600
-
+++ modif/org.eclipse.dltk.ruby.core/src/org/eclipse/dltk/ruby/internal/parser/JRubySourceParser.java 2007-03-02 01:31:000 +0600
-
@@ -160,51 +160,57 @@
-
}
-
-
public ModuleDeclaration parse(String content) {// throws
-
- Parser parser = new Parser(new IRuby() {});
-
- ProxyProblemReporter proxyProblemReporter = new ProxyProblemReporter(problemReporter);
-
- errorState[0] = false;
-
-
-
- long timeStart = System.currentTimeMillis();
-
- Node node = parser.parse("", new StringReader(content), new RubyParserConfiguration(),
-
- proxyProblemReporter);
-
- fixPositions.clear();
-
- if (!parser.isSuccess() || errorState[0]) {
-
- content = fixBrokenDots(content);
-
- content = fixBrokenColons(content);
-
+ try {
-
+ Parser parser = new Parser(new IRuby() {});
-
+ ProxyProblemReporter proxyProblemReporter = new ProxyProblemReporter(problemReporter);
-
+ errorState[0] = false;
-
-
- Node node2 = parser.parse("", new StringReader(content), new RubyParserConfiguration(),
-
- null);
-
- if (node2 != null)
-
- node = node2;
-
- else
-
- fixPositions.clear();
-
- }
-
-
-
- ModuleDeclaration module = new ModuleDeclaration(content.length());
-
- DLTKASTBuildVisitor visitor = new DLTKASTBuildVisitor(module, content);
-
- if (node != null)
-
- node.accept(visitor);
-
-
-
- if( node != null ) {
-
- if (TRACE_AST_JRUBY || TRACE_AST_DLTK)
-
- System.out.println("\n\nAST rebuilt\n");
-
- if (TRACE_AST_JRUBY)
-
- System.out.println("JRuby AST:\n" + node.toString());
-
+ long timeStart = System.currentTimeMillis();
-
+ Node node = parser.parse("", new StringReader(content), new RubyParserConfiguration(),
-
+ proxyProblemReporter);
-
+ fixPositions.clear();
-
+ if (!parser.isSuccess() || errorState[0]) {
-
+ content = fixBrokenDots(content);
-
+ content = fixBrokenColons(content);
-
+
-
+ Node node2 = parser.parse("", new StringReader(content), new RubyParserConfiguration(),
-
+ null);
-
+ if (node2 != null)
-
+ node = node2;
-
+ else
-
+ fixPositions.clear();
-
+ }
-
+
-
+ ModuleDeclaration module = new ModuleDeclaration(content.length());
-
+ DLTKASTBuildVisitor visitor = new DLTKASTBuildVisitor(module, content);
-
+ if (node != null)
-
+ node.accept(visitor);
-
+
-
+ if( node != null ) {
-
+ if (TRACE_AST_JRUBY || TRACE_AST_DLTK)
-
+ System.out.println("\n\nAST rebuilt\n");
-
+ if (TRACE_AST_JRUBY)
-
+ System.out.println("JRuby AST:\n" + node.toString());
-
+ if (TRACE_AST_DLTK)
-
+ System.out.println("DLTK AST:\n" + module.toString());
-
+ }
-
+
-
+ if (!fixPositions.isEmpty())
-
+ try {
-
+ module.traverse(new ASTPositionsCorrector());
-
+ } catch (Exception e) {
-
+ RubyPlugin.log(e);
-
+ }
-
+
-
+ long timeEnd = System.currentTimeMillis();
-
if (TRACE_AST_DLTK)
-
- System.out.println("DLTK AST:\n" + module.toString());
-
+ System.out.println("Parsing took " + (timeEnd - timeStart) + " ms");
-
+ return module;
-
+ }
-
+ catch( Throwable t ) {
-
+ ModuleDeclaration mdl = new ModuleDeclaration(1);
-
+ return mdl;
-
}
-
-
-
- if (!fixPositions.isEmpty())
-
- try {
-
- module.traverse(new ASTPositionsCorrector());
-
- } catch (Exception e) {
-
- RubyPlugin.log(e);
-
- }
-
-
-
- long timeEnd = System.currentTimeMillis();
-
- if (TRACE_AST_DLTK)
-
- System.out.println("Parsing took " + (timeEnd - timeStart) + " ms");
-
- return module;
-
}
-
-
public void setInitializationData(IConfigurationElement config, String propertyName, Object data) throws CoreException {
-
diff -rNu orig/org.eclipse.dltk.ruby.core/src/org/eclipse/dltk/ruby/internal/parsers/jruby/ASTUtils.java modif/org.eclipse.dltk.ruby.core/src/org/eclipse/dltk/ruby/internal/parsers/jruby/ASTUtils.java
-
--- orig/org.eclipse.dltk.ruby.core/src/org/eclipse/dltk/ruby/internal/parsers/jruby/ASTUtils.java 2007-03-01 23:48:000 +0600
-
+++ modif/org.eclipse.dltk.ruby.core/src/org/eclipse/dltk/ruby/internal/parsers/jruby/ASTUtils.java 2007-03-02 13:35:000 +0600
-
@@ -143,7 +143,7 @@
-
if (result != null) {
-
int oldlen = calcLen(result);
-
int newlen = realEnd - realStart;
-
- if (newlen < oldlen )
-
+ if (newlen <= oldlen )
-
result = s;
-
} else {
-
result = s;
-
diff -rNu orig/org.eclipse.dltk.ruby.core/src/org/eclipse/dltk/ruby/internal/parsers/jruby/CVS/Entries modif/org.eclipse.dltk.ruby.core/src/org/eclipse/dltk/ruby/internal/parsers/jruby/CVS/Entries
-
--- orig/org.eclipse.dltk.ruby.core/src/org/eclipse/dltk/ruby/internal/parsers/jruby/CVS/Entries 2007-03-01 23:48:000 +0600
-
+++ modif/org.eclipse.dltk.ruby.core/src/org/eclipse/dltk/ruby/internal/parsers/jruby/CVS/Entries 2007-03-02 14:46:000 +0600
-
@@ -1,2 +1,2 @@
-
-/ASTUtils.java/1.11/Thu Mar 1 17:48:53 2007//
-
-/DLTKASTBuildVisitor.java/1.24/Thu Mar 1 16:15:36 2007//
-
+/ASTUtils.java/1.12/Fri Mar 2 07:35:10 2007//
-
+/DLTKASTBuildVisitor.java/1.25/Thu Mar 1 16:15:36 2007//
-
diff -rNu orig/org.eclipse.dltk.ruby.core/src/org/eclipse/dltk/ruby/internal/parsers/jruby/DLTKASTBuildVisitor.java modif/org.eclipse.dltk.ruby.core/src/org/eclipse/dltk/ruby/internal/parsers/jruby/DLTKASTBuildVisitor.java
-
--- orig/org.eclipse.dltk.ruby.core/src/org/eclipse/dltk/ruby/internal/parsers/jruby/DLTKASTBuildVisitor.java 2007-03-01 23:21:000 +0600
-
+++ modif/org.eclipse.dltk.ruby.core/src/org/eclipse/dltk/ruby/internal/parsers/jruby/DLTKASTBuildVisitor.java 2007-03-02 14:46:000 +0600
-
@@ -31,6 +31,7 @@
-
import org.eclipse.dltk.ruby.ast.OrExpression;
-
-
import org.eclipse.dltk.ruby.ast.ReturnStatement;
-
+import org.eclipse.dltk.ruby.ast.RubyArrayExpression;
-
import org.eclipse.dltk.ruby.ast.RubyMethodArgument;
-
import org.eclipse.dltk.ruby.ast.RubySingletonClassDeclaration;
-
import org.eclipse.dltk.ruby.ast.RubySingletonMethodDeclaration;
-
@@ -318,7 +319,7 @@
-
popState();
-
-
ISourcePosition position = iVisited.getPosition();
-
- ExpressionList arr = new ExpressionList();
-
+ RubyArrayExpression arr = new RubyArrayExpression();
-
arr.setEnd(position.getEndOffset());
-
arr.setStart(position.getStartOffset());
-
for (Iterator iter = coll.getList().iterator(); iter.hasNext();) {
-
diff -rNu orig/org.eclipse.dltk.ruby.core/src/org/eclipse/dltk/ruby/typeinference/ArrayEvaluator.java modif/org.eclipse.dltk.ruby.core/src/org/eclipse/dltk/ruby/typeinference/ArrayEvaluator.java
-
--- orig/org.eclipse.dltk.ruby.core/src/org/eclipse/dltk/ruby/typeinference/ArrayEvaluator.java 1970-01-01 07:00:000 +0700
-
+++ modif/org.eclipse.dltk.ruby.core/src/org/eclipse/dltk/ruby/typeinference/ArrayEvaluator.java 2007-03-02 14:16:000 +0600
-
@@ -0,0 +1,22 @@
-
+package org.eclipse.dltk.ruby.typeinference;
-
+
-
+import org.eclipse.dltk.ddp.GoalEvaluator;
-
+import org.eclipse.dltk.ddp.IGoal;
-
+import org.eclipse.dltk.evaluation.types.IEvaluatedType;
-
+import org.eclipse.dltk.evaluation.types.SimpleType;
-
+
-
+public class ArrayEvaluator extends GoalEvaluator {
-
+
-
+ public ArrayEvaluator(IGoal goal) {
-
+ super(goal);
-
+ }
-
+
-
+ public IGoal produceNextSubgoal(IGoal previousGoal, IEvaluatedType previousResult) {
-
+ return null;
-
+ }
-
+
-
+ public IEvaluatedType produceType() {
-
+ return new SimpleType(SimpleType.TYPE_ARRAY);
-
+ }
-
+
-
+}
-
diff -rNu orig/org.eclipse.dltk.ruby.core/src/org/eclipse/dltk/ruby/typeinference/CVS/Entries modif/org.eclipse.dltk.ruby.core/src/org/eclipse/dltk/ruby/typeinference/CVS/Entries
-
--- orig/org.eclipse.dltk.ruby.core/src/org/eclipse/dltk/ruby/typeinference/CVS/Entries 2007-03-02 00:24:000 +0600
-
+++ modif/org.eclipse.dltk.ruby.core/src/org/eclipse/dltk/ruby/typeinference/CVS/Entries 2007-03-02 14:46:000 +0600
-
@@ -1,3 +1,4 @@
-
+/ArrayEvaluator.java/1.1/Fri Mar 2 08:16:13 2007//
-
/AssignmentEvaluator.java/1.1/Fri Feb 23 14:22:08 2007//
-
/BlockEvaluator.java/1.1/Sun Feb 25 13:26:47 2007//
-
/BuiltinMetaTypeMethods.java/1.1/Mon Feb 26 12:14:42 2007//
-
@@ -23,10 +24,10 @@
-
/NumericLiteralEvaluator.java/1.1/Fri Feb 23 14:22:08 2007//
-
/OffsetTargetedASTVisitor.java/1.3/Sun Feb 25 07:22:50 2007//
-
/RubyClassType.java/1.5/Sun Feb 25 07:22:48 2007//
-
-/RubyEvaluatorFactory.java/1.6/Sun Feb 25 13:34:02 2007//
-
+/RubyEvaluatorFactory.java/1.7/Fri Mar 2 08:46:54 2007//
-
/RubyMetaClassType.java/1.3/Sat Feb 24 19:05:37 2007//
-
/RubyModelUtils.java/1.13/Thu Mar 1 16:20:18 2007//
-
-/RubyTypeInferencingUtils.java/1.19/Thu Mar 1 18:15:03 2007//
-
+/RubyTypeInferencingUtils.java/1.20/Fri Mar 2 07:35:10 2007//
-
/RubyTypeUtils.java/1.2/Thu Mar 1 16:20:18 2007//
-
/SelfReferenceEvaluator.java/1.3/Thu Mar 1 16:20:17 2007//
-
/StringLiteralEvaluator.java/1.1/Sat Feb 24 13:50:33 2007//
-
diff -rNu orig/org.eclipse.dltk.ruby.core/src/org/eclipse/dltk/ruby/typeinference/RubyEvaluatorFactory.java modif/org.eclipse.dltk.ruby.core/src/org/eclipse/dltk/ruby/typeinference/RubyEvaluatorFactory.java
-
--- orig/org.eclipse.dltk.ruby.core/src/org/eclipse/dltk/ruby/typeinference/RubyEvaluatorFactory.java 2007-02-25 19:34:000 +0600
-
+++ modif/org.eclipse.dltk.ruby.core/src/org/eclipse/dltk/ruby/typeinference/RubyEvaluatorFactory.java 2007-03-02 14:46:000 +0600
-
@@ -17,6 +17,7 @@
-
import org.eclipse.dltk.ddp.IGoalEvaluatorFactory;
-
import org.eclipse.dltk.ruby.ast.ColonExpression;
-
import org.eclipse.dltk.ruby.ast.ConstantDeclaration;
-
+import org.eclipse.dltk.ruby.ast.RubyArrayExpression;
-
import org.eclipse.dltk.ruby.ast.SelfReference;
-
-
public class RubyEvaluatorFactory implements IGoalEvaluatorFactory {
-
@@ -31,6 +32,8 @@
-
return new NumericLiteralEvaluator(goal);
-
else if (expr instanceof StringLiteral)
-
return new StringLiteralEvaluator(goal);
-
+ else if (expr instanceof RubyArrayExpression)
-
+ return new ArrayEvaluator(goal);
-
else if (expr instanceof Assignment)
-
return new AssignmentEvaluator(goal);
-
else if (expr instanceof ConstantReference)
-
diff -rNu orig/org.eclipse.dltk.ruby.core/src/org/eclipse/dltk/ruby/typeinference/RubyTypeInferencingUtils.java modif/org.eclipse.dltk.ruby.core/src/org/eclipse/dltk/ruby/typeinference/RubyTypeInferencingUtils.java
-
--- orig/org.eclipse.dltk.ruby.core/src/org/eclipse/dltk/ruby/typeinference/RubyTypeInferencingUtils.java 2007-03-02 00:15:000 +0600
-
+++ modif/org.eclipse.dltk.ruby.core/src/org/eclipse/dltk/ruby/typeinference/RubyTypeInferencingUtils.java 2007-03-02 13:35:000 +0600
-
@@ -662,6 +662,16 @@
-
}
-
}
-
-
+ if (!type.getInstanceType().getTypeName().equals("Object")) {
-
+ RubyMetaClassType superType = getMetaType(RubyModelUtils.getSuperType(types[i]));
-
+ if (superType != null) {
-
+ superType = resolveMethods(module, superType);
-
+ IMethod[] allMethods = superType.getMethods();
-
+ for (int j = 0; j < allMethods.length; j++) {
-
+ result.add(allMethods[j]);
-
+ }
-
+ }
-
+ }
-
} catch (ModelException e) {
-
e.printStackTrace();
-
}
-
diff -rNu orig/org.eclipse.dltk.ruby.ui/src/org/eclipse/dltk/ruby/internal/ui/editor/RubyEditor.java modif/org.eclipse.dltk.ruby.ui/src/org/eclipse/dltk/ruby/internal/ui/editor/RubyEditor.java
-
--- orig/org.eclipse.dltk.ruby.ui/src/org/eclipse/dltk/ruby/internal/ui/editor/RubyEditor.java 2007-02-22 14:40:000 +0600
-
+++ modif/org.eclipse.dltk.ruby.ui/src/org/eclipse/dltk/ruby/internal/ui/editor/RubyEditor.java 2007-03-02 10:46:000 +0600
-
@@ -82,7 +82,7 @@
-
}
-
-
public String getCallHierarchyID() {
-
- return null;
-
+ return "org.eclipse.dltk.callhierarchy.view";
-
}
-
-
protected void initializeKeyBindingScopes() {
-
diff -rNu orig/org.eclipse.dltk.ruby.ui/src/org/eclipse/dltk/ruby/internal/ui/text/RubyPercentStringRule.java modif/org.eclipse.dltk.ruby.ui/src/org/eclipse/dltk/ruby/internal/ui/text/RubyPercentStringRule.java
-
--- orig/org.eclipse.dltk.ruby.ui/src/org/eclipse/dltk/ruby/internal/ui/text/RubyPercentStringRule.java 2007-02-22 14:39:000 +0600
-
+++ modif/org.eclipse.dltk.ruby.ui/src/org/eclipse/dltk/ruby/internal/ui/text/RubyPercentStringRule.java 2007-03-02 01:28:000 +0600
-
@@ -161,7 +161,7 @@
-
int nestCount = 1;
-
while ((c= scanner.read()) != ICharacterScanner.EOF) {
-
if (c == ESCAPE) {
-
- System.out.println("ESCAPE " + (char) c);
-
+// System.out.println("ESCAPE " + (char) c);
-
// Skip escaped character(s)
-
if (fEscapeContinuesLine) {
-
c= scanner.read();
-
diff -rNu orig/org.eclipse.dltk.ruby.ui.tests/src/org/eclipse/dltk/ruby/ui/tests/text/completion/CVS/Entries modif/org.eclipse.dltk.ruby.ui.tests/src/org/eclipse/dltk/ruby/ui/tests/text/completion/CVS/Entries
-
--- orig/org.eclipse.dltk.ruby.ui.tests/src/org/eclipse/dltk/ruby/ui/tests/text/completion/CVS/Entries 2007-03-01 22:20:000 +0600
-
+++ modif/org.eclipse.dltk.ruby.ui.tests/src/org/eclipse/dltk/ruby/ui/tests/text/completion/CVS/Entries 2007-03-02 13:35:000 +0600
-
@@ -1 +1 @@
-
-/RubyCompletionTests.java/1.5/Thu Mar 1 16:20:17 2007//
-
+/RubyCompletionTests.java/1.6/Fri Mar 2 07:35:10 2007//
-
diff -rNu orig/org.eclipse.dltk.ruby.ui.tests/src/org/eclipse/dltk/ruby/ui/tests/text/completion/RubyCompletionTests.java modif/org.eclipse.dltk.ruby.ui.tests/src/org/eclipse/dltk/ruby/ui/tests/text/completion/RubyCompletionTests.java
-
--- orig/org.eclipse.dltk.ruby.ui.tests/src/org/eclipse/dltk/ruby/ui/tests/text/completion/RubyCompletionTests.java 2007-03-01 22:20:000 +0600
-
+++ modif/org.eclipse.dltk.ruby.ui.tests/src/org/eclipse/dltk/ruby/ui/tests/text/completion/RubyCompletionTests.java 2007-03-02 13:35:000 +0600
-
@@ -303,4 +303,15 @@
-
-
}
-
-
+ public void testCompletion20() throws ModelException {
-
+ CompletionTestsRequestor requestor = new CompletionTestsRequestor();
-
+ ISourceModule cu = getSourceModule("completion", "src", "c0.rb");
-
+
-
+ String str = cu.getSource();
-
+ String completeBehind = "::";
-
+ int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
-
+ cu.codeComplete(cursorLocation, requestor);
-
+
-
+ }
-
+
-
}
-
diff -rNu orig/org.eclipse.dltk.ruby.ui.tests/workspace/completion/src/c0.rb modif/org.eclipse.dltk.ruby.ui.tests/workspace/completion/src/c0.rb
-
--- orig/org.eclipse.dltk.ruby.ui.tests/workspace/completion/src/c0.rb 1970-01-01 07:00:000 +0700
-
+++ modif/org.eclipse.dltk.ruby.ui.tests/workspace/completion/src/c0.rb 2007-03-01 23:46:000 +0600
-
@@ -0,0 +1,2 @@
-
+::
-
+
-
diff -rNu orig/org.eclipse.dltk.ruby.ui.tests/workspace/completion/src/CVS/Entries modif/org.eclipse.dltk.ruby.ui.tests/workspace/completion/src/CVS/Entries
-
--- orig/org.eclipse.dltk.ruby.ui.tests/workspace/completion/src/CVS/Entries 2007-03-01 22:20:000 +0600
-
+++ modif/org.eclipse.dltk.ruby.ui.tests/workspace/completion/src/CVS/Entries 2007-03-02 13:35:000 +0600
-
@@ -1,3 +1,4 @@
-
+/c0.rb/1.1/Thu Mar 1 17:46:37 2007//
-
/c1.rb/1.1/Wed Feb 28 08:48:49 2007//
-
/c2.rb/1.1/Wed Feb 28 08:48:49 2007//
-
/c3.rb/1.1/Wed Feb 28 08:48:49 2007//
-
diff -rNu orig/org.eclipse.dltk.tcl.core/src/org/eclipse/dltk/tcl/core/TclLanguageToolkit.java modif/org.eclipse.dltk.tcl.core/src/org/eclipse/dltk/tcl/core/TclLanguageToolkit.java
-
--- orig/org.eclipse.dltk.tcl.core/src/org/eclipse/dltk/tcl/core/TclLanguageToolkit.java 2007-02-25 15:47:000 +0600
-
+++ modif/org.eclipse.dltk.tcl.core/src/org/eclipse/dltk/tcl/core/TclLanguageToolkit.java 2007-03-02 10:29:000 +0600
-
@@ -260,23 +260,6 @@
-
return "org.eclipse.dltk.tcl.ui.editor.TclEditor";
-
}
-
-
- public ModuleDeclaration createFullAST(ISourceModule module) {
-
- TclSourceParser parser = new TclSourceParser();
-
- try {
-
- ModuleDeclaration decl = parser.parse(module.getSource());
-
- decl.rebuild();
-
-
-
- // this call has empty impl
-
- // TclASTBuilder.buildFullAST(decl);
-
- return decl;
-
- } catch (ModelException e) {
-
- if( DLTKCore.DEBUG ) {
-
- e.printStackTrace();
-
- }
-
- }
-
- return null;
-
- }
-
-
-
public ISelectionEngine createSelectionEngine(ISearchableEnvironment environment, Map options) {
-
return new TclSelectionEngine(environment, options, this);
-
}
-
diff -rNu orig/org.eclipse.dltk.tcl.core/src/org/eclipse/dltk/tcl/internal/parser/TclSourceElementParser.java modif/org.eclipse.dltk.tcl.core/src/org/eclipse/dltk/tcl/internal/parser/TclSourceElementParser.java
-
--- orig/org.eclipse.dltk.tcl.core/src/org/eclipse/dltk/tcl/internal/parser/TclSourceElementParser.java 2007-03-01 18:34:000 +0600
-
+++ modif/org.eclipse.dltk.tcl.core/src/org/eclipse/dltk/tcl/internal/parser/TclSourceElementParser.java 2007-03-02 03:28:000 +0600
-
@@ -349,8 +349,13 @@
-
inner = ((TclBlockExpression) code)
-
.parseBlock(code.sourceStart() + 1);
-
-
- this.buildModel(inner, TYPE_NAMESPACE, parentNamespaceName + "::"
-
- + sNameSpaceName);
-
+ if(sNameSpaceName.startsWith("::") && parentNamespaceName.length() == 0 ) {
-
+ this.buildModel(inner, TYPE_NAMESPACE, sNameSpaceName);
-
+ }
-
+ else {
-
+ this.buildModel(inner, TYPE_NAMESPACE, parentNamespaceName + "::"
-
+ + sNameSpaceName);
-
+ }
-
-
exit.go();
-
}
-
diff -rNu orig/org.eclipse.dltk.tcl.ui/plugin.xml modif/org.eclipse.dltk.tcl.ui/plugin.xml
-
--- orig/org.eclipse.dltk.tcl.ui/plugin.xml 2007-02-25 15:46:000 +0600
-
+++ modif/org.eclipse.dltk.tcl.ui/plugin.xml 2007-03-02 13:57:000 +0600
-
@@ -120,7 +120,7 @@
-
name="%NewSourceFolderCreationWizard.label"
-
icon="/icons/newpackfolder_wiz.gif"
-
category="org.eclipse.dltk.tcl.ui"
-
- class="org.eclipse.dltk.internal.ui.wizards.NewSourceFolderCreationWizard"
-
+ class="org.eclipse.dltk.ui.wizards.NewSourceFolderCreationWizard"
-
id="org.eclipse.dltk.tcl.ui.wizards.NewSourceFolderCreationWizard">
-
-
%NewSourceFolderCreationWizard.description
-
diff -rNu orig/org.eclipse.dltk.ui/src corext/org/eclipse/dltk/internal/corext/util/History.java modif/org.eclipse.dltk.ui/src corext/org/eclipse/dltk/internal/corext/util/History.java
-
--- orig/org.eclipse.dltk.ui/src corext/org/eclipse/dltk/internal/corext/util/History.java 2007-02-22 14:40:000 +0600
-
+++ modif/org.eclipse.dltk.ui/src corext/org/eclipse/dltk/internal/corext/util/History.java 2007-03-02 12:04:000 +0600
-
@@ -37,6 +37,8 @@
-
import org.eclipse.core.runtime.CoreException;
-
import org.eclipse.core.runtime.IPath;
-
import org.eclipse.core.runtime.IStatus;
-
+import org.eclipse.dltk.core.DLTKCore;
-
+import org.eclipse.dltk.core.ModelException;
-
import org.eclipse.dltk.internal.ui.DLTKUIException;
-
import org.eclipse.dltk.internal.ui.DLTKUIStatus;
-
import org.eclipse.dltk.ui.DLTKUIPlugin;
-
@@ -266,8 +268,15 @@
-
if (node.getNodeType() == Node.ELEMENT_NODE) {
-
Element type= (Element) node;
-
if (type.getNodeName().equalsIgnoreCase(fInfoNodeName)) {
-
- Object object= createFromElement(type);
-
- fHistory.put(getKey(object), object);
-
+ try {
-
+ Object object= createFromElement(type);
-
+ fHistory.put(getKey(object), object);
-
+ }
-
+ catch( Exception me ) {
-
+ if(DLTKCore.DEBUG) {
-
+ me.printStackTrace();
-
+ }
-
+ }
-
}
-
}
-
}
-
PermaLink to this entry https://pastebin.co.uk/11287
Posted by Andrey Tarantsov Fri 2nd Mar 2007 09:20 - Syntax is Diff - 28 views
Download | New Post | Modify | Hide line numbers
Download | New Post | Modify | Hide line numbers
Comments: 0