From 46da5960ee430bb18cd0cf577ec856d2701f3c4e Mon Sep 17 00:00:00 2001 From: Tamas Vajk Date: Wed, 13 Nov 2024 14:28:04 +0100 Subject: [PATCH] Move extraction context classes to the Semmle.Extraction.CSharp namespace --- .../{_Base => }/Extractor/BinaryLogExtractionContext.cs | 2 +- .../{_Base => }/Extractor/ExtractionContext.cs | 2 +- .../{_Base => }/Extractor/ExtractorMode.cs | 2 +- .../extractor/Semmle.Extraction.CSharp/_Base/Context.cs | 8 ++++---- 4 files changed, 7 insertions(+), 7 deletions(-) rename csharp/extractor/Semmle.Extraction.CSharp/{_Base => }/Extractor/BinaryLogExtractionContext.cs (98%) rename csharp/extractor/Semmle.Extraction.CSharp/{_Base => }/Extractor/ExtractionContext.cs (98%) rename csharp/extractor/Semmle.Extraction.CSharp/{_Base => }/Extractor/ExtractorMode.cs (88%) diff --git a/csharp/extractor/Semmle.Extraction.CSharp/_Base/Extractor/BinaryLogExtractionContext.cs b/csharp/extractor/Semmle.Extraction.CSharp/Extractor/BinaryLogExtractionContext.cs similarity index 98% rename from csharp/extractor/Semmle.Extraction.CSharp/_Base/Extractor/BinaryLogExtractionContext.cs rename to csharp/extractor/Semmle.Extraction.CSharp/Extractor/BinaryLogExtractionContext.cs index 5e3ac901bb01..e4ad5f83e2a2 100644 --- a/csharp/extractor/Semmle.Extraction.CSharp/_Base/Extractor/BinaryLogExtractionContext.cs +++ b/csharp/extractor/Semmle.Extraction.CSharp/Extractor/BinaryLogExtractionContext.cs @@ -4,7 +4,7 @@ using Microsoft.CodeAnalysis; using Semmle.Util.Logging; -namespace Semmle.Extraction +namespace Semmle.Extraction.CSharp { public class BinaryLogExtractionContext : ExtractionContext { diff --git a/csharp/extractor/Semmle.Extraction.CSharp/_Base/Extractor/ExtractionContext.cs b/csharp/extractor/Semmle.Extraction.CSharp/Extractor/ExtractionContext.cs similarity index 98% rename from csharp/extractor/Semmle.Extraction.CSharp/_Base/Extractor/ExtractionContext.cs rename to csharp/extractor/Semmle.Extraction.CSharp/Extractor/ExtractionContext.cs index 26b30ad004b2..619eb9953471 100644 --- a/csharp/extractor/Semmle.Extraction.CSharp/_Base/Extractor/ExtractionContext.cs +++ b/csharp/extractor/Semmle.Extraction.CSharp/Extractor/ExtractionContext.cs @@ -2,7 +2,7 @@ using Semmle.Util.Logging; using CompilationInfo = (string key, string value); -namespace Semmle.Extraction +namespace Semmle.Extraction.CSharp { /// /// Implementation of the main extractor state. diff --git a/csharp/extractor/Semmle.Extraction.CSharp/_Base/Extractor/ExtractorMode.cs b/csharp/extractor/Semmle.Extraction.CSharp/Extractor/ExtractorMode.cs similarity index 88% rename from csharp/extractor/Semmle.Extraction.CSharp/_Base/Extractor/ExtractorMode.cs rename to csharp/extractor/Semmle.Extraction.CSharp/Extractor/ExtractorMode.cs index cc1f5cc04132..6729878e5639 100644 --- a/csharp/extractor/Semmle.Extraction.CSharp/_Base/Extractor/ExtractorMode.cs +++ b/csharp/extractor/Semmle.Extraction.CSharp/Extractor/ExtractorMode.cs @@ -1,6 +1,6 @@ using System; -namespace Semmle.Extraction +namespace Semmle.Extraction.CSharp { /// /// The mode in which a file is extracted. diff --git a/csharp/extractor/Semmle.Extraction.CSharp/_Base/Context.cs b/csharp/extractor/Semmle.Extraction.CSharp/_Base/Context.cs index c3281e237250..a575fe4b823d 100644 --- a/csharp/extractor/Semmle.Extraction.CSharp/_Base/Context.cs +++ b/csharp/extractor/Semmle.Extraction.CSharp/_Base/Context.cs @@ -18,7 +18,7 @@ public class Context /// /// Access various extraction functions, e.g. logger, trap writer. /// - public ExtractionContext ExtractionContext { get; } + public CSharp.ExtractionContext ExtractionContext { get; } /// /// Access to the trap file. @@ -190,7 +190,7 @@ public void PopulateAll() } } - protected Context(ExtractionContext extractionContext, TrapWriter trapWriter, bool shouldAddAssemblyTrapPrefix = false) + protected Context(CSharp.ExtractionContext extractionContext, TrapWriter trapWriter, bool shouldAddAssemblyTrapPrefix = false) { ExtractionContext = extractionContext; TrapWriter = trapWriter; @@ -274,7 +274,7 @@ private void Populate(ISymbol? optionalSymbol, CachedEntity entity) bool duplicationGuard, deferred; - if (ExtractionContext.Mode is ExtractorMode.Standalone) + if (ExtractionContext.Mode is CSharp.ExtractorMode.Standalone) { duplicationGuard = false; deferred = false; @@ -408,7 +408,7 @@ private void ExtractionError(InternalError error) private void ReportError(InternalError error) { - if (!ExtractionContext.Mode.HasFlag(ExtractorMode.Standalone)) + if (!ExtractionContext.Mode.HasFlag(CSharp.ExtractorMode.Standalone)) throw error; ExtractionError(error);