4 instantiations of EmbeddedText
Microsoft.CodeAnalysis (4)
123 references to EmbeddedText
Microsoft.AspNetCore.Http.Extensions.Tests (2)
Microsoft.AspNetCore.Http.Microbenchmarks (2)
Microsoft.CodeAnalysis (34)
CommandLine\CommonCompiler.cs (12)
398internal EmbeddedText? TryReadEmbeddedFileContent(string filePath, DiagnosticBag diagnostics)
410return EmbeddedText.FromBytes(filePath, bytes, Arguments.ChecksumAlgorithm);
414return EmbeddedText.FromStream(filePath, stream, Arguments.ChecksumAlgorithm);
424private ImmutableArray<EmbeddedText?> AcquireEmbeddedTexts(Compilation compilation, DiagnosticBag diagnostics)
429return ImmutableArray<EmbeddedText?>.Empty;
456var embeddedTextBuilder = ImmutableArray.CreateBuilder<EmbeddedText?>(embeddedFileOrderedSet.Count);
460EmbeddedText? text;
464text = EmbeddedText.FromSource(path, tree.GetText());
953ImmutableArray<EmbeddedText?> embeddedTexts = AcquireEmbeddedTexts(compilation, diagnostics);
1102ImmutableArray<EmbeddedText?> embeddedTexts,
1156var embeddedTextBuilder = ArrayBuilder<EmbeddedText>.GetInstance(generatedSyntaxTrees.Count);
1167embeddedTextBuilder.Add(EmbeddedText.FromSource(tree.FilePath, sourceText));
Microsoft.CodeAnalysis.CSharp (1)
Microsoft.CodeAnalysis.CSharp.CommandLine.UnitTests (2)
Microsoft.CodeAnalysis.CSharp.EditorFeatures.UnitTests (2)
Microsoft.CodeAnalysis.CSharp.Emit2.UnitTests (3)
Microsoft.CodeAnalysis.CSharp.Symbol.UnitTests (2)
Microsoft.CodeAnalysis.Rebuild (2)
Microsoft.CodeAnalysis.Rebuild.UnitTests (1)
Microsoft.CodeAnalysis.Test.Utilities (2)
Microsoft.CodeAnalysis.UnitTests (50)
EmbeddedTextTests.cs (50)
25Assert.Throws<ArgumentNullException>("filePath", () => EmbeddedText.FromBytes(null, default(ArraySegment<byte>)));
26Assert.Throws<ArgumentException>("filePath", () => EmbeddedText.FromBytes("", default(ArraySegment<byte>)));
27Assert.Throws<ArgumentNullException>("bytes", () => EmbeddedText.FromBytes("path", default(ArraySegment<byte>)));
28Assert.Throws<ArgumentException>("checksumAlgorithm", () => EmbeddedText.FromBytes("path", new ArraySegment<byte>(new byte[0], 0, 0), SourceHashAlgorithm.None));
34Assert.Throws<ArgumentNullException>("filePath", () => EmbeddedText.FromSource(null, null));
35Assert.Throws<ArgumentException>("filePath", () => EmbeddedText.FromSource("", null));
36Assert.Throws<ArgumentNullException>("text", () => EmbeddedText.FromSource("path", null));
39Assert.Throws<ArgumentException>("text", () => EmbeddedText.FromSource("path", SourceText.From("source")));
42Assert.Throws<ArgumentException>("text", () => EmbeddedText.FromSource("path", SourceText.From(new byte[0], 0, Encoding.UTF8, canBeEmbedded: false)));
43Assert.Throws<ArgumentException>("text", () => EmbeddedText.FromSource("path", SourceText.From(new MemoryStream(new byte[0]), Encoding.UTF8, canBeEmbedded: false)));
49Assert.Throws<ArgumentNullException>("filePath", () => EmbeddedText.FromStream(null, null));
50Assert.Throws<ArgumentException>("filePath", () => EmbeddedText.FromStream("", null));
51Assert.Throws<ArgumentNullException>("stream", () => EmbeddedText.FromStream("path", null));
52Assert.Throws<ArgumentException>("stream", () => EmbeddedText.FromStream("path", new CannotReadStream()));
53Assert.Throws<ArgumentException>("stream", () => EmbeddedText.FromStream("path", new CannotSeekStream()));
54Assert.Throws<ArgumentException>("checksumAlgorithm", () => EmbeddedText.FromStream("path", new MemoryStream(), SourceHashAlgorithm.None));
60Assert.Throws<IOException>(() => EmbeddedText.FromStream("path", new HugeStream()));
61Assert.Throws<EndOfStreamException>(() => EmbeddedText.FromStream("path", new TruncatingStream(10)));
62Assert.Throws<EndOfStreamException>(() => EmbeddedText.FromStream("path", new TruncatingStream(1000)));
63Assert.Throws<IOException>(() => EmbeddedText.FromStream("path", new ReadFailsStream()));
81var text = EmbeddedText.FromBytes("pathToEmpty", new ArraySegment<byte>(new byte[0], 0, 0), SourceHashAlgorithm.Sha1);
91var text = EmbeddedText.FromStream("pathToEmpty", new MemoryStream(new byte[0]), SourceHashAlgorithm.Sha1);
104var text = EmbeddedText.FromSource("pathToEmpty", source);
118var text = EmbeddedText.FromBytes("pathToSmall", new ArraySegment<byte>(bytes, 0, bytes.Length));
133var text = EmbeddedText.FromBytes("pathToSmall", new ArraySegment<byte>(paddedBytes, 1, bytes.Length));
146var text = EmbeddedText.FromSource("pathToSmall", source);
160var text = EmbeddedText.FromBytes("pathToLarge", new ArraySegment<byte>(bytes, 0, bytes.Length), SourceHashAlgorithms.Default);
175var text = EmbeddedText.FromBytes("pathToLarge", new ArraySegment<byte>(paddedBytes, 1, bytes.Length), SourceHashAlgorithms.Default);
188var text = EmbeddedText.FromSource("pathToLarge", source);
201var expectedEmbedded = EmbeddedText.FromSource("pathToSmall", expected);
204var actualEmbedded = EmbeddedText.FromSource(expectedEmbedded.FilePath, actual);
216var expectedEmbedded = EmbeddedText.FromSource("pathToSmall", expected);
219var actualEmbedded = EmbeddedText.FromSource(expectedEmbedded.FilePath, actual);
239var text = EmbeddedText.FromSource("pathToPrecomputed", source);
253var text = EmbeddedText.FromSource("pathToLarge", source);
Microsoft.CodeAnalysis.VisualBasic (2)
Microsoft.CodeAnalysis.VisualBasic.CommandLine.UnitTests (2)
Microsoft.CodeAnalysis.VisualBasic.Emit.UnitTests (3)
Microsoft.CodeAnalysis.VisualBasic.Semantic.UnitTests (2)
Roslyn.Test.PdbUtilities (11)
Reader\PdbValidation.cs (11)
34IEnumerable<EmbeddedText> embeddedTexts = null,
48IEnumerable<EmbeddedText> embeddedTexts = null,
64IEnumerable<EmbeddedText> embeddedTexts = null,
80IEnumerable<EmbeddedText> embeddedTexts = null,
153IEnumerable<EmbeddedText> embeddedTexts = null,
168IEnumerable<EmbeddedText> embeddedTexts = null,
192IEnumerable<EmbeddedText> embeddedTexts = null,
206IEnumerable<EmbeddedText> embeddedTexts = null,
228IEnumerable<EmbeddedText> embeddedTexts,
510IEnumerable<EmbeddedText> embeddedTexts = null,
525private static void EmitWithPdb(MemoryStream peStream, MemoryStream pdbStream, Compilation compilation, IMethodSymbol debugEntryPoint, IEnumerable<EmbeddedText> embeddedTexts, bool portable)