diff --git a/csharp/CSharp.sln b/csharp/CSharp.sln
index dddba01c6ed3..f4cde4624d45 100644
--- a/csharp/CSharp.sln
+++ b/csharp/CSharp.sln
@@ -4,8 +4,6 @@ VisualStudioVersion = 15.0.27130.2036
MinimumVisualStudioVersion = 10.0.40219.1
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Semmle.Util", "extractor\Semmle.Util\Semmle.Util.csproj", "{CDD7AD69-0FD8-40F0-A9DA-F1077A2A85D6}"
EndProject
-Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Semmle.Extraction", "extractor\Semmle.Extraction\Semmle.Extraction.csproj", "{81EAAD75-4BE1-44E4-91DF-20778216DB64}"
-EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Semmle.Extraction.CSharp", "extractor\Semmle.Extraction.CSharp\Semmle.Extraction.CSharp.csproj", "{C4D62DA0-B64B-440B-86DC-AB52318CB8BF}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Semmle.Extraction.CSharp.DependencyFetching", "extractor\Semmle.Extraction.CSharp.DependencyFetching\Semmle.Extraction.CSharp.DependencyFetching.csproj", "{541D1AC5-E42C-4AB2-A1A4-C2355CE2A2EF}"
diff --git a/csharp/extractor/Semmle.Extraction.CSharp.DependencyFetching/BUILD.bazel b/csharp/extractor/Semmle.Extraction.CSharp.DependencyFetching/BUILD.bazel
index 71f541540779..4be9954a2740 100644
--- a/csharp/extractor/Semmle.Extraction.CSharp.DependencyFetching/BUILD.bazel
+++ b/csharp/extractor/Semmle.Extraction.CSharp.DependencyFetching/BUILD.bazel
@@ -14,7 +14,7 @@ codeql_csharp_library(
nowarn = ["CA1822"],
visibility = ["//csharp:__subpackages__"],
deps = [
- "//csharp/extractor/Semmle.Extraction",
+ "//csharp/extractor/Semmle.Extraction.CSharp",
"//csharp/extractor/Semmle.Util",
],
)
diff --git a/csharp/extractor/Semmle.Extraction.CSharp.DependencyFetching/NugetExeWrapper.cs b/csharp/extractor/Semmle.Extraction.CSharp.DependencyFetching/NugetExeWrapper.cs
index 0676042eb42f..c77daa8899c8 100644
--- a/csharp/extractor/Semmle.Extraction.CSharp.DependencyFetching/NugetExeWrapper.cs
+++ b/csharp/extractor/Semmle.Extraction.CSharp.DependencyFetching/NugetExeWrapper.cs
@@ -15,7 +15,7 @@ namespace Semmle.Extraction.CSharp.DependencyFetching
internal class NugetExeWrapper : IDisposable
{
private readonly string? nugetExe;
- private readonly Util.Logging.ILogger logger;
+ private readonly Semmle.Util.Logging.ILogger logger;
public int PackageCount => fileProvider.PackagesConfigs.Count;
@@ -33,7 +33,7 @@ internal class NugetExeWrapper : IDisposable
///
/// Create the package manager for a specified source tree.
///
- public NugetExeWrapper(FileProvider fileProvider, TemporaryDirectory packageDirectory, Util.Logging.ILogger logger)
+ public NugetExeWrapper(FileProvider fileProvider, TemporaryDirectory packageDirectory, Semmle.Util.Logging.ILogger logger)
{
this.fileProvider = fileProvider;
this.packageDirectory = packageDirectory;
diff --git a/csharp/extractor/Semmle.Extraction.CSharp.DependencyFetching/Semmle.Extraction.CSharp.DependencyFetching.csproj b/csharp/extractor/Semmle.Extraction.CSharp.DependencyFetching/Semmle.Extraction.CSharp.DependencyFetching.csproj
index 82003c4dd142..424094c1ed6e 100644
--- a/csharp/extractor/Semmle.Extraction.CSharp.DependencyFetching/Semmle.Extraction.CSharp.DependencyFetching.csproj
+++ b/csharp/extractor/Semmle.Extraction.CSharp.DependencyFetching/Semmle.Extraction.CSharp.DependencyFetching.csproj
@@ -5,7 +5,7 @@
-
+
diff --git a/csharp/extractor/Semmle.Extraction.CSharp/BUILD.bazel b/csharp/extractor/Semmle.Extraction.CSharp/BUILD.bazel
index f5d36340bd63..42495f63ed44 100644
--- a/csharp/extractor/Semmle.Extraction.CSharp/BUILD.bazel
+++ b/csharp/extractor/Semmle.Extraction.CSharp/BUILD.bazel
@@ -6,17 +6,18 @@ load(
codeql_csharp_library(
name = "Semmle.Extraction.CSharp",
srcs = glob([
+ "CodeAnalysisExtensions/**/*.cs",
"Comments/**/*.cs",
"Entities/**/*.cs",
"Extractor/**/*.cs",
"Kinds/**/*.cs",
"Populators/**/*.cs",
+ "Trap/**/*.cs",
"*.cs",
]),
allow_unsafe_blocks = True,
visibility = ["//csharp:__subpackages__"],
deps = [
- "//csharp/extractor/Semmle.Extraction",
"//csharp/extractor/Semmle.Extraction.CSharp.Util",
"//csharp/extractor/Semmle.Util",
"@paket.main//basic.compilerlog.util",
diff --git a/csharp/extractor/Semmle.Extraction.CSharp/CachedEntityFactory.cs b/csharp/extractor/Semmle.Extraction.CSharp/CachedEntityFactory.cs
deleted file mode 100644
index 2673ed0d7ef3..000000000000
--- a/csharp/extractor/Semmle.Extraction.CSharp/CachedEntityFactory.cs
+++ /dev/null
@@ -1,19 +0,0 @@
-namespace Semmle.Extraction.CSharp
-{
- ///
- /// A factory for creating cached entities.
- ///
- internal abstract class CachedEntityFactory
- : Extraction.CachedEntityFactory where TEntity : CachedEntity
- {
- ///
- /// Initializes the entity, but does not generate any trap code.
- ///
- public sealed override TEntity Create(Extraction.Context cx, TInit init)
- {
- return Create((Context)cx, init);
- }
-
- public abstract TEntity Create(Context cx, TInit init);
- }
-}
diff --git a/csharp/extractor/Semmle.Extraction/LocationExtensions.cs b/csharp/extractor/Semmle.Extraction.CSharp/CodeAnalysisExtensions/LocationExtensions.cs
similarity index 98%
rename from csharp/extractor/Semmle.Extraction/LocationExtensions.cs
rename to csharp/extractor/Semmle.Extraction.CSharp/CodeAnalysisExtensions/LocationExtensions.cs
index f615fe659632..6d1d644e82ce 100644
--- a/csharp/extractor/Semmle.Extraction/LocationExtensions.cs
+++ b/csharp/extractor/Semmle.Extraction.CSharp/CodeAnalysisExtensions/LocationExtensions.cs
@@ -3,7 +3,7 @@
using System.Linq;
using Microsoft.CodeAnalysis;
-namespace Semmle.Extraction
+namespace Semmle.Extraction.CSharp
{
public static class LocationExtensions
{
diff --git a/csharp/extractor/Semmle.Extraction.CSharp/SymbolExtensions.cs b/csharp/extractor/Semmle.Extraction.CSharp/CodeAnalysisExtensions/SymbolExtensions.cs
similarity index 100%
rename from csharp/extractor/Semmle.Extraction.CSharp/SymbolExtensions.cs
rename to csharp/extractor/Semmle.Extraction.CSharp/CodeAnalysisExtensions/SymbolExtensions.cs
diff --git a/csharp/extractor/Semmle.Extraction.CSharp/Comments/CommentBlock.cs b/csharp/extractor/Semmle.Extraction.CSharp/Comments/CommentBlock.cs
index 48dcd9f85a18..08db5bba0138 100644
--- a/csharp/extractor/Semmle.Extraction.CSharp/Comments/CommentBlock.cs
+++ b/csharp/extractor/Semmle.Extraction.CSharp/Comments/CommentBlock.cs
@@ -12,7 +12,7 @@ internal class CommentBlock
public IEnumerable CommentLines => lines;
- public Location Location { get; private set; }
+ public Microsoft.CodeAnalysis.Location Location { get; private set; }
public CommentBlock(CommentLine firstLine)
{
@@ -49,7 +49,7 @@ public void AddCommentLine(CommentLine line)
{
Location = !lines.Any()
? line.Location
- : Location.Create(
+ : Microsoft.CodeAnalysis.Location.Create(
line.Location.SourceTree!,
new TextSpan(Location.SourceSpan.Start, line.Location.SourceSpan.End - Location.SourceSpan.Start));
diff --git a/csharp/extractor/Semmle.Extraction.CSharp/Comments/CommentProcessor.cs b/csharp/extractor/Semmle.Extraction.CSharp/Comments/CommentProcessor.cs
index d8c9152bec11..6b6e363ba5f7 100644
--- a/csharp/extractor/Semmle.Extraction.CSharp/Comments/CommentProcessor.cs
+++ b/csharp/extractor/Semmle.Extraction.CSharp/Comments/CommentProcessor.cs
@@ -19,10 +19,10 @@ public void AddComment(CommentLine comment)
}
// Comments sorted by location.
- private readonly SortedDictionary comments = new SortedDictionary(new LocationComparer());
+ private readonly SortedDictionary comments = new SortedDictionary(new LocationComparer());
// Program elements sorted by location.
- private readonly SortedDictionary elements = new SortedDictionary(new LocationComparer());
+ private readonly SortedDictionary elements = new SortedDictionary(new LocationComparer());
private readonly Dictionary