Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Renamed GetClass-> GetTypeDefinition;

  • Loading branch information...
commit 6a85f0c50caf8ea107b8d8809ca0433ed32df03c 1 parent abec118
Mike Krüger mkrueger authored
2  ICSharpCode.NRefactory/CSharp/Analysis/MinimalResolveContext.cs
View
@@ -58,7 +58,7 @@ ITypeDefinition CreateStruct(string nameSpace, string name)
};
}
- public ITypeDefinition GetClass(string nameSpace, string name, int typeParameterCount, StringComparer nameComparer)
+ public ITypeDefinition GetTypeDefinition(string nameSpace, string name, int typeParameterCount, StringComparer nameComparer)
{
foreach (ITypeDefinition type in types) {
if (nameComparer.Equals(type.Name, name) && nameComparer.Equals(type.Namespace, nameSpace) && type.TypeParameterCount == typeParameterCount)
6 ICSharpCode.NRefactory/CSharp/Resolver/CSharpResolver.cs
View
@@ -1586,7 +1586,7 @@ ResolveResult LookupSimpleNameOrTypeName(string identifier, IList<IType> typeArg
}
}
// then look for a type
- ITypeDefinition def = context.GetClass(n.NamespaceName, identifier, k, StringComparer.Ordinal);
+ ITypeDefinition def = context.GetTypeDefinition(n.NamespaceName, identifier, k, StringComparer.Ordinal);
if (def != null) {
IType result = def;
if (k != 0) {
@@ -1620,7 +1620,7 @@ ResolveResult LookupSimpleNameOrTypeName(string identifier, IList<IType> typeArg
foreach (var u in n.Usings) {
NamespaceResolveResult ns = u.ResolveNamespace(context);
if (ns != null) {
- def = context.GetClass(ns.NamespaceName, identifier, k, StringComparer.Ordinal);
+ def = context.GetTypeDefinition(ns.NamespaceName, identifier, k, StringComparer.Ordinal);
if (def != null) {
if (firstResult == null) {
if (k == 0)
@@ -1690,7 +1690,7 @@ public ResolveResult ResolveMemberAccess(ResolveResult target, string identifier
if (context.GetNamespace(fullName, StringComparer.Ordinal) != null)
return new NamespaceResolveResult(fullName);
}
- ITypeDefinition def = context.GetClass(nrr.NamespaceName, identifier, typeArguments.Count, StringComparer.Ordinal);
+ ITypeDefinition def = context.GetTypeDefinition(nrr.NamespaceName, identifier, typeArguments.Count, StringComparer.Ordinal);
if (def != null)
return new TypeResolveResult(def);
return ErrorResult;
2  ICSharpCode.NRefactory/CSharp/Resolver/Conversions.cs
View
@@ -194,7 +194,7 @@ public bool ImplicitReferenceConversion(IType fromType, IType toType)
|| ImplicitReferenceConversion(fromArray.ElementType, toPT.TypeArguments[0]);
}
// conversion from any array to System.Array and the interfaces it implements:
- ITypeDefinition systemArray = context.GetClass("System", "Array", 0, StringComparer.Ordinal);
+ ITypeDefinition systemArray = context.GetTypeDefinition("System", "Array", 0, StringComparer.Ordinal);
return systemArray != null && (systemArray.Equals(toType) || ImplicitReferenceConversion(systemArray, toType));
}
2  ICSharpCode.NRefactory/CSharp/Resolver/MapTypeIntoNewContext.cs
View
@@ -34,7 +34,7 @@ public override IType VisitTypeDefinition(ITypeDefinition type)
}
return type;
} else {
- return context.GetClass(type.Namespace, type.Name, type.TypeParameterCount, StringComparer.Ordinal) ?? type;
+ return context.GetTypeDefinition(type.Namespace, type.Name, type.TypeParameterCount, StringComparer.Ordinal) ?? type;
}
}
2  ICSharpCode.NRefactory/TypeSystem/CecilLoader.cs
View
@@ -297,7 +297,7 @@ public AssemblyDefinition Resolve(string fullName, ReaderParameters parameters)
name = ReflectionHelper.SplitTypeParameterCountFromReflectionName(name, out typeParameterCount);
var earlyBindContext = this.EarlyBindContext;
if (earlyBindContext != null) {
- IType c = earlyBindContext.GetClass(ns, name, typeParameterCount, StringComparer.Ordinal);
+ IType c = earlyBindContext.GetTypeDefinition(ns, name, typeParameterCount, StringComparer.Ordinal);
if (c != null)
return c;
}
20 ICSharpCode.NRefactory/TypeSystem/ITypeResolveContext.cs
View
@@ -18,18 +18,18 @@ namespace ICSharpCode.NRefactory.TypeSystem
public interface ITypeResolveContext
{
/// <summary>
- /// Retrieves a class.
+ /// Retrieves a type.
/// </summary>
- /// <param name="nameSpace">Namespace that contains the class</param>
- /// <param name="name">Name of the class</param>
+ /// <param name="nameSpace">Namespace that contains the type</param>
+ /// <param name="name">Name of the type</param>
/// <param name="typeParameterCount">Number of type parameters</param>
/// <param name="nameComparer">Language-specific rules for how class names are compared</param>
- /// <returns>The type definition for the class; or null if no such class exists.</returns>
- /// <remarks>This method never returns inner classes; it can be used only with top-level classes.</remarks>
- ITypeDefinition GetClass(string nameSpace, string name, int typeParameterCount, StringComparer nameComparer);
+ /// <returns>The type definition for the class; or null if no such type exists.</returns>
+ /// <remarks>This method never returns inner types; it can be used only with top-level types.</remarks>
+ ITypeDefinition GetTypeDefinition(string nameSpace, string name, int typeParameterCount, StringComparer nameComparer);
/// <summary>
- /// Retrieves all top-level classes.
+ /// Retrieves all top-level types.
/// </summary>
/// <remarks>
/// If this method is called within <c>using (pc.Synchronize())</c>, then the returned enumerable is valid
@@ -38,11 +38,11 @@ public interface ITypeResolveContext
IEnumerable<ITypeDefinition> GetTypes();
/// <summary>
- /// Retrieves all classes in the specified namespace.
+ /// Retrieves all types in the specified namespace.
/// </summary>
- /// <param name="nameSpace">Namespace in which classes are being retrieved. Use <c>string.Empty</c> for the root namespace.</param>
+ /// <param name="nameSpace">Namespace in which types are being retrieved. Use <c>string.Empty</c> for the root namespace.</param>
/// <param name="nameComparer">Language-specific rules for how namespace names are compared</param>
- /// <returns>List of classes within that namespace.</returns>
+ /// <returns>List of types within that namespace.</returns>
/// <remarks>
/// If this method is called within <c>using (var spc = pc.Synchronize())</c>, then the returned enumerable is valid
/// only until the end of the synchronize block.
4 ICSharpCode.NRefactory/TypeSystem/Implementation/CompositeTypeResolveContext.cs
View
@@ -52,10 +52,10 @@ private CompositeTypeResolveContext(ITypeResolveContext[] children)
}
/// <inheritdoc/>
- public ITypeDefinition GetClass(string nameSpace, string name, int typeParameterCount, StringComparer nameComparer)
+ public ITypeDefinition GetTypeDefinition(string nameSpace, string name, int typeParameterCount, StringComparer nameComparer)
{
foreach (ITypeResolveContext context in children) {
- ITypeDefinition d = context.GetClass(nameSpace, name, typeParameterCount, nameComparer);
+ ITypeDefinition d = context.GetTypeDefinition(nameSpace, name, typeParameterCount, nameComparer);
if (d != null)
return d;
}
4 ICSharpCode.NRefactory/TypeSystem/Implementation/DefaultTypeParameter.cs
View
@@ -235,7 +235,7 @@ public IEnumerable<IMethod> GetConstructors(ITypeResolveContext context, Predica
public IEnumerable<IMethod> GetMethods(ITypeResolveContext context, Predicate<IMethod> filter = null)
{
// TODO: get methods from constraints
- IType objectType = context.GetClass("System", "Object", 0, StringComparer.Ordinal);
+ IType objectType = context.GetTypeDefinition("System", "Object", 0, StringComparer.Ordinal);
IEnumerable<IMethod> objectMethods;
if (objectType != null)
objectMethods = objectType.GetMethods(context, filter);
@@ -268,7 +268,7 @@ IEnumerable<IType> IType.GetNestedTypes(ITypeResolveContext context, Predicate<I
public IEnumerable<IType> GetBaseTypes(ITypeResolveContext context)
{
- IType defaultBaseType = context.GetClass("System", HasValueTypeConstraint ? "ValueType" : "Object", 0, StringComparer.Ordinal);
+ IType defaultBaseType = context.GetTypeDefinition("System", HasValueTypeConstraint ? "ValueType" : "Object", 0, StringComparer.Ordinal);
if (defaultBaseType != null)
yield return defaultBaseType;
2  ICSharpCode.NRefactory/TypeSystem/Implementation/GetClassTypeReference.cs
View
@@ -83,7 +83,7 @@ public IType Resolve(ITypeResolveContext context)
IType DoResolve(ITypeResolveContext context)
{
*/
- return context.GetClass(nameSpace, name, typeParameterCount, StringComparer.Ordinal) ?? SharedTypes.UnknownType;
+ return context.GetTypeDefinition(nameSpace, name, typeParameterCount, StringComparer.Ordinal) ?? SharedTypes.UnknownType;
}
public override string ToString()
4 ICSharpCode.NRefactory/TypeSystem/Implementation/ProxyTypeResolveContext.cs
View
@@ -25,9 +25,9 @@ public ProxyTypeResolveContext(ITypeResolveContext target)
}
/// <inheritdoc/>
- public virtual ITypeDefinition GetClass(string nameSpace, string name, int typeParameterCount, StringComparer nameComparer)
+ public virtual ITypeDefinition GetTypeDefinition(string nameSpace, string name, int typeParameterCount, StringComparer nameComparer)
{
- return target.GetClass(nameSpace, name, typeParameterCount, nameComparer);
+ return target.GetTypeDefinition(nameSpace, name, typeParameterCount, nameComparer);
}
/// <inheritdoc/>
4 ICSharpCode.NRefactory/TypeSystem/Implementation/SimpleProjectContent.cs
View
@@ -118,11 +118,11 @@ public void UpdateProjectContent(IParsedFile oldFile, IParsedFile newFile)
#endregion
#region IProjectContent implementation
- public ITypeDefinition GetClass(string nameSpace, string name, int typeParameterCount, StringComparer nameComparer)
+ public ITypeDefinition GetTypeDefinition(string nameSpace, string name, int typeParameterCount, StringComparer nameComparer)
{
readerWriterLock.EnterReadLock();
try {
- return types.GetClass(nameSpace, name, typeParameterCount, nameComparer);
+ return types.GetTypeDefinition(nameSpace, name, typeParameterCount, nameComparer);
} finally {
readerWriterLock.ExitReadLock();
}
2  ICSharpCode.NRefactory/TypeSystem/Implementation/TypeStorage.cs
View
@@ -203,7 +203,7 @@ NamespaceEntry GetOrCreateNamespaceEntry(Dictionary<string, NamespaceEntry> dict
#region ITypeResolveContext implementation
/// <inheritdoc/>
- public ITypeDefinition GetClass(string nameSpace, string name, int typeParameterCount, StringComparer nameComparer)
+ public ITypeDefinition GetTypeDefinition(string nameSpace, string name, int typeParameterCount, StringComparer nameComparer)
{
if (nameSpace == null)
throw new ArgumentNullException("nameSpace");
2  ICSharpCode.NRefactory/TypeSystem/NullableType.cs
View
@@ -47,7 +47,7 @@ public static IType Create(IType elementType, ITypeResolveContext context)
if (context == null)
throw new ArgumentNullException("context");
- ITypeDefinition nullable = context.GetClass("System", "Nullable", 1, StringComparer.Ordinal);
+ ITypeDefinition nullable = context.GetTypeDefinition("System", "Nullable", 1, StringComparer.Ordinal);
if (nullable != null)
return new ParameterizedType(nullable, new [] { elementType });
else
2  ICSharpCode.NRefactory/TypeSystem/ReflectionHelper.cs
View
@@ -54,7 +54,7 @@ public static ITypeDefinition GetClass(this ITypeResolveContext context, Type ty
} else {
int typeParameterCount;
string name = SplitTypeParameterCountFromReflectionName(type.Name, out typeParameterCount);
- return context.GetClass(type.Namespace, name, typeParameterCount, StringComparer.Ordinal);
+ return context.GetTypeDefinition(type.Namespace, name, typeParameterCount, StringComparer.Ordinal);
}
}
#endregion
Please sign in to comment.
Something went wrong with that request. Please try again.