r155386 - in trunk/monodevelop/main/src/addins/CSharpBinding: . MonoDevelop.CSharp.Formatting MonoDevelop.CSharp.Resolver

0 views
Skip to first unread message

Mike Kruger (mkrueger@novell.com)

unread,
Apr 14, 2010, 8:04:32 AM4/14/10
to mono-p...@lists.ximian.com, ximian....@gmail.com, mono-svn-patche...@googlegroups.com
Author: mkrueger
Date: 2010-04-14 08:04:32 -0400 (Wed, 14 Apr 2010)
New Revision: 155386

Modified:
trunk/monodevelop/main/src/addins/CSharpBinding/ChangeLog
trunk/monodevelop/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Formatting/CSharpFormatter.cs
trunk/monodevelop/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Resolver/NRefactoryResolver.cs
Log:
* MonoDevelop.CSharp.Formatting/CSharpFormatter.cs:
* MonoDevelop.CSharp.Resolver/NRefactoryResolver.cs: Fixed code
completion bug.

Modified: trunk/monodevelop/main/src/addins/CSharpBinding/ChangeLog
===================================================================
--- trunk/monodevelop/main/src/addins/CSharpBinding/ChangeLog 2010-04-14 11:50:55 UTC (rev 155385)
+++ trunk/monodevelop/main/src/addins/CSharpBinding/ChangeLog 2010-04-14 12:04:32 UTC (rev 155386)
@@ -1,5 +1,11 @@
2010-04-14 Mike Krüger <mkru...@novell.com>

+ * MonoDevelop.CSharp.Formatting/CSharpFormatter.cs:
+ * MonoDevelop.CSharp.Resolver/NRefactoryResolver.cs: Fixed
+ code completion bug.
+
+2010-04-14 Mike Krüger <mkru...@novell.com>
+
* MonoDevelop.CSharp.Highlighting/CSharpSyntaxMode.cs: fixed
possible null ref.

Modified: trunk/monodevelop/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Formatting/CSharpFormatter.cs
===================================================================
--- trunk/monodevelop/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Formatting/CSharpFormatter.cs 2010-04-14 11:50:55 UTC (rev 155385)
+++ trunk/monodevelop/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Formatting/CSharpFormatter.cs 2010-04-14 12:04:32 UTC (rev 155386)
@@ -167,7 +167,7 @@
IType type = NRefactoryResolver.GetTypeAtCursor (unit, unit.FileName, caretLocation);
if (type == null)
return;
- Format (data, type, NRefactoryResolver.GetMemberAt (type, caretLocation), dom, unit, caretLocation);
+ Format (data, type, NRefactoryResolver.GetMemberAt (type, unit.FileName, caretLocation), dom, unit, caretLocation);
}

static string GetIndent (string text)

Modified: trunk/monodevelop/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Resolver/NRefactoryResolver.cs
===================================================================
--- trunk/monodevelop/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Resolver/NRefactoryResolver.cs 2010-04-14 11:50:55 UTC (rev 155385)
+++ trunk/monodevelop/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Resolver/NRefactoryResolver.cs 2010-04-14 12:04:32 UTC (rev 155386)
@@ -148,9 +148,11 @@
}
}

- internal static IMember GetMemberAt (IType type, DomLocation location)
+ internal static IMember GetMemberAt (IType type, string fileName, DomLocation location)
{
foreach (IMember member in type.Members) {
+ if (member.DeclaringType.CompilationUnit.FileName != fileName)
+ continue;
if (!(member is IMethod || member is IProperty || member is IEvent || member is IField))
continue;
if (member.Location.Line == location.Line || (!member.BodyRegion.IsEmpty && member.BodyRegion.Start <= location && (location < member.BodyRegion.End || member.BodyRegion.End.IsEmpty))) {
@@ -167,11 +169,11 @@
callingType = GetTypeAtCursor (unit, fileName, resolvePosition);
if (callingType != null) {
callingType = dom.ResolveType (callingType);
- callingMember = GetMemberAt (callingType, resolvePosition);
+ callingMember = GetMemberAt (callingType, fileName, resolvePosition);
if (callingMember == null) {
DomLocation posAbove = resolvePosition;
posAbove.Line--;
- callingMember = GetMemberAt (callingType, posAbove);
+ callingMember = GetMemberAt (callingType, fileName, posAbove);
}
}

Reply all
Reply to author
Forward
0 new messages