1 write to State
Microsoft.CodeAnalysis.Workspaces (1)
Workspace\Solution\TextDocument.cs (1)
31State = state;
90 references to State
IdeCoreBenchmarks (1)
CloudCachePersistentStorage.cs (1)
87? s_projectToContainerKeyCache.GetValue(document.Project.State, _projectToContainerKeyCacheCallback).GetDocumentContainerKey(document.State)
Microsoft.CodeAnalysis.CSharp.Features (1)
Completion\CompletionProviders\ImportCompletion\ImportCompletionProviderHelper.cs (1)
65var checksum = await globalUsingDocument.State.GetChecksumAsync(cancellationToken).ConfigureAwait(false);
Microsoft.CodeAnalysis.EditorFeatures (7)
Diagnostics\AbstractPushOrPullDiagnosticsTaggerProvider.PushDiagnosticsTaggerProvider.cs (1)
94var sourceText = document.State.GetTextSynchronously(cancellationToken: default);
EditAndContinue\PdbMatchingSourceTextProvider.cs (3)
75if (!oldDocument.State.SupportsEditAndContinue()) 84if (oldDocument.State.TextAndVersionSource.CanReloadText && !newDocument.State.TextAndVersionSource.CanReloadText)
Preview\AbstractPreviewFactoryService.cs (2)
620var text = await document.State.GetTextAsync(cancellationToken); 633var text = await document.State.GetTextAsync(cancellationToken);
Remote\SolutionChecksumUpdater.cs (1)
220var state = await oldDocument.State.GetStateChecksumsAsync(cancellationToken).ConfigureAwait(false);
Microsoft.CodeAnalysis.EditorFeatures.UnitTests (1)
EditAndContinue\EditAndContinueWorkspaceServiceTests.cs (1)
855Assert.False(designTimeOnlyDocument2.State.SupportsEditAndContinue());
Microsoft.CodeAnalysis.EditorFeatures2.UnitTests (2)
Rename\RenameEngineTests.vb (2)
350Assert.Same(originalDocument.State, newDocument.State)
Microsoft.CodeAnalysis.Features (10)
Completion\Providers\ImportCompletionProvider\ExtensionMethodImportCompletionHelper.cs (1)
264if (document.State.Attributes.IsGenerated)
EditAndContinue\AbstractEditAndContinueAnalyzer.cs (1)
512Debug.Assert(newDocument.State.SupportsEditAndContinue());
EditAndContinue\CommittedSolution.cs (3)
278isGenerated: document.State.Attributes.IsGenerated) 279.WithDesignTimeOnly(document.State.Attributes.DesignTimeOnly) 280.WithDocumentServiceProvider(document.State.Services));
EditAndContinue\DebuggingSession.cs (2)
643if (document?.State.SupportsEditAndContinue() != true) 777if (_isDisposed || !EditSession.InBreakState || !mappedDocument.State.SupportsEditAndContinue() || !mappedDocument.Project.SupportsEditAndContinue())
EditAndContinue\EditSession.cs (2)
345if (document.State.Attributes.DesignTimeOnly) 366if (document.State.Attributes.DesignTimeOnly)
Workspace\CompileTimeSolutionProvider.cs (1)
240var filePath = compileTimeDocument?.State.FilePath;
Microsoft.CodeAnalysis.LanguageServer.Protocol (4)
Features\Diagnostics\DefaultDiagnosticAnalyzerService.cs (1)
152var loadDiagnostic = await document.State.GetLoadDiagnosticAsync(cancellationToken).ConfigureAwait(false);
Features\Diagnostics\DocumentAnalysisExecutor.cs (1)
76var loadDiagnostic = await textDocument.State.GetLoadDiagnosticAsync(cancellationToken).ConfigureAwait(false);
Features\Diagnostics\EngineV2\DiagnosticIncrementalAnalyzer.Executor.cs (1)
511var loadDiagnostic = await document.State.GetLoadDiagnosticAsync(cancellationToken).ConfigureAwait(false);
Handler\SpellCheck\AbstractSpellCheckingHandler.cs (1)
198var documentChecksumState = await document.State.GetStateChecksumsAsync(cancellationToken).ConfigureAwait(false);
Microsoft.CodeAnalysis.Remote.ServiceHub (13)
CloudCachePersistentStorage.cs (1)
87? s_projectToContainerKeyCache.GetValue(document.Project.State, _projectToContainerKeyCacheCallback).GetDocumentContainerKey(document.State)
Host\RemoteDocumentDifferenceService.cs (2)
52var oldTextChecksum = (await oldDocument.State.GetStateChecksumsAsync(cancellationToken).ConfigureAwait(false)).Text; 53var newTextChecksum = (await newDocument.State.GetStateChecksumsAsync(cancellationToken).ConfigureAwait(false)).Text;
Host\RemoteWorkspace.SolutionCreator.cs (7)
477Contract.ThrowIfFalse(document.State.Attributes.Id == newDocumentInfo.Id); 478Contract.ThrowIfFalse(document.State.Attributes.Name == newDocumentInfo.Name); 479Contract.ThrowIfFalse(document.State.Attributes.FilePath == newDocumentInfo.FilePath); 480Contract.ThrowIfFalse(document.State.Attributes.IsGenerated == newDocumentInfo.IsGenerated); 481Contract.ThrowIfFalse(document.State.Attributes.DesignTimeOnly == newDocumentInfo.DesignTimeOnly); 483if (document.State.Attributes.Folders != newDocumentInfo.Folders) 490if (document.State.Attributes.SourceCodeKind != newDocumentInfo.SourceCodeKind)
Host\TestUtils.cs (2)
202var documentChecksums = await document.State.GetStateChecksumsAsync(cancellationToken).ConfigureAwait(false); 203await documentChecksums.FindAsync(document.State, Flatten(documentChecksums), map, cancellationToken).ConfigureAwait(false);
Services\AssetSynchronization\RemoteAssetSynchronizationService.cs (1)
102if (!document.State.TryGetStateChecksums(out var state) ||
Microsoft.CodeAnalysis.Workspaces (31)
Classification\SemanticClassificationCacheUtilities.cs (1)
29var checksums = await document.State.GetStateChecksumsAsync(cancellationToken).ConfigureAwait(false);
FindSymbols\Shared\AbstractSyntaxIndex_Persistence.cs (1)
113var documentChecksumState = await document.State.GetStateChecksumsAsync(cancellationToken).ConfigureAwait(false);
Workspace\Host\DocumentService\Extensions.cs (3)
14=> document?.State.CanApplyChange() ?? false; 20=> document?.State.SupportsDiagnostics() ?? false; 26=> IsRazorDocument(document.State);
Workspace\Host\PersistentStorage\DocumentKey.cs (1)
42=> ToDocumentKey(ProjectKey.ToProjectKey(document.Project), document.State);
Workspace\ProjectSystem\ProjectSystemProject.BatchingDocumentCollection.cs (1)
482var attributes = w.CurrentSolution.GetRequiredDocument(documentId).State.Attributes;
Workspace\Solution\Document.cs (1)
46internal DocumentState DocumentState => (DocumentState)State;
Workspace\Solution\SourceGeneratedDocument.cs (1)
19private new SourceGeneratedDocumentState State => (SourceGeneratedDocumentState)base.State;
Workspace\Solution\TextDocument.cs (16)
39public DocumentId Id => State.Id; 44public string? FilePath => State.FilePath; 49public string Name => State.Name; 54public IReadOnlyList<string> Folders => State.Folders; 59internal IDocumentServiceProvider Services => State.Services; 65=> State.TryGetText(out text); 71=> State.TryGetTextVersion(out version); 77=> State.GetTextAsync(cancellationToken).AsTask(); 85=> State.GetTextSynchronously(cancellationToken); 91=> State.GetTextVersionAsync(cancellationToken); 99=> State.GetTextVersionSynchronously(cancellationToken); 105=> State.GetTopLevelChangeTextVersionAsync(cancellationToken); 111=> State.HasInfoChanged(otherTextDocument.State); 117=> State.HasTextChanged(otherTextDocument.State, ignoreUnchangeableDocument);
Workspace\Workspace.cs (5)
889var oldAttributes = oldSolution.GetDocument(documentId)!.State.Attributes; 1742new DocumentInfo(newDoc.State.Attributes, loader: null, documentServiceProvider: newDoc.State.Services)); 1781isGenerated: doc.State.Attributes.IsGenerated) 1782.WithDesignTimeOnly(doc.State.Attributes.DesignTimeOnly)
Workspace\Workspace_Editor.cs (1)
370var oldDocumentState = oldDocument.State;
Microsoft.CodeAnalysis.Workspaces.MSBuild.UnitTests (3)
VisualStudioMSBuildWorkspaceTests.cs (3)
980Assert.NotNull(await doc.State.GetLoadDiagnosticAsync(CancellationToken.None)); 2379var text = doc.State.GetTextSynchronously(CancellationToken.None); 2382var atext = adoc.State.GetTextSynchronously(CancellationToken.None);
Microsoft.CodeAnalysis.Workspaces.UnitTests (6)
SolutionTests\SolutionTests.cs (6)
1146Assert.Equal(expectedAlgorithm, document.State.LoadTextOptions.ChecksumAlgorithm); 1756Assert.False(document.State.Attributes.IsGenerated); 1784Assert.True(document.State.Attributes.IsGenerated); 1813Assert.False(document2.State.Attributes.IsGenerated); 1849Assert.False(document2.State.Attributes.IsGenerated); 3279var diagnostic = await doc.State.GetLoadDiagnosticAsync(CancellationToken.None).ConfigureAwait(false);
Microsoft.VisualStudio.LanguageServices (4)
Diagnostics\VisualStudioVenusSpanMappingService.cs (1)
92return solution.GetDocument(currentDocumentId).State.GetTextSynchronously(CancellationToken.None).Lines;
ProjectSystem\VisualStudioWorkspaceImpl.cs (2)
1251if (document.State.Attributes.IsGenerated != updatedInfo.IsGenerated) 1254$"This Workspace does not support changing a document's {nameof(document.State.Attributes.IsGenerated)} state.");
Storage\CloudCachePersistentStorage.cs (1)
87? s_projectToContainerKeyCache.GetValue(document.Project.State, _projectToContainerKeyCacheCallback).GetDocumentContainerKey(document.State)
Microsoft.VisualStudio.LanguageServices.UnitTests (1)
Venus\DocumentServiceTests.vb (1)
117Dim documentServices = document.State.Services
Roslyn.VisualStudio.Next.UnitTests (6)
Services\ServiceHubServicesTests.cs (6)
80var oldState = await oldDocument.State.GetStateChecksumsAsync(CancellationToken.None); 93var newState = await newDocument.State.GetStateChecksumsAsync(CancellationToken.None); 416Assert.Equal(documentStateShouldSame, object.ReferenceEquals(solution1.GetDocument(currentDocumentId).State, solution2.GetDocument(currentDocumentId).State)); 442return SourceText.From(document.State.GetTextSynchronously(CancellationToken.None).ToString() + csAddition); 445return SourceText.From(document.State.GetTextSynchronously(CancellationToken.None).ToString() + vbAddition);