1 write to State
Microsoft.CodeAnalysis.Workspaces (1)
Workspace\Solution\TextDocument.cs (1)
30State = state;
90 references to State
Microsoft.CodeAnalysis.EditorFeatures (6)
EditAndContinue\PdbMatchingSourceTextProvider.cs (3)
76if (!oldDocument.State.SupportsEditAndContinue()) 85if (oldDocument.State.TextAndVersionSource.CanReloadText && !newDocument.State.TextAndVersionSource.CanReloadText)
Preview\AbstractPreviewFactoryService.cs (1)
657var text = await document.State.GetTextAsync(cancellationToken);
Remote\SolutionChecksumUpdater.cs (2)
244var state = await oldDocument.State.GetStateChecksumsAsync(_shutdownToken).ConfigureAwait(false); 245var newState = await newDocument.State.GetStateChecksumsAsync(_shutdownToken).ConfigureAwait(false);
Microsoft.CodeAnalysis.ExternalAccess.Razor.Features (1)
TextDocumentExtensions.cs (1)
22=> new ChecksumWrapper(await document.State.GetChecksumAsync(cancellationToken).ConfigureAwait(false));
Microsoft.CodeAnalysis.Features (11)
Completion\Providers\ImportCompletionProvider\ExtensionMethodImportCompletionHelper.cs (1)
253if (document.State.Attributes.IsGenerated)
EditAndContinue\AbstractEditAndContinueAnalyzer.cs (2)
532Contract.ThrowIfFalse(newDocument == null || newDocument.State.SupportsEditAndContinue()); 533Contract.ThrowIfFalse(oldDocument == null || oldDocument.State.SupportsEditAndContinue());
EditAndContinue\CommittedSolution.cs (3)
305isGenerated: document.State.Attributes.IsGenerated) 306.WithDesignTimeOnly(document.State.Attributes.DesignTimeOnly) 307.WithDocumentServiceProvider(document.State.DocumentServiceProvider));
EditAndContinue\DebuggingSession.cs (2)
710if (document?.State.SupportsEditAndContinue() != true) 850if (_isDisposed || !EditSession.InBreakState || !mappedDocument.State.SupportsEditAndContinue() || !mappedDocument.Project.SupportsEditAndContinue())
EditAndContinue\EditSession.cs (3)
354if (!document.State.SupportsEditAndContinue()) 375if (!document.State.SupportsEditAndContinue()) 391if (!document.State.SupportsEditAndContinue())
Microsoft.CodeAnalysis.Features.UnitTests (1)
EditAndContinue\EditAndContinueWorkspaceServiceTests.cs (1)
967Assert.False(designTimeOnlyDocument2.State.SupportsEditAndContinue());
Microsoft.CodeAnalysis.LanguageServer.Protocol (3)
Handler\SemanticTokens\SemanticTokensRefreshQueue.cs (2)
93if (oldDocument?.State.Attributes.Checksum == newDocument.State.Attributes.Checksum)
Handler\SpellCheck\SpellCheckPullCache.cs (1)
26var documentChecksumState = await state.Document.State.GetStateChecksumsAsync(cancellationToken).ConfigureAwait(false);
Microsoft.CodeAnalysis.LanguageServer.Protocol.UnitTests (2)
Workspaces\LspWorkspaceManagerTests.cs (2)
72Assert.Same(testLspServer.TestWorkspace.CurrentSolution.GetDocument(firstDocument.Id)?.State, firstDocument?.State);
Microsoft.CodeAnalysis.Remote.ServiceHub (10)
Host\RemoteWorkspace.SolutionCreator.cs (7)
574Contract.ThrowIfFalse(document.State.Attributes.Id == newDocumentInfo.Id); 575Contract.ThrowIfFalse(document.State.Attributes.IsGenerated == newDocumentInfo.IsGenerated); 576Contract.ThrowIfFalse(document.State.Attributes.DesignTimeOnly == newDocumentInfo.DesignTimeOnly); 578if (document.State.Attributes.Name != newDocumentInfo.Name) 581if (document.State.Attributes.FilePath != newDocumentInfo.FilePath) 584if (document.State.Attributes.Folders != newDocumentInfo.Folders) 591if (document.State.Attributes.SourceCodeKind != newDocumentInfo.SourceCodeKind)
Host\TestUtils.cs (2)
238var documentChecksums = await document.State.GetStateChecksumsAsync(cancellationToken).ConfigureAwait(false); 239await documentChecksums.FindAsync(AssetPathKind.Documents, document.State, Flatten(documentChecksums), callback, map, cancellationToken).ConfigureAwait(false);
Services\AssetSynchronization\RemoteAssetSynchronizationService.cs (1)
132if (!document.State.TryGetStateChecksums(out var state) ||
Microsoft.CodeAnalysis.Workspaces (37)
Classification\SemanticClassificationCacheUtilities.cs (1)
29var checksums = await document.State.GetStateChecksumsAsync(cancellationToken).ConfigureAwait(false);
Diagnostics\FileContentLoadAnalyzer.cs (1)
31var exceptionMessage = await textDocument.State.GetFailedToLoadExceptionMessageAsync(cancellationToken).ConfigureAwait(false);
FindSymbols\Shared\AbstractSyntaxIndex_Persistence.cs (1)
149(DocumentState)document.State,
FindSymbols\SyntaxTree\SyntaxTreeIndex.cs (3)
39=> GetRequiredIndexAsync(SolutionKey.ToSolutionKey(document.Project.Solution), document.Project.State, (DocumentState)document.State, cancellationToken); 45=> GetIndexAsync(SolutionKey.ToSolutionKey(document.Project.Solution), document.Project.State, (DocumentState)document.State, cancellationToken); 51=> GetIndexAsync(SolutionKey.ToSolutionKey(document.Project.Solution), document.Project.State, (DocumentState)document.State, loadOnly, cancellationToken);
FindSymbols\TopLevelSyntaxTree\TopLevelSyntaxTreeIndex.cs (3)
47=> GetRequiredIndexAsync(SolutionKey.ToSolutionKey(document.Project.Solution), document.Project.State, (DocumentState)document.State, cancellationToken); 53=> GetIndexAsync(SolutionKey.ToSolutionKey(document.Project.Solution), document.Project.State, (DocumentState)document.State, cancellationToken); 59=> GetIndexAsync(SolutionKey.ToSolutionKey(document.Project.Solution), document.Project.State, (DocumentState)document.State, loadOnly, cancellationToken);
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)
34=> ToDocumentKey(ProjectKey.ToProjectKey(document.Project), document.State);
Workspace\ProjectSystem\ProjectSystemProject.BatchingDocumentCollection.cs (1)
511var documentInfo = new DocumentInfo(documentToReload.State.Attributes, fileInfo.TextLoader, fileInfo.DocumentServiceProvider);
Workspace\Solution\Document.cs (1)
50internal DocumentState DocumentState => (DocumentState)State;
Workspace\Solution\SourceGeneratedDocument.cs (1)
21private new SourceGeneratedDocumentState State => (SourceGeneratedDocumentState)base.State;
Workspace\Solution\TextDocument.cs (16)
38public DocumentId Id => State.Id; 43public string? FilePath => State.FilePath; 48public string Name => State.Name; 53public IReadOnlyList<string> Folders => State.Folders; 58internal IDocumentServiceProvider DocumentServiceProvider => State.DocumentServiceProvider; 64=> State.TryGetText(out text); 70=> State.TryGetTextVersion(out version); 79=> State.GetTextAsync(cancellationToken); 87=> State.GetTextSynchronously(cancellationToken); 93=> await State.GetTextVersionAsync(cancellationToken).ConfigureAwait(false); 101=> State.GetTextVersionSynchronously(cancellationToken); 107=> State.GetTopLevelChangeTextVersionAsync(cancellationToken); 113=> State.HasInfoChanged(otherTextDocument.State); 119=> State.HasTextChanged(otherTextDocument.State, ignoreUnchangeableDocument);
Workspace\Workspace.cs (4)
1140var oldAttributes = oldSolution.GetDocument(documentId)!.State.Attributes; 1676new DocumentInfo(newDoc.DocumentState.Attributes, loader: null, documentServiceProvider: newDoc.State.DocumentServiceProvider)); 2080isGenerated: doc.State.Attributes.IsGenerated) 2081.WithDesignTimeOnly(doc.State.Attributes.DesignTimeOnly)
Workspace\Workspace_Editor.cs (1)
394var oldDocumentState = oldDocument.State;
Microsoft.CodeAnalysis.Workspaces.MSBuild.UnitTests (3)
VisualStudioMSBuildWorkspaceTests.cs (3)
1000Assert.NotNull(await doc.State.GetFailedToLoadExceptionMessageAsync(CancellationToken.None)); 2376var text = doc.State.GetTextSynchronously(CancellationToken.None); 2379var atext = adoc.State.GetTextSynchronously(CancellationToken.None);
Microsoft.CodeAnalysis.Workspaces.UnitTests (6)
SolutionTests\SolutionTests.cs (6)
1649Assert.Equal(expectedAlgorithm, document.State.LoadTextOptions.ChecksumAlgorithm); 2404Assert.False(document.State.Attributes.IsGenerated); 2432Assert.True(document.State.Attributes.IsGenerated); 2484Assert.False(document2.State.Attributes.IsGenerated); 2523Assert.False(document2.State.Attributes.IsGenerated); 3951var exceptionMessage = await doc.State.GetFailedToLoadExceptionMessageAsync(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)
1322if (document.State.Attributes.IsGenerated != updatedInfo.IsGenerated) 1325$"This Workspace does not support changing a document's {nameof(document.State.Attributes.IsGenerated)} state.");
Workspace\VisualStudioWorkspaceUtilities.cs (1)
20return TryGetVsHierarchyAndItemId(document?.Project.Solution.Workspace, document?.State, out hierarchy, out itemID);
Roslyn.VisualStudio.Next.UnitTests (6)
Services\ServiceHubServicesTests.cs (6)
101var oldState = await oldDocument.State.GetStateChecksumsAsync(CancellationToken.None); 109var newState = await newDocument.State.GetStateChecksumsAsync(CancellationToken.None); 1693Assert.Equal(documentStateShouldSame, object.ReferenceEquals(solution1.GetDocument(currentDocumentId).State, solution2.GetDocument(currentDocumentId).State)); 1719return SourceText.From(document.State.GetTextSynchronously(CancellationToken.None).ToString() + csAddition); 1722return SourceText.From(document.State.GetTextSynchronously(CancellationToken.None).ToString() + vbAddition);