3 writes to Usings
Microsoft.CodeAnalysis.CSharp (3)
CSharpCompilationOptions.cs (3)
225
this.
Usings
= usings.AsImmutableOrEmpty();
375
return new CSharpCompilationOptions(this) {
Usings
= usings };
379
new CSharpCompilationOptions(this) {
Usings
= usings.AsImmutableOrEmpty() };
21 references to Usings
Microsoft.CodeAnalysis.CSharp (14)
Compilation\CSharpCompilation.UsingsFromOptionsAndDiagnostics.cs (1)
29
var usings = compilation.Options.
Usings
;
Compilation\CSharpDeterministicKeyBuilder.cs (1)
33
foreach (var name in csharpOptions.
Usings
)
CSharpCompilationOptions.cs (12)
236
usings: other.
Usings
,
274
internal override ImmutableArray<string> GetImports() =>
Usings
;
370
if (this.
Usings
== usings)
710
if (
Usings
!= null &&
Usings
.Any(static u => !u.IsValidClrNamespaceName()))
712
builder.Add(Diagnostic.Create(MessageProvider.Instance, (int)ErrorCode.ERR_BadCompilationOptionValue, nameof(
Usings
),
Usings
.Where(u => !u.IsValidClrNamespaceName()).First() ?? "null"));
744
(this.
Usings
== null ? other.
Usings
== null : this.
Usings
.SequenceEqual(other.
Usings
, StringComparer.Ordinal) &&
757
Hash.Combine(Hash.CombineValues(this.
Usings
, StringComparer.Ordinal),
Microsoft.CodeAnalysis.CSharp.Scripting.UnitTests (1)
CommandLineRunnerTests.cs (1)
700
}, arguments.CompilationOptions.
Usings
.AsEnumerable());
Microsoft.CodeAnalysis.CSharp.Symbol.UnitTests (5)
Compilation\CSharpCompilationOptionsTests.cs (5)
113
TestProperty((old, value) => old.WithUsings(value), opt => opt.
Usings
, ImmutableArray.Create("A", "B"));
203
var actual1 = new CSharpCompilationOptions(OutputKind.ConsoleApplication).WithUsings(new[] { "A", "B" }).
Usings
;
206
var actual2 = new CSharpCompilationOptions(OutputKind.ConsoleApplication).WithUsings(Enumerable.Repeat("A", 1)).
Usings
;
209
Assert.Equal(0, new CSharpCompilationOptions(OutputKind.ConsoleApplication).WithUsings("A", "B").WithUsings(null).
Usings
.Count());
210
Assert.Equal(0, new CSharpCompilationOptions(OutputKind.ConsoleApplication).WithUsings("A", "B").WithUsings((string[])null).
Usings
.Count());
Microsoft.CodeAnalysis.CSharp.Workspaces (1)
Serialization\CSharpOptionsSerializationService.cs (1)
31
writer.WriteArray(csharpOptions.
Usings
, static (w, u) => w.WriteString(u));