From 64e0edd04b1f82eaa5f2e077d7f600781162ed5a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mike=20Kr=C3=BCger?= Date: Thu, 18 Oct 2012 17:21:13 +0200 Subject: [PATCH] Revert "Fixed duplicate type issue." - I choosed to handle the ambiguous types on IDE level. This reverts commit b99b871ccbf1a388dd1061a9b8c2ce8a6bbe0ea7. --- .../Completion/CompletionDataWrapper.cs | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/ICSharpCode.NRefactory.CSharp/Completion/CompletionDataWrapper.cs b/ICSharpCode.NRefactory.CSharp/Completion/CompletionDataWrapper.cs index af3fdd5217..c4eff72e6a 100644 --- a/ICSharpCode.NRefactory.CSharp/Completion/CompletionDataWrapper.cs +++ b/ICSharpCode.NRefactory.CSharp/Completion/CompletionDataWrapper.cs @@ -95,13 +95,15 @@ namespace ICSharpCode.NRefactory.CSharp.Completion } Dictionary typeDisplayText = new Dictionary (); - Dictionary addedTypes = new Dictionary (); + Dictionary addedTypes = new Dictionary (); public ICompletionData AddType(IType type, bool showFullName, bool isInAttributeContext = false) { if (type == null) throw new ArgumentNullException("type"); if (type.Name == "Void" && type.Namespace == "System" || type.Kind == TypeKind.Unknown) return null; + if (addedTypes.ContainsKey (type)) + return addedTypes[type]; var def = type.GetDefinition(); if (def != null && def.ParentAssembly != completion.ctx.CurrentAssembly && !def.IsBrowsable()) @@ -110,18 +112,13 @@ namespace ICSharpCode.NRefactory.CSharp.Completion var data = Factory.CreateTypeCompletionData(type, showFullName, isInAttributeContext); var text = data.DisplayText; - var reflectionName = text + "~" + type.TypeParameterCount; - if (addedTypes.ContainsKey(reflectionName)) - return addedTypes[reflectionName]; - - if (typeDisplayText.TryGetValue(text, out usedType)) { usedType.AddOverload(data); return usedType; } typeDisplayText [text] = data; result.Add(data); - addedTypes[reflectionName] = data; + addedTypes[type] = data; return data; }