40 references to From
GenerateDocumentationAndConfigFiles (1)
src\Compilers\Core\Portable\EncodedStringText.cs (1)
191
return SourceText.
From
(bytes.Array,
Metrics (1)
src\Compilers\Core\Portable\EncodedStringText.cs (1)
191
return SourceText.
From
(bytes.Array,
Metrics.Legacy (1)
src\Compilers\Core\Portable\EncodedStringText.cs (1)
191
return SourceText.
From
(bytes.Array,
Microsoft.AspNetCore.Http.Microbenchmarks (1)
src\Http\Http.Extensions\test\RequestDelegateGenerator\RequestDelegateCreationTestBase.cs (1)
139
var sourceText = SourceText.
From
(buffer, buffer.Length, encoding, canBeEmbedded: true);
Microsoft.CodeAnalysis (3)
EncodedStringText.cs (1)
191
return SourceText.
From
(bytes.Array,
Text\SourceText.cs (2)
226
=>
From
(buffer, length, encoding, checksumAlgorithm, throwIfBinaryDetected, canBeEmbedded: false);
424
/// If this text was constructed via <see cref="
From
(byte[], int, Encoding, SourceHashAlgorithm, bool, bool)"/> or
Microsoft.CodeAnalysis.Analyzers (1)
src\Compilers\Core\Portable\EncodedStringText.cs (1)
191
return SourceText.
From
(bytes.Array,
Microsoft.CodeAnalysis.AnalyzerUtilities (1)
src\Compilers\Core\Portable\EncodedStringText.cs (1)
191
return SourceText.
From
(bytes.Array,
Microsoft.CodeAnalysis.BannedApiAnalyzers (1)
src\Compilers\Core\Portable\EncodedStringText.cs (1)
191
return SourceText.
From
(bytes.Array,
Microsoft.CodeAnalysis.CodeStyle (1)
src\Compilers\Core\Portable\EncodedStringText.cs (1)
191
return SourceText.
From
(bytes.Array,
Microsoft.CodeAnalysis.Features.UnitTests (3)
EditAndContinue\EditAndContinueWorkspaceServiceTests.cs (3)
66
var sourceTreeA1 = SyntaxFactory.ParseSyntaxTree(SourceText.
From
(sourceBytesA1, sourceBytesA1.Length, encodingA, SourceHashAlgorithms.Default), TestOptions.Regular, sourceFileA.Path);
67
var sourceTreeB1 = SyntaxFactory.ParseSyntaxTree(SourceText.
From
(sourceBytesB1, sourceBytesB1.Length, encodingB, SourceHashAlgorithms.Default), TestOptions.Regular, sourceFileB.Path);
68
var sourceTreeC1 = SyntaxFactory.ParseSyntaxTree(SourceText.
From
(sourceBytesC1, sourceBytesC1.Length, encodingC, SourceHashAlgorithm.Sha1), TestOptions.Regular, sourceFileC.Path);
Microsoft.CodeAnalysis.PerformanceSensitiveAnalyzers (1)
src\Compilers\Core\Portable\EncodedStringText.cs (1)
191
return SourceText.
From
(bytes.Array,
Microsoft.CodeAnalysis.PublicApiAnalyzers (1)
src\Compilers\Core\Portable\EncodedStringText.cs (1)
191
return SourceText.
From
(bytes.Array,
Microsoft.CodeAnalysis.ResxSourceGenerator (1)
src\Compilers\Core\Portable\EncodedStringText.cs (1)
191
return SourceText.
From
(bytes.Array,
Microsoft.CodeAnalysis.UnitTests (18)
EmbeddedTextTests.cs (2)
42
Assert.Throws<ArgumentException>("text", () => EmbeddedText.FromSource("path", SourceText.
From
(new byte[0], 0, Encoding.UTF8, canBeEmbedded: false)));
237
SourceText.
From
(bytes, bytes.Length, Encoding.ASCII, SourceHashAlgorithm.Sha1, canBeEmbedded: true);
Text\SourceTextTests.cs (16)
29
SourceText[] texts = [SourceText.From(string.Empty), SourceText.
From
([], 0), SourceText.From(new MemoryStream())];
60
Assert.Same(s_unicode, SourceText.
From
(bytes, bytes.Length, s_unicode).Encoding);
61
Assert.Equal(utf8NoBOM, SourceText.
From
(bytes, bytes.Length, null).Encoding);
74
Assert.Equal(utf8BOM, SourceText.
From
(bytes, bytes.Length, s_unicode).Encoding);
75
Assert.Equal(utf8BOM, SourceText.
From
(bytes, bytes.Length, null).Encoding);
88
Assert.Equal(SourceHashAlgorithm.Sha1, SourceText.
From
(bytes, bytes.Length).ChecksumAlgorithm);
102
Assert.Equal(algorithm, SourceText.
From
(bytes, bytes.Length, checksumAlgorithm: algorithm).ChecksumAlgorithm);
131
verifyChecksumAndContentHash(SourceText.
From
(bytesNoBOM, bytesNoBOM.Length, null, checksumAlgorithm), checksumNoBOM, expectedContentHash);
132
verifyChecksumAndContentHash(SourceText.
From
(bytesNoBOM, bytesNoBOM.Length, encodingNoBOM, checksumAlgorithm), checksumNoBOM, expectedContentHash);
133
verifyChecksumAndContentHash(SourceText.
From
(bytesNoBOM, bytesNoBOM.Length, encodingBOM, checksumAlgorithm), checksumNoBOM, expectedContentHash);
136
verifyChecksumAndContentHash(SourceText.
From
(bytesBOM, bytesBOM.Length, null, checksumAlgorithm), checksumBOM, expectedContentHash);
137
verifyChecksumAndContentHash(SourceText.
From
(bytesBOM, bytesBOM.Length, encodingNoBOM, checksumAlgorithm), checksumBOM, expectedContentHash);
138
verifyChecksumAndContentHash(SourceText.
From
(bytesBOM, bytesBOM.Length, encodingBOM, checksumAlgorithm), checksumBOM, expectedContentHash);
343
Assert.Throws<InvalidDataException>(() => SourceText.
From
(bytes, bytes.Length, throwIfBinaryDetected: true));
511
var textWithBOM = SourceText.
From
(bytesWithBOM, bytesWithBOM.Length, Encoding.UTF8);
512
var textNoBOM = SourceText.
From
(bytesNoBOM, bytesNoBOM.Length, Encoding.UTF8);
Microsoft.CodeAnalysis.Workspaces (1)
src\Compilers\Core\Portable\EncodedStringText.cs (1)
191
return SourceText.
From
(bytes.Array,
Microsoft.Extensions.Validation.GeneratorTests (1)
ValidationsGeneratorTestBase.cs (1)
146
var sourceText = SourceText.
From
(buffer, buffer.Length, encoding, canBeEmbedded: true);
Roslyn.Diagnostics.Analyzers (1)
src\Compilers\Core\Portable\EncodedStringText.cs (1)
191
return SourceText.
From
(bytes.Array,
Test.Utilities (1)
src\Compilers\Core\Portable\EncodedStringText.cs (1)
191
return SourceText.
From
(bytes.Array,
Text.Analyzers (1)
src\Compilers\Core\Portable\EncodedStringText.cs (1)
191
return SourceText.
From
(bytes.Array,