Skip to content

Commit 11faf08

Browse files
committed
Remove specific standalone/tracing extractor state classes
1 parent 3574b9f commit 11faf08

File tree

5 files changed

+11
-58
lines changed

5 files changed

+11
-58
lines changed

csharp/extractor/Semmle.Extraction.CSharp/Extractor/StandaloneAnalyser.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ public StandaloneAnalyser(IProgressMonitor pm, ILogger logger, bool addAssemblyT
1616
public void Initialize(string outputPath, IEnumerable<(string, string)> compilationInfos, CSharpCompilation compilationIn, CommonOptions options)
1717
{
1818
compilation = compilationIn;
19-
extractor = new StandaloneExtractor(Directory.GetCurrentDirectory(), outputPath, compilationInfos, Logger, PathTransformer, options);
19+
extractor = new Extraction.Extractor(Directory.GetCurrentDirectory(), [], outputPath, compilationInfos, Logger, PathTransformer, ExtractorMode.Standalone, options.QlTest);
2020
this.options = options;
2121
LogExtractorInfo(Extraction.Extractor.Version);
2222
SetReferencePaths();

csharp/extractor/Semmle.Extraction.CSharp/Extractor/TracingAnalyser.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ public void EndInitialize(
4646
throw new InternalError("EndInitialize called without BeginInitialize returning true");
4747
this.options = options;
4848
this.compilation = compilation;
49-
this.extractor = new TracingExtractor(cwd, args, GetOutputName(compilation, commandLineArguments), Logger, PathTransformer, options);
49+
this.extractor = new Extraction.Extractor(cwd, args, GetOutputName(compilation, commandLineArguments), [], Logger, PathTransformer, ExtractorMode.None, options.QlTest);
5050
LogDiagnostics();
5151

5252
SetReferencePaths();

csharp/extractor/Semmle.Extraction/Extractor/Extractor.cs

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
using System.Collections.Generic;
22
using System.Reflection;
3-
using System.IO;
43
using Semmle.Util.Logging;
54
using CompilationInfo = (string key, string value);
65

@@ -9,27 +8,31 @@ namespace Semmle.Extraction
98
/// <summary>
109
/// Implementation of the main extractor state.
1110
/// </summary>
12-
public abstract class Extractor
11+
public class Extractor
1312
{
1413
public string Cwd { get; init; }
1514
public string[] Args { get; init; }
16-
public abstract ExtractorMode Mode { get; }
15+
public ExtractorMode Mode { get; }
1716
public string OutputPath { get; }
1817
public IEnumerable<CompilationInfo> CompilationInfos { get; }
1918

2019
/// <summary>
2120
/// Creates a new extractor instance for one compilation unit.
2221
/// </summary>
23-
/// <param name="logger">The object used for logging.</param>
24-
/// <param name="pathTransformer">The object used for path transformations.</param>
25-
protected Extractor(string cwd, string[] args, string outputPath, IEnumerable<CompilationInfo> compilationInfos, ILogger logger, PathTransformer pathTransformer)
22+
public Extractor(string cwd, string[] args, string outputPath, IEnumerable<CompilationInfo> compilationInfos, ILogger logger, PathTransformer pathTransformer, ExtractorMode mode, bool isQlTest)
2623
{
2724
OutputPath = outputPath;
2825
Logger = logger;
2926
PathTransformer = pathTransformer;
3027
CompilationInfos = compilationInfos;
3128
Cwd = cwd;
3229
Args = args;
30+
31+
Mode = mode;
32+
if (isQlTest)
33+
{
34+
Mode |= ExtractorMode.QlTest;
35+
}
3336
}
3437

3538
// Limit the number of error messages in the log file

csharp/extractor/Semmle.Extraction/Extractor/StandaloneExtractor.cs

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

csharp/extractor/Semmle.Extraction/Extractor/TracingExtractor.cs

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

0 commit comments

Comments
 (0)