diff options
author | Mike Krüger <mkrueger@xamarin.com> | 2012-07-23 17:34:27 +0400 |
---|---|---|
committer | Mike Krüger <mkrueger@xamarin.com> | 2012-07-23 17:34:27 +0400 |
commit | da8bd2a460b845c8ca9673603e9b1b1cbce0bad8 (patch) | |
tree | 56639224efad4d5ff9737aac8ff174ecd91277cc /main/contrib | |
parent | b83531865b6e097a561c54c5a5f24000d456cd40 (diff) |
Worked on 'Bug 6237 - Code completion includes private code '.
Diffstat (limited to 'main/contrib')
-rw-r--r-- | main/contrib/ICSharpCode.NRefactory.CSharp/Completion/CSharpCompletionEngine.cs | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/main/contrib/ICSharpCode.NRefactory.CSharp/Completion/CSharpCompletionEngine.cs b/main/contrib/ICSharpCode.NRefactory.CSharp/Completion/CSharpCompletionEngine.cs index 02b70bafc7..59e763a425 100644 --- a/main/contrib/ICSharpCode.NRefactory.CSharp/Completion/CSharpCompletionEngine.cs +++ b/main/contrib/ICSharpCode.NRefactory.CSharp/Completion/CSharpCompletionEngine.cs @@ -262,7 +262,7 @@ namespace ICSharpCode.NRefactory.CSharp.Completion return contextList.Result; } - foreach (var m in initializerResult.Item1.Type.GetMembers (m => m.IsPublic && (m.EntityType == EntityType.Property || m.EntityType == EntityType.Field))) { + foreach (var m in initializerResult.Item1.Type.GetMembers (m => !m.IsSynthetic && m.IsPublic && (m.EntityType == EntityType.Property || m.EntityType == EntityType.Field))) { contextList.AddMember(m); } @@ -1349,6 +1349,8 @@ namespace ICSharpCode.NRefactory.CSharp.Completion if (member is IMethod && ((IMethod)member).FullName == "System.Object.Finalize") { continue; } + if (member.IsSynthetic) + continue; if (member.EntityType == EntityType.Operator) { continue; } @@ -1365,7 +1367,7 @@ namespace ICSharpCode.NRefactory.CSharp.Completion } var declaring = def.DeclaringTypeDefinition; while (declaring != null) { - foreach (var member in declaring.GetMembers (m => m.IsStatic)) { + foreach (var member in declaring.GetMembers (m => m.IsStatic && !m.IsSynthetic)) { if (memberPred == null || memberPred(member)) { wrapper.AddMember(member); } @@ -2147,6 +2149,8 @@ namespace ICSharpCode.NRefactory.CSharp.Completion var nr = (NamespaceResolveResult)resolveResult; if (!(resolvedNode.Parent is UsingDeclaration || resolvedNode.Parent != null && resolvedNode.Parent.Parent is UsingDeclaration)) { foreach (var cl in nr.Namespace.Types) { + if (cl.IsSynthetic) + continue; string name = cl.Name; if (hintType != null && hintType.Kind != TypeKind.Array && cl.Kind == TypeKind.Interface) { continue; @@ -2285,6 +2289,8 @@ namespace ICSharpCode.NRefactory.CSharp.Completion var namespaceContents = new CompletionDataWrapper(this); foreach (var cl in nr.Namespace.Types) { + if (cl.IsSynthetic) + continue; IType addType = typePred != null ? typePred(cl) : cl; if (addType != null) namespaceContents.AddType(addType, addType.Name); @@ -2385,6 +2391,8 @@ namespace ICSharpCode.NRefactory.CSharp.Completion var filteredList = new List<IMember>(); foreach (var member in type.GetMembers ()) { + if (member.IsSynthetic) + continue; if (member.EntityType == EntityType.Indexer || member.EntityType == EntityType.Operator || member.EntityType == EntityType.Constructor || member.EntityType == EntityType.Destructor) { continue; } |