Author: mkrueger
Date: 2007-09-12 04:10:44 -0400 (Wed, 12 Sep 2007)
New Revision: 85668

Modified:
   trunk/monodevelop/Extras/CSharpBinding/ChangeLog
   trunk/monodevelop/Extras/CSharpBinding/Parser/CodeGenerator.cs
Log:
* Parser/CodeGenerator.cs: Fixed 82311: Rename fails when we have two
  variables that are called the same.

Modified: trunk/monodevelop/Extras/CSharpBinding/ChangeLog
===================================================================
--- trunk/monodevelop/Extras/CSharpBinding/ChangeLog    2007-09-12 08:09:02 UTC 
(rev 85667)
+++ trunk/monodevelop/Extras/CSharpBinding/ChangeLog    2007-09-12 08:10:44 UTC 
(rev 85668)
@@ -1,3 +1,8 @@
+2007-09-12  Mike Krüger <[EMAIL PROTECTED]> 
+
+       * Parser/CodeGenerator.cs: Fixed 82311: Rename fails when we have two
+         variables that are called the same.
+
 2007-09-11  Ankit Jain  <[EMAIL PROTECTED]>
 
        * CSharpBindingCompilerManager.cs (Compile): Pass /warn: command line

Modified: trunk/monodevelop/Extras/CSharpBinding/Parser/CodeGenerator.cs
===================================================================
--- trunk/monodevelop/Extras/CSharpBinding/Parser/CodeGenerator.cs      
2007-09-12 08:09:02 UTC (rev 85667)
+++ trunk/monodevelop/Extras/CSharpBinding/Parser/CodeGenerator.cs      
2007-09-12 08:10:44 UTC (rev 85668)
@@ -451,6 +451,7 @@
                        IParseInformation pi = pctx.ParseFile (file);
                        
                        fileCompilationUnit = pi.MostRecentCompilationUnit.Tag 
as CompilationUnit;
+                       
                        if (fileCompilationUnit != null)
                                VisitCompilationUnit (fileCompilationUnit, 
null);
                }
@@ -486,6 +487,8 @@
                                           node.StartLocation.Y, 
node.StartLocation.X);
                }
                
+                
+               
                public override object VisitFieldDeclaration (FieldDeclaration 
fieldDeclaration, object data)
                {
                        //Debug ("FieldDeclaration", fieldDeclaration.ToString 
(), fieldDeclaration);
@@ -511,7 +514,8 @@
                                IClass cls = resolver.ResolveExpressionType 
(fileCompilationUnit, fieldExp.TargetObject, fieldExp.StartLocation.Y, 
fieldExp.StartLocation.X);
                                if (cls != null && IsExpectedClass (cls)) {
                                        int pos = 
file.GetPositionFromLineColumn (fieldExp.StartLocation.Y, 
fieldExp.StartLocation.X);
-                                       string txt = file.GetText (pos, pos + 
member.Name.Length);
+                                       int endpos = 
file.GetPositionFromLineColumn (fieldExp.EndLocation.Y, fieldExp.EndLocation.X);
+                                       string txt = file.GetText (pos, endpos);
                                        if (txt == member.Name) {
                                                //Debug ("adding 
FieldReferenceExpression", member.Name, fieldExp);
                                                AddUniqueReference 
(fieldExp.StartLocation.Y, fieldExp.StartLocation.X, member.Name);

_______________________________________________
Mono-patches maillist  -  [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches

Reply via email to