4 instantiations of EmbeddedText
Microsoft.CodeAnalysis (4)
EmbeddedText.cs (4)
113return new EmbeddedText(filePath, text.GetChecksum(), text.ChecksumAlgorithm, text.PrecomputedEmbeddedTextBlob); 116return new EmbeddedText(filePath, text.GetChecksum(), text.ChecksumAlgorithm, CreateBlob(text)); 152return new EmbeddedText( 186return new EmbeddedText(
123 references to EmbeddedText
Microsoft.AspNetCore.Http.Extensions.Tests (2)
RequestDelegateGenerator\RequestDelegateCreationTestBase.cs (2)
131var embeddedTexts = new List<EmbeddedText>(); 146embeddedTexts.Add(EmbeddedText.FromSource(syntaxTree.FilePath, sourceText));
Microsoft.AspNetCore.Http.Microbenchmarks (2)
src\Http\Http.Extensions\test\RequestDelegateGenerator\RequestDelegateCreationTestBase.cs (2)
131var embeddedTexts = new List<EmbeddedText>(); 146embeddedTexts.Add(EmbeddedText.FromSource(syntaxTree.FilePath, sourceText));
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));
Compilation\Compilation.cs (8)
2466IEnumerable<EmbeddedText>? embeddedTexts, 2483internal bool CreateDebugDocuments(DebugDocumentsBuilder documentsBuilder, IEnumerable<EmbeddedText> embeddedTexts, DiagnosticBag diagnostics) 2505foreach (var text in embeddedTexts) 2723IEnumerable<EmbeddedText>? embeddedTexts, 2784IEnumerable<EmbeddedText>? embeddedTexts = null, 2812IEnumerable<EmbeddedText>? embeddedTexts, 2930IEnumerable<EmbeddedText>? embeddedTexts, 3145IEnumerable<EmbeddedText>? embeddedTexts,
EmbeddedText.cs (6)
85/// Constructs a <see cref="EmbeddedText"/> for embedding the given <see cref="SourceText"/>. 97public static EmbeddedText FromSource(string filePath, SourceText text) 120/// Constructs an <see cref="EmbeddedText"/> from stream content. 136public static EmbeddedText FromStream(string filePath, Stream stream, SourceHashAlgorithm checksumAlgorithm = SourceHashAlgorithm.Sha1) 160/// Constructs an <see cref="EmbeddedText"/> from bytes. 175public static EmbeddedText FromBytes(string filePath, ArraySegment<byte> bytes, SourceHashAlgorithm checksumAlgorithm = SourceHashAlgorithm.Sha1)
Emit\CommonPEModuleBuilder.cs (3)
44private IEnumerable<EmbeddedText> _embeddedTexts = SpecializedCollections.EmptyEnumerable<EmbeddedText>(); 533public IEnumerable<EmbeddedText> EmbeddedTexts
Text\LargeText.cs (1)
76var embeddedTextBlob = canBeEmbedded ? EmbeddedText.CreateBlob(stream) : default(ImmutableArray<byte>);
Text\SourceText.cs (4)
170/// <param name="canBeEmbedded">True if the text can be passed to <see cref="EmbeddedText.FromSource"/> and be embedded in a PDB.</param> 219var embeddedTextBlob = canBeEmbedded ? EmbeddedText.CreateBlob(stream) : default(ImmutableArray<byte>); 243/// <param name="canBeEmbedded">True if the text can be passed to <see cref="EmbeddedText.FromSource"/> and be embedded in a PDB.</param> 278var embeddedTextBlob = canBeEmbedded ? EmbeddedText.CreateBlob(new ArraySegment<byte>(buffer, 0, length)) : default(ImmutableArray<byte>);
Microsoft.CodeAnalysis.CSharp (1)
Compilation\CSharpCompilation.cs (1)
3376IEnumerable<EmbeddedText>? embeddedTexts,
Microsoft.CodeAnalysis.CSharp.CommandLine.UnitTests (2)
CommandLineTests.cs (2)
2424Assert.True(embed_cs.Length >= EmbeddedText.CompressionThreshold); 2425Assert.True(embed2_cs.Length < EmbeddedText.CompressionThreshold);
Microsoft.CodeAnalysis.CSharp.EditorFeatures.UnitTests (2)
PdbSourceDocument\AbstractPdbSourceDocumentTests.cs (2)
275IEnumerable<EmbeddedText>? embeddedTexts; 290embeddedTexts = sources.Select((s, i) => EmbeddedText.FromSource(sourceCodePaths[i], s)).ToArray();
Microsoft.CodeAnalysis.CSharp.Emit2.UnitTests (3)
PDB\PDBEmbeddedSourceTests.cs (3)
47EmbeddedText.FromSource(tree1.FilePath, tree1.GetText()), 48EmbeddedText.FromSource(tree2.FilePath, tree2.GetText()) 109embeddedTexts: new[] { EmbeddedText.FromSource(tree.FilePath, tree.GetText()) });
Microsoft.CodeAnalysis.CSharp.Symbol.UnitTests (2)
Compilation\CompilationAPITests.cs (2)
461embeddedTexts: new[] { EmbeddedText.FromStream("_", new MemoryStream()) })); 467embeddedTexts: new[] { EmbeddedText.FromStream("_", new MemoryStream()) }));
Microsoft.CodeAnalysis.Rebuild (2)
CompilationFactory.cs (2)
87.Select(pair => EmbeddedText.FromSource(pair.path, pair.text)) 102ImmutableArray<EmbeddedText> embeddedTexts,
Microsoft.CodeAnalysis.Rebuild.UnitTests (1)
RoundTripUtil.cs (1)
106embeddedTexts: ImmutableArray<EmbeddedText>.Empty,
Microsoft.CodeAnalysis.Test.Utilities (2)
Compilation\CompilationExtensions.cs (1)
58IEnumerable<EmbeddedText> embeddedTexts = null,
Compilation\IRuntimeEnvironment.cs (1)
254.Select(t => EmbeddedText.FromSource(t.filePath, t.text))
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)
Compilation\VisualBasicCompilation.vb (2)
2374embeddedTexts As IEnumerable(Of EmbeddedText), 2396embeddedTexts As IEnumerable(Of EmbeddedText),
Microsoft.CodeAnalysis.VisualBasic.CommandLine.UnitTests (2)
CommandLineTests.vb (2)
3355Assert.True(embed_vb.Length >= EmbeddedText.CompressionThreshold) 3356Assert.True(embed2_vb.Length < EmbeddedText.CompressionThreshold)
Microsoft.CodeAnalysis.VisualBasic.Emit.UnitTests (3)
PDB\PDBEmbeddedSourceTests.vb (3)
38EmbeddedText.FromSource(tree1.FilePath, tree1.GetText()), 39EmbeddedText.FromSource(tree2.FilePath, tree2.GetText()) 91embeddedTexts:={EmbeddedText.FromSource(tree.FilePath, tree.GetText())})
Microsoft.CodeAnalysis.VisualBasic.Semantic.UnitTests (2)
Compilation\CompilationAPITests.vb (2)
467embeddedTexts:={EmbeddedText.FromStream("_", New MemoryStream())})) 473embeddedTexts:={EmbeddedText.FromStream("_", New MemoryStream())}))
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)