diff options
author | Mike Krüger <mkrueger@xamarin.com> | 2011-12-02 17:12:41 +0400 |
---|---|---|
committer | Mike Krüger <mkrueger@xamarin.com> | 2011-12-02 17:12:41 +0400 |
commit | cae60273e4a57e48a35c61b4ec7d0fec5a611b98 (patch) | |
tree | 2f23a22d4aa368399714f5032b65221eee2d864a /main/src/addins/CSharpBinding | |
parent | b3f516a03ac1e5bb9ff077477194493ce745a1cc (diff) |
[AssemblyBrowser] Tracked NRefactory API changes.
Diffstat (limited to 'main/src/addins/CSharpBinding')
-rw-r--r-- | main/src/addins/CSharpBinding/MonoDevelop.CSharp/CSharpAmbience.cs | 22 |
1 files changed, 12 insertions, 10 deletions
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp/CSharpAmbience.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp/CSharpAmbience.cs index c466bd9be3..648de7c287 100644 --- a/main/src/addins/CSharpBinding/MonoDevelop.CSharp/CSharpAmbience.cs +++ b/main/src/addins/CSharpBinding/MonoDevelop.CSharp/CSharpAmbience.cs @@ -349,7 +349,7 @@ namespace MonoDevelop.CSharp return "null"; var type = reference; if (type.Kind == TypeKind.Unknown) - return reference.ToString (); + return ((UnknownType)reference).Name; var sb = new StringBuilder (); if (type is ITypeDefinition && ((ITypeDefinition)type).IsSynthetic&& ((ITypeDefinition)type).Name == "$Anonymous$") { sb.Append ("new {"); @@ -372,6 +372,8 @@ namespace MonoDevelop.CSharp protected override string GetTypeString (IType t, OutputSettings settings) { + if (t is UnknownType) + return ((UnknownType)t).Name; ITypeDefinition type = t.GetDefinition (); if (type == null) return ""; @@ -500,7 +502,7 @@ namespace MonoDevelop.CSharp } if (!settings.IncludeReturnType && settings.UseFullName) { - result.Append (GetTypeReferenceString (method.DeclaringType, new OutputSettings (OutputFlags.UseFullName))); + result.Append (GetTypeReferenceString (method.DeclaringTypeDefinition, new OutputSettings (OutputFlags.UseFullName))); result.Append (settings.Markup (".")); } AppendExplicitInterfaces (result, method, settings); @@ -541,17 +543,17 @@ namespace MonoDevelop.CSharp protected override string GetMethodString (IMethod method, OutputSettings settings) { - return InternalGetMethodString (method, settings, settings.EmitName (method, Format (FilterName (method.EntityType == EntityType.Constructor || method.EntityType == EntityType.Destructor ? method.DeclaringType.Name : method.Name))), true); + return InternalGetMethodString (method, settings, settings.EmitName (method, Format (FilterName (method.EntityType == EntityType.Constructor || method.EntityType == EntityType.Destructor ? method.DeclaringTypeDefinition.Name : method.Name))), true); } protected override string GetConstructorString (IMethod method, OutputSettings settings) { - return InternalGetMethodString (method, settings, settings.EmitName (method, Format (FilterName (method.DeclaringType.Name))), false); + return InternalGetMethodString (method, settings, settings.EmitName (method, Format (FilterName (method.DeclaringTypeDefinition != null ? method.DeclaringTypeDefinition.Name : method.Name))), false); } protected override string GetDestructorString (IMethod method, OutputSettings settings) { - return InternalGetMethodString (method, settings, settings.EmitName (method, settings.Markup ("~") + Format (FilterName (method.DeclaringType.Name))), false); + return InternalGetMethodString (method, settings, settings.EmitName (method, settings.Markup ("~") + Format (FilterName (method.DeclaringTypeDefinition != null ? method.DeclaringTypeDefinition.Name : method.Name))), false); } protected override string GetOperatorString (IMethod method, OutputSettings settings) @@ -564,7 +566,7 @@ namespace MonoDevelop.CSharp if (field == null) return ""; var result = new StringBuilder (); - bool isEnum = field.DeclaringType != null && field.DeclaringType.Kind == TypeKind.Enum; + bool isEnum = field.DeclaringTypeDefinition != null && field.DeclaringTypeDefinition.Kind == TypeKind.Enum; AppendModifiers (result, settings, field); if (!settings.CompletionListFomat && settings.IncludeReturnType && !isEnum) { @@ -573,7 +575,7 @@ namespace MonoDevelop.CSharp } if (!settings.IncludeReturnType && settings.UseFullName) { - result.Append (GetTypeReferenceString (field.DeclaringType, settings)); + result.Append (GetTypeReferenceString (field.DeclaringTypeDefinition, settings)); result.Append (settings.Markup (".")); } result.Append (settings.EmitName (field, FilterName (Format (field.Name)))); @@ -599,7 +601,7 @@ namespace MonoDevelop.CSharp } if (!settings.IncludeReturnType && settings.UseFullName) { - result.Append (GetTypeReferenceString (evt.DeclaringType, new OutputSettings (OutputFlags.UseFullName))); + result.Append (GetTypeReferenceString (evt.DeclaringTypeDefinition, new OutputSettings (OutputFlags.UseFullName))); result.Append (settings.Markup (".")); } @@ -625,7 +627,7 @@ namespace MonoDevelop.CSharp } if (!settings.IncludeReturnType && settings.UseFullName) { - result.Append (GetTypeReferenceString (property.DeclaringType, new OutputSettings (OutputFlags.UseFullName))); + result.Append (GetTypeReferenceString (property.DeclaringTypeDefinition, new OutputSettings (OutputFlags.UseFullName))); result.Append (settings.Markup (".")); } @@ -654,7 +656,7 @@ namespace MonoDevelop.CSharp } if (!settings.IncludeReturnType && settings.UseFullName) { - result.Append (GetTypeReferenceString (property.DeclaringType, new OutputSettings (OutputFlags.UseFullName))); + result.Append (GetTypeReferenceString (property.DeclaringTypeDefinition, new OutputSettings (OutputFlags.UseFullName))); result.Append (settings.Markup (".")); } |