|
|
|
@ -80,12 +80,11 @@ namespace ICSharpCode.NRefactory.CSharp.Completion |
|
|
|
result.Add (Factory.CreateLiteralCompletionData (alias)); |
|
|
|
result.Add (Factory.CreateLiteralCompletionData (alias)); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Dictionary<string, ICompletionData> usedTypes = new Dictionary<string, ICompletionData> (); |
|
|
|
HashSet<string> usedTypes = new HashSet<string> (); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public ICompletionData AddType(IType type, string shortType) |
|
|
|
public ICompletionData AddType(IType type, string shortType) |
|
|
|
{ |
|
|
|
{ |
|
|
|
if (type == null || string.IsNullOrEmpty(shortType) || usedTypes.Contains(shortType)) |
|
|
|
if (type == null || string.IsNullOrEmpty(shortType)) |
|
|
|
return null; |
|
|
|
return null; |
|
|
|
if (type.Name == "Void" && type.Namespace == "System") |
|
|
|
if (type.Name == "Void" && type.Namespace == "System") |
|
|
|
return null; |
|
|
|
return null; |
|
|
|
@ -93,9 +92,13 @@ namespace ICSharpCode.NRefactory.CSharp.Completion |
|
|
|
var def = type.GetDefinition(); |
|
|
|
var def = type.GetDefinition(); |
|
|
|
if (def != null && def.ParentAssembly != completion.ctx.CurrentAssembly && !def.IsBrowsable()) |
|
|
|
if (def != null && def.ParentAssembly != completion.ctx.CurrentAssembly && !def.IsBrowsable()) |
|
|
|
return null; |
|
|
|
return null; |
|
|
|
|
|
|
|
ICompletionData usedType; |
|
|
|
usedTypes.Add(shortType); |
|
|
|
if (usedTypes.TryGetValue (shortType, out usedType)) { |
|
|
|
|
|
|
|
usedType.AddOverload (Factory.CreateTypeCompletionData(type, shortType)); |
|
|
|
|
|
|
|
return usedType; |
|
|
|
|
|
|
|
} |
|
|
|
var iCompletionData = Factory.CreateTypeCompletionData(type, shortType); |
|
|
|
var iCompletionData = Factory.CreateTypeCompletionData(type, shortType); |
|
|
|
|
|
|
|
usedTypes[shortType] = iCompletionData; |
|
|
|
result.Add(iCompletionData); |
|
|
|
result.Add(iCompletionData); |
|
|
|
return iCompletionData; |
|
|
|
return iCompletionData; |
|
|
|
} |
|
|
|
} |
|
|
|
|