Skip to content

Commit 9057994

Browse files
committed
Move all classes to the Semmle.Extraction.CSharp namespace
1 parent a0cac46 commit 9057994

25 files changed

+494
-568
lines changed

csharp/extractor/Semmle.Extraction.CSharp/BUILD.bazel

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ load(
66
codeql_csharp_library(
77
name = "Semmle.Extraction.CSharp",
88
srcs = glob([
9-
"_Base/**/*.cs",
109
"CodeAnalysisExtensions/**/*.cs",
1110
"Comments/**/*.cs",
1211
"Entities/**/*.cs",

csharp/extractor/Semmle.Extraction.CSharp/Entities/Base/CachedEntity`1.cs renamed to csharp/extractor/Semmle.Extraction.CSharp/Entities/Base/CachedEntity.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,14 @@
22
using System.IO;
33
using Microsoft.CodeAnalysis;
44

5-
namespace Semmle.Extraction
5+
namespace Semmle.Extraction.CSharp.Entities
66
{
77
/// <summary>
88
/// A cached entity.
99
///
1010
/// The <see cref="Entity.Id"/> property is used as label in caching.
1111
/// </summary>
12-
public abstract class CachedEntity : CSharp.LabelledEntity
12+
public abstract class CachedEntity : LabelledEntity
1313
{
1414
protected CachedEntity(Context context) : base(context)
1515
{
@@ -62,7 +62,7 @@ public override bool Equals(object? obj)
6262
return other?.GetType() == GetType() && Equals(other.Symbol, Symbol);
6363
}
6464

65-
public override CSharp.TrapStackBehaviour TrapStackBehaviour => CSharp.TrapStackBehaviour.NoLabel;
65+
public override TrapStackBehaviour TrapStackBehaviour => TrapStackBehaviour.NoLabel;
6666
}
6767

6868
/// <summary>

csharp/extractor/Semmle.Extraction.CSharp/Entities/Base/CachedEntityFactory.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ namespace Semmle.Extraction.CSharp
33
/// <summary>
44
/// A factory for creating cached entities.
55
/// </summary>
6-
public abstract class CachedEntityFactory<TInit, TEntity> where TEntity : CachedEntity
6+
public abstract class CachedEntityFactory<TInit, TEntity> where TEntity : Entities.CachedEntity
77
{
88
public abstract TEntity Create(Context cx, TInit init);
99
}

csharp/extractor/Semmle.Extraction.CSharp/Entities/Base/CachedEntityFactoryExtensions.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ public static class CachedEntityFactoryExtensions
1616
/// <param name="init">The initializer for the entity.</param>
1717
/// <returns>The entity.</returns>
1818
public static TEntity CreateEntity<TInit, TEntity>(this CachedEntityFactory<TInit, TEntity> factory, Context cx, object cacheKey, TInit init)
19-
where TEntity : CachedEntity => cx.CreateEntity(factory, cacheKey, init);
19+
where TEntity : Entities.CachedEntity => cx.CreateEntity(factory, cacheKey, init);
2020

2121
/// <summary>
2222
/// Creates and populates a new entity from an `ISymbol`, or returns the existing one
@@ -30,6 +30,6 @@ public static TEntity CreateEntity<TInit, TEntity>(this CachedEntityFactory<TIni
3030
/// <returns>The entity.</returns>
3131
public static TEntity CreateEntityFromSymbol<TSymbol, TEntity>(this CachedEntityFactory<TSymbol, TEntity> factory, Context cx, TSymbol init)
3232
where TSymbol : ISymbol
33-
where TEntity : CachedEntity => cx.CreateEntityFromSymbol(factory, init);
33+
where TEntity : Entities.CachedEntity => cx.CreateEntityFromSymbol(factory, init);
3434
}
3535
}

csharp/extractor/Semmle.Extraction.CSharp/Entities/CachedSymbol.cs renamed to csharp/extractor/Semmle.Extraction.CSharp/Entities/Base/CachedSymbol.cs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
using System.Collections.Generic;
22
using System.IO;
33
using System.Linq;
4-
using System.Reflection.Metadata;
5-
using System.Reflection.Metadata.Ecma335;
64
using Microsoft.CodeAnalysis;
75
using Microsoft.CodeAnalysis.CSharp.Syntax;
86

csharp/extractor/Semmle.Extraction.CSharp/Entities/Base/Entity.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@ namespace Semmle.Extraction.CSharp
66
{
77
public abstract class Entity : IEntity
88
{
9-
public virtual Semmle.Extraction.Context Context { get; }
9+
public virtual Context Context { get; }
1010

11-
protected Entity(Semmle.Extraction.Context context)
11+
protected Entity(Context context)
1212
{
1313
this.Context = context;
1414
}

csharp/extractor/Semmle.Extraction.CSharp/Entities/Base/FreshEntity.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
using System.IO;
22

3-
namespace Semmle.Extraction
3+
namespace Semmle.Extraction.CSharp.Entities
44
{
55
/// <summary>
66
/// An entity which has a default "*" ID assigned to it.
77
/// </summary>
8-
public abstract class FreshEntity : CSharp.UnlabelledEntity
8+
public abstract class FreshEntity : UnlabelledEntity
99
{
1010
protected FreshEntity(Context cx) : base(cx)
1111
{
@@ -33,6 +33,6 @@ public string DebugContents
3333

3434
public override Microsoft.CodeAnalysis.Location? ReportingLocation => null;
3535

36-
public override CSharp.TrapStackBehaviour TrapStackBehaviour => CSharp.TrapStackBehaviour.NoLabel;
36+
public override TrapStackBehaviour TrapStackBehaviour => TrapStackBehaviour.NoLabel;
3737
}
3838
}

csharp/extractor/Semmle.Extraction.CSharp/Entities/Base/LabelledEntity.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ namespace Semmle.Extraction.CSharp
22
{
33
public abstract class LabelledEntity : Entity
44
{
5-
protected LabelledEntity(Semmle.Extraction.Context cx) : base(cx)
5+
protected LabelledEntity(Context cx) : base(cx)
66
{
77
}
88
}

csharp/extractor/Semmle.Extraction.CSharp/Entities/Base/UnlabelledEntity.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ namespace Semmle.Extraction.CSharp
22
{
33
public abstract class UnlabelledEntity : Entity
44
{
5-
protected UnlabelledEntity(Extraction.Context cx) : base(cx)
5+
protected UnlabelledEntity(Context cx) : base(cx)
66
{
77
cx.AddFreshLabel(this);
88
}

csharp/extractor/Semmle.Extraction.CSharp/Entities/CachedEntity.cs

Lines changed: 0 additions & 12 deletions
This file was deleted.

0 commit comments

Comments
 (0)