Skip to content

Commit 9dde974

Browse files
Rename ResolvedUsingScope to UsingScope
1 parent c9e3790 commit 9dde974

File tree

10 files changed

+28
-28
lines changed

10 files changed

+28
-28
lines changed

ICSharpCode.Decompiler/CSharp/CSharpDecompiler.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -532,7 +532,7 @@ DecompileRun CreateDecompileRun(HashSet<string> namespaces)
532532
}
533533
}
534534

535-
ResolvedUsingScope usingScope = new ResolvedUsingScope(
535+
UsingScope usingScope = new UsingScope(
536536
new CSharpTypeResolveContext(typeSystem.MainModule),
537537
typeSystem.RootNamespace,
538538
resolvedNamespaces.ToImmutableArray()

ICSharpCode.Decompiler/CSharp/Resolver/CSharpResolver.cs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -162,14 +162,14 @@ ITypeResolveContext ITypeResolveContext.WithCurrentMember(IMember member)
162162
/// <summary>
163163
/// Gets the current using scope that is used to look up identifiers as class names.
164164
/// </summary>
165-
public ResolvedUsingScope CurrentUsingScope {
165+
public UsingScope CurrentUsingScope {
166166
get { return context.CurrentUsingScope; }
167167
}
168168

169169
/// <summary>
170170
/// Sets the current using scope that is used to look up identifiers as class names.
171171
/// </summary>
172-
public CSharpResolver WithCurrentUsingScope(ResolvedUsingScope usingScope)
172+
public CSharpResolver WithCurrentUsingScope(UsingScope usingScope)
173173
{
174174
return WithContext(context.WithUsingScope(usingScope));
175175
}
@@ -1656,8 +1656,8 @@ ResolveResult LookInCurrentType(string identifier, IReadOnlyList<IType> typeArgu
16561656
ResolveResult LookInCurrentUsingScope(string identifier, IReadOnlyList<IType> typeArguments, bool isInUsingDeclaration, bool parameterizeResultType)
16571657
{
16581658
// look in current namespace definitions
1659-
ResolvedUsingScope currentUsingScope = this.CurrentUsingScope;
1660-
for (ResolvedUsingScope u = currentUsingScope; u != null; u = u.Parent)
1659+
UsingScope currentUsingScope = this.CurrentUsingScope;
1660+
for (UsingScope u = currentUsingScope; u != null; u = u.Parent)
16611661
{
16621662
var resultInNamespace = LookInUsingScopeNamespace(u, u.Namespace, identifier, typeArguments, parameterizeResultType);
16631663
if (resultInNamespace != null)
@@ -1714,7 +1714,7 @@ ResolveResult LookInCurrentUsingScope(string identifier, IReadOnlyList<IType> ty
17141714
return null;
17151715
}
17161716

1717-
ResolveResult LookInUsingScopeNamespace(ResolvedUsingScope usingScope, INamespace n, string identifier, IReadOnlyList<IType> typeArguments, bool parameterizeResultType)
1717+
ResolveResult LookInUsingScopeNamespace(UsingScope usingScope, INamespace n, string identifier, IReadOnlyList<IType> typeArguments, bool parameterizeResultType)
17181718
{
17191719
if (n == null)
17201720
return null;
@@ -1764,7 +1764,7 @@ public ResolveResult ResolveAlias(string identifier)
17641764
if (identifier == "global")
17651765
return new NamespaceResolveResult(compilation.RootNamespace);
17661766

1767-
for (ResolvedUsingScope n = this.CurrentUsingScope; n != null; n = n.Parent)
1767+
for (UsingScope n = this.CurrentUsingScope; n != null; n = n.Parent)
17681768
{
17691769
if (n.ExternAliases.Contains(identifier))
17701770
{
@@ -2190,7 +2190,7 @@ IList<List<IMethod>> GetAllExtensionMethods(MemberLookup lookup)
21902190
}
21912191
extensionMethodGroups = new List<List<IMethod>>();
21922192
List<IMethod> m;
2193-
for (ResolvedUsingScope scope = currentUsingScope; scope != null; scope = scope.Parent)
2193+
for (UsingScope scope = currentUsingScope; scope != null; scope = scope.Parent)
21942194
{
21952195
INamespace ns = scope.Namespace;
21962196
if (ns != null)

ICSharpCode.Decompiler/CSharp/Syntax/TypeSystemAstBuilder.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -495,7 +495,7 @@ AstType ConvertTypeHelper(IType genericType, IReadOnlyList<IType> typeArguments)
495495
// Look if there's an alias to the target type
496496
if (UseAliases)
497497
{
498-
for (ResolvedUsingScope usingScope = resolver.CurrentUsingScope; usingScope != null; usingScope = usingScope.Parent)
498+
for (UsingScope usingScope = resolver.CurrentUsingScope; usingScope != null; usingScope = usingScope.Parent)
499499
{
500500
foreach (var pair in usingScope.UsingAliases)
501501
{
@@ -643,7 +643,7 @@ AstType ConvertNamespace(string namespaceName, out NamespaceResolveResult nrr, b
643643
// Look if there's an alias to the target namespace
644644
if (UseAliases)
645645
{
646-
for (ResolvedUsingScope usingScope = resolver.CurrentUsingScope; usingScope != null; usingScope = usingScope.Parent)
646+
for (UsingScope usingScope = resolver.CurrentUsingScope; usingScope != null; usingScope = usingScope.Parent)
647647
{
648648
foreach (var pair in usingScope.UsingAliases)
649649
{

ICSharpCode.Decompiler/CSharp/Transforms/IntroduceExtensionMethods.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,11 +42,11 @@ public void Run(AstNode rootNode, TransformContext context)
4242
{
4343
this.context = context;
4444
this.conversions = CSharpConversions.Get(context.TypeSystem);
45-
InitializeContext(rootNode.Annotation<ResolvedUsingScope>());
45+
InitializeContext(rootNode.Annotation<UsingScope>());
4646
rootNode.AcceptVisitor(this);
4747
}
4848

49-
void InitializeContext(ResolvedUsingScope usingScope)
49+
void InitializeContext(UsingScope usingScope)
5050
{
5151
if (!string.IsNullOrEmpty(context.CurrentTypeDefinition?.Namespace))
5252
{

ICSharpCode.Decompiler/CSharp/Transforms/IntroduceUsingDeclarations.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ public void Run(AstNode rootNode, TransformContext context)
7373
}
7474
}
7575

76-
var usingScope = new ResolvedUsingScope(
76+
var usingScope = new UsingScope(
7777
new CSharpTypeResolveContext(context.TypeSystem.MainModule),
7878
context.TypeSystem.RootNamespace,
7979
resolvedNamespaces.ToImmutableArray()
@@ -189,7 +189,7 @@ sealed class FullyQualifyAmbiguousTypeNamesVisitor : DepthFirstAstVisitor
189189
CSharpResolver resolver;
190190
TypeSystemAstBuilder astBuilder;
191191

192-
public FullyQualifyAmbiguousTypeNamesVisitor(TransformContext context, ResolvedUsingScope usingScope)
192+
public FullyQualifyAmbiguousTypeNamesVisitor(TransformContext context, UsingScope usingScope)
193193
{
194194
this.ignoreUsingScope = !context.Settings.UsingDeclarations;
195195
this.settings = context.Settings;

ICSharpCode.Decompiler/CSharp/TypeSystem/CSharpTypeResolveContext.cs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -25,12 +25,12 @@ namespace ICSharpCode.Decompiler.CSharp.TypeSystem
2525
public sealed class CSharpTypeResolveContext : ITypeResolveContext
2626
{
2727
readonly IModule module;
28-
readonly ResolvedUsingScope currentUsingScope;
28+
readonly UsingScope currentUsingScope;
2929
readonly ITypeDefinition currentTypeDefinition;
3030
readonly IMember currentMember;
3131
readonly string[] methodTypeParameterNames;
3232

33-
public CSharpTypeResolveContext(IModule module, ResolvedUsingScope usingScope = null, ITypeDefinition typeDefinition = null, IMember member = null)
33+
public CSharpTypeResolveContext(IModule module, UsingScope usingScope = null, ITypeDefinition typeDefinition = null, IMember member = null)
3434
{
3535
if (module == null)
3636
throw new ArgumentNullException(nameof(module));
@@ -40,7 +40,7 @@ public CSharpTypeResolveContext(IModule module, ResolvedUsingScope usingScope =
4040
this.currentMember = member;
4141
}
4242

43-
private CSharpTypeResolveContext(IModule module, ResolvedUsingScope usingScope, ITypeDefinition typeDefinition, IMember member, string[] methodTypeParameterNames)
43+
private CSharpTypeResolveContext(IModule module, UsingScope usingScope, ITypeDefinition typeDefinition, IMember member, string[] methodTypeParameterNames)
4444
{
4545
this.module = module;
4646
this.currentUsingScope = usingScope;
@@ -49,7 +49,7 @@ private CSharpTypeResolveContext(IModule module, ResolvedUsingScope usingScope,
4949
this.methodTypeParameterNames = methodTypeParameterNames;
5050
}
5151

52-
public ResolvedUsingScope CurrentUsingScope {
52+
public UsingScope CurrentUsingScope {
5353
get { return currentUsingScope; }
5454
}
5555

@@ -89,7 +89,7 @@ ITypeResolveContext ITypeResolveContext.WithCurrentMember(IMember member)
8989
return WithCurrentMember(member);
9090
}
9191

92-
public CSharpTypeResolveContext WithUsingScope(ResolvedUsingScope usingScope)
92+
public CSharpTypeResolveContext WithUsingScope(UsingScope usingScope)
9393
{
9494
return new CSharpTypeResolveContext(module, usingScope, currentTypeDefinition, currentMember, methodTypeParameterNames);
9595
}

ICSharpCode.Decompiler/CSharp/TypeSystem/ResolvedUsingScope.cs renamed to ICSharpCode.Decompiler/CSharp/TypeSystem/UsingScope.cs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -34,14 +34,14 @@ namespace ICSharpCode.Decompiler.CSharp.TypeSystem
3434
/// Represents a scope that contains "using" statements.
3535
/// This is either the mo itself, or a namespace declaration.
3636
/// </summary>
37-
public class ResolvedUsingScope
37+
public class UsingScope
3838
{
3939
readonly CSharpTypeResolveContext parentContext;
4040

4141
internal readonly ConcurrentDictionary<string, ResolveResult> ResolveCache = new ConcurrentDictionary<string, ResolveResult>();
4242
internal List<List<IMethod>>? AllExtensionMethods;
4343

44-
public ResolvedUsingScope(CSharpTypeResolveContext context, INamespace @namespace, ImmutableArray<INamespace> usings)
44+
public UsingScope(CSharpTypeResolveContext context, INamespace @namespace, ImmutableArray<INamespace> usings)
4545
{
4646
this.parentContext = context ?? throw new ArgumentNullException(nameof(context));
4747
this.Usings = usings;
@@ -50,7 +50,7 @@ public ResolvedUsingScope(CSharpTypeResolveContext context, INamespace @namespac
5050

5151
public INamespace Namespace { get; }
5252

53-
public ResolvedUsingScope Parent {
53+
public UsingScope Parent {
5454
get { return parentContext.CurrentUsingScope; }
5555
}
5656

@@ -66,10 +66,10 @@ public ResolvedUsingScope Parent {
6666
/// </summary>
6767
public bool HasAlias(string identifier) => false;
6868

69-
internal ResolvedUsingScope WithNestedNamespace(string simpleName)
69+
internal UsingScope WithNestedNamespace(string simpleName)
7070
{
7171
var ns = Namespace.GetChildNamespace(simpleName) ?? new DummyNamespace(Namespace, simpleName);
72-
return new ResolvedUsingScope(
72+
return new UsingScope(
7373
parentContext.WithUsingScope(this),
7474
ns,
7575
[]);

ICSharpCode.Decompiler/DecompileRun.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,9 +37,9 @@ internal class DecompileRun
3737

3838
public Dictionary<ITypeDefinition, bool> TypeHierarchyIsKnown { get; } = new();
3939

40-
public CSharp.TypeSystem.ResolvedUsingScope UsingScope { get; }
40+
public CSharp.TypeSystem.UsingScope UsingScope { get; }
4141

42-
public DecompileRun(DecompilerSettings settings, CSharp.TypeSystem.ResolvedUsingScope usingScope)
42+
public DecompileRun(DecompilerSettings settings, CSharp.TypeSystem.UsingScope usingScope)
4343
{
4444
this.Settings = settings ?? throw new ArgumentNullException(nameof(settings));
4545
this.UsingScope = usingScope ?? throw new ArgumentNullException(nameof(usingScope));

ICSharpCode.Decompiler/ICSharpCode.Decompiler.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -338,7 +338,7 @@
338338
<Compile Include="CSharp\TypeSystem\AliasNamespaceReference.cs" />
339339
<Compile Include="CSharp\TypeSystem\CSharpTypeResolveContext.cs" />
340340
<Compile Include="CSharp\TypeSystem\MemberTypeOrNamespaceReference.cs" />
341-
<Compile Include="CSharp\TypeSystem\ResolvedUsingScope.cs" />
341+
<Compile Include="CSharp\TypeSystem\UsingScope.cs" />
342342
<Compile Include="CSharp\TypeSystem\SimpleTypeOrNamespaceReference.cs" />
343343
<Compile Include="CSharp\TypeSystem\TypeOrNamespaceReference.cs" />
344344
<Compile Include="DebugInfo\AsyncDebugInfo.cs" />

ICSharpCode.Decompiler/IL/Transforms/IILTransform.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ public class ILTransformContext
5252
public Metadata.MetadataFile PEFile => TypeSystem.MainModule.MetadataFile;
5353

5454
internal DecompileRun? DecompileRun { get; set; }
55-
internal ResolvedUsingScope? UsingScope => DecompileRun?.UsingScope;
55+
internal UsingScope? UsingScope => DecompileRun?.UsingScope;
5656

5757
CSharpResolver? csharpResolver;
5858

0 commit comments

Comments
 (0)