43 references to GetContentHash
Microsoft.CodeAnalysis.CodeStyle (1)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\InterceptsLocationUtilities.cs (1)
15/// (See <see cref="SourceText.GetContentHash()"/>)</param>
Microsoft.CodeAnalysis.CSharp (4)
Compilation\CSharpCompilation.cs (1)
1100var hash = text.GetContentHash().AsMemory();
Compilation\CSharpSemanticModel.cs (1)
5226var checksum = text.GetContentHash();
Symbols\Source\SourceMethodSymbolWithAttributes.cs (2)
1111DeclaringCompilation.AddInterception(matchingTree.GetText().GetContentHash(), position, attributeLocation, this); 1325DeclaringCompilation.AddInterception(matchingTree.GetText().GetContentHash(), referencedToken.Position, attributeLocation, this);
Microsoft.CodeAnalysis.CSharp.Semantic.UnitTests (2)
Semantics\InterceptorsTests.cs (2)
3547builder.WriteBytes(sourceTree.GetText().GetContentHash()); 3597builder.WriteBytes(sourceTree.GetText().GetContentHash());
Microsoft.CodeAnalysis.LanguageServer.Protocol (1)
Workspaces\LspWorkspaceManager.cs (1)
528return lspText.GetContentHash().AsSpan().SequenceEqual(documentText.GetContentHash().AsSpan());
Microsoft.CodeAnalysis.UnitTests (23)
Text\SourceTextTests.cs (23)
38Assert.True(text1.GetContentHash().SequenceEqual(text2.GetContentHash())); 184var actualContentHash = text.GetContentHash(); 196Assert.True(text.GetContentHash().SequenceEqual(changed.GetContentHash())); 230Assert.True(e1.GetContentHash().SequenceEqual(e1.GetContentHash())); 231Assert.True(f.GetContentHash().SequenceEqual(e1.GetContentHash())); 232Assert.True(e1.GetContentHash().SequenceEqual(f.GetContentHash())); 234Assert.True(e2.GetContentHash().SequenceEqual(e2.GetContentHash())); 235Assert.True(e1.GetContentHash().SequenceEqual(e2.GetContentHash())); 236Assert.True(e2.GetContentHash().SequenceEqual(e1.GetContentHash())); 274Assert.True(sourceText1.GetContentHash().SequenceEqual(sourceText2.GetContentHash())); 292Assert.False(sourceText1.GetContentHash().SequenceEqual(sourceText2.GetContentHash())); 315Assert.False(sourceText1.GetContentHash().SequenceEqual(sourceText2.GetContentHash()));
Microsoft.CodeAnalysis.Workspaces (10)
LinkedFileDiffMerging\LinkedFileDiffMergingSession.cs (1)
40var newContentHash = newText.GetContentHash();
Serialization\SerializableSourceText.cs (4)
55/// Checksum of the contents (see <see cref="SourceText.GetContentHash"/>) of the text. 83var computedContentHash = TryGetText()?.GetContentHash() ?? _storageHandle!.ContentHash; 141static (text, _) => new SerializableSourceText(text, text.GetContentHash()), 166writer.WriteByteArray(ImmutableCollectionsMarshal.AsArray(_text.GetContentHash())!);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\InterceptsLocationUtilities.cs (1)
15/// (See <see cref="SourceText.GetContentHash()"/>)</param>
TemporaryStorage\TemporaryStorageService.cs (1)
106return new(this, memoryMappedInfo.MemoryMappedFile, identifier, text.ChecksumAlgorithm, text.Encoding, text.GetContentHash());
Workspace\Solution\DocumentState.cs (1)
109ImmutableInterlocked.InterlockedCompareExchange(ref _contentHash, text.GetContentHash(), default);
Workspace\Solution\ProjectState.cs (1)
143var contentHash = text.GetContentHash();
Workspace\Solution\SourceGeneratedDocumentState.cs (1)
122=> Checksum.From(text.GetContentHash());
Roslyn.VisualStudio.Next.UnitTests (2)
Remote\SnapshotSerializationTests.cs (2)
608var serializableSourceText = new SerializableSourceText(sourceText, sourceText.GetContentHash()); 626serializableSourceText = new SerializableSourceText(sourceText, sourceText.GetContentHash());