forked from daveaglick/Scripty
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCsExtraction.cs
More file actions
65 lines (58 loc) · 2.41 KB
/
Copy pathCsExtraction.cs
File metadata and controls
65 lines (58 loc) · 2.41 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
namespace Scripty.Core.Resolvers
{
using System.Collections.Generic;
using System.Collections.Immutable;
using Microsoft.CodeAnalysis;
/// <summary>
/// An extraction from a class file
/// </summary>
public class CsExtraction
{
/// <summary>
/// The namespace members to be compiled
/// </summary>
public ImmutableList<SyntaxTree> CompilationTargets { get; }
/// <summary>
/// Any using directives found while extracting as well as expansions
/// of namespaces that were removed as part of the extraction.
/// </summary>
public ImmutableList<string> Namespaces { get; }
/// <summary>
/// Errors encountered
/// </summary>
public ImmutableList<string> Errors { get; }
/// <summary>
/// Gets the extract file path.
/// </summary>
public string ExtractFilePath { get; }
/// <summary>
/// Gets the metadata references.
/// </summary>
public ImmutableList<MetadataReference> MetadataReferenceAssemblies { get; }
/// <summary>
/// Initializes a new instance of the <see cref="CsExtraction" /> class.
/// </summary>
/// <param name="metadataReferences"></param>
/// <param name="compilationTargets">The compilation targets.</param>
/// <param name="namespaces">The namespaces.</param>
/// <param name="filePath">The file path.</param>
public CsExtraction(IEnumerable<MetadataReference> metadataReferences, IEnumerable<SyntaxTree> compilationTargets, IEnumerable<string> namespaces, string filePath)
{
MetadataReferenceAssemblies = metadataReferences.ToImmutableList();
CompilationTargets = compilationTargets.ToImmutableList();
Namespaces = namespaces.ToImmutableList();
ExtractFilePath = filePath;
Errors = ImmutableList.Create<string>();
}
/// <summary>
/// Initializes a new instance of the <see cref="CsExtraction" /> class.
/// </summary>
/// <param name="errors">The errors.</param>
/// <param name="extractFilePath">The extract file path.</param>
public CsExtraction(IEnumerable<string> errors, string extractFilePath)
{
Errors = errors.ToImmutableList();
ExtractFilePath = extractFilePath;
}
}
}