Browse Source

[Completion] Types with different type parameters are now added as

overloads again.
newNRvisualizers
Mike Krüger 14 years ago
parent
commit
43641dc5a1
  1. 16
      ICSharpCode.NRefactory.CSharp/Completion/CompletionDataWrapper.cs

16
ICSharpCode.NRefactory.CSharp/Completion/CompletionDataWrapper.cs

@ -80,7 +80,7 @@ namespace ICSharpCode.NRefactory.CSharp.Completion @@ -80,7 +80,7 @@ namespace ICSharpCode.NRefactory.CSharp.Completion
result.Add (Factory.CreateLiteralCompletionData (alias));
}
Dictionary<IType, ICompletionData> usedTypes = new Dictionary<IType, ICompletionData> ();
Dictionary<string, ICompletionData> usedTypes = new Dictionary<string, ICompletionData> ();
public ICompletionData AddType(IType type, bool showFullName, bool isInAttributeContext = false)
{
@ -93,14 +93,16 @@ namespace ICSharpCode.NRefactory.CSharp.Completion @@ -93,14 +93,16 @@ namespace ICSharpCode.NRefactory.CSharp.Completion
if (def != null && def.ParentAssembly != completion.ctx.CurrentAssembly && !def.IsBrowsable())
return null;
ICompletionData usedType;
if (usedTypes.TryGetValue (type, out usedType)) {
usedType.AddOverload (Factory.CreateTypeCompletionData(type, showFullName, isInAttributeContext));
var data = Factory.CreateTypeCompletionData(type, showFullName, isInAttributeContext);
var text = data.DisplayText;
if (usedTypes.TryGetValue(text, out usedType)) {
usedType.AddOverload(data);
return usedType;
}
var iCompletionData = Factory.CreateTypeCompletionData(type, showFullName, isInAttributeContext);
usedTypes[type] = iCompletionData;
result.Add(iCompletionData);
return iCompletionData;
usedTypes [text] = data;
result.Add(data);
return data;
}
Dictionary<string, List<ICompletionData>> data = new Dictionary<string, List<ICompletionData>> ();

Loading…
Cancel
Save