* some fixes from HEAD
diff --git a/plugins/org.eclipse.dltk.ruby.core/META-INF/MANIFEST.MF b/plugins/org.eclipse.dltk.ruby.core/META-INF/MANIFEST.MF
index 87e0e7e..9c710f5 100644
--- a/plugins/org.eclipse.dltk.ruby.core/META-INF/MANIFEST.MF
+++ b/plugins/org.eclipse.dltk.ruby.core/META-INF/MANIFEST.MF
@@ -8,7 +8,6 @@
Bundle-Localization: plugin
Require-Bundle: org.eclipse.core.runtime,
org.eclipse.dltk.core,
- org.eclipse.core.resources,
org.eclipse.debug.core
Eclipse-LazyStart: true
Export-Package: org.eclipse.dltk.ruby.ast;
diff --git a/plugins/org.eclipse.dltk.ruby.core/src/org/eclipse/dltk/ruby/internal/parser/mixin/RubyMixinBuildVisitor.java b/plugins/org.eclipse.dltk.ruby.core/src/org/eclipse/dltk/ruby/internal/parser/mixin/RubyMixinBuildVisitor.java
index 288d5d9..7934da8 100644
--- a/plugins/org.eclipse.dltk.ruby.core/src/org/eclipse/dltk/ruby/internal/parser/mixin/RubyMixinBuildVisitor.java
+++ b/plugins/org.eclipse.dltk.ruby.core/src/org/eclipse/dltk/ruby/internal/parser/mixin/RubyMixinBuildVisitor.java
@@ -484,6 +484,10 @@
IType obj = null;
if (moduleAvailable) {
IModelElement elementFor = findModelElementFor(decl);
+ if (!(elementFor instanceof IType)) {
+ elementFor = findModelElementFor(decl);
+ //System.out.println();
+ }
obj = (IType) elementFor;
}
boolean module = (decl.getModifiers() & Modifiers.AccModule) != 0;
diff --git a/plugins/org.eclipse.dltk.ruby.core/src/org/eclipse/dltk/ruby/typeinference/LocalVariableInfo.java b/plugins/org.eclipse.dltk.ruby.core/src/org/eclipse/dltk/ruby/typeinference/LocalVariableInfo.java
index e4c2c12..2908d24 100644
--- a/plugins/org.eclipse.dltk.ruby.core/src/org/eclipse/dltk/ruby/typeinference/LocalVariableInfo.java
+++ b/plugins/org.eclipse.dltk.ruby.core/src/org/eclipse/dltk/ruby/typeinference/LocalVariableInfo.java
@@ -34,11 +34,11 @@
public final static int KIND_LOOP_VAR = 3;
- public ASTNode declaringScope;
+ private ASTNode declaringScope;
- public RubyAssignment[] conditionalAssignments;
+ private RubyAssignment[] conditionalAssignments;
- public RubyAssignment lastAssignment;
+ private RubyAssignment lastAssignment;
private int kind;
@@ -46,7 +46,7 @@
final RubyAssignment[] assignments, final RubyAssignment last) {
this.declaringScope = declaringScope;
this.conditionalAssignments = assignments;
- lastAssignment = last;
+ this.lastAssignment = last;
this.kind = 0;
}
diff --git a/plugins/org.eclipse.dltk.ruby.core/src/org/eclipse/dltk/ruby/typeinference/RubyTypeInferencingUtils.java b/plugins/org.eclipse.dltk.ruby.core/src/org/eclipse/dltk/ruby/typeinference/RubyTypeInferencingUtils.java
index 17f422b..6180c19 100644
--- a/plugins/org.eclipse.dltk.ruby.core/src/org/eclipse/dltk/ruby/typeinference/RubyTypeInferencingUtils.java
+++ b/plugins/org.eclipse.dltk.ruby.core/src/org/eclipse/dltk/ruby/typeinference/RubyTypeInferencingUtils.java
@@ -425,20 +425,8 @@
return visitor.getUnconditionalAssignment();
}
- /**
- * @deprecated
- * @param module
- * @param offset
- * @param name
- * @return
- */
public static LocalVariableInfo inspectLocalVariable(
ModuleDeclaration module, int offset, String name) {
- return searchLocalVars(module, offset, name);
- }
-
- public static LocalVariableInfo searchLocalVars(
- ModuleDeclaration module, int offset, String name) {
LocalVariableInfo info = new LocalVariableInfo();
ASTNode[] scopes = getAllStaticScopes(module, offset);
int i = -1;
diff --git a/plugins/org.eclipse.dltk.ruby.core/src/org/eclipse/dltk/ruby/typeinference/evaluators/VariableReferenceEvaluator.java b/plugins/org.eclipse.dltk.ruby.core/src/org/eclipse/dltk/ruby/typeinference/evaluators/VariableReferenceEvaluator.java
index 2ec5548..7c3b2e2 100644
--- a/plugins/org.eclipse.dltk.ruby.core/src/org/eclipse/dltk/ruby/typeinference/evaluators/VariableReferenceEvaluator.java
+++ b/plugins/org.eclipse.dltk.ruby.core/src/org/eclipse/dltk/ruby/typeinference/evaluators/VariableReferenceEvaluator.java
@@ -1,52 +1,52 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2007 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
-
- *******************************************************************************/
-package org.eclipse.dltk.ruby.typeinference.evaluators;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.core.resources.IResource;
-import org.eclipse.dltk.ast.ASTNode;
-import org.eclipse.dltk.ast.declarations.MethodDeclaration;
-import org.eclipse.dltk.ast.declarations.ModuleDeclaration;
-import org.eclipse.dltk.ast.expressions.CallArgumentsList;
-import org.eclipse.dltk.ast.expressions.CallExpression;
-import org.eclipse.dltk.ast.references.VariableKind;
-import org.eclipse.dltk.ast.references.VariableReference;
-import org.eclipse.dltk.core.DLTKCore;
-import org.eclipse.dltk.core.ISourceModule;
-import org.eclipse.dltk.core.mixin.MixinModel;
-import org.eclipse.dltk.ruby.ast.RubyCallArgument;
-import org.eclipse.dltk.ruby.ast.RubyDVarExpression;
-import org.eclipse.dltk.ruby.ast.RubyMethodArgument;
-import org.eclipse.dltk.ruby.ast.RubySingletonMethodDeclaration;
-import org.eclipse.dltk.ruby.ast.RubyVariableKind;
-import org.eclipse.dltk.ruby.internal.parsers.jruby.ASTUtils;
-import org.eclipse.dltk.ruby.typeinference.IArgumentsContext;
-import org.eclipse.dltk.ruby.typeinference.LocalVariableInfo;
-import org.eclipse.dltk.ruby.typeinference.RubyClassType;
-import org.eclipse.dltk.ruby.typeinference.RubyMethodReference;
-import org.eclipse.dltk.ruby.typeinference.RubyTypeInferencingUtils;
-import org.eclipse.dltk.ruby.typeinference.VariableTypeGoal;
-import org.eclipse.dltk.ti.BasicContext;
-import org.eclipse.dltk.ti.GoalState;
-import org.eclipse.dltk.ti.IContext;
-import org.eclipse.dltk.ti.ISourceModuleContext;
-import org.eclipse.dltk.ti.goals.ExpressionTypeGoal;
-import org.eclipse.dltk.ti.goals.GoalEvaluator;
-import org.eclipse.dltk.ti.goals.IGoal;
-import org.eclipse.dltk.ti.goals.ItemReference;
-import org.eclipse.dltk.ti.goals.MethodCallsGoal;
-import org.eclipse.dltk.ti.types.IEvaluatedType;
-
+/*******************************************************************************
+ * Copyright (c) 2005, 2007 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+
+ *******************************************************************************/
+package org.eclipse.dltk.ruby.typeinference.evaluators;
+
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.List;
+
+import org.eclipse.core.resources.IResource;
+import org.eclipse.dltk.ast.ASTNode;
+import org.eclipse.dltk.ast.declarations.MethodDeclaration;
+import org.eclipse.dltk.ast.declarations.ModuleDeclaration;
+import org.eclipse.dltk.ast.expressions.CallArgumentsList;
+import org.eclipse.dltk.ast.expressions.CallExpression;
+import org.eclipse.dltk.ast.references.VariableKind;
+import org.eclipse.dltk.ast.references.VariableReference;
+import org.eclipse.dltk.core.DLTKCore;
+import org.eclipse.dltk.core.ISourceModule;
+import org.eclipse.dltk.core.mixin.MixinModel;
+import org.eclipse.dltk.ruby.ast.RubyCallArgument;
+import org.eclipse.dltk.ruby.ast.RubyDVarExpression;
+import org.eclipse.dltk.ruby.ast.RubyMethodArgument;
+import org.eclipse.dltk.ruby.ast.RubySingletonMethodDeclaration;
+import org.eclipse.dltk.ruby.ast.RubyVariableKind;
+import org.eclipse.dltk.ruby.internal.parsers.jruby.ASTUtils;
+import org.eclipse.dltk.ruby.typeinference.IArgumentsContext;
+import org.eclipse.dltk.ruby.typeinference.LocalVariableInfo;
+import org.eclipse.dltk.ruby.typeinference.RubyClassType;
+import org.eclipse.dltk.ruby.typeinference.RubyMethodReference;
+import org.eclipse.dltk.ruby.typeinference.RubyTypeInferencingUtils;
+import org.eclipse.dltk.ruby.typeinference.VariableTypeGoal;
+import org.eclipse.dltk.ti.BasicContext;
+import org.eclipse.dltk.ti.GoalState;
+import org.eclipse.dltk.ti.IContext;
+import org.eclipse.dltk.ti.ISourceModuleContext;
+import org.eclipse.dltk.ti.goals.ExpressionTypeGoal;
+import org.eclipse.dltk.ti.goals.GoalEvaluator;
+import org.eclipse.dltk.ti.goals.IGoal;
+import org.eclipse.dltk.ti.goals.ItemReference;
+import org.eclipse.dltk.ti.goals.MethodCallsGoal;
+import org.eclipse.dltk.ti.types.IEvaluatedType;
+
public class VariableReferenceEvaluator extends GoalEvaluator {
private LocalVariableInfo info;
@@ -106,7 +106,7 @@
}
}
- info = RubyTypeInferencingUtils.searchLocalVars(rootNode,
+ info = RubyTypeInferencingUtils.inspectLocalVariable(rootNode,
expression.sourceStart(), varName);
List poss = new ArrayList();
@@ -258,4 +258,4 @@
return IGoal.NO_GOALS;
}
-}
+}