2 implementations of IDocumentSnapshot
Microsoft.AspNetCore.Razor.Test.Common.Tooling (1)
ProjectSystem\TestDocumentSnapshot.cs (1)
16internal sealed class TestDocumentSnapshot : IDocumentSnapshot
Microsoft.CodeAnalysis.Remote.Razor (1)
ProjectSystem\RemoteDocumentSnapshot.cs (1)
15internal sealed class RemoteDocumentSnapshot : IDocumentSnapshot
92 references to IDocumentSnapshot
Microsoft.AspNetCore.Razor.Test.Common.Tooling (2)
ProjectSystem\TestDocumentSnapshot.cs (2)
33internal static IDocumentSnapshot Create(string filePath, RazorCodeDocument codeDocument) 72public IDocumentSnapshot WithText(SourceText text)
Microsoft.CodeAnalysis.Razor.Workspaces (59)
CodeActions\CodeActionsService.cs (3)
39public async Task<SumType<Command, CodeAction>[]?> GetCodeActionsAsync(VSCodeActionParams request, IDocumentSnapshot documentSnapshot, RazorVSInternalCodeAction[] delegatedCodeActions, Uri? delegatedDocumentUri, bool supportsCodeActionResolve, CancellationToken cancellationToken) 97IDocumentSnapshot documentSnapshot, 131public async Task<VSCodeActionParams?> GetCSharpCodeActionsRequestAsync(IDocumentSnapshot documentSnapshot, VSCodeActionParams request, CancellationToken cancellationToken)
CodeActions\Html\HtmlCodeActionProvider.cs (1)
44public static async Task MapAndFixHtmlCodeActionEditAsync(IRazorEditService razorEditService, IDocumentSnapshot documentSnapshot, CodeAction codeAction, CancellationToken cancellationToken)
CodeActions\ICodeActionsService.cs (2)
17IDocumentSnapshot documentSnapshot, 23Task<VSCodeActionParams?> GetCSharpCodeActionsRequestAsync(IDocumentSnapshot documentSnapshot, VSCodeActionParams request, CancellationToken cancellationToken);
CodeActions\Razor\AddUsingsCodeActionResolver.cs (1)
29var documentSnapshot = documentContext.Snapshot;
CodeActions\RazorCodeActionContext.cs (1)
14IDocumentSnapshot DocumentSnapshot,
Diagnostics\RazorDiagnosticHelper.cs (4)
18public static async Task<LspDiagnostic[]?> GetRazorDiagnosticsAsync(IDocumentSnapshot documentSnapshot, CancellationToken cancellationToken) 33public static VSDiagnosticProjectInformation[] GetProjectInformation(IDocumentSnapshot? documentSnapshot) 48internal static LspDiagnostic[] Convert(ImmutableArray<RazorDiagnostic> diagnostics, SourceText sourceText, IDocumentSnapshot documentSnapshot) 87internal static VSDiagnostic ConvertToVSDiagnostic(RazorDiagnostic razorDiagnostic, SourceText sourceText, IDocumentSnapshot? documentSnapshot)
Diagnostics\RazorTranslateDiagnosticsService.cs (3)
47/// The <see cref="IDocumentSnapshot"/> for the code document associated with the diagnostics. 54IDocumentSnapshot documentSnapshot, 103IDocumentSnapshot documentSnapshot,
DocumentMapping\IRazorEditService.cs (2)
28IDocumentSnapshot snapshot, 35Task MapWorkspaceEditAsync(IDocumentSnapshot contextDocumentSnapshot, WorkspaceEdit workspaceEdit, CancellationToken cancellationToken);
DocumentMapping\IRazorEditServiceExtensions.cs (1)
18IDocumentSnapshot snapshot,
DocumentMapping\RazorEditService.cs (1)
38IDocumentSnapshot snapshot,
DocumentMapping\RazorEditService_WorkspaceEdit.cs (5)
19public async Task MapWorkspaceEditAsync(IDocumentSnapshot contextDocumentSnapshot, WorkspaceEdit workspaceEdit, CancellationToken cancellationToken) 47private async Task MapTextDocumentEditAsync(IDocumentSnapshot contextDocumentSnapshot, TextDocumentEdit entry, CancellationToken cancellationToken) 97private async Task<Dictionary<string, TextEdit[]>> MapDocumentEditsAsync(IDocumentSnapshot contextDocumentSnapshot, Dictionary<string, TextEdit[]> changes, CancellationToken cancellationToken) 155protected abstract bool TryGetDocumentContext(IDocumentSnapshot contextDocumentSnapshot, Uri razorDocumentUri, VSProjectContext? projectContext, [NotNullWhen(true)] out DocumentContext? documentContext); 157protected abstract Task<Uri?> GetRazorDocumentUriAsync(IDocumentSnapshot contextDocumentSnapshot, Uri uri, CancellationToken cancellationToken);
FindAllReferences\FindAllReferencesHelper.cs (1)
39project.TryGetDocument(filePath, out var document))
Formatting\FormattingContext.cs (7)
26IDocumentSnapshot originalSnapshot, 28IDocumentSnapshot currentSnapshot, 47public IDocumentSnapshot OriginalSnapshot { get; } 49public IDocumentSnapshot CurrentSnapshot { get; } 234var changedSnapshot = OriginalSnapshot.WithText(changedText); 272IDocumentSnapshot originalSnapshot, 292IDocumentSnapshot originalSnapshot,
Formatting\RazorFormattingService.cs (7)
104var documentSnapshot = documentContext.Snapshot; 140var documentSnapshot = documentContext.Snapshot; 161var documentSnapshot = documentContext.Snapshot; 183var documentSnapshot = documentContext.Snapshot; 208var documentSnapshot = documentContext.Snapshot; 235var documentSnapshot = documentContext.Snapshot; 273IDocumentSnapshot documentSnapshot,
GoToDefinition\AbstractDefinitionService.cs (5)
30IDocumentSnapshot documentSnapshot, 64var componentDocument = await _componentSearchEngine 83private async Task<LspRange> GetNavigateRangeAsync(IDocumentSnapshot documentSnapshot, BoundAttributeDescriptor? attributeDescriptor, CancellationToken cancellationToken) 107IDocumentSnapshot documentSnapshot, 141private bool TryResolveFilePath(IDocumentSnapshot documentSnapshot, string filePath, out string resolvedPath)
GoToDefinition\IDefinitionService.cs (2)
17IDocumentSnapshot documentSnapshot, 24IDocumentSnapshot documentSnapshot,
GoToDefinition\RazorComponentDefinitionHelpers.cs (1)
156IDocumentSnapshot documentSnapshot,
IRazorComponentSearchEngine.cs (1)
13Task<IDocumentSnapshot?> TryLocateComponentAsync(
ITagHelperSearchEngine.cs (1)
14Task<LspLocation[]?> TryLocateTagHelperDefinitionsAsync(ImmutableArray<BoundTagHelperResult> boundTagHelpers, IDocumentSnapshot documentSnapshot, ISolutionQueryOperations solutionQueryOperations, CancellationToken cancellationToken);
ProjectSystem\DocumentContext.cs (2)
14internal class DocumentContext(Uri uri, IDocumentSnapshot snapshot) 20public IDocumentSnapshot Snapshot { get; } = snapshot;
ProjectSystem\IDocumentSnapshot.cs (1)
37IDocumentSnapshot WithText(SourceText text);
ProjectSystem\IDocumentSnapshotExtensions.cs (2)
16this IDocumentSnapshot documentSnapshot, 48public static bool IsPathCandidateForComponent(this IDocumentSnapshot documentSnapshot, ReadOnlyMemory<char> path)
ProjectSystem\IProjectSnapshot.cs (1)
31bool TryGetDocument(string filePath, [NotNullWhen(true)] out IDocumentSnapshot? document);
RazorComponentSearchEngine.cs (3)
30/// The corresponding <see cref="IDocumentSnapshot"/> if found, <see langword="null"/> otherwise. 42public async Task<IDocumentSnapshot?> TryLocateComponentAsync( 67if (!project.TryGetDocument(path, out var document))
Rename\RenameService.cs (1)
52var originComponentDocumentSnapshot = await _componentSearchEngine
Microsoft.CodeAnalysis.Remote.Razor (7)
DocumentMapping\RemoteRazorEditService.cs (2)
30protected override bool TryGetDocumentContext(IDocumentSnapshot contextDocumentSnapshot, Uri razorDocumentUri, VSProjectContext? projectContext, [NotNullWhen(true)] out DocumentContext? documentContext) 50protected override async Task<Uri?> GetRazorDocumentUriAsync(IDocumentSnapshot contextDocumentSnapshot, Uri generatedDocumentUri, CancellationToken cancellationToken)
ProjectSystem\RemoteDocumentSnapshot.cs (1)
76public IDocumentSnapshot WithText(SourceText text)
ProjectSystem\RemoteProjectSnapshot.cs (3)
111public bool TryGetDocument(string filePath, [NotNullWhen(true)] out IDocumentSnapshot? document) 134internal async Task<RazorCodeDocument> GetRequiredCodeDocumentAsync(IDocumentSnapshot documentSnapshot, CancellationToken cancellationToken) 143internal async Task<SourceGeneratedDocument> GetRequiredGeneratedDocumentAsync(IDocumentSnapshot documentSnapshot, CancellationToken cancellationToken)
RemoteTagHelperSearchEngine.cs (1)
23public async Task<LspLocation[]?> TryLocateTagHelperDefinitionsAsync(ImmutableArray<BoundTagHelperResult> boundTagHelperResults, IDocumentSnapshot documentSnapshot, ISolutionQueryOperations solutionQueryOperations, CancellationToken cancellationToken)
Microsoft.VisualStudio.LanguageServices.Razor.UnitTests (12)
src\Razor\src\Razor\test\Microsoft.CodeAnalysis.Razor.CohostingShared.UnitTests\CodeActions\Html\HtmlCodeActionProviderTest.cs (3)
80.Setup(x => x.MapWorkspaceEditAsync(It.IsAny<IDocumentSnapshot>(), It.IsAny<WorkspaceEdit>(), It.IsAny<CancellationToken>())) 81.Callback<IDocumentSnapshot, WorkspaceEdit, CancellationToken>((_, edit, _) => 148var documentSnapshotMock = new StrictMock<IDocumentSnapshot>();
src\Razor\src\Razor\test\Microsoft.CodeAnalysis.Razor.CohostingShared.UnitTests\CodeActions\Html\HtmlCodeActionResolverTest.cs (2)
41.Setup(x => x.MapWorkspaceEditAsync(It.IsAny<IDocumentSnapshot>(), It.IsAny<WorkspaceEdit>(), It.IsAny<CancellationToken>())) 42.Callback<IDocumentSnapshot, WorkspaceEdit, CancellationToken>((_, edit, _) =>
src\Razor\src\Razor\test\Microsoft.CodeAnalysis.Razor.CohostingShared.UnitTests\DocumentExcerpt\DocumentExcerptServiceTestBase.cs (3)
30private async Task<(IDocumentSnapshot primary, SourceGeneratedDocument secondary)> InitializeDocumentAsync(SourceText sourceText) 43private static async Task<TextSpan> GetSecondarySpanAsync(IDocumentSnapshot primary, TextSpan primarySpan, Document secondary, CancellationToken cancellationToken) 72internal async Task<(IDocumentSnapshot primary, SourceGeneratedDocument generatedDocument, TextSpan generatedSpan)> InitializeWithSnapshotAsync(string razorSource, CancellationToken cancellationToken)
src\Razor\src\Razor\test\Microsoft.CodeAnalysis.Razor.CohostingShared.UnitTests\Formatting\FormattingContentValidationPassTest.cs (2)
93private static (RazorCodeDocument, IDocumentSnapshot) CreateCodeDocumentAndSnapshot( 115var documentSnapshot = new StrictMock<IDocumentSnapshot>();
src\Razor\src\Razor\test\Microsoft.CodeAnalysis.Razor.CohostingShared.UnitTests\Formatting\FormattingDiagnosticValidationPassTest.cs (1)
92private async Task<(RazorCodeDocument, IDocumentSnapshot)> CreateCodeDocumentAndSnapshotAsync(
src\Razor\src\Razor\test\Microsoft.CodeAnalysis.Razor.CohostingShared.UnitTests\Mapping\RazorEditServiceTest.cs (1)
1323var snapshot = TestDocumentSnapshot.Create(razorPath, codeDocument);
Microsoft.VisualStudioCode.RazorExtension.UnitTests (12)
src\Razor\src\Razor\test\Microsoft.CodeAnalysis.Razor.CohostingShared.UnitTests\CodeActions\Html\HtmlCodeActionProviderTest.cs (3)
80.Setup(x => x.MapWorkspaceEditAsync(It.IsAny<IDocumentSnapshot>(), It.IsAny<WorkspaceEdit>(), It.IsAny<CancellationToken>())) 81.Callback<IDocumentSnapshot, WorkspaceEdit, CancellationToken>((_, edit, _) => 148var documentSnapshotMock = new StrictMock<IDocumentSnapshot>();
src\Razor\src\Razor\test\Microsoft.CodeAnalysis.Razor.CohostingShared.UnitTests\CodeActions\Html\HtmlCodeActionResolverTest.cs (2)
41.Setup(x => x.MapWorkspaceEditAsync(It.IsAny<IDocumentSnapshot>(), It.IsAny<WorkspaceEdit>(), It.IsAny<CancellationToken>())) 42.Callback<IDocumentSnapshot, WorkspaceEdit, CancellationToken>((_, edit, _) =>
src\Razor\src\Razor\test\Microsoft.CodeAnalysis.Razor.CohostingShared.UnitTests\DocumentExcerpt\DocumentExcerptServiceTestBase.cs (3)
30private async Task<(IDocumentSnapshot primary, SourceGeneratedDocument secondary)> InitializeDocumentAsync(SourceText sourceText) 43private static async Task<TextSpan> GetSecondarySpanAsync(IDocumentSnapshot primary, TextSpan primarySpan, Document secondary, CancellationToken cancellationToken) 72internal async Task<(IDocumentSnapshot primary, SourceGeneratedDocument generatedDocument, TextSpan generatedSpan)> InitializeWithSnapshotAsync(string razorSource, CancellationToken cancellationToken)
src\Razor\src\Razor\test\Microsoft.CodeAnalysis.Razor.CohostingShared.UnitTests\Formatting\FormattingContentValidationPassTest.cs (2)
93private static (RazorCodeDocument, IDocumentSnapshot) CreateCodeDocumentAndSnapshot( 115var documentSnapshot = new StrictMock<IDocumentSnapshot>();
src\Razor\src\Razor\test\Microsoft.CodeAnalysis.Razor.CohostingShared.UnitTests\Formatting\FormattingDiagnosticValidationPassTest.cs (1)
92private async Task<(RazorCodeDocument, IDocumentSnapshot)> CreateCodeDocumentAndSnapshotAsync(
src\Razor\src\Razor\test\Microsoft.CodeAnalysis.Razor.CohostingShared.UnitTests\Mapping\RazorEditServiceTest.cs (1)
1323var snapshot = TestDocumentSnapshot.Create(razorPath, codeDocument);