1 type derived from Document
Microsoft.CodeAnalysis.Workspaces (1)
Workspace\Solution\SourceGeneratedDocument.cs (1)
13public sealed class SourceGeneratedDocument : Document
1 instantiation of Document
Microsoft.CodeAnalysis.Workspaces (1)
Workspace\Solution\Project.cs (1)
466(documentId, project) => project.State.DocumentStates.TryGetState(documentId, out var state) ? new Document(project, state) : null;
5648 references to Document
AnalyzerRunner (7)
CodeRefactoringRunner.cs (4)
57foreach (var document in project.Documents) 59var newDocument = await RefactorDocumentAsync(document, cancellationToken).ConfigureAwait(false); 75private async Task<Document> RefactorDocumentAsync(Document document, CancellationToken cancellationToken)
DiagnosticAnalyzerRunner.cs (2)
115var document = project.GetDocument(documentId); 141var document = solution.GetDocument(pair.Key);
Program.cs (1)
204private static async Task<Statistic> GetSolutionStatisticsAsync(Document document, CancellationToken cancellationToken)
IdeBenchmarks (6)
FormatterBenchmarks.cs (2)
47var document = workspace.CurrentSolution.GetDocument(workspace.Documents.First().Id); 60var document = workspace.CurrentSolution.GetDocument(workspace.Documents.First().Id);
InheritanceMargin\BenchmarksHelpers.cs (1)
26foreach (var document in project.Documents)
RegexClassifierBenchmarks.cs (2)
73var document = workspace.CurrentSolution.GetDocument(workspace.Documents.First().Id); 78protected static async Task<ImmutableArray<ClassifiedSpan>> GetSemanticClassificationsAsync(Document document, TextSpan span)
SQLitePersistentStorageBenchmark.cs (1)
33private Document _document;
IdeCoreBenchmarks (10)
ClassificationBenchmarks.cs (2)
85protected static async Task<ImmutableArray<ClassifiedSpan>> GetSemanticClassificationsAsync(Document document, TextSpan span) 97foreach (var document in project.Documents)
FormatterBenchmarks.cs (3)
24private Document _document; 53var document = solution.GetDocument(documentId); 69var formattedDoc = Formatter.FormatAsync(_document, Formatter.Annotation, _options, CancellationToken.None).Result;
NavigateToBenchmarks.cs (4)
113foreach (var document in project.Documents) 147foreach (var document in project.Documents) 217g => Task.Run(() => SearchAsync(solution, g, priorityDocuments: ImmutableArray<Document>.Empty), CancellationToken.None)).ToArray(); 226private async Task<int> SearchAsync(Solution solution, IGrouping<INavigateToSearchService, Project> grouping, ImmutableArray<Document> priorityDocuments)
ProjectOperationBenchmarks.cs (1)
96foreach (var _ in Project.Documents)
ILLink.CodeFixProvider (6)
BaseAttributeCodeFixProvider.cs (3)
35 var document = context.Document; 53 private async Task<Document> AddAttributeAsync ( 54 Document document,
DynamicallyAccessedMembersCodeFixProvider.cs (3)
95 var document = context.Document; 120 private static async Task<Document> AddAttributeAsync ( 121 Document document,
Microsoft.Analyzers.Extra (18)
CallAnalysis\Fixers\LegacyLoggingFixer.cs (13)
39internal Func<Document, CancellationToken, Task<SyntaxNode?>> GetSyntaxRootAsync = (d, t) => d.GetSyntaxRootAsync(t); 40internal Func<Document, CancellationToken, Task<SemanticModel?>> GetSemanticModelAsync = (d, t) => d.GetSemanticModelAsync(t); 71CheckIfCanFixAsync(Document invocationDoc, TextSpan span, CancellationToken cancellationToken) 133Document targetDoc, 135Document invocationDoc, 263private static async Task<(Solution solution, ClassDeclarationSyntax declarationSyntax, Document document)> 320private static async Task<(Document document, ExpressionSyntax expressionSyntax)> 323var doc = sol.GetDocument(docId)!; 464Document doc, 535private async Task<Solution> ApplyFixAsync(Document invocationDoc, ExpressionSyntax invocationExpression, FixDetails details, CancellationToken cancellationToken) 538Document targetDoc; 570Document targetDoc, 572Document invocationDoc,
CallAnalysis\Fixers\LegacyLoggingFixer.FixDetails.cs (3)
38IEnumerable<Document> docs) 162private static string FindUniqueFilename(IEnumerable<Document> docs) 170foreach (var doc in docs)
MakeExeTypesInternalFixer.cs (2)
37private static async Task<Document> MakeInternalAsync(Document document, SyntaxNode decl, CancellationToken cancellationToken)
Microsoft.Analyzers.Extra.Tests (9)
CallAnalysis\LegacyLoggingTests.cs (2)
821var targetDoc = proj.FindDocument("target.cs"); 824var invocationDoc = proj.FindDocument("invocation.cs");
Resources\RoslynTestUtils.cs (7)
74public static Document FindDocument(this Project proj, string name) 76foreach (var doc in proj.Documents) 348var doc = proj.GetDocument(d.Location.SourceTree); 496var document = project.GetDocument(documentId); 504private static async Task<Document> RecreateDocumentAsync(Document document) 527public override async Task<IEnumerable<Diagnostic>> GetDocumentDiagnosticsAsync(Document document, CancellationToken cancellationToken)
Microsoft.Analyzers.Local.Tests (7)
Resources\RoslynTestUtils.cs (7)
74public static Document FindDocument(this Project proj, string name) 76foreach (var doc in proj.Documents) 349var doc = proj.GetDocument(d.Location.SourceTree); 497var document = project.GetDocument(documentId); 505private static async Task<Document> RecreateDocumentAsync(Document document) 528public override async Task<IEnumerable<Diagnostic>> GetDocumentDiagnosticsAsync(Document document, CancellationToken cancellationToken)
Microsoft.AspNetCore.Analyzer.Testing (7)
CodeFixRunner.cs (2)
24Document document, 39var updatedDocument = updatedSolution.GetDocument(document.Id);
DiagnosticAnalyzerRunner.cs (1)
96foreach (var document in projects.SelectMany(p => p.Documents))
DiagnosticVerifier.cs (4)
71protected async Task<Diagnostic[]> GetDiagnosticsAsync(Document[] documents, DiagnosticAnalyzer analyzer, string[] additionalEnabledDiagnostics) 74foreach (var document in documents) 119foreach (var document in documents) 139private Document[] GetDocuments(string[] sources)
Microsoft.AspNetCore.App.Analyzers (5)
RouteEmbeddedLanguage\FrameworkParametersCompletionProvider.cs (3)
25using Document = Microsoft.CodeAnalysis.Document; 66public override Task<CompletionDescription?> GetDescriptionAsync(Document document, CompletionItem item, CancellationToken cancellationToken) 77public override Task<CompletionChange> GetChangeAsync(Document document, CompletionItem item, char? commitKey, CancellationToken cancellationToken)
RouteEmbeddedLanguage\RoutePatternCompletionProvider.cs (2)
60public override Task<CompletionDescription?> GetDescriptionAsync(Document document, CompletionItem item, CancellationToken cancellationToken) 71public override Task<CompletionChange> GetChangeAsync(Document document, CompletionItem item, char? commitKey, CancellationToken cancellationToken)
Microsoft.AspNetCore.App.Analyzers.Test (5)
Dependencies\AddPackageTests.cs (1)
73Document document,
TestDiagnosticAnalyzer.cs (4)
32var doc = project.Solution.GetDocument(project.Documents.First().Id); 49var doc = project.Solution.GetDocument(project.Documents.First().Id); 71var document = project.Solution.GetDocument(project.Documents.First().Id); 177public record CompletionResult(Document Document, CompletionService Service, CompletionList Completions, TextSpan CompletionListSpan, bool ShouldTriggerCompletion);
Microsoft.AspNetCore.App.CodeFixes (17)
Authorization\AddAuthorizationBuilderFixer.cs (2)
134private static Task<Document> ReplaceWithAddAuthorizationBuilder(Diagnostic diagnostic, SyntaxNode root, Document document, InvocationExpressionSyntax invocation)
Dependencies\AddPackageFixer.cs (1)
113Document document,
DetectMismatchedParameterOptionalityFixer.cs (2)
37private static async Task<Document> FixMismatchedParameterOptionalityAsync(Diagnostic diagnostic, Document document, CancellationToken cancellationToken)
Http\HeaderDictionaryAddFixer.cs (4)
68private static Task<Document> ReplaceWithAppend(Diagnostic diagnostic, WellKnownTypes wellKnownTypes, SyntaxNode root, Document document, InvocationExpressionSyntax invocation) 99private static Task<Document> ReplaceWithIndexer(Diagnostic diagnostic, SyntaxNode root, Document document, AssignmentExpressionSyntax assignment)
Http\HeaderDictionaryIndexerFixer.cs (2)
42private static async Task<Document> FixHeaderDictionaryIndexer(Diagnostic diagnostic, Document document, string resolvedPropertyName, CancellationToken cancellationToken)
RouteParameterUnusedParameterFixer.cs (4)
58private static Task<Document> AddRouteParameterAsync(Diagnostic diagnostic, SyntaxNode root, RouteUsageCache routeUsageCache, Document document, CancellationToken cancellationToken) 74private static Document UpdateDocument(Diagnostic diagnostic, SyntaxNode root, Document document, SyntaxNode methodSyntax)
WebApplicationBuilderFixer.cs (2)
77private static Task<Document> FixWebApplicationBuilderAsync(Diagnostic diagnostic, SyntaxNode root, Document document, InvocationExpressionSyntax invocation)
Microsoft.AspNetCore.Components.Analyzers (2)
ComponentParametersShouldBePublicCodeFixProvider.cs (2)
50private static Task<Document> GetTransformedDocumentAsync( 51Document document,
Microsoft.AspNetCore.Components.Analyzers.Tests (11)
Helpers\CodeFixVerifier.Helper.cs (5)
26private static Document ApplyFix(Document document, CodeAction codeAction) 68private static IEnumerable<Diagnostic> GetCompilerDiagnostics(Document document) 78private static string GetStringFromDocument(Document document) 80var simplifiedDoc = Simplifier.ReduceAsync(document, Simplifier.Annotation).Result;
Helpers\DiagnosticVerifier.Helper.cs (5)
51protected static Diagnostic[] GetSortedDiagnosticsFromDocuments(DiagnosticAnalyzer analyzer, Document[] documents) 54foreach (var document in documents) 74var document = documents[i]; 109private static Document[] GetDocuments(string[] sources, string language) 133protected static Document CreateDocument(string source, string language = LanguageNames.CSharp)
Verifiers\CodeFixVerifier.cs (1)
78var document = CreateDocument(oldSource, language);
Microsoft.AspNetCore.Components.SdkAnalyzers (2)
ComponentParametersShouldBePublicCodeFixProvider.cs (2)
50private static Task<Document> GetTransformedDocumentAsync( 51Document document,
Microsoft.AspNetCore.Components.SdkAnalyzers.Tests (11)
Helpers\CodeFixVerifier.Helper.cs (5)
26private static Document ApplyFix(Document document, CodeAction codeAction) 68private static IEnumerable<Diagnostic> GetCompilerDiagnostics(Document document) 78private static string GetStringFromDocument(Document document) 80var simplifiedDoc = Simplifier.ReduceAsync(document, Simplifier.Annotation).Result;
Helpers\DiagnosticVerifier.Helper.cs (5)
51protected static Diagnostic[] GetSortedDiagnosticsFromDocuments(DiagnosticAnalyzer analyzer, Document[] documents) 54foreach (var document in documents) 74var document = documents[i]; 109private static Document[] GetDocuments(string[] sources, string language) 133protected static Document CreateDocument(string source, string language = LanguageNames.CSharp)
Verifiers\CodeFixVerifier.cs (1)
78var document = CreateDocument(oldSource, language);
Microsoft.AspNetCore.Mvc.Api.Analyzers (7)
AddResponseTypeAttributeCodeFixAction.cs (4)
32private readonly Document _document; 35public AddResponseTypeAttributeCodeFixAction(Document document, Diagnostic diagnostic) 45protected override async Task<Document> GetChangedDocumentAsync(CancellationToken cancellationToken) 108var document = documentEditor.GetChangedDocument();
ApiActionsDoNotRequireExplicitModelValidationCodeFixProvider.cs (3)
39private readonly Document _document; 42public MyCodeAction(Document document, TextSpan ifBlockSpan) 52protected override async Task<Document> GetChangedDocumentAsync(CancellationToken cancellationToken)
Microsoft.CodeAnalysis.CodeStyle.Fixes (388)
LanguageServices\SemanticModelWorkspaceService\SemanticModelWorkspaceServiceFactory.SemanticModelWorkspaceService.cs (1)
20public ValueTask<SemanticModel> ReuseExistingSpeculativeModelAsync(Document document, SyntaxNode node, CancellationToken cancellationToken)
src\Analyzers\Core\CodeFixes\AddAccessibilityModifiers\AbstractAddAccessibilityModifiersCodeFixProvider.cs (1)
44Document document, ImmutableArray<Diagnostic> diagnostics,
src\Analyzers\Core\CodeFixes\AddAnonymousTypeMemberName\AbstractAddAnonymousTypeMemberNameCodeFixProvider.cs (4)
35var document = context.Document; 54Document document, Diagnostic diagnostic, CancellationToken cancellationToken) 84Document document, ImmutableArray<Diagnostic> diagnostics, 101Document document, SemanticModel semanticModel, Diagnostic diagnostic,
src\Analyzers\Core\CodeFixes\AddExplicitCast\AbstractAddExplicitCastCodeFixProvider.cs (6)
49Document document, SemanticModel semanticModel, SyntaxNode root, 61Document document, SemanticModel semanticModel, SyntaxNode root, 68var document = context.Document; 117Document document, 172Document document, 213Document document,
src\Analyzers\Core\CodeFixes\AddExplicitCast\Fixer.cs (2)
39Document document, 109Document document,
src\Analyzers\Core\CodeFixes\AddObsoleteAttribute\AbstractAddObsoleteAttributeCodeFixProvider.cs (3)
36var document = context.Document; 58private static async Task<INamedTypeSymbol?> GetObsoleteAttributeAsync(Document document, CancellationToken cancellationToken) 72Document document, ImmutableArray<Diagnostic> diagnostics,
src\Analyzers\Core\CodeFixes\AddParameter\AbstractAddParameterCodeFixProvider.cs (5)
66var document = context.Document; 330Document document, 374Document invocationDocument, 401private async Task<(ITypeSymbol, RefKind)> GetArgumentTypeAndRefKindAsync(Document invocationDocument, TArgumentSyntax argument, CancellationToken cancellationToken) 411Document invocationDocument, TArgumentSyntax argument, INamedTypeSymbol containingType, CancellationToken cancellationToken)
src\Analyzers\Core\CodeFixes\AddParameter\AddParameterService.cs (3)
79Document invocationDocument, 183var rewrittenDocument = rewrittenSolution.GetRequiredDocument(documentId); 216Document invocationDocument, IMethodSymbol method, CancellationToken cancellationToken)
src\Analyzers\Core\CodeFixes\AddRequiredParentheses\AddRequiredParenthesesCodeFixProvider.cs (2)
26protected override bool IncludeDiagnosticDuringFixAll(Diagnostic diagnostic, Document document, string? equivalenceKey, CancellationToken cancellationToken) 43Document document, ImmutableArray<Diagnostic> diagnostics,
src\Analyzers\Core\CodeFixes\AliasAmbiguousType\AbstractAliasAmbiguousTypeCodeFixProvider.cs (1)
33var document = context.Document;
src\Analyzers\Core\CodeFixes\AnalyzerOptionsProviders.cs (1)
14public static async ValueTask<AnalyzerOptionsProvider> GetAnalyzerOptionsProviderAsync(this Document document, CancellationToken cancellationToken)
src\Analyzers\Core\CodeFixes\ConflictMarkerResolution\AbstractConflictMarkerCodeFixProvider.cs (14)
71var document = context.Document; 267var document = context.Document; 300static CodeAction CreateCodeAction(string title, Func<CancellationToken, Task<Document>> action, string equivalenceKey) 313private static async Task<Document> AddEditsAsync( 314Document document, int startPos, int firstMiddlePos, int secondMiddlePos, int endPos, 379private static Task<Document> TakeTopAsync(Document document, int startPos, int firstMiddlePos, int secondMiddlePos, int endPos, CancellationToken cancellationToken) 382private static Task<Document> TakeBottomAsync(Document document, int startPos, int firstMiddlePos, int secondMiddlePos, int endPos, CancellationToken cancellationToken) 385private static Task<Document> TakeBothAsync(Document document, int startPos, int firstMiddlePos, int secondMiddlePos, int endPos, CancellationToken cancellationToken) 391private async Task<Document> FixAllAsync( 392Document document, ImmutableArray<Diagnostic> diagnostics, 444var finalDoc = document.WithText(finalText);
src\Analyzers\Core\CodeFixes\ConvertToAsync\AbstractConvertToAsyncCodeFixProvider.cs (2)
62SyntaxNode node, Document document, Diagnostic diagnostic, CancellationToken cancellationToken) 72var otherDocument = document.Project.Solution.GetDocument(syntaxTree);
src\Analyzers\Core\CodeFixes\ConvertTypeOfToNameOf\AbstractConvertTypeOfToNameOfCodeFixProvider.cs (1)
35Document document, ImmutableArray<Diagnostic> diagnostics,
src\Analyzers\Core\CodeFixes\DocumentationComments\AbstractAddDocCommentNodesCodeFixProvider.cs (2)
58protected async Task<Document> AddParamTagAsync( 59Document document, TMemberDeclarationSyntax parentMethod, SyntaxNode docCommentNode, CancellationToken cancellationToken)
src\Analyzers\Core\CodeFixes\DocumentationComments\AbstractRemoveDocCommentNodeCodeFixProvider.cs (2)
59private async Task<Document> RemoveDuplicateParamTagAsync( 60Document document, TXmlElementSyntax paramNode, CancellationToken cancellationToken)
src\Analyzers\Core\CodeFixes\FileHeaders\AbstractFileHeaderCodeFixProvider.cs (4)
46private async Task<Document> GetTransformedDocumentAsync(Document document, CancellationToken cancellationToken) 49private async Task<SyntaxNode> GetTransformedSyntaxRootAsync(Document document, CancellationToken cancellationToken) 58internal static async Task<SyntaxNode> GetTransformedSyntaxRootAsync(ISyntaxFacts syntaxFacts, AbstractFileHeaderHelper fileHeaderHelper, SyntaxTrivia newLineTrivia, Document document, string? fileHeaderTemplate, CancellationToken cancellationToken)
src\Analyzers\Core\CodeFixes\ForEachCast\AbstractForEachCastCodeFixProvider.cs (1)
44Document document, ImmutableArray<Diagnostic> diagnostics,
src\Analyzers\Core\CodeFixes\Formatting\FormattingCodeFixProvider.cs (2)
62private async Task<Document> FixOneAsync(CodeFixContext context, Diagnostic diagnostic, CancellationToken cancellationToken) 80protected override async Task FixAllAsync(Document document, ImmutableArray<Diagnostic> diagnostics, SyntaxEditor editor, CancellationToken cancellationToken)
src\Analyzers\Core\CodeFixes\GenerateConstructor\AbstractGenerateConstructorService.cs (1)
78public async Task<ImmutableArray<CodeAction>> GenerateConstructorAsync(Document document, SyntaxNode node, CancellationToken cancellationToken)
src\Analyzers\Core\CodeFixes\GenerateConstructor\AbstractGenerateConstructorService.State.cs (7)
412public async Task<Document> GetChangedDocumentAsync( 413Document document, bool withFields, bool withProperties, CancellationToken cancellationToken) 428private async Task<Document?> GenerateThisOrBaseDelegatingConstructorAsync( 429Document document, bool withFields, bool withProperties, CancellationToken cancellationToken) 465Document document, bool withFields, bool withProperties, CancellationToken cancellationToken) 486private async Task<Document> GenerateMemberDelegatingConstructorAsync( 487Document document, bool withFields, bool withProperties, CancellationToken cancellationToken)
src\Analyzers\Core\CodeFixes\GenerateConstructor\IGenerateConstructorService.cs (1)
16Task<ImmutableArray<CodeAction>> GenerateConstructorAsync(Document document, SyntaxNode node, CancellationToken cancellationToken);
src\Analyzers\Core\CodeFixes\GenerateDefaultConstructors\AbstractGenerateDefaultConstructorCodeFixProvider.cs (1)
23var document = context.Document;
src\Analyzers\Core\CodeFixes\GenerateDefaultConstructors\AbstractGenerateDefaultConstructorsService.cs (1)
26Document document,
src\Analyzers\Core\CodeFixes\GenerateDefaultConstructors\GenerateDefaultConstructorsCodeAction.cs (4)
26Document document, 32private readonly Document _document = document; 37protected override async Task<Document> GetChangedDocumentAsync(CancellationToken cancellationToken) 40var result = await CodeGenerator.AddMemberDeclarationsAsync(
src\Analyzers\Core\CodeFixes\GenerateDefaultConstructors\IGenerateDefaultConstructorsService.cs (1)
17Document document, TextSpan textSpan, bool forRefactoring, CancellationToken cancellationToken);
src\Analyzers\Core\CodeFixes\GenerateEnumMember\AbstractGenerateEnumMemberService.CodeAction.cs (3)
19private sealed partial class GenerateEnumMemberCodeAction(Document document, State state) : CodeAction 21private readonly Document _document = document; 24protected override async Task<Document> GetChangedDocumentAsync(CancellationToken cancellationToken)
src\Analyzers\Core\CodeFixes\GenerateEnumMember\AbstractGenerateEnumMemberService.cs (1)
24public async Task<ImmutableArray<CodeAction>> GenerateEnumMemberAsync(Document document, SyntaxNode node, CancellationToken cancellationToken)
src\Analyzers\Core\CodeFixes\GenerateEnumMember\IGenerateEnumMemberService.cs (1)
15Task<ImmutableArray<CodeAction>> GenerateEnumMemberAsync(Document document, SyntaxNode node, CancellationToken cancellationToken);
src\Analyzers\Core\CodeFixes\GenerateMember\AbstractGenerateMemberCodeFixProvider.cs (2)
27protected abstract Task<ImmutableArray<CodeAction>> GetCodeActionsAsync(Document document, SyntaxNode node, CancellationToken cancellationToken); 40var document = context.Document;
src\Analyzers\Core\CodeFixes\GenerateParameterizedMember\AbstractGenerateConversionService.cs (1)
30Document document,
src\Analyzers\Core\CodeFixes\GenerateParameterizedMember\AbstractGenerateDeconstructMethodService.cs (1)
25Document document,
src\Analyzers\Core\CodeFixes\GenerateParameterizedMember\AbstractGenerateMethodService.cs (1)
31Document document,
src\Analyzers\Core\CodeFixes\GenerateParameterizedMember\AbstractGenerateParameterizedMemberService.CodeAction.cs (3)
21private readonly Document _document; 29Document document, 65protected override async Task<Document> GetChangedDocumentAsync(CancellationToken cancellationToken)
src\Analyzers\Core\CodeFixes\GenerateParameterizedMember\AbstractGenerateParameterizedMemberService.cs (1)
42protected async ValueTask<ImmutableArray<CodeAction>> GetActionsAsync(Document document, State state, CancellationToken cancellationToken)
src\Analyzers\Core\CodeFixes\GenerateParameterizedMember\IGenerateConversionService.cs (1)
15Task<ImmutableArray<CodeAction>> GenerateConversionAsync(Document document, SyntaxNode node, CancellationToken cancellationToken);
src\Analyzers\Core\CodeFixes\GenerateParameterizedMember\IGenerateDeconstructMemberService.cs (1)
17Document document, SyntaxNode targetVariables, INamedTypeSymbol typeToGenerateIn, CancellationToken cancellationToken);
src\Analyzers\Core\CodeFixes\GenerateParameterizedMember\IGenerateParameterizedMemberService.cs (1)
16Task<ImmutableArray<CodeAction>> GenerateMethodAsync(Document document, SyntaxNode node, CancellationToken cancellationToken);
src\Analyzers\Core\CodeFixes\GenerateVariable\AbstractGenerateVariableService.CodeAction.cs (1)
55protected override async Task<Document> GetChangedDocumentAsync(CancellationToken cancellationToken)
src\Analyzers\Core\CodeFixes\GenerateVariable\AbstractGenerateVariableService.cs (4)
33Document document, 116Document document, State state, SymbolKind kind, Accessibility accessibility, CancellationToken cancellationToken) 176ArrayBuilder<CodeAction> result, Document document, State state, CancellationToken cancellationToken) 192ArrayBuilder<CodeAction> result, Document document, State state, CancellationToken cancellationToken)
src\Analyzers\Core\CodeFixes\GenerateVariable\AbstractGenerateVariableService.GenerateLocalCodeAction.cs (3)
21private sealed class GenerateLocalCodeAction(TService service, Document document, State state) : CodeAction 24private readonly Document _document = document; 39protected override async Task<Document> GetChangedDocumentAsync(CancellationToken cancellationToken)
src\Analyzers\Core\CodeFixes\GenerateVariable\AbstractGenerateVariableService.GenerateParameterCodeAction.cs (2)
18Document document, 23private readonly Document _document = document;
src\Analyzers\Core\CodeFixes\GenerateVariable\IGenerateVariableService.cs (1)
17Task<ImmutableArray<CodeAction>> GenerateVariableAsync(Document document, SyntaxNode node, CancellationToken cancellationToken);
src\Analyzers\Core\CodeFixes\ImplementAbstractClass\AbstractImplementAbstractClassCodeFixProvider.cs (1)
27var document = context.Document;
src\Analyzers\Core\CodeFixes\ImplementAbstractClass\ImplementAbstractClassData.cs (6)
33Document document, ImplementTypeOptions options, SyntaxNode classNode, SyntaxToken classIdentifier, 37private readonly Document _document = document; 47Document document, SyntaxNode classNode, SyntaxToken classIdentifier, CancellationToken cancellationToken) 78public static async Task<Document?> TryImplementAbstractClassAsync( 79Document document, SyntaxNode classNode, SyntaxToken classIdentifier, CancellationToken cancellationToken) 88public async Task<Document> ImplementAbstractClassAsync(
src\Analyzers\Core\CodeFixes\ImplementInterface\AbstractImplementInterfaceCodeFixProvider.cs (3)
32var document = context.Document; 126Document document, ImplementInterfaceInfo state, [EnumeratorCancellation] CancellationToken cancellationToken) 201Document document, ImplementInterfaceInfo state, CancellationToken cancellationToken)
src\Analyzers\Core\CodeFixes\ImplementInterface\AbstractImplementInterfaceService.cs (7)
31protected abstract bool TryInitializeState(Document document, SemanticModel model, SyntaxNode interfaceNode, CancellationToken cancellationToken, out SyntaxNode classOrStructDecl, out INamedTypeSymbol classOrStructType, out ImmutableArray<INamedTypeSymbol> interfaceTypes); 37public async Task<Document> ImplementInterfaceAsync( 38Document document, ImplementTypeOptions options, SyntaxNode node, CancellationToken cancellationToken) 57public async Task<ImplementInterfaceInfo?> AnalyzeAsync(Document document, SyntaxNode interfaceType, CancellationToken cancellationToken) 86public async Task<Document> ImplementInterfaceAsync( 87Document document, 99Document document,
src\Analyzers\Core\CodeFixes\ImplementInterface\AbstractImplementInterfaceService.State.cs (3)
15Document document, 33public readonly Document Document = document; 44Document document,
src\Analyzers\Core\CodeFixes\ImplementInterface\IImplementInterfaceService.cs (6)
24Task<Document> ImplementInterfaceAsync(Document document, ImplementTypeOptions options, SyntaxNode node, CancellationToken cancellationToken); 26Task<ImplementInterfaceInfo?> AnalyzeAsync(Document document, SyntaxNode interfaceType, CancellationToken cancellationToken); 28Task<Document> ImplementInterfaceAsync( 29Document document, 41Document document,
src\Analyzers\Core\CodeFixes\ImplementInterface\ImplementHelpers.cs (1)
19Document document,
src\Analyzers\Core\CodeFixes\ImplementInterface\ImplementInterfaceGenerator.cs (4)
35private readonly Document Document; 50Document document, 62public Task<Document> ImplementInterfaceAsync(CancellationToken cancellationToken) 75private async Task<Document> ImplementInterfaceAsync(
src\Analyzers\Core\CodeFixes\ImplementInterface\ImplementInterfaceGenerator_DisposePattern.cs (5)
45private async Task<Document> ImplementDisposePatternAsync( 49var document = this.Document; 94private async Task<Document> AddFinalizerCommentAsync( 95Document document, SyntaxNode finalizer, CancellationToken cancellationToken) 234Document document,
src\Analyzers\Core\CodeFixes\ImplementType\ImplementTypeOptions.cs (1)
77public static async ValueTask<ImplementTypeOptions> GetImplementTypeOptionsAsync(this Document document, CancellationToken cancellationToken)
src\Analyzers\Core\CodeFixes\Iterator\AbstractIteratorCodeFixProvider.cs (1)
24protected abstract Task<CodeAction> GetCodeFixAsync(SyntaxNode root, SyntaxNode node, Document document, Diagnostic diagnostics, CancellationToken cancellationToken);
src\Analyzers\Core\CodeFixes\MakeFieldReadonly\AbstractMakeFieldReadonlyCodeFixProvider.cs (2)
39Document document, 57Document document, SyntaxEditor editor, List<TSymbolSyntax> declarators, CancellationToken cancellationToken)
src\Analyzers\Core\CodeFixes\MakeMemberStatic\AbstractMakeMemberStaticCodeFixProvider.cs (1)
32protected sealed override Task FixAllAsync(Document document, ImmutableArray<Diagnostic> diagnostics, SyntaxEditor editor,
src\Analyzers\Core\CodeFixes\MakeMethodAsynchronous\AbstractMakeMethodAsynchronousCodeFixProvider.cs (7)
35var document = context.Document; 94private static bool IsLikelyEntryPointName(string name, Document document) 103Document document, 156Document document, 172var newDocument = newSolution.GetRequiredDocument(document.Id); 186Document document, 197var newDocument = document.WithSyntaxRoot(newRoot);
src\Analyzers\Core\CodeFixes\MakeMethodSynchronous\AbstractMakeMethodSynchronousCodeFixProvider.cs (8)
52Document document, SyntaxNode node, CancellationToken cancellationToken) 73private async Task<Solution> RenameThenRemoveAsyncTokenAsync(Document document, SyntaxNode node, IMethodSymbol methodSymbol, CancellationToken cancellationToken) 84var newDocument = newSolution.GetRequiredDocument(document.Id); 97Document document, IMethodSymbol methodSymbol, SyntaxNode node, CancellationToken cancellationToken) 109var newDocument = document.WithSyntaxRoot(newRoot); 120Document document, SyntaxAnnotation annotation, CancellationToken cancellationToken) 171Solution currentSolution, IGrouping<Document, ReferenceLocation> group, CancellationToken cancellationToken) 173var document = group.Key;
src\Analyzers\Core\CodeFixes\MakeTypeAbstract\AbstractMakeTypeAbstractCodeFixProvider.cs (1)
32protected sealed override Task FixAllAsync(Document document, ImmutableArray<Diagnostic> diagnostics, SyntaxEditor editor,
src\Analyzers\Core\CodeFixes\MakeTypePartial\AbstractMakeTypePartialCodeFixProvider.cs (1)
29protected override async Task FixAllAsync(Document document, ImmutableArray<Diagnostic> diagnostics, SyntaxEditor editor, CancellationToken cancellationToken)
src\Analyzers\Core\CodeFixes\MatchFolderAndNamespace\AbstractChangeNamespaceToMatchFolderCodeFixProvider.cs (2)
42private static async Task<Solution> FixAllInDocumentAsync(Document document, ImmutableArray<Diagnostic> diagnostics, CancellationToken cancellationToken) 55var documentWithInvalidFolders = document.WithFolders(document.Folders.Concat("Force-Namespace-Change"));
src\Analyzers\Core\CodeFixes\MatchFolderAndNamespace\AbstractChangeNamespaceToMatchFolderCodeFixProvider.CustomFixAllProvider.cs (1)
88var document = newSolution.GetRequiredDocument(documentId);
src\Analyzers\Core\CodeFixes\Naming\NamingExtensions.cs (2)
18this Document document, SymbolKind symbolKind, Accessibility accessibility, CancellationToken cancellationToken) 36this Document document, CancellationToken cancellationToken)
src\Analyzers\Core\CodeFixes\NamingStyle\NamingStyleCodeFixProvider.cs (2)
54var document = context.Document; 104Document document, ISymbol symbol, string fixedName, CancellationToken cancellationToken)
src\Analyzers\Core\CodeFixes\NewLines\ConsecutiveStatementPlacement\ConsecutiveStatementPlacementCodeFixProvider.cs (5)
31var document = context.Document; 41private static Task<Document> UpdateDocumentAsync(Document document, Diagnostic diagnostic, CancellationToken cancellationToken) 44public static async Task<Document> FixAllAsync(Document document, ImmutableArray<Diagnostic> diagnostics, CancellationToken cancellationToken)
src\Analyzers\Core\CodeFixes\NewLines\MultipleBlankLines\AbstractMultipleBlankLinesCodeFixProvider.cs (5)
31var document = context.Document; 41private static Task<Document> UpdateDocumentAsync(Document document, Diagnostic diagnostic, CancellationToken cancellationToken) 44private static async Task<Document> FixAllAsync( 45Document document, ImmutableArray<Diagnostic> diagnostics, CancellationToken cancellationToken)
src\Analyzers\Core\CodeFixes\OrderModifiers\AbstractOrderModifiersCodeFixProvider.cs (1)
53Document document, ImmutableArray<Diagnostic> diagnostics, SyntaxEditor editor, CancellationToken cancellationToken)
src\Analyzers\Core\CodeFixes\PopulateSwitch\AbstractPopulateSwitchCodeFixProvider.cs (10)
50Document document, SyntaxEditor editor, SemanticModel semanticModel, 64var document = context.Document; 104private Task<Document> FixAsync( 105Document document, Diagnostic diagnostic, 113private Task<Document> FixAllAsync( 114Document document, ImmutableArray<Diagnostic> diagnostics, 124Document document, SyntaxEditor editor, ImmutableArray<Diagnostic> diagnostics, 137Document document, SyntaxEditor editor, Diagnostic diagnostic, 204Document document, 220Document document,
src\Analyzers\Core\CodeFixes\PopulateSwitch\AbstractPopulateSwitchExpressionCodeFixProvider.cs (1)
30Document document, SyntaxEditor editor, SemanticModel semanticModel,
src\Analyzers\Core\CodeFixes\PopulateSwitch\AbstractPopulateSwitchStatementCodeFixProvider.cs (1)
31Document document, SyntaxEditor editor, SemanticModel semanticModel,
src\Analyzers\Core\CodeFixes\QualifyMemberAccess\AbstractQualifyMemberAccessCodeFixProvider.cs (1)
36Document document, ImmutableArray<Diagnostic> diagnostics,
src\Analyzers\Core\CodeFixes\RemoveAsyncModifier\AbstractRemoveAsyncModifierCodeFixProvider.cs (2)
31var document = context.Document; 64Document document, ImmutableArray<Diagnostic> diagnostics,
src\Analyzers\Core\CodeFixes\RemoveRedundantEquality\RemoveRedundantEqualityCodeFixProvider.cs (1)
32Document document,
src\Analyzers\Core\CodeFixes\RemoveUnnecessaryImports\AbstractRemoveUnnecessaryImportsCodeFixProvider.cs (2)
39private static Task<Document> RemoveUnnecessaryImportsAsync( 40Document document,
src\Analyzers\Core\CodeFixes\RemoveUnnecessaryParentheses\AbstractRemoveUnnecessaryParenthesesCodeFixProvider.cs (1)
35Document document, ImmutableArray<Diagnostic> diagnostics,
src\Analyzers\Core\CodeFixes\RemoveUnnecessarySuppressions\RemoveUnnecessaryAttributeSuppressionsCodeFixProvider.cs (1)
40protected override Task FixAllAsync(Document document, ImmutableArray<Diagnostic> diagnostics, SyntaxEditor editor, CancellationToken cancellationToken)
src\Analyzers\Core\CodeFixes\RemoveUnnecessarySuppressions\RemoveUnnecessaryPragmaSuppressionsCodeFixProvider.cs (1)
47protected override Task FixAllAsync(Document document, ImmutableArray<Diagnostic> diagnostics, SyntaxEditor editor, CancellationToken cancellationToken)
src\Analyzers\Core\CodeFixes\RemoveUnusedMembers\AbstractRemoveUnusedMembersCodeFixProvider.cs (1)
41Document document,
src\Analyzers\Core\CodeFixes\RemoveUnusedParametersAndValues\AbstractRemoveUnusedValuesCodeFixProvider.cs (18)
203private static bool IsForEachIterationVariableDiagnostic(Diagnostic diagnostic, Document document, CancellationToken cancellationToken) 233protected override bool IncludeDiagnosticDuringFixAll(Diagnostic diagnostic, Document document, string? equivalenceKey, CancellationToken cancellationToken) 272private static async Task<Document> PreprocessDocumentAsync(Document document, ImmutableArray<Diagnostic> diagnostics, CancellationToken cancellationToken) 284protected sealed override async Task FixAllAsync(Document document, ImmutableArray<Diagnostic> diagnostics, SyntaxEditor editor, CancellationToken cancellationToken) 287var preprocessedDocument = await PreprocessDocumentAsync(document, diagnostics, cancellationToken).ConfigureAwait(false); 293Document document, 347Document document, 384Document document, 443Document document, 745Document document, 774Func<SyntaxNode, Document, SyntaxFormattingOptions, CancellationToken, Task<SyntaxNode>> processMemberDeclarationAsync, 776Document document, 783var newDocument = document.WithSyntaxRoot(currentRoot); 805private async Task<SyntaxNode> ReplaceDiscardDeclarationsWithAssignmentsAsync(SyntaxNode memberDeclaration, Document document, SyntaxFormattingOptions options, CancellationToken cancellationToken) 823Document document, 829var originalDocument = document; 916Document document,
src\Analyzers\Core\CodeFixes\SimplifyBooleanExpression\SimplifyConditionalCodeFixProvider.cs (1)
36Document document,
src\Analyzers\Core\CodeFixes\SimplifyInterpolation\AbstractSimplifyInterpolationCodeFixProvider.cs (1)
50Document document, ImmutableArray<Diagnostic> diagnostics,
src\Analyzers\Core\CodeFixes\SimplifyLinqExpression\SimplifyLinqExpressionCodeFixProvider.cs (1)
34Document document,
src\Analyzers\Core\CodeFixes\UnsealClass\AbstractUnsealClassCodeFixProvider.cs (2)
31var document = context.Document; 63var document = solution.GetRequiredDocument(documentId);
src\Analyzers\Core\CodeFixes\UpdateLegacySuppressions\UpdateLegacySuppressionsCodeFixProvider.cs (1)
41protected override Task FixAllAsync(Document document, ImmutableArray<Diagnostic> diagnostics, SyntaxEditor editor, CancellationToken cancellationToken)
src\Analyzers\Core\CodeFixes\UseCoalesceExpression\AbstractUseCoalesceExpressionForIfNullStatementCheckCodeFixProvider.cs (1)
35Document document, ImmutableArray<Diagnostic> diagnostics,
src\Analyzers\Core\CodeFixes\UseCoalesceExpression\UseCoalesceExpressionForNullableTernaryConditionalCheckCodeFixProvider.cs (1)
38Document document, ImmutableArray<Diagnostic> diagnostics,
src\Analyzers\Core\CodeFixes\UseCoalesceExpression\UseCoalesceExpressionForTernaryConditionalCheckCodeFixProvider.cs (1)
39Document document, ImmutableArray<Diagnostic> diagnostics,
src\Analyzers\Core\CodeFixes\UseCollectionExpression\AbstractUseCollectionExpressionCodeFixProvider.cs (1)
27protected override bool IncludeDiagnosticDuringFixAll(Diagnostic diagnostic, Document document, string? equivalenceKey, CancellationToken cancellationToken)
src\Analyzers\Core\CodeFixes\UseCollectionInitializer\AbstractUseCollectionInitializerCodeFixProvider.cs (2)
56Document document, TObjectCreationExpressionSyntax objectCreation, bool useCollectionExpression, 61Document document,
src\Analyzers\Core\CodeFixes\UseCompoundAssignment\AbstractUseCompoundAssignmentCodeFixProvider.cs (1)
53Document document, ImmutableArray<Diagnostic> diagnostics,
src\Analyzers\Core\CodeFixes\UseConditionalExpression\AbstractUseConditionalExpressionCodeFixProvider.cs (4)
41Document document, Diagnostic diagnostic, 45Document document, ImmutableArray<Diagnostic> diagnostics, SyntaxEditor editor, 85Document document, IConditionalOperation ifOperation, 138Document document, SyntaxNode condition, SyntaxNode trueSyntax, SyntaxNode falseSyntax, SyntaxFormattingOptions formattingOptions,
src\Analyzers\Core\CodeFixes\UseConditionalExpression\ForAssignment\AbstractUseConditionalExpressionForAssignmentCodeFixProvider.cs (1)
59Document document, Diagnostic diagnostic,
src\Analyzers\Core\CodeFixes\UseConditionalExpression\ForReturn\AbstractUseConditionalExpressionForReturnCodeFixProvider.cs (1)
48Document document, Diagnostic diagnostic,
src\Analyzers\Core\CodeFixes\UseExplicitTupleName\UseExplicitTupleNameCodeFixProvider.cs (1)
35Document document, ImmutableArray<Diagnostic> diagnostics,
src\Analyzers\Core\CodeFixes\UseInferredMemberName\AbstractUseInferredMemberNameCodeFixProvider.cs (1)
32Document document, ImmutableArray<Diagnostic> diagnostics,
src\Analyzers\Core\CodeFixes\UseIsNullCheck\AbstractUseIsNullForReferenceEqualsCodeFixProvider.cs (1)
51Document document, ImmutableArray<Diagnostic> diagnostics,
src\Analyzers\Core\CodeFixes\UseNullPropagation\AbstractUseNullPropagationCodeFixProvider.cs (3)
80Document document, ImmutableArray<Diagnostic> diagnostics, 101Document document, 160Document document,
src\Analyzers\Core\CodeFixes\UseObjectInitializer\AbstractUseObjectInitializerCodeFixProvider.cs (1)
65Document document,
src\Analyzers\Core\CodeFixes\UseSystemHashCode\UseSystemHashCodeCodeFixProvider.cs (1)
36Document document, ImmutableArray<Diagnostic> diagnostics,
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\AddImport\AddImportPlacementOptionsProviders.cs (2)
17public static bool AllowImportsInHiddenRegions(this Document document) 27public static async ValueTask<AddImportPlacementOptions> GetAddImportPlacementOptionsAsync(this Document document, CancellationToken cancellationToken)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeCleanup\CodeCleanupOptionsProviders.cs (1)
27public static async ValueTask<CodeCleanupOptions> GetCodeCleanupOptionsAsync(this Document document, CancellationToken cancellationToken)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeFixes\ForkingSyntaxEditorBasedCodeFixProvider.cs (2)
40Document document, 58Document document,
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeFixes\SyntaxEditorBasedCodeFixProvider.cs (8)
54protected Func<CancellationToken, Task<Document>> GetDocumentUpdater(CodeFixContext context, Diagnostic? diagnostic = null) 60private Task<Document> FixAllAsync( 61Document document, ImmutableArray<Diagnostic> diagnostics, CancellationToken cancellationToken) 69internal static async Task<Document> FixAllWithEditorAsync( 70Document document, 89Document document, ImmutableArray<Diagnostic> diagnostics, SyntaxEditor editor, CancellationToken cancellationToken); 103protected virtual bool IncludeDiagnosticDuringFixAll(Diagnostic diagnostic, Document document, string? equivalenceKey, CancellationToken cancellationToken) 116/// Document, string, CancellationToken)"/> should be overridden instead.
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeFixesAndRefactorings\FixAllHelper.cs (1)
15Document triggerDocument,
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\AbstractCodeGenerationService.cs (12)
230private async Task<Document> GetEditAsync( 243var oldDocument = context.Solution.GetRequiredDocument(destinationTree); 253var newDocument = oldDocument.WithSyntaxRoot(currentRoot); 392public virtual Task<Document> AddEventAsync( 402public Task<Document> AddFieldAsync(CodeGenerationSolutionContext context, INamedTypeSymbol destination, IFieldSymbol field, CancellationToken cancellationToken) 411public Task<Document> AddPropertyAsync(CodeGenerationSolutionContext context, INamedTypeSymbol destination, IPropertySymbol property, CancellationToken cancellationToken) 420public Task<Document> AddNamedTypeAsync(CodeGenerationSolutionContext context, INamedTypeSymbol destination, INamedTypeSymbol namedType, CancellationToken cancellationToken) 429public Task<Document> AddNamedTypeAsync(CodeGenerationSolutionContext context, INamespaceSymbol destination, INamedTypeSymbol namedType, CancellationToken cancellationToken) 438public Task<Document> AddNamespaceAsync(CodeGenerationSolutionContext context, INamespaceSymbol destination, INamespaceSymbol @namespace, CancellationToken cancellationToken) 447public Task<Document> AddMethodAsync(CodeGenerationSolutionContext context, INamedTypeSymbol destination, IMethodSymbol method, CancellationToken cancellationToken) 456public Task<Document> AddMembersAsync(CodeGenerationSolutionContext context, INamedTypeSymbol destination, IEnumerable<ISymbol> members, CancellationToken cancellationToken) 465public Task<Document> AddNamespaceOrTypeAsync(CodeGenerationSolutionContext context, INamespaceSymbol destination, INamespaceOrTypeSymbol namespaceOrType, CancellationToken cancellationToken)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\AbstractCodeGenerationService_FindDeclaration.cs (1)
67var document = solution.GetDocument(syntaxTree);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\CodeGenerationOptionsProviders.cs (2)
35public static async ValueTask<CodeGenerationOptions> GetCodeGenerationOptionsAsync(this Document document, CancellationToken cancellationToken) 41public static async ValueTask<CodeGenerationContextInfo> GetCodeGenerationInfoAsync(this Document document, CodeGenerationContext context, CancellationToken cancellationToken)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\CodeGenerator.cs (9)
30public static Task<Document> AddEventDeclarationAsync(CodeGenerationSolutionContext context, INamedTypeSymbol destination, IEventSymbol @event, CancellationToken cancellationToken) 37public static Task<Document> AddFieldDeclarationAsync(CodeGenerationSolutionContext context, INamedTypeSymbol destination, IFieldSymbol field, CancellationToken cancellationToken) 44public static Task<Document> AddMethodDeclarationAsync(CodeGenerationSolutionContext context, INamedTypeSymbol destination, IMethodSymbol method, CancellationToken cancellationToken) 51public static Task<Document> AddPropertyDeclarationAsync(CodeGenerationSolutionContext context, INamedTypeSymbol destination, IPropertySymbol property, CancellationToken cancellationToken) 58public static Task<Document> AddNamedTypeDeclarationAsync(CodeGenerationSolutionContext context, INamedTypeSymbol destination, INamedTypeSymbol namedType, CancellationToken cancellationToken) 65public static Task<Document> AddNamedTypeDeclarationAsync(CodeGenerationSolutionContext context, INamespaceSymbol destination, INamedTypeSymbol namedType, CancellationToken cancellationToken) 72public static Task<Document> AddNamespaceDeclarationAsync(CodeGenerationSolutionContext context, INamespaceSymbol destination, INamespaceSymbol @namespace, CancellationToken cancellationToken) 79public static Task<Document> AddNamespaceOrTypeDeclarationAsync(CodeGenerationSolutionContext context, INamespaceSymbol destination, INamespaceOrTypeSymbol namespaceOrType, CancellationToken cancellationToken) 86public static Task<Document> AddMemberDeclarationsAsync(CodeGenerationSolutionContext context, INamedTypeSymbol destination, IEnumerable<ISymbol> members, CancellationToken cancellationToken)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\ICodeGenerationService.cs (9)
134Task<Document> AddEventAsync(CodeGenerationSolutionContext context, INamedTypeSymbol destination, IEventSymbol @event, CancellationToken cancellationToken); 139Task<Document> AddFieldAsync(CodeGenerationSolutionContext context, INamedTypeSymbol destination, IFieldSymbol field, CancellationToken cancellationToken); 144Task<Document> AddMethodAsync(CodeGenerationSolutionContext context, INamedTypeSymbol destination, IMethodSymbol method, CancellationToken cancellationToken); 149Task<Document> AddPropertyAsync(CodeGenerationSolutionContext context, INamedTypeSymbol destination, IPropertySymbol property, CancellationToken cancellationToken); 154Task<Document> AddNamedTypeAsync(CodeGenerationSolutionContext context, INamedTypeSymbol destination, INamedTypeSymbol namedType, CancellationToken cancellationToken); 159Task<Document> AddNamedTypeAsync(CodeGenerationSolutionContext context, INamespaceSymbol destination, INamedTypeSymbol namedType, CancellationToken cancellationToken); 164Task<Document> AddNamespaceAsync(CodeGenerationSolutionContext context, INamespaceSymbol destination, INamespaceSymbol @namespace, CancellationToken cancellationToken); 169Task<Document> AddNamespaceOrTypeAsync(CodeGenerationSolutionContext context, INamespaceSymbol destination, INamespaceOrTypeSymbol namespaceOrType, CancellationToken cancellationToken); 174Task<Document> AddMembersAsync(CodeGenerationSolutionContext context, INamedTypeSymbol destination, IEnumerable<ISymbol> members, CancellationToken cancellationToken);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Editing\ImportAdderService.cs (6)
32public async Task<Document> AddImportsAsync( 33Document document, 105private async Task<Document> AddImportDirectivesFromSyntaxesAsync( 106Document document, 166private async Task<Document> AddImportDirectivesFromSymbolAnnotationsAsync( 167Document document,
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\ContextQuery\ISyntaxContextService.cs (1)
13SyntaxContext CreateContext(Document document, SemanticModel semanticModel, int position, CancellationToken cancellationToken);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\ContextQuery\SyntaxContext.cs (2)
14public Document Document { get; } 59Document document,
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\DocumentExtensions.cs (15)
32public static TLanguageService? GetLanguageService<TLanguageService>(this Document? document) where TLanguageService : class, ILanguageService 35public static TLanguageService GetRequiredLanguageService<TLanguageService>(this Document document) where TLanguageService : class, ILanguageService 38public static async ValueTask<SemanticModel> GetRequiredSemanticModelAsync(this Document document, CancellationToken cancellationToken) 62public static async ValueTask<SyntaxTree> GetRequiredSyntaxTreeAsync(this Document document, CancellationToken cancellationToken) 79public static async ValueTask<SyntaxNode> GetRequiredSyntaxRootAsync(this Document document, CancellationToken cancellationToken) 116public static ValueTask<SemanticModel> ReuseExistingSpeculativeModelAsync(this Document document, int position, CancellationToken cancellationToken) 133public static async ValueTask<SemanticModel> ReuseExistingSpeculativeModelAsync(this Document document, TextSpan span, CancellationToken cancellationToken) 158public static ValueTask<SemanticModel> ReuseExistingSpeculativeModelAsync(this Document document, SyntaxNode? node, CancellationToken cancellationToken) 169public static async Task<bool> HasAnyErrorsAsync(this Document document, CancellationToken cancellationToken, List<string>? ignoreErrorCode = null) 175public static async Task<ImmutableArray<Diagnostic>> GetErrorsAsync(this Document document, CancellationToken cancellationToken, IList<string>? ignoreErrorCode = null) 191public static async Task VerifyNoErrorsAsync(this Document newDocument, string message, CancellationToken cancellationToken, List<string>? ignoreErrorCodes = null) 210public static async Task<bool> IsGeneratedCodeAsync(this Document document, CancellationToken cancellationToken) 217public static IEnumerable<Document> GetLinkedDocuments(this Document document) 228public static async ValueTask<IOptionsReader> GetHostAnalyzerConfigOptionsAsync(this Document document, CancellationToken cancellationToken)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\ISolutionExtensions.cs (2)
35public static Document GetRequiredDocument(this Solution solution, SyntaxTree syntaxTree) 49public static Document GetRequiredDocument(this Solution solution, DocumentId documentId)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\SyntaxEditorExtensions.cs (6)
27this SyntaxEditor editor, Document document, 50this SyntaxEditor editor, Document document, 73this SyntaxEditor editor, Document document, 94this SyntaxEditor editor, Document document, 117this SyntaxEditor editor, Document document, 151this SyntaxEditor editor, Document document,
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\TextDocumentExtensions.cs (1)
31case Document document:
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Formatting\DocumentFormattingOptionsProviders.cs (1)
22public static async ValueTask<DocumentFormattingOptions> GetDocumentFormattingOptionsAsync(this Document document, CancellationToken cancellationToken)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Formatting\LineFormattingOptionsProviders.cs (1)
17public static async ValueTask<LineFormattingOptions> GetLineFormattingOptionsAsync(this Document document, CancellationToken cancellationToken)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Formatting\SyntaxFormattingOptionsProviders.cs (2)
17public static ValueTask<SyntaxFormattingOptions> GetSyntaxFormattingOptionsAsync(this Document document, CancellationToken cancellationToken) 20public static async ValueTask<SyntaxFormattingOptions> GetSyntaxFormattingOptionsAsync(this Document document, ISyntaxFormatting formatting, CancellationToken cancellationToken)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\LanguageServices\GeneratedCodeRecognition\AbstractGeneratedCodeRecognitionService.cs (2)
25public async Task<bool> IsGeneratedCodeAsync(Document document, CancellationToken cancellationToken) 31private static bool IsGeneratedCode(SyntaxTree syntaxTree, Document document, CancellationToken cancellationToken)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\LanguageServices\GeneratedCodeRecognition\IGeneratedCodeRecognitionService.cs (1)
19Task<bool> IsGeneratedCodeAsync(Document document, CancellationToken cancellationToken);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\LanguageServices\InitializeParameter\AbstractInitializerParameterService.cs (4)
31Document document, IParameterSymbol parameter, ISymbol fieldOrProperty, CancellationToken cancellationToken); 83Document document, 112Document document, 127var newDocument = document.WithSyntaxRoot(editor.GetChangedRoot());
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\LanguageServices\InitializeParameter\IInitializeParameterService.cs (1)
22Document document, IParameterSymbol parameter, ISymbol fieldOrProperty, CancellationToken cancellationToken);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\LanguageServices\MoveDeclarationNearReference\AbstractMoveDeclarationNearReferenceService.cs (9)
35protected abstract Task<bool> TypesAreCompatibleAsync(Document document, ILocalSymbol localSymbol, TLocalDeclarationStatementSyntax declarationStatement, SyntaxNode right, CancellationToken cancellationToken); 37public async Task<(bool canMove, bool mayChangeSemantics)> CanMoveDeclarationNearReferenceAsync(Document document, SyntaxNode node, CancellationToken cancellationToken) 46private async Task<State> ComputeStateAsync(Document document, SyntaxNode node, CancellationToken cancellationToken) 76public async Task<Document> MoveDeclarationNearReferenceAsync( 77Document document, SyntaxNode localDeclarationStatement, CancellationToken cancellationToken) 118Document document, State state, SyntaxEditor editor, SyntaxAnnotation warningAnnotation, CancellationToken cancellationToken) 159Document document, State state, SyntaxEditor editor, SyntaxAnnotation warningAnnotation) 204Document document, 235Document document, State state)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\LanguageServices\MoveDeclarationNearReference\AbstractMoveDeclarationNearReferenceService.State.cs (2)
40Document document, 55Document document,
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\LanguageServices\MoveDeclarationNearReference\IMoveDeclarationNearReferenceService.cs (3)
19Task<(bool canMove, bool mayChangeSemantics)> CanMoveDeclarationNearReferenceAsync(Document document, SyntaxNode localDeclarationStatement, CancellationToken cancellationToken); 26Task<Document> MoveDeclarationNearReferenceAsync(Document document, SyntaxNode localDeclarationStatement, CancellationToken cancellationToken);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\LanguageServices\RemoveUnnecessaryImports\AbstractRemoveUnnecessaryImportsService.cs (6)
23public Task<Document> RemoveUnnecessaryImportsAsync(Document document, CancellationToken cancellationToken) 26public abstract Task<Document> RemoveUnnecessaryImportsAsync(Document fromDocument, Func<SyntaxNode, bool>? predicate, CancellationToken cancellationToken); 29Document document, Func<SyntaxNode, bool> predicate, CancellationToken cancellationToken) 36foreach (var current in document.GetLinkedDocuments())
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\LanguageServices\RemoveUnnecessaryImports\IRemoveUnnecessaryImportsService.cs (4)
14Task<Document> RemoveUnnecessaryImportsAsync(Document document, CancellationToken cancellationToken); 16Task<Document> RemoveUnnecessaryImportsAsync(Document fromDocument, Func<SyntaxNode, bool>? predicate, CancellationToken cancellationToken);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\LanguageServices\ReplaceDiscardDeclarationsWithAssignments\IReplaceDiscardDeclarationsWithAssignmentsService.cs (1)
32Task<SyntaxNode> ReplaceAsync(Document document, SyntaxNode memberDeclaration, CancellationToken cancellationToken);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\NamingStyles\NamingStylePreferencesProviders.cs (1)
15public static async ValueTask<NamingStylePreferences> GetNamingStylePreferencesAsync(this Document document, CancellationToken cancellationToken)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Options\MemberDisplayOptions.cs (1)
50public static async ValueTask<MemberDisplayOptions> GetMemberDisplayOptionsAsync(this Document document, CancellationToken cancellationToken)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Simplification\AbstractSimplificationService.cs (8)
54public async Task<Document> ReduceAsync( 55Document document, 86private async Task<Document> ReduceCoreAsync( 87Document document, 151Document document, 235var newDocument = document.WithSyntaxRoot(newRoot); 286private async Task<Document> RemoveUnusedNamespaceImportsAsync( 287Document document,
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Simplification\ISimplificationService.cs (2)
30Task<Document> ReduceAsync( 31Document document,
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Simplification\SimplifierOptionsProviders.cs (2)
17public static ValueTask<SimplifierOptions> GetSimplifierOptionsAsync(this Document document, CancellationToken cancellationToken) 20public static async ValueTask<SimplifierOptions> GetSimplifierOptionsAsync(this Document document, ISimplification simplification, CancellationToken cancellationToken)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Utilities\ParsedDocument.cs (5)
19/// Represents a <see cref="Document"/> content that has been parsed. 24/// In general, any feature API that accepts <see cref="ParsedDocument"/> should be synchronous and not access <see cref="Document"/> or <see cref="Solution"/> snapshots. 35public static async ValueTask<ParsedDocument> CreateAsync(Document document, CancellationToken cancellationToken) 70/// Equivalent semantics to <see cref="Document.GetTextChangesAsync(Document, CancellationToken)"/>
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Utilities\SemanticDocument.cs (2)
13internal sealed class SemanticDocument(Document document, SourceText text, SyntaxNode root, SemanticModel semanticModel) 18public static new async Task<SemanticDocument> CreateAsync(Document document, CancellationToken cancellationToken)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Utilities\SyntacticDocument.cs (4)
14public readonly Document Document; 18protected SyntacticDocument(Document document, SourceText text, SyntaxNode root) 28public static async ValueTask<SyntacticDocument> CreateAsync(Document document, CancellationToken cancellationToken) 37var newDocument = this.Document.WithSyntaxRoot(root);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\WorkspaceServices\SemanticModelReuse\ISemanticModelReuseWorkspaceService.cs (2)
19/// Don't call this directly. use <see cref="DocumentExtensions.ReuseExistingSpeculativeModelAsync(Document, SyntaxNode, CancellationToken)"/> (or an overload). 21ValueTask<SemanticModel> ReuseExistingSpeculativeModelAsync(Document document, SyntaxNode node, CancellationToken cancellationToken);
Microsoft.CodeAnalysis.CSharp.CodeStyle.Fixes (197)
src\Analyzers\CSharp\CodeFixes\AddBraces\CSharpAddBracesCodeFixProvider.cs (1)
32Document document, ImmutableArray<Diagnostic> diagnostics,
src\Analyzers\CSharp\CodeFixes\AddExplicitCast\CSharpAddExplicitCastCodeFixProvider.cs (1)
51Document document,
src\Analyzers\CSharp\CodeFixes\AddInheritdoc\AddInheritdocCodeFixProvider.cs (2)
38var document = context.Document; 67protected override async Task FixAllAsync(Document document, ImmutableArray<Diagnostic> diagnostics, SyntaxEditor editor, CancellationToken cancellationToken)
src\Analyzers\CSharp\CodeFixes\AssignOutParameters\AbstractAssignOutParametersCodeFixProvider.cs (4)
32var document = context.Document; 47protected abstract void TryRegisterFix(CodeFixContext context, Document document, SyntaxNode container, SyntaxNode location); 96Document document, ImmutableArray<Diagnostic> diagnostics, CancellationToken cancellationToken) 136Document document, ImmutableArray<Diagnostic> diagnostics,
src\Analyzers\CSharp\CodeFixes\AssignOutParameters\AssignOutParametersAboveReturnCodeFixProvider.cs (1)
26protected override void TryRegisterFix(CodeFixContext context, Document document, SyntaxNode container, SyntaxNode location)
src\Analyzers\CSharp\CodeFixes\AssignOutParameters\AssignOutParametersAtStartCodeFixProvider.cs (1)
24protected override void TryRegisterFix(CodeFixContext context, Document document, SyntaxNode container, SyntaxNode location)
src\Analyzers\CSharp\CodeFixes\ConditionalExpressionInStringInterpolation\CSharpAddParenthesesAroundConditionalExpressionInInterpolatedStringCodeFixProvider.cs (5)
52private static async Task<Document> GetChangedDocumentAsync(Document document, int conditionalExpressionSyntaxStartPosition, CancellationToken cancellationToken) 66var documentWithOpenParenthesis = document.WithText(textWithOpenParenthesis); 81private static async Task<Document> InsertCloseParenthesisAsync( 82Document document,
src\Analyzers\CSharp\CodeFixes\ConvertNamespace\ConvertNamespaceCodeFixProvider.cs (1)
52Document document, ImmutableArray<Diagnostic> diagnostics,
src\Analyzers\CSharp\CodeFixes\ConvertNamespace\ConvertNamespaceTransform.cs (8)
26public static Task<Document> ConvertAsync(Document document, BaseNamespaceDeclarationSyntax baseNamespace, CSharpSyntaxFormattingOptions options, CancellationToken cancellationToken) 37public static async Task<Document> ConvertNamespaceDeclarationAsync(Document document, NamespaceDeclarationSyntax namespaceDeclaration, SyntaxFormattingOptions options, CancellationToken cancellationToken) 44var updatedDocument = document.WithSyntaxRoot(updatedRoot); 238public static async Task<Document> ConvertFileScopedNamespaceAsync( 239Document document, FileScopedNamespaceDeclarationSyntax fileScopedNamespace, CSharpSyntaxFormattingOptions options, CancellationToken cancellationToken) 246var updatedDocument = document.WithSyntaxRoot(updatedRoot);
src\Analyzers\CSharp\CodeFixes\ConvertSwitchStatementToExpression\ConvertSwitchStatementToExpressionCodeFixProvider.cs (1)
52Document document, ImmutableArray<Diagnostic> diagnostics,
src\Analyzers\CSharp\CodeFixes\ConvertToRecord\ConvertToRecordEngine.cs (2)
34Document document, TypeDeclarationSyntax typeDeclaration, CancellationToken cancellationToken) 80Document document,
src\Analyzers\CSharp\CodeFixes\ConvertToRecord\CSharpConvertToRecordCodeFixProvider.cs (1)
31var document = context.Document;
src\Analyzers\CSharp\CodeFixes\DisambiguateSameVariable\CSharpDisambiguateSameVariableCodeFixProvider.cs (2)
39var document = context.Document; 133Document document, ImmutableArray<Diagnostic> diagnostics,
src\Analyzers\CSharp\CodeFixes\FixIncorrectConstraint\CSharpFixIncorrectConstraintCodeFixProvider.cs (1)
77Document document, ImmutableArray<Diagnostic> diagnostics,
src\Analyzers\CSharp\CodeFixes\FixReturnType\CSharpFixReturnTypeCodeFixProvider.cs (3)
38var document = context.Document; 62Document document, ImmutableArray<Diagnostic> diagnostics, CancellationToken cancellationToken) 127protected override async Task FixAllAsync(Document document, ImmutableArray<Diagnostic> diagnostics, SyntaxEditor editor, CancellationToken cancellationToken)
src\Analyzers\CSharp\CodeFixes\GenerateConstructor\GenerateConstructorCodeFixProvider.cs (1)
44Document document, SyntaxNode node, CancellationToken cancellationToken)
src\Analyzers\CSharp\CodeFixes\GenerateEnumMember\GenerateEnumMemberCodeFixProvider.cs (1)
32protected override Task<ImmutableArray<CodeAction>> GetCodeActionsAsync(Document document, SyntaxNode node, CancellationToken cancellationToken)
src\Analyzers\CSharp\CodeFixes\GenerateMethod\GenerateConversionCodeFixProvider.cs (1)
59Document document, SyntaxNode node, CancellationToken cancellationToken)
src\Analyzers\CSharp\CodeFixes\GenerateMethod\GenerateDeconstructMethodCodeFixProvider.cs (1)
49var document = context.Document;
src\Analyzers\CSharp\CodeFixes\GenerateMethod\GenerateMethodCodeFixProvider.cs (1)
82Document document, SyntaxNode node, CancellationToken cancellationToken)
src\Analyzers\CSharp\CodeFixes\GenerateParameterizedMember\CSharpGenerateParameterizedMemberService.cs (8)
34return Document.SemanticModel.GenerateParameterNames( 45var typeInference = Document.Document.GetLanguageService<ITypeInferenceService>(); 47Document.SemanticModel, _invocationExpression, objectAsDefault: true, 55var semanticModel = Document.SemanticModel; 74var semanticModel = Document.SemanticModel; 120var info = Document.SemanticModel.GetTypeInfo(type, cancellationToken); 135=> argument.DetermineParameterType(Document.SemanticModel, cancellationToken); 158var typeInfo = Document.SemanticModel.GetTypeInfo(typeArgument, cancellationToken);
src\Analyzers\CSharp\CodeFixes\GenerateVariable\CSharpGenerateVariableCodeFixProvider.cs (1)
55Document document, SyntaxNode node, CancellationToken cancellationToken)
src\Analyzers\CSharp\CodeFixes\HideBase\HideBaseCodeFixProvider.AddNewKeywordAction.cs (3)
23private sealed class AddNewKeywordAction(Document document, SyntaxNode node) : CodeAction 25private readonly Document _document = document; 30protected override async Task<Document> GetChangedDocumentAsync(CancellationToken cancellationToken)
src\Analyzers\CSharp\CodeFixes\ImplementInterface\CSharpImplementInterfaceService.cs (1)
42Document document, SemanticModel model, SyntaxNode node, CancellationToken cancellationToken,
src\Analyzers\CSharp\CodeFixes\InlineDeclaration\CSharpInlineDeclarationCodeFixProvider.cs (2)
45Document document, ImmutableArray<Diagnostic> diagnostics, 95Document document,
src\Analyzers\CSharp\CodeFixes\InvokeDelegateWithConditionalAccess\InvokeDelegateWithConditionalAccessCodeFixProvider.cs (1)
45Document document, ImmutableArray<Diagnostic> diagnostics,
src\Analyzers\CSharp\CodeFixes\Iterator\CSharpAddYieldCodeFixProvider.cs (1)
44protected override async Task<CodeAction?> GetCodeFixAsync(SyntaxNode root, SyntaxNode node, Document document, Diagnostic diagnostics, CancellationToken cancellationToken)
src\Analyzers\CSharp\CodeFixes\Iterator\CSharpChangeToIEnumerableCodeFixProvider.cs (2)
35protected override async Task<CodeAction?> GetCodeFixAsync(SyntaxNode root, SyntaxNode node, Document document, Diagnostic diagnostics, CancellationToken cancellationToken) 74Document? newDocument = null;
src\Analyzers\CSharp\CodeFixes\MakeAnonymousFunctionStatic\CSharpMakeAnonymousFunctionStaticCodeFixProvider.cs (1)
38protected override Task FixAllAsync(Document document, ImmutableArray<Diagnostic> diagnostics, SyntaxEditor editor, CancellationToken cancellationToken)
src\Analyzers\CSharp\CodeFixes\MakeLocalFunctionStatic\MakeLocalFunctionStaticCodeFixHelper.cs (3)
28public static async Task<Document> MakeLocalFunctionStaticAsync( 29Document document, 41Document document,
src\Analyzers\CSharp\CodeFixes\MakeLocalFunctionStatic\MakeLocalFunctionStaticCodeFixProvider.cs (1)
32Document document, ImmutableArray<Diagnostic> diagnostics, SyntaxEditor editor, CancellationToken cancellationToken)
src\Analyzers\CSharp\CodeFixes\MakeLocalFunctionStatic\PassInCapturedVariablesAsArgumentsCodeFixProvider.cs (3)
52protected override Task FixAllAsync(Document document, ImmutableArray<Diagnostic> diagnostics, SyntaxEditor editor, CancellationToken cancellationToken) 63Document document, 65Func<Document, LocalFunctionStatementSyntax, ImmutableArray<ISymbol>, Task> fixer,
src\Analyzers\CSharp\CodeFixes\MakeMemberRequired\CSharpMakeMemberRequiredCodeFixProvider.cs (2)
34var document = context.Document; 107protected override Task FixAllAsync(Document document, ImmutableArray<Diagnostic> diagnostics, SyntaxEditor editor, CancellationToken cancellationToken)
src\Analyzers\CSharp\CodeFixes\MakeRefStruct\MakeRefStructCodeFixProvider.cs (3)
37var document = context.Document; 63private static async Task<Document> FixCodeAsync( 64Document document,
src\Analyzers\CSharp\CodeFixes\MakeStatementAsynchronous\CSharpMakeStatementAsynchronousCodeFixProvider.cs (1)
48Document document, ImmutableArray<Diagnostic> diagnostics,
src\Analyzers\CSharp\CodeFixes\MakeStructFieldsWritable\CSharpMakeStructFieldsWritableCodeFixProvider.cs (1)
35Document document,
src\Analyzers\CSharp\CodeFixes\MakeStructMemberReadOnly\CSharpMakeStructMemberReadOnlyCodeFixProvider.cs (1)
36Document document,
src\Analyzers\CSharp\CodeFixes\MakeStructReadOnly\CSharpMakeStructReadOnlyCodeFixProvider.cs (1)
34Document document,
src\Analyzers\CSharp\CodeFixes\MisplacedUsingDirectives\MisplacedUsingDirectivesCodeFixProvider.cs (8)
57var document = context.Document; 83internal static async Task<Document> TransformDocumentIfRequiredAsync( 84Document document, 133private static async Task<Document> GetTransformedDocumentAsync( 134Document document, 156var newDocument = document.WithSyntaxRoot(newCompilationUnitWithHeader); 169Document document, CompilationUnitSyntax compilationUnit, ImmutableArray<UsingDirectiveSyntax> allUsingDirectives, CancellationToken cancellationToken) 185private static async Task<SyntaxNode> ExpandUsingDirectiveAsync(Document document, UsingDirectiveSyntax usingDirective, CancellationToken cancellationToken)
src\Analyzers\CSharp\CodeFixes\NewLines\ArrowExpressionClausePlacement\ArrowExpressionClausePlacementCodeFixProvider.cs (3)
33var document = context.Document; 44private static async Task<Document> UpdateDocumentAsync( 45Document document, ImmutableArray<Diagnostic> diagnostics, CancellationToken cancellationToken)
src\Analyzers\CSharp\CodeFixes\NewLines\ConditionalExpressionPlacement\ConditionalExpressionPlacementCodeFixProvider.cs (3)
33var document = context.Document; 44private static async Task<Document> UpdateDocumentAsync( 45Document document, ImmutableArray<Diagnostic> diagnostics, CancellationToken cancellationToken)
src\Analyzers\CSharp\CodeFixes\NewLines\ConsecutiveBracePlacement\ConsecutiveBracePlacementCodeFixProvider.cs (5)
33var document = context.Document; 44private static Task<Document> UpdateDocumentAsync(Document document, Diagnostic diagnostic, CancellationToken cancellationToken) 47public static async Task<Document> FixAllAsync(Document document, ImmutableArray<Diagnostic> diagnostics, CancellationToken cancellationToken)
src\Analyzers\CSharp\CodeFixes\NewLines\ConstructorInitializerPlacement\ConstructorInitializerPlacementCodeFixProvider.cs (3)
32var document = context.Document; 43private static async Task<Document> UpdateDocumentAsync( 44Document document, ImmutableArray<Diagnostic> diagnostics, CancellationToken cancellationToken)
src\Analyzers\CSharp\CodeFixes\NewLines\EmbeddedStatementPlacement\EmbeddedStatementPlacementCodeFixProvider.cs (3)
35var document = context.Document; 46public static async Task<Document> FixAllAsync(Document document, ImmutableArray<Diagnostic> diagnostics, CancellationToken cancellationToken)
src\Analyzers\CSharp\CodeFixes\Nullable\CSharpDeclareAsNullableCodeFixProvider.cs (4)
75Document document, 93protected override bool IncludeDiagnosticDuringFixAll(Diagnostic diagnostic, Document document, string? equivalenceKey, CancellationToken cancellationToken) 100Document document, SemanticModel model, SyntaxEditor editor, SyntaxNode node, HashSet<TypeSyntax> alreadyHandled, CancellationToken cancellationToken) 112Document document, SemanticModel? model, SyntaxNode node, CancellationToken cancellationToken)
src\Analyzers\CSharp\CodeFixes\RemoveConfusingSuppression\CSharpRemoveConfusingSuppressionCodeFixProvider.cs (3)
36var document = context.Document; 57private static async Task<Document> FixAllAsync( 58Document document, ImmutableArray<Diagnostic> diagnostics,
src\Analyzers\CSharp\CodeFixes\RemoveInKeyword\RemoveInKeywordCodeFixProvider.cs (2)
54private static async Task<Document> FixAsync( 55Document document,
src\Analyzers\CSharp\CodeFixes\RemoveNewModifier\RemoveNewModifierCodeFixProvider.cs (2)
56private static async Task<Document> FixAsync( 57Document document,
src\Analyzers\CSharp\CodeFixes\RemoveUnnecessaryCast\CSharpRemoveUnnecessaryCastCodeFixProvider.cs (1)
39Document document, ImmutableArray<Diagnostic> diagnostics,
src\Analyzers\CSharp\CodeFixes\RemoveUnnecessaryDiscardDesignation\CSharpRemoveUnnecessaryDiscardDesignationCodeFixProvider.cs (1)
35Document document, ImmutableArray<Diagnostic> diagnostics,
src\Analyzers\CSharp\CodeFixes\RemoveUnnecessaryLambdaExpression\CSharpRemoveUnnecessaryLambdaExpressionCodeFixProvider.cs (1)
41Document document, ImmutableArray<Diagnostic> diagnostics,
src\Analyzers\CSharp\CodeFixes\RemoveUnnecessaryNullableDirective\CSharpRemoveUnnecessaryNullableDirectiveCodeFixProvider.cs (1)
50Document document,
src\Analyzers\CSharp\CodeFixes\RemoveUnreachableCode\CSharpRemoveUnreachableCodeCodeFixProvider.cs (1)
51Document document,
src\Analyzers\CSharp\CodeFixes\RemoveUnusedLocalFunction\CSharpRemoveUnusedLocalFunctionCodeFixProvider.cs (1)
42protected override Task FixAllAsync(Document document, ImmutableArray<Diagnostic> diagnostics, SyntaxEditor editor, CancellationToken cancellationToken)
src\Analyzers\CSharp\CodeFixes\ReplaceDefaultLiteral\CSharpReplaceDefaultLiteralCodeFixProvider.cs (3)
64private static async Task<Document> ReplaceAsync( 65Document document, TextSpan span, SyntaxNode newExpression, CancellationToken cancellationToken) 77Document document,
src\Analyzers\CSharp\CodeFixes\SimplifyLinqExpression\CSharpSimplifyLinqTypeCheckAndCastCodeFixProvider.cs (1)
37Document document,
src\Analyzers\CSharp\CodeFixes\SimplifyPropertyPattern\CSharpSimplifyPropertyPatternCodeFixProvider.cs (1)
39Document document, ImmutableArray<Diagnostic> diagnostics,
src\Analyzers\CSharp\CodeFixes\TransposeRecordKeyword\CSharpTransposeRecordKeywordCodeFixProvider.cs (1)
96Document document, ImmutableArray<Diagnostic> diagnostics,
src\Analyzers\CSharp\CodeFixes\UseCollectionExpression\CSharpCollectionExpressionRewriter.cs (1)
38Document workspaceDocument,
src\Analyzers\CSharp\CodeFixes\UseCollectionExpression\CSharpUseCollectionExpressionForArrayCodeFixProvider.cs (1)
36Document document,
src\Analyzers\CSharp\CodeFixes\UseCollectionExpression\CSharpUseCollectionExpressionForBuilderCodeFixProvider.cs (4)
38Document document, 105static async Task<Document> CreateTrackedDocumentAsync( 106Document document, 127var newDocument = document.WithSyntaxRoot(newRoot.ReplaceNode(creationExpression, dummyObjectCreation));
src\Analyzers\CSharp\CodeFixes\UseCollectionExpression\CSharpUseCollectionExpressionForCreateCodeFixProvider.cs (1)
37Document document,
src\Analyzers\CSharp\CodeFixes\UseCollectionExpression\CSharpUseCollectionExpressionForEmptyCodeFixProvider.cs (1)
35Document document,
src\Analyzers\CSharp\CodeFixes\UseCollectionExpression\CSharpUseCollectionExpressionForFluentCodeFixProvider.cs (2)
45Document document, 142Document document,
src\Analyzers\CSharp\CodeFixes\UseCollectionExpression\CSharpUseCollectionExpressionForNewCodeFixProvider.cs (1)
36Document document,
src\Analyzers\CSharp\CodeFixes\UseCollectionExpression\CSharpUseCollectionExpressionForStackAllocCodeFixProvider.cs (1)
32Document document,
src\Analyzers\CSharp\CodeFixes\UseCollectionInitializer\CSharpUseCollectionInitializerCodeFixProvider.cs (1)
37Document document,
src\Analyzers\CSharp\CodeFixes\UseCollectionInitializer\CSharpUseCollectionInitializerCodeFixProvider_CollectionExpression.cs (1)
22Document document,
src\Analyzers\CSharp\CodeFixes\UseCompoundAssignment\CSharpUseCompoundCoalesceAssignmentCodeFixProvider.cs (1)
41Document document, ImmutableArray<Diagnostic> diagnostics,
src\Analyzers\CSharp\CodeFixes\UseDeconstruction\CSharpUseDeconstructionCodeFixProvider.cs (2)
40Document document, ImmutableArray<Diagnostic> diagnostics, 59Document document,
src\Analyzers\CSharp\CodeFixes\UseDefaultLiteral\CSharpUseDefaultLiteralCodeFixProvider.cs (1)
35Document document, ImmutableArray<Diagnostic> diagnostics,
src\Analyzers\CSharp\CodeFixes\UseExplicitArrayInExpressionTree\CSharpUseExplicitArrayInExpressionTreeCodeFixProvider.cs (1)
115protected override async Task FixAllAsync(Document document, ImmutableArray<Diagnostic> diagnostics, SyntaxEditor editor, CancellationToken cancellationToken)
src\Analyzers\CSharp\CodeFixes\UseExplicitTypeForConst\UseExplicitTypeForConstCodeFixProvider.cs (3)
36var document = context.Document; 61private static async Task<Document> FixAsync( 62Document document, TextSpan span, ITypeSymbol type, CancellationToken cancellationToken)
src\Analyzers\CSharp\CodeFixes\UseExpressionBody\UseExpressionBodyCodeFixProvider.cs (1)
54Document document, ImmutableArray<Diagnostic> diagnostics,
src\Analyzers\CSharp\CodeFixes\UseExpressionBodyForLambda\UseExpressionBodyForLambdaCodeFixProvider.cs (5)
29var document = context.Document; 42protected override Task FixAllAsync(Document document, ImmutableArray<Diagnostic> diagnostics, SyntaxEditor editor, CancellationToken cancellationToken) 45private static async Task FixAllImplAsync(Document document, ImmutableArray<Diagnostic> diagnostics, SyntaxEditor editor, CancellationToken cancellationToken) 55private static Task<Document> FixWithSyntaxEditorAsync(Document document, Diagnostic diagnostic, CancellationToken cancellationToken)
src\Analyzers\CSharp\CodeFixes\UseImplicitObjectCreation\CSharpUseImplicitObjectCreationCodeFixProvider.cs (1)
45Document document, ImmutableArray<Diagnostic> diagnostics,
src\Analyzers\CSharp\CodeFixes\UseImplicitOrExplicitType\UseExplicitTypeCodeFixProvider.cs (6)
42Document document, ImmutableArray<Diagnostic> diagnostics, 55Document document, SyntaxEditor editor, 83private static async Task HandleDeclarationExpressionAsync(Document document, SyntaxEditor editor, DeclarationExpressionSyntax declarationExpression, CancellationToken cancellationToken) 110private static Task HandleForEachStatementAsync(Document document, SyntaxEditor editor, ForEachStatementSyntax forEach, CancellationToken cancellationToken) 118private static Task HandleVariableDeclarationAsync(Document document, SyntaxEditor editor, VariableDeclarationSyntax varDecl, CancellationToken cancellationToken) 130Document document,
src\Analyzers\CSharp\CodeFixes\UseImplicitOrExplicitType\UseImplicitTypeCodeFixProvider.cs (1)
33Document document, ImmutableArray<Diagnostic> diagnostics,
src\Analyzers\CSharp\CodeFixes\UseIndexOrRangeOperator\CSharpUseIndexOperatorCodeFixProvider.cs (1)
36Document document, ImmutableArray<Diagnostic> diagnostics,
src\Analyzers\CSharp\CodeFixes\UseIndexOrRangeOperator\CSharpUseRangeOperatorCodeFixProvider.cs (1)
46Document document, ImmutableArray<Diagnostic> diagnostics,
src\Analyzers\CSharp\CodeFixes\UseInterpolatedVerbatimString\CSharpUseInterpolatedVerbatimStringCodeFixProvider.cs (1)
36Document document, ImmutableArray<Diagnostic> diagnostics,
src\Analyzers\CSharp\CodeFixes\UseIsNullCheck\CSharpUseIsNullCheckForCastAndEqualityOperatorCodeFixProvider.cs (1)
54Document document, ImmutableArray<Diagnostic> diagnostics,
src\Analyzers\CSharp\CodeFixes\UseIsNullCheck\CSharpUseNullCheckOverTypeCheckCodeFixProvider.cs (1)
39Document document, ImmutableArray<Diagnostic> diagnostics,
src\Analyzers\CSharp\CodeFixes\UseLocalFunction\CSharpUseLocalFunctionCodeFixProvider.cs (2)
52Document document, ImmutableArray<Diagnostic> diagnostics, 176Document document, SyntaxNode currentRoot,
src\Analyzers\CSharp\CodeFixes\UseNameofInAttribute\CSharpUseNameofInAttributeCodeFixProvider.cs (1)
37Document document,
src\Analyzers\CSharp\CodeFixes\UsePatternCombinators\CSharpUsePatternCombinatorsCodeFixProvider.cs (2)
52Diagnostic diagnostic, Document document, string? equivalenceKey, CancellationToken cancellationToken) 73Document document, ImmutableArray<Diagnostic> diagnostics,
src\Analyzers\CSharp\CodeFixes\UsePatternMatching\CSharpAsAndMemberAccessCodeFixProvider.cs (1)
40Document document, ImmutableArray<Diagnostic> diagnostics,
src\Analyzers\CSharp\CodeFixes\UsePatternMatching\CSharpAsAndNullCheckCodeFixProvider.cs (1)
40Document document, ImmutableArray<Diagnostic> diagnostics,
src\Analyzers\CSharp\CodeFixes\UsePatternMatching\CSharpIsAndCastCheckCodeFixProvider.cs (1)
37Document document, ImmutableArray<Diagnostic> diagnostics,
src\Analyzers\CSharp\CodeFixes\UsePatternMatching\CSharpUseNotPatternCodeFixProvider.cs (1)
35Document document, ImmutableArray<Diagnostic> diagnostics,
src\Analyzers\CSharp\CodeFixes\UsePrimaryConstructor\CSharpUsePrimaryConstructorCodeFixProvider.cs (3)
59var document = context.Document; 96Document document, 112Document document,
src\Analyzers\CSharp\CodeFixes\UseSimpleUsingStatement\UseSimpleUsingStatementCodeFixProvider.cs (1)
46Document document, ImmutableArray<Diagnostic> diagnostics,
src\Analyzers\CSharp\CodeFixes\UseSystemThreadingLock\CSharpUseSystemThreadingLockCodeFixProvider.cs (3)
43var document = context.Document; 62Document document, 77Document document,
src\Analyzers\CSharp\CodeFixes\UseThrowExpression\UseThrowExpressionCodeFixProvider.cs (1)
40Document document, ImmutableArray<Diagnostic> diagnostics,
src\Analyzers\CSharp\CodeFixes\UseTupleSwap\CSharpUseTupleSwapCodeFixProvider.cs (1)
37Document document, ImmutableArray<Diagnostic> diagnostics,
src\Analyzers\CSharp\CodeFixes\UseUnboundGenericTypeInNameOf\CSharpUseUnboundGenericTypeInNameOfCodeFixProvider.cs (1)
40Document document, ImmutableArray<Diagnostic> diagnostics,
src\Analyzers\CSharp\CodeFixes\UseUtf8StringLiteral\UseUtf8StringLiteralCodeFixProvider.cs (1)
43Document document, ImmutableArray<Diagnostic> diagnostics,
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\CodeGeneration\CSharpCodeGenerationService.cs (1)
62public override async Task<Document> AddEventAsync(
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\ContextQuery\CSharpSyntaxContext.cs (3)
51Document document, 179public static CSharpSyntaxContext CreateContext(Document document, SemanticModel semanticModel, int position, CancellationToken cancellationToken) 183Document document, SemanticModel semanticModel, int position, CancellationToken cancellationToken)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\ContextQuery\CSharpSyntaxContextService.cs (1)
18public SyntaxContext CreateContext(Document document, SemanticModel semanticModel, int position, CancellationToken cancellationToken)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Formatting\CSharpSyntaxFormattingOptionsProviders.cs (1)
14public static async ValueTask<CSharpSyntaxFormattingOptions> GetCSharpSyntaxFormattingOptionsAsync(this Document document, CancellationToken cancellationToken)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\LanguageServices\CSharpMoveDeclarationNearReferenceService.cs (1)
53Document document, ILocalSymbol localSymbol,
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\LanguageServices\CSharpRemoveUnnecessaryImportsService.cs (2)
37public override async Task<Document> RemoveUnnecessaryImportsAsync( 38Document document,
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\LanguageServices\CSharpReplaceDiscardDeclarationsWithAssignmentsService.cs (1)
39Document document,
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\LanguageServices\InitializeParameter\CSharpInitializeParameterService.cs (1)
109protected override Task<Solution> TryAddAssignmentForPrimaryConstructorAsync(Document document, IParameterSymbol parameter, ISymbol fieldOrProperty, CancellationToken cancellationToken)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\LanguageServices\InitializeParameter\InitializeParameterHelpers.cs (1)
35Document document,
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Simplification\CSharpSimplifierOptionsProviders.cs (1)
14public static async ValueTask<CSharpSimplifierOptions> GetCSharpSimplifierOptionsAsync(this Document document, CancellationToken cancellationToken)
Microsoft.CodeAnalysis.CSharp.EditorFeatures (42)
BlockCommentEditing\BlockCommentEditingCommandHandler.cs (1)
278var document = snapshot.GetOpenDocumentInCurrentContextWithChanges();
CommentSelection\CSharpToggleBlockCommentCommandHandler.cs (1)
41protected override ImmutableArray<TextSpan> GetBlockCommentsInDocument(Document document, ITextSnapshot snapshot,
CompleteStatement\CompleteStatementCommandHandler.cs (2)
109var document = caret.Snapshot.GetOpenDocumentInCurrentContextWithChanges(); 193Document document,
ConvertNamespace\ConvertNamespaceCommandHandler.cs (1)
114var document = subjectBuffer.CurrentSnapshot.GetOpenDocumentInCurrentContextWithChanges();
EventHookup\EventHookupCommandHandler_TabKeyCommand.cs (7)
89var document = currentSnapshot.GetOpenDocumentInCurrentContextWithChanges(); 119Document document, 190Document document, Task<string?> eventNameTask, int position, CancellationToken cancellationToken) 197var documentWithNameAndAnnotationsAdded = await AddMethodNameAndAnnotationsToSolutionAsync( 239private static async Task<Document?> AddMethodNameAndAnnotationsToSolutionAsync( 240Document document, 265var documentWithNameAdded = document.WithText(newText);
EventHookup\EventHookupCommandHandler_TypeCharCommand.cs (1)
49var document = args.SubjectBuffer.CurrentSnapshot.GetOpenDocumentInCurrentContextWithChanges();
EventHookup\EventHookupSessionManager.cs (1)
128Document document,
EventHookup\EventHookupSessionManager_EventHookupSession.cs (3)
89Document document, 129private async Task<string?> DetermineIfEventHookupAndGetHandlerNameAsync(Document document, int position, CancellationToken cancellationToken) 168private async Task<SyntaxToken?> GetPlusEqualsTokenInsideAddAssignExpressionAsync(Document document, int position, CancellationToken cancellationToken)
FixInterpolatedVerbatimString\FixInterpolatedVerbatimStringCommandHandler.cs (1)
75var document = snapshot.GetOpenDocumentInCurrentContextWithChanges();
Formatting\CSharpFormattingInteractionService.cs (5)
44public bool SupportsFormattingOnTypedCharacter(Document document, char ch) 78Document document, 92public Task<ImmutableArray<TextChange>> GetFormattingChangesOnPasteAsync(Document document, ITextBuffer textBuffer, TextSpan textSpan, CancellationToken cancellationToken) 100public Task<ImmutableArray<TextChange>> GetFormattingChangesOnReturnAsync(Document document, int caretPosition, CancellationToken cancellationToken) 103public Task<ImmutableArray<TextChange>> GetFormattingChangesAsync(Document document, ITextBuffer textBuffer, char typedChar, int position, CancellationToken cancellationToken)
GoToBase\CSharpGoToBaseService.cs (1)
32var document = solution.GetDocument(constructorDeclaration.SyntaxTree);
NavigationBar\CSharpEditorNavigationBarItemService.cs (1)
23protected override async Task<bool> TryNavigateToItemAsync(Document document, WrappedNavigationBarItem item, ITextView textView, ITextVersion textVersion, CancellationToken cancellationToken)
RawStringLiteral\RawStringLiteralCommandHandler_Return.cs (1)
56var document = currentSnapshot.GetOpenDocumentInCurrentContextWithChanges();
RawStringLiteral\RawStringLiteralCommandHandler_TypeChar.cs (3)
109var document = snapshot.GetOpenDocumentInCurrentContextWithChanges(); 161var document = snapshot.GetOpenDocumentInCurrentContextWithChanges(); 210var document = snapshot.GetOpenDocumentInCurrentContextWithChanges();
SplitStringLiteral\SplitStringLiteralCommandHandler.cs (1)
78var document = subjectBuffer.CurrentSnapshot.GetOpenDocumentInCurrentContextWithChanges();
StringCopyPaste\AbstractPasteProcessor.cs (4)
47protected readonly Document DocumentBeforePaste; 52protected readonly Document DocumentAfterPaste; 98Document documentBeforePaste, 99Document documentAfterPaste,
StringCopyPaste\KnownSourcePasteProcessor.cs (2)
31Document documentBeforePaste, 32Document documentAfterPaste,
StringCopyPaste\StringCopyPasteCommandHandler.cs (3)
115var documentBeforePaste = snapshotBeforePaste.GetOpenDocumentInCurrentContextWithChanges(); 116var documentAfterPaste = snapshotAfterPaste.GetOpenDocumentInCurrentContextWithChanges(); 270Document documentAfterPaste,
StringCopyPaste\StringCopyPasteCommandHandler_CutCopy.cs (1)
54var document = subjectBuffer.CurrentSnapshot.GetOpenDocumentInCurrentContextWithChanges();
StringCopyPaste\UnknownSourcePasteProcessor.cs (2)
32Document documentBeforePaste, 33Document documentAfterPaste,
Microsoft.CodeAnalysis.CSharp.EditorFeatures.UnitTests (111)
Classification\SyntacticClassifierTests.cs (3)
24var document = workspace.CurrentSolution.Projects.First().Documents.First(); 6050var document = workspace.CurrentSolution.Projects.First().Documents.First(); 6080var document = workspace.CurrentSolution.Projects.First().Documents.First();
CodeActions\ApplyChangesOperationTests.cs (11)
79var document1 = solution.Projects.Single().Documents.Single(d => d.FilePath!.Contains("Program1")); 84var document2 = solution.Projects.Single().Documents.Single(d => d.FilePath!.Contains("Program2")); 111var document1 = solution.Projects.Single().Documents.Single(d => d.FilePath!.Contains("Program1")); 116var document2 = solution.Projects.Single().Documents.Single(d => d.FilePath!.Contains("Program2")); 143var document1 = solution.Projects.Single().Documents.Single(d => d.FilePath!.Contains("Program1")); 148var document1 = solution.Projects.Single().Documents.Single(d => d.FilePath!.Contains("Program1")); 174var document1 = solution.Projects.Single().Documents.Single(d => d.FilePath!.Contains("Program1")); 179var document1 = solution.Projects.Single().Documents.Single(d => d.FilePath!.Contains("Program1")); 206var document1 = solution.Projects.Single().Documents.Single(d => d.FilePath!.Contains("Program1")); 211var document2 = solution.Projects.Single().Documents.Single(d => d.FilePath!.Contains("Program2")); 243var document = GetDocument(workspace);
CodeActions\MoveType\MoveTypeTests.MoveScope.cs (1)
919var documentToModify = workspace.CurrentSolution.GetDocument(documentToModifyId);
CodeActions\Preview\ErrorCases\ExceptionInCodeAction.cs (3)
48protected override Task<Document> GetChangedDocumentAsync(CancellationToken cancellationToken) 54protected override Task<Document> PostProcessChangesAsync(Document document, CancellationToken cancellationToken)
CodeActions\PreviewExceptionTests.cs (2)
94RefactoringSetup(workspace, provider, codeActions, out extensionManager, out var textBuffer, out var document); 106out Document document)
CodeActions\PreviewTests.cs (4)
54private readonly Document _oldDocument; 56public TestCodeAction(Document document) 91private async Task<(Document document, SolutionPreviewResult previews)> GetMainDocumentAndPreviewsAsync(TestParameters parameters, EditorTestWorkspace workspace) 93var document = GetDocument(workspace);
CodeActions\SyncNamespace\CSharpSyncNamespaceTestsBase.cs (2)
85var newDocument = GetDocumentToVerify(expectedChangedDocumentId: null, oldSolution, newSolution); 169var modifiedOriginalDocument = newSolution.GetDocument(originalDocumentId);
CodeGeneration\SyntaxGeneratorTests.cs (3)
36var document = solution.Projects.Single().Documents.Single(); 46var newDocument = document.WithSyntaxRoot(newRoot); 70var document = solution.Projects.Single().Documents.Single();
Completion\CompletionProviders\AbstractCSharpCompletionProviderTests.cs (1)
181var document = workspace.CurrentSolution.GetDocument(documentId);
Completion\CompletionProviders\DeclarationNameCompletionProviderTests_NameDeclarationInfoTests.cs (1)
809private (Document, int) ApplyChangesToFixture(string markup)
Completion\CompletionProviders\ObjectInitializerCompletionProviderTests.cs (2)
690var document = workspace.CurrentSolution.GetDocument(hostDocument.Id); 1350var document = workspace.CurrentSolution.GetDocument(hostDocument.Id);
Completion\CompletionProviders\SuggestionModeCompletionProviderTests.cs (3)
1512var document1 = workspaceFixture.UpdateDocument(code, SourceCodeKind.Regular); 1517var document2 = workspaceFixture.UpdateDocument(code, SourceCodeKind.Regular, cleanBeforeUpdate: false); 1522private async Task CheckResultsAsync(Document document, int position, bool isBuilder)
Completion\CompletionProviders\SymbolCompletionProviderTests_NoInteractive.cs (2)
376var document = workspace.CurrentSolution.GetDocument(testDocument.Id); 387var currentDocument = workspace.CurrentSolution.GetDocument(testDocument.Id);
Completion\CompletionServiceTests.cs (6)
37var document = workspace 51var document = workspace.CurrentSolution 109var document = workspace.CurrentSolution 138var document = workspace.CurrentSolution.GetDocument(testDocument.Id); 170var document = workspace 212var document = workspace.CurrentSolution.Projects.Single().Documents.Single();
Debugging\ProximityExpressionsGetterTests.cs (2)
69Func<CSharpProximityExpressionsService, Document, int, Task> continuation) 76var document = workspace.CurrentSolution.GetDocument(testDocument.Id);
DecompiledSource\DecompiledSourceFormattingTests.cs (1)
256var document = workspace.CurrentSolution.Projects.Single().Documents.Single();
Diagnostics\DiagnosticAnalyzerDriver\DiagnosticAnalyzerDriverTests.cs (6)
63var document = workspace.CurrentSolution.Projects.Single().Documents.Single(); 92var ideEngineDocument = ideEngineWorkspace.CurrentSolution.Projects.Single().Documents.Single(); 174var sourceDocument = workspace.CurrentSolution.Projects.Single().Documents.Single(); 204var ideEngineDocument = workspace.CurrentSolution.Projects.Single().Documents.Single(); 260var ideEngineDocument = ideEngineWorkspace.CurrentSolution.Projects.Single().Documents.Single(); 797var document = project.Documents.Single();
Diagnostics\FixAllProvider\BatchFixerTests.cs (1)
84var newDocument = context.Document.WithSyntaxRoot(newRoot);
EditAndContinue\ActiveStatementTrackingServiceTests.cs (2)
65var document1 = project.Documents.Single(d => d.Name == "1.cs"); 66var document2 = project.Documents.Single(d => d.Name == "2.cs");
EncapsulateField\EncapsulateFieldTestState.cs (1)
28public Document TargetDocument { get; }
ExtractMethod\ExtractMethodBase.cs (3)
122var document = workspace.CurrentSolution.GetDocument(testDocument.Id); 173var document = workspace.CurrentSolution.GetDocument(testDocument.Id); 197var document = workspace.CurrentSolution.GetDocument(workspace.Documents.First().Id);
Formatting\CodeCleanupTests.cs (3)
809var document = workspace.CurrentSolution.GetDocument(hostdoc.Id); 826var document = workspace.CurrentSolution.GetDocument(hostdoc.Id); 908var document = workspace.CurrentSolution.GetDocument(hostdoc.Id);
Formatting\FormattingEngineTests.cs (1)
439var document = workspace.CurrentSolution.Projects.Single().Documents.Single();
Formatting\Indentation\CSharpFormatterTestsBase.cs (1)
73var document = buffer.CurrentSnapshot.GetRelatedDocumentsWithChanges().First();
Formatting\Indentation\SmartIndenterEnterOnTokenTests.cs (2)
1405var document = workspace.CurrentSolution.GetDocument(hostdoc.Id); 1446var document = workspace.CurrentSolution.GetDocument(hostdoc.Id);
Formatting\Indentation\SmartTokenFormatterFormatRangeTests.cs (1)
3418var document = workspace.CurrentSolution.GetDocument(testDocument.Id);
Formatting\RazorLineFormattingOptionsTests.cs (2)
67var document = workspace.AddDocument(documentInfo); 70var formattedDocument = await Formatter.FormatAsync(document, spans: null, options: null, CancellationToken.None);
Intents\IntentTestsBase.cs (1)
116var currentDocument = currentTextBuffer.CurrentSnapshot.GetOpenDocumentInCurrentContextWithChanges();
NavigateTo\NavigateToSearcherTests.cs (16)
41It.IsAny<ImmutableArray<Document>>(), 44It.IsAny<Document?>(), 50ImmutableArray<Document> priorityDocuments, 53Document? activeDocument, 67It.IsAny<Document?>(), 75Document? activeDocument, 91It.IsAny<ImmutableArray<Document>>(), 94It.IsAny<Document?>(), 100ImmutableArray<Document> priorityDocuments, 103Document? activeDocument, 368public Task SearchCachedDocumentsAsync(Solution solution, ImmutableArray<Project> projects, ImmutableArray<Document> priorityDocuments, string searchPattern, IImmutableSet<string> kinds, Document? activeDocument, Func<ImmutableArray<INavigateToSearchResult>, Task> onResultsFound, Func<Task> onProjectCompleted, CancellationToken cancellationToken) 374public Task SearchDocumentAsync(Document document, string searchPattern, IImmutableSet<string> kinds, Func<ImmutableArray<INavigateToSearchResult>, Task> onResultsFound, CancellationToken cancellationToken) 380public Task SearchGeneratedDocumentsAsync(Solution solution, ImmutableArray<Project> projects, string searchPattern, IImmutableSet<string> kinds, Document? activeDocument, Func<ImmutableArray<INavigateToSearchResult>, Task> onResultsFound, Func<Task> onProjectCompleted, CancellationToken cancellationToken) 386public Task SearchProjectsAsync(Solution solution, ImmutableArray<Project> projects, ImmutableArray<Document> priorityDocuments, string searchPattern, IImmutableSet<string> kinds, Document? activeDocument, Func<ImmutableArray<INavigateToSearchResult>, Task> onResultsFound, Func<Task> onProjectCompleted, CancellationToken cancellationToken)
Organizing\AbstractOrganizerTests.cs (1)
29var document = workspace.CurrentSolution.GetDocument(workspace.Documents.First().Id);
PdbSourceDocument\NullResultMetadataAsSourceFileProvider.cs (1)
46public Project? MapDocument(Document document)
QuickInfo\DiagnosticAnalyzerQuickInfoSourceTests.cs (4)
178private static async Task AssertContentIsAsync(EditorTestWorkspace workspace, Document document, int position, string expectedDescription, 189private static async Task<QuickInfoItem> GetQuickinfo(EditorTestWorkspace workspace, Document document, int position) 197private static async Task AssertNoContentAsync(EditorTestWorkspace workspace, Document document, int position) 217var document = workspace.CurrentSolution.Projects.First().Documents.First();
QuickInfo\SemanticQuickInfoSourceTests.cs (1)
74private static async Task TestWithOptionsAsync(Document document, QuickInfoService service, int position, Action<QuickInfoItem>[] expectedResults)
QuickInfo\SyntacticQuickInfoSourceTests.cs (3)
535Document document, 544Document document, 604var document = workspace.CurrentSolution.Projects.First().Documents.First();
Structure\CommentStructureTests.cs (1)
34internal override async Task<ImmutableArray<BlockSpan>> GetBlockSpansWorkerAsync(Document document, BlockStructureOptions options, int position)
Structure\MetadataAsSource\InvalidIdentifierStructureTests.cs (1)
29internal override async Task<ImmutableArray<BlockSpan>> GetBlockSpansWorkerAsync(Document document, BlockStructureOptions options, int position)
TaskList\NoCompilationTaskListTests.cs (1)
62public Task<ImmutableArray<TaskListItem>> GetTaskListItemsAsync(Document document, ImmutableArray<TaskListItemDescriptor> descriptors, CancellationToken cancellationToken)
TypeInferrer\TypeInferrerTests.cs (1)
25protected override async Task TestWorkerAsync(Document document, TextSpan textSpan, string expectedType, TestMode mode)
Workspaces\WorkspaceTests_EditorFeatures.cs (10)
513var docZ = solutionZ.GetDocument(document1.Id); 573var doc1Z = cs.GetDocument(document1.Id); 644var doc1Z = cs.GetDocument(document1.Id); 649var doc2Z = cs.GetDocument(document2.Id); 650var partialDoc2Z = doc2Z.WithFrozenPartialSemantics(CancellationToken.None); 666var doc1Z = cs.GetDocument(document1.Id); 671var doc2Z = cs.GetDocument(document2.Id); 705var doc = solution.Projects.Single().Documents.First(); 1059var doc = project.GetDocument(additionalDoc.Id); 1083var doc = project.GetDocument(analyzerConfigDoc.Id);
Microsoft.CodeAnalysis.CSharp.EditorFeatures2.UnitTests (1)
Recommendations\RecommenderTests.cs (1)
61var document = project.AddDocument("test.cs", text);
Microsoft.CodeAnalysis.CSharp.Features (471)
AddDebuggerDisplay\CSharpAddDebuggerDisplayCodeRefactoringProvider.cs (1)
24protected override bool SupportsConstantInterpolatedStrings(Document document)
AddImport\CSharpAddImportFeatureService.cs (7)
293Document document, 342protected override async Task<Document> AddImportAsync( 345Document document, 355Document document, CompilationUnitSyntax root, SyntaxNode contextNode, INamespaceOrTypeSymbol namespaceOrTypeSymbol, 390protected override async Task<Document> AddImportAsync( 392Document document, AddImportPlacementOptions options, CancellationToken cancellationToken) 439Document document,
BraceCompletion\LessAndGreaterThanBraceCompletionService.cs (2)
38protected override ValueTask<bool> IsValidOpenBraceTokenAtPositionAsync(Document document, SyntaxToken token, int position, CancellationToken cancellationToken) 65static async ValueTask<bool> IsSemanticTypeArgumentAsync(Document document, int position, IdentifierNameSyntax identifier, CancellationToken cancellationToken)
BraceMatching\BlockCommentBraceMatcher.cs (1)
21public async Task<BraceMatchingResult?> FindBracesAsync(Document document, int position, BraceMatchingOptions options, CancellationToken cancellationToken)
BraceMatching\StringLiteralBraceMatcher.cs (1)
26public async Task<BraceMatchingResult?> FindBracesAsync(Document document, int position, BraceMatchingOptions options, CancellationToken cancellationToken)
ChangeSignature\CSharpChangeSignatureService.cs (5)
116Document document, int position, bool restrictToDeclarations, CancellationToken cancellationToken) 239public override SyntaxNode? FindNodeToUpdate(Document document, SyntaxNode node) 769Document document, 852Document document, 889protected override ImmutableArray<AbstractFormattingRule> GetFormattingRules(Document document)
CodeFixes\GenerateType\GenerateTypeCodeFixProvider.cs (1)
51Document document, SyntaxNode node, CancellationToken cancellationToken)
CodeLens\CSharpCodeLensMemberFinder.cs (1)
27public async Task<ImmutableArray<CodeLensMember>> GetCodeLensMembersAsync(Document document, CancellationToken cancellationToken)
CodeRefactorings\ConvertLocalFunctionToMethod\CSharpConvertLocalFunctionToMethodCodeRefactoringProvider.cs (2)
66private static async Task<Document> UpdateDocumentAsync( 67Document document,
CodeRefactorings\EnableNullable\EnableNullableCodeRefactoringProvider.cs (2)
96private static async Task<SyntaxNode> EnableNullableReferenceTypesAsync(Document document, CancellationToken cancellationToken) 161private static async Task<SyntaxNode> DisableNullableReferenceTypesInExistingDocumentIfNecessaryAsync(Document document, SyntaxNode root, SyntaxToken firstToken, CancellationToken cancellationToken)
CodeRefactorings\InlineTemporary\InlineTemporaryCodeRefactoringProvider.cs (6)
133private static async Task<Document> InlineTemporaryAsync(Document document, VariableDeclaratorSyntax declarator, CancellationToken cancellationToken) 247private static async Task<VariableDeclaratorSyntax> FindDeclaratorAsync(Document document, CancellationToken cancellationToken) 250private static async Task<T> FindNodeWithAnnotationAsync<T>(Document document, SyntaxAnnotation annotation, CancellationToken cancellationToken) 260private static async Task<ImmutableArray<IdentifierNameSyntax>> FindReferenceAnnotatedNodesAsync(Document document, CancellationToken cancellationToken) 362Document document,
CodeRefactorings\MoveType\CSharpMoveTypeService.cs (1)
26protected override async Task<BaseTypeDeclarationSyntax?> GetRelevantNodeAsync(Document document, TextSpan textSpan, CancellationToken cancellationToken)
CodeRefactorings\SyncNamespace\CSharpChangeNamespaceService.cs (2)
40Document document, 338protected override async Task<SyntaxNode?> TryGetApplicableContainerFromSpanAsync(Document document, TextSpan span, CancellationToken cancellationToken)
CodeRefactorings\SyncNamespace\CSharpSyncNamespaceCodeRefactoringProvider.cs (1)
29protected override async Task<SyntaxNode?> TryGetApplicableInvocationNodeAsync(Document document, TextSpan span, CancellationToken cancellationToken)
CodeRefactorings\UseExplicitOrImplicitType\AbstractUseTypeCodeRefactoringProvider.cs (3)
23protected abstract Task HandleDeclarationAsync(Document document, SyntaxEditor editor, TypeSyntax type, CancellationToken cancellationToken); 118private async Task<Document> UpdateDocumentAsync(Document document, TypeSyntax type, CancellationToken cancellationToken)
CodeRefactorings\UseExplicitOrImplicitType\UseExplicitTypeCodeRefactoringProvider.cs (1)
35protected override Task HandleDeclarationAsync(Document document, SyntaxEditor editor, TypeSyntax node, CancellationToken cancellationToken)
CodeRefactorings\UseExplicitOrImplicitType\UseImplicitTypeCodeRefactoringProvider.cs (1)
35protected override Task HandleDeclarationAsync(Document document, SyntaxEditor editor, TypeSyntax type, CancellationToken cancellationToken)
CodeRefactorings\UseRecursivePatterns\UseRecursivePatternsCodeRefactoringProvider.cs (1)
583Document document,
Completion\CompletionProviders\AttributeNamedParameterCompletionProvider.cs (2)
55var document = context.Document; 198internal override Task<CompletionDescription> GetDescriptionWorkerAsync(Document document, CompletionItem item, CompletionOptions options, SymbolDescriptionOptions displayOptions, CancellationToken cancellationToken)
Completion\CompletionProviders\CrefCompletionProvider.cs (2)
62var document = context.Document; 90Document document, int position, CompletionOptions options, CancellationToken cancellationToken)
Completion\CompletionProviders\CSharpSuggestionModeCompletionProvider.cs (1)
32Document document, int position, TextSpan itemSpan, CompletionTrigger trigger, CancellationToken cancellationToken = default)
Completion\CompletionProviders\DeclarationName\DeclarationNameCompletionProvider.cs (1)
45var document = completionContext.Document;
Completion\CompletionProviders\DeclarationName\DeclarationNameInfo.cs (2)
44public static async Task<NameDeclarationInfo> GetDeclarationInfoAsync(Document document, int position, CancellationToken cancellationToken) 66private static async Task<NameDeclarationInfo> GetDeclarationInfoWorkerAsync(Document document, int position, CancellationToken cancellationToken)
Completion\CompletionProviders\DeclarationName\DeclarationNameRecommender.cs (1)
40Document document,
Completion\CompletionProviders\DeclarationName\IDeclarationNameRecommender.cs (1)
17Document document,
Completion\CompletionProviders\EnumAndCompletionListTagCompletionProvider.cs (2)
65var document = context.Document; 316internal override Task<CompletionDescription> GetDescriptionWorkerAsync(Document document, CompletionItem item, CompletionOptions options, SymbolDescriptionOptions displayOptions, CancellationToken cancellationToken)
Completion\CompletionProviders\ExplicitInterfaceMemberCompletionProvider.cs (2)
38Document document, 128internal override Task<CompletionDescription> GetDescriptionWorkerAsync(Document document, CompletionItem item, CompletionOptions options, SymbolDescriptionOptions displayOptions, CancellationToken cancellationToken)
Completion\CompletionProviders\ExplicitInterfaceMemberCompletionProvider.ItemGetter.cs (8)
33Document document, 50Document document, 66var syntaxFacts = Document.GetRequiredLanguageService<ISyntaxFactsService>(); 67var semanticFacts = Document.GetRequiredLanguageService<ISemanticFactsService>(); 68var implementInterfaceService = Document.GetRequiredLanguageService<IImplementInterfaceService>(); 99var semanticModel = await Document.ReuseExistingSpeculativeModelAsync(Position, CancellationToken).ConfigureAwait(false); 116var options = await Document.GetImplementTypeOptionsAsync(CancellationToken).ConfigureAwait(false); 125var text = await Document.GetValueTextAsync(CancellationToken).ConfigureAwait(false);
Completion\CompletionProviders\ExternAliasCompletionProvider.cs (1)
43var document = context.Document;
Completion\CompletionProviders\FunctionPointerUnmanagedCallingConventionCompletionProvider.cs (2)
47var document = context.Document; 122internal override Task<CompletionDescription> GetDescriptionWorkerAsync(Document document, CompletionItem item, CompletionOptions options, SymbolDescriptionOptions displayOptions, CancellationToken cancellationToken)
Completion\CompletionProviders\ImportCompletion\ExtensionMethodImportCompletionProvider.cs (1)
52Document document,
Completion\CompletionProviders\ImportCompletion\TypeImportCompletionProvider.cs (1)
52Document document,
Completion\CompletionProviders\NamedParameterCompletionProvider.cs (2)
57var document = context.Document; 132internal override Task<CompletionDescription> GetDescriptionWorkerAsync(Document document, CompletionItem item, CompletionOptions options, SymbolDescriptionOptions displayOptions, CancellationToken cancellationToken)
Completion\CompletionProviders\ObjectAndWithInitializerCompletionProvider.cs (3)
35protected override async Task<bool> IsExclusiveAsync(Document document, int position, CancellationToken cancellationToken) 103Document document, SemanticModel semanticModel, int position, CancellationToken cancellationToken) 140private static ITypeSymbol? GetInitializedType(SyntaxToken token, Document document, SemanticModel semanticModel, CancellationToken cancellationToken)
Completion\CompletionProviders\OperatorsAndIndexer\UnnamedSymbolCompletionProvider.cs (5)
100var document = context.Document; 143Document document, 159Document document, 175private static Task<CompletionChange> ReplaceTextAfterOperatorAsync(Document document, CompletionItem item, string text, CancellationToken cancellationToken) 179Document document,
Completion\CompletionProviders\OperatorsAndIndexer\UnnamedSymbolCompletionProvider_Conversions.cs (3)
77Document document, CompletionItem item, CancellationToken cancellationToken) 132private static async Task<CompletionDescription?> GetConversionDescriptionAsync(Document document, CompletionItem item, SymbolDescriptionOptions displayOptions, CancellationToken cancellationToken) 142private static async Task<ISymbol?> TryRehydrateAsync(Document document, CompletionItem item, CancellationToken cancellationToken)
Completion\CompletionProviders\OperatorsAndIndexer\UnnamedSymbolCompletionProvider_Indexers.cs (2)
39private static Task<CompletionChange> GetIndexerChangeAsync(Document document, CompletionItem item, CancellationToken cancellationToken) 42private static Task<CompletionDescription> GetIndexerDescriptionAsync(Document document, CompletionItem item, SymbolDescriptionOptions options, CancellationToken cancellationToken)
Completion\CompletionProviders\OperatorsAndIndexer\UnnamedSymbolCompletionProvider_Operators.cs (2)
124Document document, CompletionItem item, CancellationToken cancellationToken) 160private static Task<CompletionDescription> GetOperatorDescriptionAsync(Document document, CompletionItem item, SymbolDescriptionOptions displayOptions, CancellationToken cancellationToken)
Completion\CompletionProviders\PartialTypeCompletionProvider.cs (1)
82Document document, CompletionItem selectedItem, char? ch, CancellationToken cancellationToken)
Completion\CompletionProviders\PropertySubPatternCompletionProvider.cs (5)
44var document = context.Document; 99static ITypeSymbol? GetMemberAccessType(ITypeSymbol? type, ExpressionSyntax? expression, Document document, SemanticModel semanticModel, int position) 118static ITypeSymbol? GetMemberType(ITypeSymbol? type, string name, Document document, SemanticModel semanticModel, int position) 135static ImmutableArray<ISymbol> GetCandidatePropertiesAndFields(Document document, SemanticModel semanticModel, int position, ITypeSymbol? type) 160internal override Task<CompletionDescription> GetDescriptionWorkerAsync(Document document, CompletionItem item, CompletionOptions options, SymbolDescriptionOptions displayOptions, CancellationToken cancellationToken)
Completion\CompletionProviders\SnippetCompletionProvider.cs (2)
76var document = context.Document; 102Document document, CompletionContext completionContext, CancellationToken cancellationToken)
Completion\CompletionProviders\SpeculativeTCompletionProvider.cs (2)
44var document = context.Document; 64private static async Task<bool> ShouldShowSpeculativeTCompletionItemAsync(Document document, CompletionContext completionContext, CancellationToken cancellationToken)
Completion\CompletionProviders\SymbolCompletionProvider.cs (2)
145internal override async Task<bool> IsSyntacticTriggerCharacterAsync(Document document, int caretPosition, CompletionTrigger trigger, CompletionOptions options, CancellationToken cancellationToken) 175private static async Task<bool?> IsTriggerInArgumentListAsync(Document document, int characterPosition, CancellationToken cancellationToken)
Completion\CompletionProviders\TupleNameCompletionProvider.cs (1)
44var document = completionContext.Document;
Completion\CompletionProviders\XmlDocCommentCompletionProvider.cs (1)
69Document document, int position,
ConvertAutoPropertyToFullProperty\CSharpConvertAutoPropertyToFullPropertyCodeRefactoringProvider.cs (1)
34protected override async Task<string> GetFieldNameAsync(Document document, IPropertySymbol property, CancellationToken cancellationToken)
ConvertBetweenRegularAndVerbatimString\AbstractConvertBetweenRegularAndVerbatimStringCodeRefactoringProvider.cs (6)
81private static async Task<Document> ConvertAsync( 83Document document, TStringExpressionSyntax stringExpression, CancellationToken cancellationToken) 94private Task<Document> ConvertToVerbatimStringAsync(Document document, TStringExpressionSyntax stringExpression, CancellationToken cancellationToken) 97private Task<Document> ConvertToRegularStringAsync(Document document, TStringExpressionSyntax stringExpression, CancellationToken cancellationToken)
ConvertNamespace\ConvertNamespaceCodeRefactoringProvider.cs (1)
88Document document,
ConvertPrimaryToRegularConstructor\ConvertPrimaryToRegularConstructorCodeRefactoringProvider.cs (2)
66Document document, 125async ValueTask<SemanticModel> GetSemanticModelAsync(Document document)
ConvertProgram\ConvertProgramTransform_ProgramMain.cs (3)
26public static async Task<Document> ConvertToProgramMainAsync(Document document, AccessibilityModifiersRequired accessibilityModifiersRequired, CancellationToken cancellationToken) 70Document document,
ConvertProgram\ConvertProgramTransform_TopLevelStatements.cs (7)
29public static async Task<Document> ConvertToTopLevelStatementsAsync( 30Document document, MethodDeclarationSyntax methodDeclaration, CancellationToken cancellationToken) 60private static async Task<Document> ConvertFileScopedNamespaceAsync(Document document, CodeCleanupOptions cleanupOptions, CancellationToken cancellationToken) 68private static async Task<Document> AddUsingDirectivesAsync( 69Document document, SyntaxNode root, BaseNamespaceDeclarationSyntax namespaceDeclaration, CodeCleanupOptions options, CancellationToken cancellationToken) 80var documentWithImportsAdded = document.WithSyntaxRoot(addImportsService.AddImports(
ConvertProgram\ConvertToProgramMainCodeFixProvider.cs (2)
33var document = context.Document; 45Document document, ImmutableArray<Diagnostic> diagnostics, SyntaxEditor editor, CancellationToken cancellationToken)
ConvertProgram\ConvertToTopLevelStatementsCodeFixProvider.cs (3)
37var document = context.Document; 49Document document, ImmutableArray<Diagnostic> diagnostics, SyntaxEditor editor, CancellationToken cancellationToken) 53var newDocument = await ConvertToTopLevelStatementsAsync(document, methodDeclaration, cancellationToken).ConfigureAwait(false);
ConvertToRawString\ConvertStringToRawStringCodeRefactoringProvider.cs (3)
123private static async Task<Document> UpdateDocumentAsync( 124Document document, 139Document document,
Copilot\CSharpCopilotCodeFixProvider.cs (3)
56var document = context.Document; 92Document document, 123async Task<Document> GetFixedDocumentAsync(SyntaxNode method, string fix, CancellationToken cancellationToken)
Copilot\CSharpCopilotCodeFixProvider.DocumentChangeCodeAction.cs (1)
23Func<IProgress<CodeAnalysisProgress>, CancellationToken, Task<Document>> createChangedDocument,
Debugging\CSharpBreakpointResolutionService.cs (1)
31public async Task<BreakpointResolutionResult?> ResolveBreakpointAsync(Document document, TextSpan textSpan, CancellationToken cancellationToken)
Debugging\CSharpLanguageDebugInfoService.cs (2)
19public Task<DebugLocationInfo> GetLocationInfoAsync(Document document, int position, CancellationToken cancellationToken) 22public Task<DebugDataTipInfo> GetDataTipInfoAsync(Document document, int position, bool includeKind, CancellationToken cancellationToken)
Debugging\CSharpProximityExpressionsService.cs (2)
50Document document, 88Document document,
Debugging\DataTipInfoGetter.cs (1)
23Document document, int position, bool includeKind, CancellationToken cancellationToken)
Debugging\LocationInfoGetter.cs (1)
18internal static async Task<DebugLocationInfo> GetInfoAsync(Document document, int position, CancellationToken cancellationToken)
DecompiledSource\CSharpDecompiledSourceService.cs (8)
31public async Task<Document?> AddSourceToAsync(Document document, Compilation symbolCompilation, ISymbol symbol, MetadataReference? metadataReference, string? assemblyLocation, SyntaxFormattingOptions? formattingOptions, CancellationToken cancellationToken) 55public static async Task<Document> FormatDocumentAsync(Document document, SyntaxFormattingOptions? formattingOptions, CancellationToken cancellationToken) 70private static async Task<Document> AddAssemblyInfoRegionAsync(Document document, ISymbol symbol, IDecompilationService decompilationService, CancellationToken cancellationToken) 98private static async Task<Document> ConvertDocCommentsToRegularCommentsAsync(Document document, IDocumentationCommentFormattingService docCommentFormattingService, CancellationToken cancellationToken)
DocumentHighlighting\CSharpDocumentHighlightsService.cs (1)
35Document document, ISymbol symbol, CancellationToken cancellationToken)
EncapsulateField\CSharpEncapsulateFieldService.cs (2)
36protected override async Task<SyntaxNode> RewriteFieldNameAndAccessibilityAsync(string originalFieldName, bool makePrivate, Document document, SyntaxAnnotation declarationAnnotation, CancellationToken cancellationToken) 123protected override async Task<ImmutableArray<IFieldSymbol>> GetFieldsAsync(Document document, TextSpan span, CancellationToken cancellationToken)
ExternalAccess\Pythia\Api\IPythiaDeclarationNameRecommenderImplmentation.cs (1)
24public Document Document => _context.Document;
ExternalAccess\Pythia\Api\IPythiaSignatureHelpProviderImplementation.cs (1)
14Task<(ImmutableArray<PythiaSignatureHelpItemWrapper> items, int? selectedItemIndex)> GetMethodGroupItemsAndSelectionAsync(ImmutableArray<IMethodSymbol> accessibleMethods, Document document, InvocationExpressionSyntax invocationExpression, SemanticModel semanticModel, SymbolInfo currentSymbol, CancellationToken cancellationToken);
ExternalAccess\Pythia\Api\PythiaSignatureHelpItemWrapper.cs (1)
19Document document,
ExternalAccess\Pythia\PythiaDeclarationNameRecommender.cs (1)
28Document document,
ExternalAccess\Pythia\PythiaSignatureHelpProvider.cs (1)
32Document document,
ExtractInterface\CSharpExtractInterfaceService.cs (1)
32protected override async Task<SyntaxNode> GetTypeDeclarationAsync(Document document, int position, TypeDiscoveryRule typeDiscoveryRule, CancellationToken cancellationToken)
ExtractMethod\CSharpMethodExtractor.cs (3)
163protected override AbstractFormattingRule GetCustomFormattingRule(Document document) 172protected override async Task<(Document document, SyntaxToken? invocationNameToken)> InsertNewLineBeforeLocalFunctionIfNecessaryAsync( 173Document document,
ExtractMethod\CSharpMethodExtractor.CSharpCodeGenerator.cs (1)
812static async Task<Document> GenerateNewDocumentAsync(
ExtractMethod\CSharpMethodExtractor.CSharpCodeGenerator.ExpressionCodeGenerator.cs (1)
164var updatedDocument = SemanticDocument.Document;
Formatting\CSharpAccessibilityModifiersNewDocumentFormattingProvider.cs (3)
30public async Task<Document> FormatNewDocumentAsync(Document document, Document? hintDocument, CodeCleanupOptions options, CancellationToken cancellationToken)
Formatting\CSharpNamespaceDeclarationNewDocumentFormattingProvider.cs (4)
31public async Task<Document> FormatNewDocumentAsync(Document document, Document? hintDocument, CodeCleanupOptions options, CancellationToken cancellationToken) 44private static IEnumerable<BaseNamespaceDeclarationSyntax> GetNamespacesToReplace(Document document, CompilationUnitSyntax root, CodeStyleOption2<NamespaceDeclarationPreference> option)
Formatting\CSharpOrganizeUsingsNewDocumentFormattingProvider.cs (3)
27public async Task<Document> FormatNewDocumentAsync(Document document, Document? hintDocument, CodeCleanupOptions options, CancellationToken cancellationToken)
Formatting\CSharpUseProgramMainNewDocumentFormattingProvider.cs (3)
25public async Task<Document> FormatNewDocumentAsync(Document document, Document? hintDocument, CodeCleanupOptions options, CancellationToken cancellationToken)
GenerateConstructors\CSharpGenerateConstructorsCodeRefactoringProvider.cs (1)
50protected override async ValueTask<bool> PrefersThrowExpressionAsync(Document document, CancellationToken cancellationToken)
GenerateType\CSharpGenerateTypeService.cs (2)
544INamedTypeSymbol namedTypeSymbol, string[] containers, Document selectedDocument, SyntaxNode selectedDocumentRoot, CancellationToken cancellationToken) 715Solution updatedSolution, SyntaxNode modifiedRoot, Document document, SimpleNameSyntax simpleName, string includeUsingsOrImports, CancellationToken cancellationToken)
ImplementInterface\AbstractChangeImplementationCodeRefactoringProvider.cs (1)
229var documentToImplDeclarations = new OrderedMultiDictionary<Document, (SyntaxNode, ISymbol impl, SetWithInsertionOrder<ISymbol> interfaceMembers)>();
InitializeParameter\CSharpInitializeMemberFromPrimaryConstructorParameterCodeRefactoringProvider_Update.cs (2)
25Document document, 74Document document,
IntroduceVariable\CSharpIntroduceLocalForExpressionCodeRefactoringProvider.cs (1)
90Document document,
IntroduceVariable\CSharpIntroduceVariableService_IntroduceField.cs (1)
24protected override Task<Document> IntroduceFieldAsync(
IntroduceVariable\CSharpIntroduceVariableService_IntroduceLocal.cs (5)
29protected override Document IntroduceLocal( 91private Document IntroduceLocalDeclarationIntoLambda( 213private Document RewriteExpressionBodiedMemberAndIntroduceLocalDeclaration( 269private Document IntroduceLocalDeclarationIntoCompilationUnit( 337private Document IntroduceLocalDeclarationIntoBlock(
IntroduceVariable\CSharpIntroduceVariableService_IntroduceQueryLocal.cs (2)
26protected override Document IntroduceQueryLocal( 76private Document IntroduceQueryLocalForSingleOccurrence(
LineSeparators\CSharpLineSeparatorService.cs (1)
35Document document,
MetadataAsSource\CSharpMetadataAsSourceService.cs (7)
37protected override async Task<Document> AddAssemblyInfoRegionAsync(Document document, Compilation symbolCompilation, ISymbol symbol, CancellationToken cancellationToken) 58protected override ImmutableArray<AbstractFormattingRule> GetFormattingRules(Document document) 61protected override async Task<Document> ConvertDocCommentsToRegularCommentsAsync(Document document, IDocumentationCommentFormattingService docCommentFormattingService, CancellationToken cancellationToken) 101protected override async Task<Document> AddNullableRegionsAsync(Document document, CancellationToken cancellationToken)
NavigationBar\CSharpNavigationBarItemService.cs (2)
49Document document, bool supportsCodeGeneration, CancellationToken cancellationToken) 123private static async Task<IEnumerable<INamedTypeSymbol>> GetTypesInFileAsync(Document document, CancellationToken cancellationToken)
Organizing\CSharpOrganizingService.cs (2)
25protected override async Task<Document> ProcessAsync(Document document, IEnumerable<ISyntaxOrganizer> organizers, CancellationToken cancellationToken)
QuickInfo\CSharpDiagnosticAnalyzerQuickInfoProvider.cs (4)
36var document = context.Document; 50private QuickInfoItem? GetQuickinfoForPragmaWarning(Document document, SyntaxToken token) 90Document document, 131private QuickInfoItem? GetQuickInfoFromSupportedDiagnosticsOfProjectAnalyzers(Document document,
QuickInfo\CSharpSemanticQuickInfoProvider.cs (1)
141var document = context.Document;
ReplacePropertyWithMethods\CSharpReplacePropertyWithMethodsService.cs (1)
36Document document,
ReverseForStatement\CSharpReverseForStatementCodeRefactoringProvider.cs (2)
263private static async Task<Document> ReverseForStatementAsync( 264Document document, ForStatementSyntax forStatement, CancellationToken cancellationToken)
SignatureHelp\AbstractOrdinaryMethodSignatureHelpProvider.cs (2)
17Document document, 26Document document,
SignatureHelp\AttributeSignatureHelpProvider.cs (1)
74protected override async Task<SignatureHelpItems?> GetItemsWorkerAsync(Document document, int position, SignatureHelpTriggerInfo triggerInfo, MemberDisplayOptions options, CancellationToken cancellationToken)
SignatureHelp\ConstructorInitializerSignatureHelpProvider.cs (3)
39Document document, 69protected override async Task<SignatureHelpItems?> GetItemsWorkerAsync(Document document, int position, SignatureHelpTriggerInfo triggerInfo, MemberDisplayOptions options, CancellationToken cancellationToken) 119Document document, int position, TextSpan currentSpan, CancellationToken cancellationToken)
SignatureHelp\ElementAccessExpressionSignatureHelpProvider.cs (1)
53protected override async Task<SignatureHelpItems?> GetItemsWorkerAsync(Document document, int position, SignatureHelpTriggerInfo triggerInfo, MemberDisplayOptions options, CancellationToken cancellationToken)
SignatureHelp\GenericNameSignatureHelpProvider.cs (1)
77protected override async Task<SignatureHelpItems?> GetItemsWorkerAsync(Document document, int position, SignatureHelpTriggerInfo triggerInfo, MemberDisplayOptions options, CancellationToken cancellationToken)
SignatureHelp\InitializerExpressionSignatureHelpProvider.cs (1)
56protected override async Task<SignatureHelpItems?> GetItemsWorkerAsync(Document document, int position, SignatureHelpTriggerInfo triggerInfo, MemberDisplayOptions options, CancellationToken cancellationToken)
SignatureHelp\InvocationExpressionSignatureHelpProvider.cs (4)
39private async Task<InvocationExpressionSyntax?> TryGetInvocationExpressionAsync(Document document, int position, SignatureHelpTriggerReason triggerReason, CancellationToken cancellationToken) 66Document document, 121Document document, 167Document document,
SignatureHelp\InvocationExpressionSignatureHelpProviderBase_MethodGroup.cs (1)
22Document document,
SignatureHelp\ObjectCreationExpressionSignatureHelpProvider.cs (4)
32Document document, 62protected override async Task<SignatureHelpItems?> GetItemsWorkerAsync(Document document, int position, SignatureHelpTriggerInfo triggerInfo, MemberDisplayOptions options, CancellationToken cancellationToken) 111private async Task<SignatureHelpItems?> GetItemsWorkerForDelegateAsync(Document document, int position, BaseObjectCreationExpressionSyntax objectCreationExpression, 136Document document, int position, TextSpan currentSpan, CancellationToken cancellationToken)
SignatureHelp\PrimaryConstructorBaseTypeSignatureHelpProvider.cs (1)
70protected override async Task<SignatureHelpItems?> GetItemsWorkerAsync(Document document, int position, SignatureHelpTriggerInfo triggerInfo, MemberDisplayOptions options, CancellationToken cancellationToken)
SignatureHelp\TupleConstructionSignatureHelpProvider.cs (1)
107protected override async Task<SignatureHelpItems?> GetItemsWorkerAsync(Document document, int position, SignatureHelpTriggerInfo triggerInfo, MemberDisplayOptions options, CancellationToken cancellationToken)
Snippets\AbstractCSharpAutoPropertySnippetProvider.cs (1)
42protected override async Task<PropertyDeclarationSyntax> GenerateSnippetSyntaxAsync(Document document, int position, CancellationToken cancellationToken)
Snippets\AbstractCSharpForLoopSnippetProvider.cs (2)
121protected override Task<Document> AddIndentationToDocumentAsync(Document document, ForStatementSyntax forStatement, CancellationToken cancellationToken)
Snippets\AbstractCSharpTypeSnippetProvider.cs (3)
45protected override async Task<TextChange?> GetAccessibilityModifiersChangeAsync(Document document, int position, CancellationToken cancellationToken) 96protected override async Task<Document> AddIndentationToDocumentAsync(Document document, TTypeDeclarationSyntax typeDeclaration, CancellationToken cancellationToken)
Snippets\CSharpClassSnippetProvider.cs (1)
45protected override async Task<ClassDeclarationSyntax> GenerateTypeDeclarationAsync(Document document, int position, CancellationToken cancellationToken)
Snippets\CSharpConstructorSnippetProvider.cs (3)
59protected override async Task<TextChange> GenerateSnippetTextChangeAsync(Document document, int position, CancellationToken cancellationToken) 84protected override Task<Document> AddIndentationToDocumentAsync(Document document, ConstructorDeclarationSyntax constructorDeclaration, CancellationToken cancellationToken)
Snippets\CSharpDoWhileLoopSnippetProvider.cs (2)
49protected override Task<Document> AddIndentationToDocumentAsync(Document document, DoStatementSyntax doStatement, CancellationToken cancellationToken)
Snippets\CSharpElseSnippetProvider.cs (3)
57protected override Task<TextChange> GenerateSnippetTextChangeAsync(Document document, int position, CancellationToken cancellationToken) 69protected override Task<Document> AddIndentationToDocumentAsync(Document document, ElseClauseSyntax elseClause, CancellationToken cancellationToken)
Snippets\CSharpEnumSnippetProvider.cs (1)
42protected override async Task<EnumDeclarationSyntax> GenerateTypeDeclarationAsync(Document document, int position, CancellationToken cancellationToken)
Snippets\CSharpForEachLoopSnippetProvider.cs (2)
129protected override Task<Document> AddIndentationToDocumentAsync(Document document, ForEachStatementSyntax forEachStatement, CancellationToken cancellationToken)
Snippets\CSharpIfSnippetProvider.cs (2)
39protected override Task<Document> AddIndentationToDocumentAsync(Document document, IfStatementSyntax ifStatement, CancellationToken cancellationToken)
Snippets\CSharpInterfaceSnippetProvider.cs (1)
41protected override async Task<InterfaceDeclarationSyntax> GenerateTypeDeclarationAsync(Document document, int position, CancellationToken cancellationToken)
Snippets\CSharpIntMainSnippetProvider.cs (2)
50protected override async Task<Document> AddIndentationToDocumentAsync(Document document, MethodDeclarationSyntax methodDeclaration, CancellationToken cancellationToken)
Snippets\CSharpLockSnippetProvider.cs (2)
40protected override Task<Document> AddIndentationToDocumentAsync(Document document, LockStatementSyntax lockStatement, CancellationToken cancellationToken)
Snippets\CSharpSnippetFunctionService.cs (5)
21public override async Task<string?> GetContainingClassNameAsync(Document document, int position, CancellationToken cancellationToken) 30protected override async Task<ITypeSymbol?> GetEnumSymbolAsync(Document document, TextSpan switchExpressionSpan, CancellationToken cancellationToken) 47protected override async Task<(Document, TextSpan)> GetDocumentWithEnumCaseAsync( 48Document document, 59var documentWithCaseAdded = document.WithText(text.WithChanges(textChange));
Snippets\CSharpSnippetHelpers.cs (3)
29public static string GetBlockLikeIndentationString(Document document, int startPositionOfOpenCurlyBrace, SyntaxFormattingOptions syntaxFormattingOptions, CancellationToken cancellationToken) 45public static async Task<Document> AddBlockIndentationToDocumentAsync<TTargetNode>( 46Document document, TTargetNode targetNode, Func<TTargetNode, BlockSyntax> getBlock, CancellationToken cancellationToken)
Snippets\CSharpStructSnippetProvider.cs (1)
43protected override async Task<StructDeclarationSyntax> GenerateTypeDeclarationAsync(Document document, int position, CancellationToken cancellationToken)
Snippets\CSharpVoidMainSnippetProvider.cs (2)
42protected override Task<Document> AddIndentationToDocumentAsync(Document document, MethodDeclarationSyntax methodDeclaration, CancellationToken cancellationToken)
Snippets\CSharpWhileLoopSnippetProvider.cs (2)
39protected override Task<Document> AddIndentationToDocumentAsync(Document document, WhileStatementSyntax whileStatement, CancellationToken cancellationToken)
SplitStringLiteral\InterpolatedStringSplitter.cs (1)
83var content = Document.Text.ToString(TextSpan.FromBounds(start, end));
SplitStringLiteral\SimpleStringSplitter.cs (3)
41var prefix = Document.Text.GetSubText(TextSpan.FromBounds(_token.SpanStart, CursorPosition)).ToString(); 42var suffix = Document.Text.GetSubText(TextSpan.FromBounds(CursorPosition, _token.Span.End)).ToString(); 47? Document.Text.GetSubText(TextSpan.FromBounds(_token.Span.End - "u8".Length, _token.Span.End)).ToString()
SplitStringLiteral\StringSplitter.cs (4)
112var newRoot = Document.Root.ReplaceNode(nodeToReplace, splitString); 124var indentationService = Document.LanguageServices.GetRequiredService<IIndentationService>(); 125var originalLineNumber = Document.Text.Lines.GetLineFromPosition(CursorPosition).LineNumber; 127var newDocument = Document.WithChangedRoot(newRoot, CancellationToken);
src\Analyzers\CSharp\CodeFixes\AddBraces\CSharpAddBracesCodeFixProvider.cs (1)
32Document document, ImmutableArray<Diagnostic> diagnostics,
src\Analyzers\CSharp\CodeFixes\AddExplicitCast\CSharpAddExplicitCastCodeFixProvider.cs (1)
51Document document,
src\Analyzers\CSharp\CodeFixes\AddInheritdoc\AddInheritdocCodeFixProvider.cs (2)
38var document = context.Document; 67protected override async Task FixAllAsync(Document document, ImmutableArray<Diagnostic> diagnostics, SyntaxEditor editor, CancellationToken cancellationToken)
src\Analyzers\CSharp\CodeFixes\AssignOutParameters\AbstractAssignOutParametersCodeFixProvider.cs (4)
32var document = context.Document; 47protected abstract void TryRegisterFix(CodeFixContext context, Document document, SyntaxNode container, SyntaxNode location); 96Document document, ImmutableArray<Diagnostic> diagnostics, CancellationToken cancellationToken) 136Document document, ImmutableArray<Diagnostic> diagnostics,
src\Analyzers\CSharp\CodeFixes\AssignOutParameters\AssignOutParametersAboveReturnCodeFixProvider.cs (1)
26protected override void TryRegisterFix(CodeFixContext context, Document document, SyntaxNode container, SyntaxNode location)
src\Analyzers\CSharp\CodeFixes\AssignOutParameters\AssignOutParametersAtStartCodeFixProvider.cs (1)
24protected override void TryRegisterFix(CodeFixContext context, Document document, SyntaxNode container, SyntaxNode location)
src\Analyzers\CSharp\CodeFixes\ConditionalExpressionInStringInterpolation\CSharpAddParenthesesAroundConditionalExpressionInInterpolatedStringCodeFixProvider.cs (5)
52private static async Task<Document> GetChangedDocumentAsync(Document document, int conditionalExpressionSyntaxStartPosition, CancellationToken cancellationToken) 66var documentWithOpenParenthesis = document.WithText(textWithOpenParenthesis); 81private static async Task<Document> InsertCloseParenthesisAsync( 82Document document,
src\Analyzers\CSharp\CodeFixes\ConvertNamespace\ConvertNamespaceCodeFixProvider.cs (1)
52Document document, ImmutableArray<Diagnostic> diagnostics,
src\Analyzers\CSharp\CodeFixes\ConvertNamespace\ConvertNamespaceTransform.cs (8)
26public static Task<Document> ConvertAsync(Document document, BaseNamespaceDeclarationSyntax baseNamespace, CSharpSyntaxFormattingOptions options, CancellationToken cancellationToken) 37public static async Task<Document> ConvertNamespaceDeclarationAsync(Document document, NamespaceDeclarationSyntax namespaceDeclaration, SyntaxFormattingOptions options, CancellationToken cancellationToken) 44var updatedDocument = document.WithSyntaxRoot(updatedRoot); 238public static async Task<Document> ConvertFileScopedNamespaceAsync( 239Document document, FileScopedNamespaceDeclarationSyntax fileScopedNamespace, CSharpSyntaxFormattingOptions options, CancellationToken cancellationToken) 246var updatedDocument = document.WithSyntaxRoot(updatedRoot);
src\Analyzers\CSharp\CodeFixes\ConvertSwitchStatementToExpression\ConvertSwitchStatementToExpressionCodeFixProvider.cs (1)
52Document document, ImmutableArray<Diagnostic> diagnostics,
src\Analyzers\CSharp\CodeFixes\ConvertToRecord\ConvertToRecordEngine.cs (2)
34Document document, TypeDeclarationSyntax typeDeclaration, CancellationToken cancellationToken) 80Document document,
src\Analyzers\CSharp\CodeFixes\ConvertToRecord\CSharpConvertToRecordCodeFixProvider.cs (1)
31var document = context.Document;
src\Analyzers\CSharp\CodeFixes\DisambiguateSameVariable\CSharpDisambiguateSameVariableCodeFixProvider.cs (2)
39var document = context.Document; 133Document document, ImmutableArray<Diagnostic> diagnostics,
src\Analyzers\CSharp\CodeFixes\FixIncorrectConstraint\CSharpFixIncorrectConstraintCodeFixProvider.cs (1)
77Document document, ImmutableArray<Diagnostic> diagnostics,
src\Analyzers\CSharp\CodeFixes\FixReturnType\CSharpFixReturnTypeCodeFixProvider.cs (3)
38var document = context.Document; 62Document document, ImmutableArray<Diagnostic> diagnostics, CancellationToken cancellationToken) 127protected override async Task FixAllAsync(Document document, ImmutableArray<Diagnostic> diagnostics, SyntaxEditor editor, CancellationToken cancellationToken)
src\Analyzers\CSharp\CodeFixes\GenerateConstructor\GenerateConstructorCodeFixProvider.cs (1)
44Document document, SyntaxNode node, CancellationToken cancellationToken)
src\Analyzers\CSharp\CodeFixes\GenerateEnumMember\GenerateEnumMemberCodeFixProvider.cs (1)
32protected override Task<ImmutableArray<CodeAction>> GetCodeActionsAsync(Document document, SyntaxNode node, CancellationToken cancellationToken)
src\Analyzers\CSharp\CodeFixes\GenerateMethod\GenerateConversionCodeFixProvider.cs (1)
59Document document, SyntaxNode node, CancellationToken cancellationToken)
src\Analyzers\CSharp\CodeFixes\GenerateMethod\GenerateDeconstructMethodCodeFixProvider.cs (1)
49var document = context.Document;
src\Analyzers\CSharp\CodeFixes\GenerateMethod\GenerateMethodCodeFixProvider.cs (1)
82Document document, SyntaxNode node, CancellationToken cancellationToken)
src\Analyzers\CSharp\CodeFixes\GenerateParameterizedMember\CSharpGenerateParameterizedMemberService.cs (8)
34return Document.SemanticModel.GenerateParameterNames( 45var typeInference = Document.Document.GetLanguageService<ITypeInferenceService>(); 47Document.SemanticModel, _invocationExpression, objectAsDefault: true, 55var semanticModel = Document.SemanticModel; 74var semanticModel = Document.SemanticModel; 120var info = Document.SemanticModel.GetTypeInfo(type, cancellationToken); 135=> argument.DetermineParameterType(Document.SemanticModel, cancellationToken); 158var typeInfo = Document.SemanticModel.GetTypeInfo(typeArgument, cancellationToken);
src\Analyzers\CSharp\CodeFixes\GenerateVariable\CSharpGenerateVariableCodeFixProvider.cs (1)
55Document document, SyntaxNode node, CancellationToken cancellationToken)
src\Analyzers\CSharp\CodeFixes\HideBase\HideBaseCodeFixProvider.AddNewKeywordAction.cs (3)
23private sealed class AddNewKeywordAction(Document document, SyntaxNode node) : CodeAction 25private readonly Document _document = document; 30protected override async Task<Document> GetChangedDocumentAsync(CancellationToken cancellationToken)
src\Analyzers\CSharp\CodeFixes\ImplementInterface\CSharpImplementInterfaceService.cs (1)
42Document document, SemanticModel model, SyntaxNode node, CancellationToken cancellationToken,
src\Analyzers\CSharp\CodeFixes\InlineDeclaration\CSharpInlineDeclarationCodeFixProvider.cs (2)
45Document document, ImmutableArray<Diagnostic> diagnostics, 95Document document,
src\Analyzers\CSharp\CodeFixes\InvokeDelegateWithConditionalAccess\InvokeDelegateWithConditionalAccessCodeFixProvider.cs (1)
45Document document, ImmutableArray<Diagnostic> diagnostics,
src\Analyzers\CSharp\CodeFixes\Iterator\CSharpAddYieldCodeFixProvider.cs (1)
44protected override async Task<CodeAction?> GetCodeFixAsync(SyntaxNode root, SyntaxNode node, Document document, Diagnostic diagnostics, CancellationToken cancellationToken)
src\Analyzers\CSharp\CodeFixes\Iterator\CSharpChangeToIEnumerableCodeFixProvider.cs (2)
35protected override async Task<CodeAction?> GetCodeFixAsync(SyntaxNode root, SyntaxNode node, Document document, Diagnostic diagnostics, CancellationToken cancellationToken) 74Document? newDocument = null;
src\Analyzers\CSharp\CodeFixes\MakeAnonymousFunctionStatic\CSharpMakeAnonymousFunctionStaticCodeFixProvider.cs (1)
38protected override Task FixAllAsync(Document document, ImmutableArray<Diagnostic> diagnostics, SyntaxEditor editor, CancellationToken cancellationToken)
src\Analyzers\CSharp\CodeFixes\MakeLocalFunctionStatic\MakeLocalFunctionStaticCodeFixHelper.cs (3)
28public static async Task<Document> MakeLocalFunctionStaticAsync( 29Document document, 41Document document,
src\Analyzers\CSharp\CodeFixes\MakeLocalFunctionStatic\MakeLocalFunctionStaticCodeFixProvider.cs (1)
32Document document, ImmutableArray<Diagnostic> diagnostics, SyntaxEditor editor, CancellationToken cancellationToken)
src\Analyzers\CSharp\CodeFixes\MakeLocalFunctionStatic\PassInCapturedVariablesAsArgumentsCodeFixProvider.cs (3)
52protected override Task FixAllAsync(Document document, ImmutableArray<Diagnostic> diagnostics, SyntaxEditor editor, CancellationToken cancellationToken) 63Document document, 65Func<Document, LocalFunctionStatementSyntax, ImmutableArray<ISymbol>, Task> fixer,
src\Analyzers\CSharp\CodeFixes\MakeMemberRequired\CSharpMakeMemberRequiredCodeFixProvider.cs (2)
34var document = context.Document; 107protected override Task FixAllAsync(Document document, ImmutableArray<Diagnostic> diagnostics, SyntaxEditor editor, CancellationToken cancellationToken)
src\Analyzers\CSharp\CodeFixes\MakeRefStruct\MakeRefStructCodeFixProvider.cs (3)
37var document = context.Document; 63private static async Task<Document> FixCodeAsync( 64Document document,
src\Analyzers\CSharp\CodeFixes\MakeStatementAsynchronous\CSharpMakeStatementAsynchronousCodeFixProvider.cs (1)
48Document document, ImmutableArray<Diagnostic> diagnostics,
src\Analyzers\CSharp\CodeFixes\MakeStructFieldsWritable\CSharpMakeStructFieldsWritableCodeFixProvider.cs (1)
35Document document,
src\Analyzers\CSharp\CodeFixes\MakeStructMemberReadOnly\CSharpMakeStructMemberReadOnlyCodeFixProvider.cs (1)
36Document document,
src\Analyzers\CSharp\CodeFixes\MakeStructReadOnly\CSharpMakeStructReadOnlyCodeFixProvider.cs (1)
34Document document,
src\Analyzers\CSharp\CodeFixes\MisplacedUsingDirectives\MisplacedUsingDirectivesCodeFixProvider.cs (8)
57var document = context.Document; 83internal static async Task<Document> TransformDocumentIfRequiredAsync( 84Document document, 133private static async Task<Document> GetTransformedDocumentAsync( 134Document document, 156var newDocument = document.WithSyntaxRoot(newCompilationUnitWithHeader); 169Document document, CompilationUnitSyntax compilationUnit, ImmutableArray<UsingDirectiveSyntax> allUsingDirectives, CancellationToken cancellationToken) 185private static async Task<SyntaxNode> ExpandUsingDirectiveAsync(Document document, UsingDirectiveSyntax usingDirective, CancellationToken cancellationToken)
src\Analyzers\CSharp\CodeFixes\NewLines\ArrowExpressionClausePlacement\ArrowExpressionClausePlacementCodeFixProvider.cs (3)
33var document = context.Document; 44private static async Task<Document> UpdateDocumentAsync( 45Document document, ImmutableArray<Diagnostic> diagnostics, CancellationToken cancellationToken)
src\Analyzers\CSharp\CodeFixes\NewLines\ConditionalExpressionPlacement\ConditionalExpressionPlacementCodeFixProvider.cs (3)
33var document = context.Document; 44private static async Task<Document> UpdateDocumentAsync( 45Document document, ImmutableArray<Diagnostic> diagnostics, CancellationToken cancellationToken)
src\Analyzers\CSharp\CodeFixes\NewLines\ConsecutiveBracePlacement\ConsecutiveBracePlacementCodeFixProvider.cs (5)
33var document = context.Document; 44private static Task<Document> UpdateDocumentAsync(Document document, Diagnostic diagnostic, CancellationToken cancellationToken) 47public static async Task<Document> FixAllAsync(Document document, ImmutableArray<Diagnostic> diagnostics, CancellationToken cancellationToken)
src\Analyzers\CSharp\CodeFixes\NewLines\ConstructorInitializerPlacement\ConstructorInitializerPlacementCodeFixProvider.cs (3)
32var document = context.Document; 43private static async Task<Document> UpdateDocumentAsync( 44Document document, ImmutableArray<Diagnostic> diagnostics, CancellationToken cancellationToken)
src\Analyzers\CSharp\CodeFixes\NewLines\EmbeddedStatementPlacement\EmbeddedStatementPlacementCodeFixProvider.cs (3)
35var document = context.Document; 46public static async Task<Document> FixAllAsync(Document document, ImmutableArray<Diagnostic> diagnostics, CancellationToken cancellationToken)
src\Analyzers\CSharp\CodeFixes\Nullable\CSharpDeclareAsNullableCodeFixProvider.cs (4)
75Document document, 93protected override bool IncludeDiagnosticDuringFixAll(Diagnostic diagnostic, Document document, string? equivalenceKey, CancellationToken cancellationToken) 100Document document, SemanticModel model, SyntaxEditor editor, SyntaxNode node, HashSet<TypeSyntax> alreadyHandled, CancellationToken cancellationToken) 112Document document, SemanticModel? model, SyntaxNode node, CancellationToken cancellationToken)
src\Analyzers\CSharp\CodeFixes\RemoveConfusingSuppression\CSharpRemoveConfusingSuppressionCodeFixProvider.cs (3)
36var document = context.Document; 57private static async Task<Document> FixAllAsync( 58Document document, ImmutableArray<Diagnostic> diagnostics,
src\Analyzers\CSharp\CodeFixes\RemoveInKeyword\RemoveInKeywordCodeFixProvider.cs (2)
54private static async Task<Document> FixAsync( 55Document document,
src\Analyzers\CSharp\CodeFixes\RemoveNewModifier\RemoveNewModifierCodeFixProvider.cs (2)
56private static async Task<Document> FixAsync( 57Document document,
src\Analyzers\CSharp\CodeFixes\RemoveUnnecessaryCast\CSharpRemoveUnnecessaryCastCodeFixProvider.cs (1)
39Document document, ImmutableArray<Diagnostic> diagnostics,
src\Analyzers\CSharp\CodeFixes\RemoveUnnecessaryDiscardDesignation\CSharpRemoveUnnecessaryDiscardDesignationCodeFixProvider.cs (1)
35Document document, ImmutableArray<Diagnostic> diagnostics,
src\Analyzers\CSharp\CodeFixes\RemoveUnnecessaryLambdaExpression\CSharpRemoveUnnecessaryLambdaExpressionCodeFixProvider.cs (1)
41Document document, ImmutableArray<Diagnostic> diagnostics,
src\Analyzers\CSharp\CodeFixes\RemoveUnnecessaryNullableDirective\CSharpRemoveUnnecessaryNullableDirectiveCodeFixProvider.cs (1)
50Document document,
src\Analyzers\CSharp\CodeFixes\RemoveUnreachableCode\CSharpRemoveUnreachableCodeCodeFixProvider.cs (1)
51Document document,
src\Analyzers\CSharp\CodeFixes\RemoveUnusedLocalFunction\CSharpRemoveUnusedLocalFunctionCodeFixProvider.cs (1)
42protected override Task FixAllAsync(Document document, ImmutableArray<Diagnostic> diagnostics, SyntaxEditor editor, CancellationToken cancellationToken)
src\Analyzers\CSharp\CodeFixes\ReplaceDefaultLiteral\CSharpReplaceDefaultLiteralCodeFixProvider.cs (3)
64private static async Task<Document> ReplaceAsync( 65Document document, TextSpan span, SyntaxNode newExpression, CancellationToken cancellationToken) 77Document document,
src\Analyzers\CSharp\CodeFixes\SimplifyLinqExpression\CSharpSimplifyLinqTypeCheckAndCastCodeFixProvider.cs (1)
37Document document,
src\Analyzers\CSharp\CodeFixes\SimplifyPropertyPattern\CSharpSimplifyPropertyPatternCodeFixProvider.cs (1)
39Document document, ImmutableArray<Diagnostic> diagnostics,
src\Analyzers\CSharp\CodeFixes\TransposeRecordKeyword\CSharpTransposeRecordKeywordCodeFixProvider.cs (1)
96Document document, ImmutableArray<Diagnostic> diagnostics,
src\Analyzers\CSharp\CodeFixes\UseCollectionExpression\CSharpCollectionExpressionRewriter.cs (1)
38Document workspaceDocument,
src\Analyzers\CSharp\CodeFixes\UseCollectionExpression\CSharpUseCollectionExpressionForArrayCodeFixProvider.cs (1)
36Document document,
src\Analyzers\CSharp\CodeFixes\UseCollectionExpression\CSharpUseCollectionExpressionForBuilderCodeFixProvider.cs (4)
38Document document, 105static async Task<Document> CreateTrackedDocumentAsync( 106Document document, 127var newDocument = document.WithSyntaxRoot(newRoot.ReplaceNode(creationExpression, dummyObjectCreation));
src\Analyzers\CSharp\CodeFixes\UseCollectionExpression\CSharpUseCollectionExpressionForCreateCodeFixProvider.cs (1)
37Document document,
src\Analyzers\CSharp\CodeFixes\UseCollectionExpression\CSharpUseCollectionExpressionForEmptyCodeFixProvider.cs (1)
35Document document,
src\Analyzers\CSharp\CodeFixes\UseCollectionExpression\CSharpUseCollectionExpressionForFluentCodeFixProvider.cs (2)
45Document document, 142Document document,
src\Analyzers\CSharp\CodeFixes\UseCollectionExpression\CSharpUseCollectionExpressionForNewCodeFixProvider.cs (1)
36Document document,
src\Analyzers\CSharp\CodeFixes\UseCollectionExpression\CSharpUseCollectionExpressionForStackAllocCodeFixProvider.cs (1)
32Document document,
src\Analyzers\CSharp\CodeFixes\UseCollectionInitializer\CSharpUseCollectionInitializerCodeFixProvider.cs (1)
37Document document,
src\Analyzers\CSharp\CodeFixes\UseCollectionInitializer\CSharpUseCollectionInitializerCodeFixProvider_CollectionExpression.cs (1)
22Document document,
src\Analyzers\CSharp\CodeFixes\UseCompoundAssignment\CSharpUseCompoundCoalesceAssignmentCodeFixProvider.cs (1)
41Document document, ImmutableArray<Diagnostic> diagnostics,
src\Analyzers\CSharp\CodeFixes\UseDeconstruction\CSharpUseDeconstructionCodeFixProvider.cs (2)
40Document document, ImmutableArray<Diagnostic> diagnostics, 59Document document,
src\Analyzers\CSharp\CodeFixes\UseDefaultLiteral\CSharpUseDefaultLiteralCodeFixProvider.cs (1)
35Document document, ImmutableArray<Diagnostic> diagnostics,
src\Analyzers\CSharp\CodeFixes\UseExplicitArrayInExpressionTree\CSharpUseExplicitArrayInExpressionTreeCodeFixProvider.cs (1)
115protected override async Task FixAllAsync(Document document, ImmutableArray<Diagnostic> diagnostics, SyntaxEditor editor, CancellationToken cancellationToken)
src\Analyzers\CSharp\CodeFixes\UseExplicitTypeForConst\UseExplicitTypeForConstCodeFixProvider.cs (3)
36var document = context.Document; 61private static async Task<Document> FixAsync( 62Document document, TextSpan span, ITypeSymbol type, CancellationToken cancellationToken)
src\Analyzers\CSharp\CodeFixes\UseExpressionBody\UseExpressionBodyCodeFixProvider.cs (1)
54Document document, ImmutableArray<Diagnostic> diagnostics,
src\Analyzers\CSharp\CodeFixes\UseExpressionBodyForLambda\UseExpressionBodyForLambdaCodeFixProvider.cs (5)
29var document = context.Document; 42protected override Task FixAllAsync(Document document, ImmutableArray<Diagnostic> diagnostics, SyntaxEditor editor, CancellationToken cancellationToken) 45private static async Task FixAllImplAsync(Document document, ImmutableArray<Diagnostic> diagnostics, SyntaxEditor editor, CancellationToken cancellationToken) 55private static Task<Document> FixWithSyntaxEditorAsync(Document document, Diagnostic diagnostic, CancellationToken cancellationToken)
src\Analyzers\CSharp\CodeFixes\UseImplicitObjectCreation\CSharpUseImplicitObjectCreationCodeFixProvider.cs (1)
45Document document, ImmutableArray<Diagnostic> diagnostics,
src\Analyzers\CSharp\CodeFixes\UseImplicitOrExplicitType\UseExplicitTypeCodeFixProvider.cs (6)
42Document document, ImmutableArray<Diagnostic> diagnostics, 55Document document, SyntaxEditor editor, 83private static async Task HandleDeclarationExpressionAsync(Document document, SyntaxEditor editor, DeclarationExpressionSyntax declarationExpression, CancellationToken cancellationToken) 110private static Task HandleForEachStatementAsync(Document document, SyntaxEditor editor, ForEachStatementSyntax forEach, CancellationToken cancellationToken) 118private static Task HandleVariableDeclarationAsync(Document document, SyntaxEditor editor, VariableDeclarationSyntax varDecl, CancellationToken cancellationToken) 130Document document,
src\Analyzers\CSharp\CodeFixes\UseImplicitOrExplicitType\UseImplicitTypeCodeFixProvider.cs (1)
33Document document, ImmutableArray<Diagnostic> diagnostics,
src\Analyzers\CSharp\CodeFixes\UseIndexOrRangeOperator\CSharpUseIndexOperatorCodeFixProvider.cs (1)
36Document document, ImmutableArray<Diagnostic> diagnostics,
src\Analyzers\CSharp\CodeFixes\UseIndexOrRangeOperator\CSharpUseRangeOperatorCodeFixProvider.cs (1)
46Document document, ImmutableArray<Diagnostic> diagnostics,
src\Analyzers\CSharp\CodeFixes\UseInterpolatedVerbatimString\CSharpUseInterpolatedVerbatimStringCodeFixProvider.cs (1)
36Document document, ImmutableArray<Diagnostic> diagnostics,
src\Analyzers\CSharp\CodeFixes\UseIsNullCheck\CSharpUseIsNullCheckForCastAndEqualityOperatorCodeFixProvider.cs (1)
54Document document, ImmutableArray<Diagnostic> diagnostics,
src\Analyzers\CSharp\CodeFixes\UseIsNullCheck\CSharpUseNullCheckOverTypeCheckCodeFixProvider.cs (1)
39Document document, ImmutableArray<Diagnostic> diagnostics,
src\Analyzers\CSharp\CodeFixes\UseLocalFunction\CSharpUseLocalFunctionCodeFixProvider.cs (2)
52Document document, ImmutableArray<Diagnostic> diagnostics, 176Document document, SyntaxNode currentRoot,
src\Analyzers\CSharp\CodeFixes\UseNameofInAttribute\CSharpUseNameofInAttributeCodeFixProvider.cs (1)
37Document document,
src\Analyzers\CSharp\CodeFixes\UsePatternCombinators\CSharpUsePatternCombinatorsCodeFixProvider.cs (2)
52Diagnostic diagnostic, Document document, string? equivalenceKey, CancellationToken cancellationToken) 73Document document, ImmutableArray<Diagnostic> diagnostics,
src\Analyzers\CSharp\CodeFixes\UsePatternMatching\CSharpAsAndMemberAccessCodeFixProvider.cs (1)
40Document document, ImmutableArray<Diagnostic> diagnostics,
src\Analyzers\CSharp\CodeFixes\UsePatternMatching\CSharpAsAndNullCheckCodeFixProvider.cs (1)
40Document document, ImmutableArray<Diagnostic> diagnostics,
src\Analyzers\CSharp\CodeFixes\UsePatternMatching\CSharpIsAndCastCheckCodeFixProvider.cs (1)
37Document document, ImmutableArray<Diagnostic> diagnostics,
src\Analyzers\CSharp\CodeFixes\UsePatternMatching\CSharpUseNotPatternCodeFixProvider.cs (1)
35Document document, ImmutableArray<Diagnostic> diagnostics,
src\Analyzers\CSharp\CodeFixes\UsePrimaryConstructor\CSharpUsePrimaryConstructorCodeFixProvider.cs (3)
59var document = context.Document; 96Document document, 112Document document,
src\Analyzers\CSharp\CodeFixes\UseSimpleUsingStatement\UseSimpleUsingStatementCodeFixProvider.cs (1)
46Document document, ImmutableArray<Diagnostic> diagnostics,
src\Analyzers\CSharp\CodeFixes\UseSystemThreadingLock\CSharpUseSystemThreadingLockCodeFixProvider.cs (3)
43var document = context.Document; 62Document document, 77Document document,
src\Analyzers\CSharp\CodeFixes\UseThrowExpression\UseThrowExpressionCodeFixProvider.cs (1)
40Document document, ImmutableArray<Diagnostic> diagnostics,
src\Analyzers\CSharp\CodeFixes\UseTupleSwap\CSharpUseTupleSwapCodeFixProvider.cs (1)
37Document document, ImmutableArray<Diagnostic> diagnostics,
src\Analyzers\CSharp\CodeFixes\UseUnboundGenericTypeInNameOf\CSharpUseUnboundGenericTypeInNameOfCodeFixProvider.cs (1)
40Document document, ImmutableArray<Diagnostic> diagnostics,
src\Analyzers\CSharp\CodeFixes\UseUtf8StringLiteral\UseUtf8StringLiteralCodeFixProvider.cs (1)
43Document document, ImmutableArray<Diagnostic> diagnostics,
StringIndentation\CSharpStringIndentationService.cs (1)
28Document document, TextSpan textSpan, CancellationToken cancellationToken)
UseAutoProperty\CSharpUseAutoPropertyCodeFixProvider.cs (1)
80Document propertyDocument,
UseExpressionBody\UseExpressionBodyCodeRefactoringProvider.cs (5)
117var document = context.Document; 161private static async Task<Document> UpdateDocumentAsync( 162Document document, SyntaxNode root, SyntaxNode declaration, 188Document document, 235Document document,
UseExpressionBodyForLambda\UseExpressionBodyForLambdaCodeRefactoringProvider.cs (7)
31var document = context.Document; 78var document = context.Document; 91Document document, TextSpan span, ExpressionBodyPreference option, CancellationToken cancellationToken) 147Document document, TextSpan span, CancellationToken cancellationToken) 163Document document, TextSpan span, ExpressionBodyPreference option, CancellationToken cancellationToken) 194private static async Task<Document> UpdateDocumentAsync( 195Document document, SyntaxNode root, LambdaExpressionSyntax declaration, CancellationToken cancellationToken)
UsePatternMatching\CSharpIsAndCastCheckWithoutNameCodeFixProvider.cs (1)
43Document document, ImmutableArray<Diagnostic> diagnostics,
Microsoft.CodeAnalysis.CSharp.Features.UnitTests (15)
Diagnostics\Suppression\SuppressionTests.cs (1)
459var document = GetDocumentAndSelectSpan(workspace, out var span);
EditAndContinue\CSharpEditAndContinueAnalyzerTests.cs (13)
120Document newDocument, 303var oldDocument = oldProject.Documents.Single(); 308var newDocument = newSolution.GetDocument(documentId); 370var oldDocument = oldProject.Documents.Single(); 397var oldDocument = oldProject.Documents.Single(); 431var oldDocument = oldProject.Documents.Single(); 467var oldDocument = oldProject.Documents.Single(); 513var oldDocument = oldProject.Documents.Single(); 545var oldDocument = oldProject.Documents.Single(); 582var oldDocument = oldProject.Documents.Single(); 621var oldDocument = oldProject.Documents.Single(); 746var newDocument = newProject.GetDocument(documentId); 800var newDocument = newSolution.GetDocument(documentId);
ExtractClass\ExtractClassTests.cs (1)
3107Document document,
Microsoft.CodeAnalysis.CSharp.Workspaces (21)
LanguageServices\FixAllSpanMappingService\CSharpFixAllSpanMappingService.cs (5)
28protected override async Task<ImmutableDictionary<Document, ImmutableArray<TextSpan>>> GetFixAllSpansIfWithinGlobalStatementAsync( 29Document document, TextSpan span, CancellationToken cancellationToken) 34return ImmutableDictionary<Document, ImmutableArray<TextSpan>>.Empty; 47return ImmutableDictionary<Document, ImmutableArray<TextSpan>>.Empty; 52return ImmutableDictionary<Document, ImmutableArray<TextSpan>>.Empty
OrganizeImports\CSharpOrganizeImportsService.cs (2)
20public async Task<Document> OrganizeImportsAsync(Document document, OrganizeImportsOptions options, CancellationToken cancellationToken)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Services\SemanticFacts\CSharpSemanticFacts.cs (1)
419public async Task<ISymbol?> GetInterceptorSymbolAsync(Document document, int position, CancellationToken cancellationToken)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\CodeGeneration\CSharpCodeGenerationService.cs (1)
62public override async Task<Document> AddEventAsync(
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\ContextQuery\CSharpSyntaxContext.cs (3)
51Document document, 179public static CSharpSyntaxContext CreateContext(Document document, SemanticModel semanticModel, int position, CancellationToken cancellationToken) 183Document document, SemanticModel semanticModel, int position, CancellationToken cancellationToken)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\ContextQuery\CSharpSyntaxContextService.cs (1)
18public SyntaxContext CreateContext(Document document, SemanticModel semanticModel, int position, CancellationToken cancellationToken)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Formatting\CSharpSyntaxFormattingOptionsProviders.cs (1)
14public static async ValueTask<CSharpSyntaxFormattingOptions> GetCSharpSyntaxFormattingOptionsAsync(this Document document, CancellationToken cancellationToken)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\LanguageServices\CSharpMoveDeclarationNearReferenceService.cs (1)
53Document document, ILocalSymbol localSymbol,
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\LanguageServices\CSharpRemoveUnnecessaryImportsService.cs (2)
37public override async Task<Document> RemoveUnnecessaryImportsAsync( 38Document document,
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\LanguageServices\CSharpReplaceDiscardDeclarationsWithAssignmentsService.cs (1)
39Document document,
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\LanguageServices\InitializeParameter\CSharpInitializeParameterService.cs (1)
109protected override Task<Solution> TryAddAssignmentForPrimaryConstructorAsync(Document document, IParameterSymbol parameter, ISymbol fieldOrProperty, CancellationToken cancellationToken)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\LanguageServices\InitializeParameter\InitializeParameterHelpers.cs (1)
35Document document,
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Simplification\CSharpSimplifierOptionsProviders.cs (1)
14public static async ValueTask<CSharpSimplifierOptions> GetCSharpSimplifierOptionsAsync(this Document document, CancellationToken cancellationToken)
Microsoft.CodeAnalysis.CSharp.Workspaces.UnitTests (12)
CodeGeneration\AddAttributesTests.cs (3)
24private static Document GetDocument(string code) 41var doc = GetDocument(initialText); 56var changedDoc = editor.GetChangedDocument();
CodeGeneration\AddImportsTests.cs (3)
28private static async Task<Document> GetDocument(string code, bool withAnnotations) 40var doc = emptyProject.AddDocument("test.cs", code); 77var doc = await GetDocument(initialText, useSymbolAnnotations);
CodeGeneration\SymbolEditorTests.cs (1)
54private static async Task<string> GetActualAsync(Document document)
Formatting\FormattingMultipleSpanTests.cs (1)
165var document = project.AddDocument("Document", SourceText.From(""));
Formatting\FormattingTreeEditTests.cs (2)
21private static Document GetDocument(string code) 37var document = GetDocument(code);
OrganizeImports\OrganizeUsingsTests.cs (2)
31var document = project.AddDocument("Document", initial.ReplaceLineEndings(endOfLine ?? Environment.NewLine)); 92var document = project.AddDocument("Document", initial);
Microsoft.CodeAnalysis.EditorFeatures (269)
AddImports\AbstractAddImportsPasteCommandHandler.cs (1)
133private async Task ExecuteAsync(Document document, SnapshotSpan snapshotSpan, ITextView textView)
AutomaticCompletion\AbstractAutomaticLineEnderCommandHandler.cs (1)
85var document = args.SubjectBuffer.CurrentSnapshot.GetOpenDocumentInCurrentContextWithChanges();
AutomaticCompletion\BraceCompletionSessionProvider.BraceCompletionSession.cs (2)
97var document = SubjectBuffer.CurrentSnapshot.GetOpenDocumentInCurrentContextWithChanges(); 386var document = SubjectBuffer.CurrentSnapshot.GetOpenDocumentInCurrentContextWithChanges();
AutomaticCompletion\BraceCompletionSessionProvider.cs (1)
51var document = textSnapshot.GetOpenDocumentInCurrentContextWithChanges();
BraceMatching\BraceHighlightingViewTaggerProvider.cs (2)
64TaggerContext<BraceHighlightTag> context, Document document, ITextSnapshot snapshot, int position, BraceMatchingOptions options, CancellationToken cancellationToken) 96Document document,
ChangeSignature\AbstractChangeSignatureCommandHandler.cs (1)
66var document = await subjectBuffer.CurrentSnapshot.GetFullyLoadedOpenDocumentInCurrentContextWithChangesAsync(context.OperationContext).ConfigureAwait(true);
Classification\CopyPasteAndPrintingClassificationBufferTaggerProvider.Tagger.cs (2)
115var document = snapshot.GetOpenDocumentInCurrentContextWithChanges(); 142Document document,
Classification\Semantic\AbstractSemanticOrEmbeddedClassificationViewTaggerProvider.cs (2)
141Document document, 219Document document,
Classification\Syntactic\SyntacticClassificationTaggerProvider.TagComputer.cs (7)
83private (ITextSnapshot lastSnapshot, Document document, SyntaxNode? root)? _lastProcessedData; 323var currentDocument = currentSnapshot.GetOpenDocumentInCurrentContextWithChanges(); 372Document currentDocument, 374Document? lastProcessedDocument, 396private (ITextSnapshot lastSnapshot, Document document, SyntaxNode? root)? GetLastProcessedData() 472Document lastProcessedDocument, 512Document lastProcessedDocument,
CodeActions\CodeActionEditHandlerService.cs (2)
95Document? fromDocument, 346var latestDocument = workspace.CurrentSolution.GetDocument(documentId);
CodeActions\ICodeActionEditHandlerService.cs (1)
23Document? fromDocument,
CodeDefinitionWindow\DefinitionContextTracker.cs (3)
129var document = snapshot.GetOpenDocumentInCurrentContextWithChanges(); 141Document document, int position, CancellationToken cancellationToken) 196private static async Task<ImmutableArray<INavigableItem>> GetNavigableItemsAsync(Document document, int position, CancellationToken cancellationToken)
CommentSelection\AbstractCommentSelectionBase.cs (3)
69Document document, ICommentSelectionService service, ITextBuffer textBuffer, NormalizedSnapshotSpanCollection selectedSpans, 100var document = subjectBuffer.CurrentSnapshot.GetOpenDocumentInCurrentContextWithChanges(); 123private void ApplyEdits(Document document, ITextView textView, ITextBuffer subjectBuffer, string title, CommentSelectionResult edits, CancellationToken cancellationToken)
CommentSelection\AbstractToggleBlockCommentBase.cs (3)
57protected abstract ImmutableArray<TextSpan> GetBlockCommentsInDocument(Document document, ITextSnapshot snapshot, 72internal override CommentSelectionResult CollectEdits(Document document, ICommentSelectionService service, 93private CommentSelectionResult ToggleBlockComments(Document document, CommentSelectionInfo commentInfo,
CommentSelection\CommentUncommentSelectionCommandHandler.cs (1)
75Document document, ICommentSelectionService service, ITextBuffer subjectBuffer, NormalizedSnapshotSpanCollection selectedSpans,
CommentSelection\ToggleBlockCommentCommandHandler.cs (1)
38protected override ImmutableArray<TextSpan> GetBlockCommentsInDocument(Document document, ITextSnapshot snapshot,
CommentSelection\ToggleLineCommentCommandHandler.cs (1)
58internal override CommentSelectionResult CollectEdits(Document document, ICommentSelectionService service,
DocumentationComments\AbstractDocumentationCommentCommandHandler.cs (6)
83var document = subjectBuffer.CurrentSnapshot.GetOpenDocumentInCurrentContextWithChanges(); 192var document = args.SubjectBuffer.CurrentSnapshot.GetOpenDocumentInCurrentContextWithChanges(); 245var document = subjectBuffer.CurrentSnapshot.GetOpenDocumentInCurrentContextWithChanges(); 278var document = subjectBuffer.CurrentSnapshot.GetOpenDocumentInCurrentContextWithChanges(); 300var document = subjectBuffer.CurrentSnapshot.GetOpenDocumentInCurrentContextWithChanges(); 335var document = subjectBuffer.CurrentSnapshot.GetOpenDocumentInCurrentContextWithChanges();
DocumentationComments\AbstractXmlTagCompletionCommandHandler.cs (2)
78var document = buffer.CurrentSnapshot.GetOpenDocumentInCurrentContextWithChanges(); 114private void TryCompleteTag(ITextView textView, ITextBuffer subjectBuffer, Document document, SnapshotPoint position, CancellationToken cancellationToken)
DocumentSnapshotSpan.cs (4)
10/// Represents an editor <see cref="VisualStudio.Text.SnapshotSpan"/> and the <see cref="CodeAnalysis.Document"/> 16internal readonly struct DocumentSnapshotSpan(Document? document, SnapshotSpan snapshotSpan) 19/// The <see cref="CodeAnalysis.Document"/> the span was produced from. 21public Document? Document { get; } = document;
EditAndContinue\ActiveStatementTrackingService.cs (2)
159private async Task TrackActiveSpansAsync(Document designTimeDocument) 310/// Returns location of the tracking spans in the specified <see cref="Document"/> snapshot (#line target document).
EditAndContinue\PdbMatchingSourceTextProvider.cs (2)
61var oldDocument = e.OldSolution.GetDocument(e.DocumentId); 68var newDocument = e.NewSolution.GetDocument(e.DocumentId);
Editor\GoToAdjacentMemberCommandHandler.cs (2)
61var document = subjectBuffer.CurrentSnapshot.GetOpenDocumentInCurrentContextWithChanges(); 79var document = subjectBuffer.CurrentSnapshot.GetOpenDocumentInCurrentContextWithChanges();
EncapsulateField\AbstractEncapsulateFieldCommandHandler.cs (3)
61Document initialDocument, 75var document = await subjectBuffer.CurrentSnapshot.GetFullyLoadedOpenDocumentInCurrentContextWithChangesAsync(context).ConfigureAwait(false); 102Document document,
Extensibility\Completion\ICustomCommitCompletionProvider.cs (1)
17void Commit(CompletionItem completionItem, Document document, ITextView textView, ITextBuffer subjectBuffer, ITextSnapshot triggerSnapshot, char? commitChar);
Extensibility\NavigationBar\AbstractEditorNavigationBarItemService.cs (5)
28protected abstract Task<bool> TryNavigateToItemAsync(Document document, WrappedNavigationBarItem item, ITextView textView, ITextVersion textVersion, CancellationToken cancellationToken); 31Document document, 42public Task<bool> TryNavigateToItemAsync(Document document, NavigationBarItem item, ITextView textView, ITextVersion textVersion, CancellationToken cancellationToken) 46Document document, NavigationBarItem item, SymbolItem symbolItem, ITextVersion textVersion, CancellationToken cancellationToken) 72Document document,
Extensibility\NavigationBar\INavigationBarItemService.cs (2)
17Document document, 28Document document, NavigationBarItem item, ITextView view, ITextVersion textVersion, CancellationToken cancellationToken);
ExternalAccess\IntelliCode\IntentProcessor.cs (4)
40var currentDocument = intentRequestContext.CurrentSnapshotSpan.Snapshot.GetOpenDocumentInCurrentContextWithChanges(); 59var originalDocument = currentDocument.WithText(currentText.WithChanges(intentRequestContext.PriorTextEdits)); 87Document originalDocument, 88Document currentDocument,
ExternalAccess\UnitTestGenerator\Api\UnitTestGeneratorAddMissingImportsFeatureServiceAccessor.cs (5)
23internal async Task<Document> AddMissingImportsAsync(Document document, TextSpan textSpan, CancellationToken cancellationToken) 33internal async Task<WrappedMissingImportsAnalysisResult> AnalyzeAsync(Document document, TextSpan textSpan, CancellationToken cancellationToken) 42internal async Task<Document> AddMissingImportsAsync(Document document, WrappedMissingImportsAnalysisResult analysisResult, CancellationToken cancellationToken)
ExternalAccess\UnitTestGenerator\Api\UnitTestGeneratorOrganizeImportsAccessor.cs (2)
23public async Task<Document> OrganizeImportsAsync(Document document, CancellationToken cancellationToken)
ExternalAccess\VSTypeScript\Api\AbstractVSTypeScriptRequestHandler.cs (1)
62internal record struct TypeScriptRequestContext(Solution? Solution, Document? Document);
ExternalAccess\VSTypeScript\Api\IVSTypeScriptBlockStructureServiceImplementation.cs (1)
12Task<VSTypeScriptBlockStructure> GetBlockStructureAsync(Document document, CancellationToken cancellationToken);
ExternalAccess\VSTypeScript\Api\IVSTypeScriptBreakpointResolutionServiceImplementation.cs (1)
14Task<VSTypeScriptBreakpointResolutionResultWrapper> ResolveBreakpointAsync(Document document, TextSpan textSpan, CancellationToken cancellationToken = default);
ExternalAccess\VSTypeScript\Api\IVSTypeScriptEditorInlineRenameService.cs (1)
19public abstract Task<VSTypeScriptInlineRenameInfo> GetRenameInfoAsync(Document document, int position, CancellationToken cancellationToken);
ExternalAccess\VSTypeScript\Api\IVSTypeScriptFindUsagesService.cs (2)
17Task FindReferencesAsync(Document document, int position, IVSTypeScriptFindUsagesContext context, CancellationToken cancellationToken); 23Task FindImplementationsAsync(Document document, int position, IVSTypeScriptFindUsagesContext context, CancellationToken cancellationToken);
ExternalAccess\VSTypeScript\Api\IVSTypeScriptFormattingInteractionService.cs (5)
24bool SupportsFormattingOnTypedCharacter(Document document, char ch); 31Task<ImmutableArray<TextChange>> GetFormattingChangesAsync(Document document, TextSpan? textSpan, DocumentOptionSet? documentOptions, CancellationToken cancellationToken); 36Task<ImmutableArray<TextChange>> GetFormattingChangesOnPasteAsync(Document document, TextSpan textSpan, DocumentOptionSet? documentOptions, CancellationToken cancellationToken); 43Task<ImmutableArray<TextChange>> GetFormattingChangesAsync(Document document, char typedChar, int position, DocumentOptionSet? documentOptions, CancellationToken cancellationToken); 48Task<ImmutableArray<TextChange>> GetFormattingChangesOnReturnAsync(Document document, int position, DocumentOptionSet? documentOptions, CancellationToken cancellationToken);
ExternalAccess\VSTypeScript\Api\IVSTypeScriptLanguageDebugInfoServiceImplementation.cs (2)
12Task<VSTypeScriptDebugLocationInfoWrapper> GetLocationInfoAsync(Document document, int position, CancellationToken cancellationToken); 20Task<VSTypeScriptDebugDataTipInfoWrapper> GetDataTipInfoAsync(Document document, int position, CancellationToken cancellationToken);
ExternalAccess\VSTypeScript\Api\IVSTypeScriptNavigationBarItemService.cs (1)
13Task<ImmutableArray<VSTypescriptNavigationBarItem>> GetItemsAsync(Document document, CancellationToken cancellationToken);
ExternalAccess\VSTypeScript\Api\VSTypeScriptBreakpointResolutionResultWrapper.cs (3)
17public Document Document => UnderlyingObject.Document; 22public static VSTypeScriptBreakpointResolutionResultWrapper CreateSpanResult(Document document, TextSpan textSpan, string? locationNameOpt = null) 25public static VSTypeScriptBreakpointResolutionResultWrapper CreateLineResult(Document document, string? locationNameOpt = null)
ExternalAccess\VSTypeScript\Api\VSTypeScriptDocumentSpan.cs (2)
11internal readonly struct VSTypeScriptDocumentSpan(Document document, TextSpan sourceSpan) 13public Document Document { get; } = document;
ExternalAccess\VSTypeScript\Api\VSTypeScriptGoToSymbolContext.cs (2)
15internal VSTypeScriptGoToSymbolContext(Document document, int position, CancellationToken cancellationToken) 22public Document Document { get; }
ExternalAccess\VSTypeScript\Api\VSTypeScriptInlineRenameLocationWrapper.cs (1)
16public Document Document => _underlyingObject.Document;
ExternalAccess\VSTypeScript\VSTypeScriptBlockStructureService.cs (1)
24public override async Task<BlockStructure> GetBlockStructureAsync(Document document, BlockStructureOptions options, CancellationToken cancellationToken)
ExternalAccess\VSTypeScript\VSTypeScriptBreakpointResolutionService.cs (1)
26public async Task<BreakpointResolutionResult?> ResolveBreakpointAsync(Document document, TextSpan textSpan, CancellationToken cancellationToken = default)
ExternalAccess\VSTypeScript\VSTypeScriptEditorInlineRenameService.cs (1)
45public async Task<IInlineRenameInfo> GetRenameInfoAsync(Document document, int position, CancellationToken cancellationToken)
ExternalAccess\VSTypeScript\VSTypeScriptFindUsagesService.cs (2)
26public Task FindReferencesAsync(IFindUsagesContext context, Document document, int position, OptionsProvider<ClassificationOptions> classificationOptions, CancellationToken cancellationToken) 29public Task FindImplementationsAsync(IFindUsagesContext context, Document document, int position, OptionsProvider<ClassificationOptions> classificationOptions, CancellationToken cancellationToken)
ExternalAccess\VSTypeScript\VSTypeScriptFormattingInteractionService.cs (5)
30public bool SupportsFormattingOnTypedCharacter(Document document, char ch) 33public Task<ImmutableArray<TextChange>> GetFormattingChangesAsync(Document document, ITextBuffer textBuffer, TextSpan? textSpan, CancellationToken cancellationToken) 36public Task<ImmutableArray<TextChange>> GetFormattingChangesOnPasteAsync(Document document, ITextBuffer textBuffer, TextSpan textSpan, CancellationToken cancellationToken) 39public Task<ImmutableArray<TextChange>> GetFormattingChangesAsync(Document document, ITextBuffer textBuffer, char typedChar, int position, CancellationToken cancellationToken) 42public Task<ImmutableArray<TextChange>> GetFormattingChangesOnReturnAsync(Document document, int position, CancellationToken cancellationToken)
ExternalAccess\VSTypeScript\VSTypeScriptLanguageDebugInfoService.cs (2)
23public async Task<DebugDataTipInfo> GetDataTipInfoAsync(Document document, int position, bool includeKind, CancellationToken cancellationToken) 26public async Task<DebugLocationInfo> GetLocationInfoAsync(Document document, int position, CancellationToken cancellationToken)
ExternalAccess\VSTypeScript\VSTypeScriptNavigationBarItemService.cs (3)
33Document document, ITextVersion textVersion, CancellationToken cancellationToken) 40Document document, 54Document document, NavigationBarItem item, ITextView view, ITextVersion textVersion, CancellationToken cancellationToken)
ExtractInterface\AbstractExtractInterfaceCommandHandler.cs (1)
49var document = subjectBuffer.CurrentSnapshot.GetFullyLoadedOpenDocumentInCurrentContextWithChanges(
ExtractMethod\ExtractMethodCommandHandler.cs (4)
101var document = args.SubjectBuffer.CurrentSnapshot.GetOpenDocumentInCurrentContextWithChanges(); 112Document document, 134var document = await textBuffer.CurrentSnapshot.GetFullyLoadedOpenDocumentInCurrentContextWithChangesAsync(waitContext).ConfigureAwait(false); 211Document document, ExtractMethodResult result, CancellationToken cancellationToken)
FindReferences\FindReferencesCommandHandler.cs (4)
92private static (Document, IFindUsagesService) GetDocumentAndService(ITextSnapshot snapshot) 94var document = snapshot.GetOpenDocumentInCurrentContextWithChanges(); 98private bool TryExecuteCommand(int caretPosition, Document document, IFindUsagesService findUsagesService) 116Document document,
Formatting\FormatCommandHandler.cs (3)
60private void Format(ITextView textView, ITextBuffer textBuffer, Document document, TextSpan? selectionOpt, CancellationToken cancellationToken) 73ITextBuffer textBuffer, Document document, TextSpan? selectionOpt, CancellationToken cancellationToken) 136var document = subjectBuffer.CurrentSnapshot.GetOpenDocumentInCurrentContextWithChanges();
Formatting\FormatCommandHandler.FormatDocument.cs (1)
24var document = args.SubjectBuffer.CurrentSnapshot.GetOpenDocumentInCurrentContextWithChanges();
Formatting\FormatCommandHandler.FormatSelection.cs (1)
30var document = args.SubjectBuffer.CurrentSnapshot.GetOpenDocumentInCurrentContextWithChanges();
Formatting\FormatCommandHandler.Paste.cs (1)
58var document = subjectBuffer.CurrentSnapshot.GetOpenDocumentInCurrentContextWithChanges();
Formatting\IFormattingInteractionService.cs (5)
25bool SupportsFormattingOnTypedCharacter(Document document, char ch); 31Task<ImmutableArray<TextChange>> GetFormattingChangesAsync(Document document, ITextBuffer textBuffer, TextSpan? textSpan, CancellationToken cancellationToken); 36Task<ImmutableArray<TextChange>> GetFormattingChangesOnPasteAsync(Document document, ITextBuffer textBuffer, TextSpan textSpan, CancellationToken cancellationToken); 43Task<ImmutableArray<TextChange>> GetFormattingChangesAsync(Document document, ITextBuffer textBuffer, char typedChar, int position, CancellationToken cancellationToken); 48Task<ImmutableArray<TextChange>> GetFormattingChangesOnReturnAsync(Document document, int position, CancellationToken cancellationToken);
GoToBase\GoToBaseCommandHandler.cs (1)
46protected override Task FindActionAsync(IFindUsagesContext context, Document document, int caretPosition, CancellationToken cancellationToken)
GoToDefinition\AbstractGoToCommandHandler`2.cs (6)
77protected abstract Task FindActionAsync(IFindUsagesContext context, Document document, int caretPosition, CancellationToken cancellationToken); 79private static (Document?, TLanguageService?) GetDocumentAndService(ITextSnapshot snapshot) 81var document = snapshot.GetOpenDocumentInCurrentContextWithChanges(); 119Document document, 151Document document, 251IFindUsagesContext findContext, Document document, int position, CancellationToken cancellationToken)
GoToDefinition\GoToDefinitionCommandHandler.cs (3)
47private static (Document?, IDefinitionLocationService?) GetDocumentAndService(ITextSnapshot snapshot) 49var document = snapshot.GetOpenDocumentInCurrentContextWithChanges(); 103GoToDefinitionCommandArgs args, Document document, IDefinitionLocationService service, SnapshotPoint position)
GoToImplementation\GoToImplementationCommandHandler.cs (1)
46protected override Task FindActionAsync(IFindUsagesContext context, Document document, int caretPosition, CancellationToken cancellationToken)
IInlineRenameService.cs (1)
23InlineRenameSessionInfo StartInlineSession(Document document, TextSpan triggerSpan, CancellationToken cancellationToken);
InlineRename\AbstractEditorInlineRenameService.cs (2)
25public async Task<IInlineRenameInfo> GetRenameInfoAsync(Document document, int position, CancellationToken cancellationToken) 46Document document,
InlineRename\AbstractEditorInlineRenameService.SymbolRenameInfo.cs (2)
33private Document Document => _info.Document!; 167var symbolSourceDocument = this.Document.Project.Solution.GetDocument(RenameSymbol.Locations.Single().SourceTree);
InlineRename\CommandHandlers\AbstractRenameCommandHandler_RenameHandler.cs (2)
99var document = await args 133args.SubjectBuffer.CurrentSnapshot.GetOpenDocumentInCurrentContextWithChanges() is Document document &&
InlineRename\CommandHandlers\AbstractRenameCommandHandler_TypeCharHandler.cs (1)
24var document = args.SubjectBuffer.CurrentSnapshot.GetOpenDocumentInCurrentContextWithChanges();
InlineRename\IEditorInlineRenameService.cs (3)
23public Document Document { get; } 26public InlineRenameLocation(Document document, TextSpan textSpan) : this() 266Task<IInlineRenameInfo> GetRenameInfoAsync(Document document, int position, CancellationToken cancellationToken);
InlineRename\InlineRenameService.cs (3)
56Document document, 64Document document, 124IThreadingContext threadingContext, IInlineRenameInfo renameInfo, Document document, CancellationToken cancellationToken)
InlineRename\InlineRenameSession.cs (5)
62/// The original <see cref="Document"/> where rename was triggered 64public Document TriggerDocument { get; } 201private class NullTextBufferException(Document document, SourceText text) : Exception("Cannot retrieve textbuffer from document.") 204private readonly Document _document = document; 712var document = textBuffer.CurrentSnapshot.GetOpenDocumentInCurrentContextWithChanges();
InlineRename\InlineRenameSession.OpenTextBufferManager.cs (10)
39private readonly IEnumerable<Document> _baseDocuments; 187var document = _baseDocuments.First(); 212private static string GetTriggerText(Document document, TextSpan span) 315internal async Task ApplyConflictResolutionEditsAsync(IInlineRenameReplacementInfo conflictResolution, LinkedFileMergeSessionResult mergeResult, IEnumerable<Document> documents, CancellationToken cancellationToken) 331var originalDocument = _baseDocuments.Single(d => d.Id == newDocument.Id); 438foreach (var document in documents) 540private static async Task<IEnumerable<TextChange>> GetTextChangesFromTextDifferencingServiceAsync(Document oldDocument, Document newDocument, CancellationToken cancellationToken = default) 585Document preMergeDocument, 586Document postMergeDocument,
IntelliSense\AsyncCompletion\CommitManager.cs (4)
103var document = subjectBuffer.CurrentSnapshot.GetOpenDocumentInCurrentContextWithChanges(); 164var triggerDocument = itemData.TriggerLocation.Value.Snapshot.GetOpenDocumentInCurrentContextWithChanges(); 186Document document, 314var currentDocument = subjectBuffer.CurrentSnapshot.GetOpenDocumentInCurrentContextWithChanges();
IntelliSense\AsyncCompletion\CompletionSource.cs (7)
104var document = triggerLocation.Snapshot.GetOpenDocumentInCurrentContextWithChanges(); 153Document document, 213var document = triggerLocation.Snapshot.GetOpenDocumentInCurrentContextWithChanges(); 347var document = initialTriggerLocation.Snapshot.GetOpenDocumentInCurrentContextWithChanges(); 371Document document, 467var document = snapshot.GetOpenDocumentInCurrentContextWithChanges(); 509Document document,
IntelliSense\AsyncCompletion\ItemManager.CompletionListUpdater.cs (1)
48private readonly Document? _document;
IntelliSense\IDocumentProvider.cs (2)
17Document GetDocument(ITextSnapshot snapshot, CancellationToken cancellationToken); 24public Document GetDocument(ITextSnapshot snapshot, CancellationToken cancellationToken)
IntelliSense\NavigationActionFactory.cs (1)
22Document document,
IntelliSense\QuickInfo\IntellisenseQuickInfoBuilder.cs (1)
21Document document,
IntelliSense\QuickInfo\QuickInfoSourceProvider.QuickInfoSource.cs (1)
64var document = snapshot.GetOpenDocumentInCurrentContextWithChanges();
Intents\DeleteParameterIntentProvider.cs (2)
26Document priorDocument, 28Document currentDocument,
Intents\RenameIntentProvider.cs (2)
32Document priorDocument, 34Document currentDocument,
Interactive\SendToInteractiveSubmissionProvider.cs (1)
68var document = args.SubjectBuffer.CurrentSnapshot.GetOpenDocumentInCurrentContextWithChanges();
Navigation\AbstractDefinitionLocationService.cs (10)
30Document document, int position, CancellationToken cancellationToken) 40public async Task<DefinitionLocation?> GetDefinitionLocationAsync(Document document, int position, CancellationToken cancellationToken) 51async ValueTask<DefinitionLocation?> GetDefinitionLocationWorkerAsync(Document document) 60Document document, SemanticModel semanticModel) 73Document document, SemanticModel semanticModel) 113Solution solution, Document document, TextSpan span, CancellationToken cancellationToken) 129Project project, int position, ISymbol symbol, Document originalDocument, CancellationToken cancellationToken) 139var definitionDocument = solution.GetDocument(definitionTree); 267var document = solution.GetDocument(sourceTree); 277ISymbol symbolToNavigateTo, int caretPosition, Document document, CancellationToken cancellationToken)
Navigation\IDocumentNavigationServiceExtensions.cs (1)
78var document = workspace.CurrentSolution.GetDocument(documentId);
Organizing\OrganizeDocumentCommandHandler.cs (8)
97Func<ITextSnapshot, IUIThreadOperationContext, Task<Document?>> getCurrentDocumentAsync, 98Func<Document, CancellationToken, Task<Document>> getChangedDocumentAsync) 113Func<ITextSnapshot, IUIThreadOperationContext, Task<Document?>> getCurrentDocumentAsync, 114Func<Document, CancellationToken, Task<Document>> getChangedDocumentAsync) 142var currentDocument = await getCurrentDocumentAsync(caretPoint.Value.Snapshot, backgroundWorkContext).ConfigureAwait(false); 146var newDocument = await getChangedDocumentAsync(currentDocument, cancellationToken).ConfigureAwait(false);
Preview\AbstractPreviewFactoryService.cs (9)
249public Task<IDifferenceViewerPreview<TDifferenceViewer>> CreateAddedDocumentPreviewViewAsync(Document document, CancellationToken cancellationToken) 297public Task<IDifferenceViewerPreview<TDifferenceViewer>> CreateAddedDocumentPreviewViewAsync(Document document, double zoomLevel, CancellationToken cancellationToken) 321public Task<IDifferenceViewerPreview<TDifferenceViewer>> CreateRemovedDocumentPreviewViewAsync(Document document, CancellationToken cancellationToken) 379public Task<IDifferenceViewerPreview<TDifferenceViewer>> CreateRemovedDocumentPreviewViewAsync(Document document, double zoomLevel, CancellationToken cancellationToken) 403public Task<IDifferenceViewerPreview<TDifferenceViewer>?> CreateChangedDocumentPreviewViewAsync(Document oldDocument, Document newDocument, CancellationToken cancellationToken) 406public async Task<IDifferenceViewerPreview<TDifferenceViewer>?> CreateChangedDocumentPreviewViewAsync(Document oldDocument, Document newDocument, double zoomLevel, CancellationToken cancellationToken) 628private async ValueTask<ITextDocument> CreateNewBufferAsync(Document document, CancellationToken cancellationToken)
Preview\SolutionPreviewItem.cs (1)
16/// <param name="documentId"><see cref="DocumentId"/> for the <see cref="Document"/> being visualized in the supplied <paramref name="lazyPreview"/></param>
ReferenceHighlighting\ReferenceHighlightingViewTaggerProvider.cs (3)
138Document document, 155var documentsToSearchBuilder = ImmutableHashSet.CreateBuilder<Document>(); 177var document = documentHighlights.Document;
Remote\SolutionChecksumUpdater.cs (8)
41private readonly AsyncBatchingWorkQueue<(Document oldDocument, Document newDocument)> _textChangeQueue; 76_textChangeQueue = new AsyncBatchingWorkQueue<(Document oldDocument, Document newDocument)>( 148var oldDocument = e.OldSolution.GetDocument(e.DocumentId); 149var newDocument = e.NewSolution.GetDocument(e.DocumentId); 206ImmutableSegmentedList<(Document oldDocument, Document newDocument)> values,
RenameTracking\RenameTrackingCancellationCommandHandler.cs (1)
40var document = args.SubjectBuffer.CurrentSnapshot.GetOpenDocumentInCurrentContextWithChanges();
RenameTracking\RenameTrackingTaggerProvider.cs (2)
72var document = workspace.CurrentSolution.GetDocument(documentId); 106Document document, TextSpan textSpan,
RenameTracking\RenameTrackingTaggerProvider.RenameTrackingCodeAction.cs (2)
28private readonly Document _document; 36Document document,
RenameTracking\RenameTrackingTaggerProvider.RenameTrackingCommitter.cs (5)
80var document = _snapshotSpan.Snapshot.GetOpenDocumentInCurrentContextWithChanges(); 126var document = _snapshotSpan.Snapshot.GetOpenDocumentInCurrentContextWithChanges(); 183Document document, CancellationToken cancellationToken) 192var documentWithOriginalName = document.WithSyntaxRoot(syntaxTreeWithOriginalName.GetRoot(cancellationToken)); 207var documentWithOriginalName = solutionWithOriginalName.GetDocument(documentId);
RenameTracking\RenameTrackingTaggerProvider.StateMachine.cs (4)
234var document = Buffer.CurrentSnapshot.GetOpenDocumentInCurrentContextWithChanges(); 287Document document, 352var document = Buffer.CurrentSnapshot.GetOpenDocumentInCurrentContextWithChanges(); 366var document = Buffer.CurrentSnapshot.GetOpenDocumentInCurrentContextWithChanges();
RenameTracking\RenameTrackingTaggerProvider.TrackingSession.cs (3)
165var document = snapshotSpan.Snapshot.GetOpenDocumentInCurrentContextWithChanges(); 219private TriggerIdentifierKind DetermineIfRenamableSymbols(IEnumerable<ISymbol> symbols, Document document) 235private TriggerIdentifierKind DetermineIfRenamableSymbol(ISymbol symbol, Document document, SyntaxToken token)
Shared\Extensions\ITextSnapshotExtensions.cs (5)
31var document = textBuffer.CurrentSnapshot.GetOpenDocumentInCurrentContextWithChanges(); 53/// Get <see cref="Document"/> from <see cref="Text.Extensions.GetOpenDocumentInCurrentContextWithChanges(ITextSnapshot)"/> 60public static async Task<Document?> GetFullyLoadedOpenDocumentInCurrentContextWithChangesAsync( 88/// Get <see cref="Document"/> from <see cref="Text.Extensions.GetOpenDocumentInCurrentContextWithChanges(ITextSnapshot)"/> 91public static Document? GetFullyLoadedOpenDocumentInCurrentContextWithChanges(
Shared\Extensions\WorkspaceExtensions.cs (1)
22this Workspace workspace, IThreadingContext threadingContext, Document newDocument, CancellationToken cancellationToken)
Shared\Preview\PreviewWorkspace.cs (1)
63else if (document is Document)
SmartIndent\SmartIndent.cs (1)
37var document = line.Snapshot.GetOpenDocumentInCurrentContextWithChanges();
SpellCheck\RoslynSpellCheckFixerProvider.cs (1)
79var document = snapshot.GetOpenDocumentInCurrentContextWithChanges();
SplitComment\SplitCommentCommandHandler.cs (1)
61var document = snapshot.GetOpenDocumentInCurrentContextWithChanges();
Structure\AbstractStructureTaggerProvider.cs (1)
59var openDocument = subjectBuffer.AsTextContainer().GetRelatedDocuments().FirstOrDefault();
Tagging\AbstractAsynchronousTaggerProvider.TagSource_ProduceTags.cs (1)
428using var snapshotToDocument = TemporaryArray<(ITextSnapshot snapshot, Document? document)>.Empty;
Tagging\TaggerContext.cs (1)
54Document document,
TextDiffing\EditorTextDifferencingService.cs (4)
27public Task<ImmutableArray<TextChange>> GetTextChangesAsync(Document oldDocument, Document newDocument, CancellationToken cancellationToken) 30public async Task<ImmutableArray<TextChange>> GetTextChangesAsync(Document oldDocument, Document newDocument, TextDifferenceTypes preferredDifferenceType, CancellationToken cancellationToken)
TextStructureNavigation\AbstractTextStructureNavigatorProvider.TextStructureNavigator.cs (2)
79var document = GetDocument(position); 276private static Document? GetDocument(SnapshotPoint point)
Microsoft.CodeAnalysis.EditorFeatures.Test.Utilities (72)
BraceHighlighting\AbstractBraceHighlightingTests.cs (1)
45var document = buffer.CurrentSnapshot.GetRelatedDocumentsWithChanges().FirstOrDefault();
BraceHighlighting\MultiCharacterBraceHighlightingTests.cs (1)
32Document document, int position, BraceMatchingOptions options, CancellationToken cancellationToken)
BraceMatching\AbstractBraceMatcherTests.cs (1)
27var document = workspace.CurrentSolution.GetDocument(workspace.Documents.First().Id);
BracePairs\AbstractBracePairsTests.cs (1)
30var document = workspace.CurrentSolution.Projects.Single().Documents.Single();
ChangeSignature\AddedParameterOrExistingIndex.cs (1)
62internal AddedParameter GetAddedParameter(Document document)
Classification\AbstractClassifierTests.cs (3)
268protected static async Task<ImmutableArray<ClassifiedSpan>> GetSemanticClassificationsAsync(Document document, ImmutableArray<TextSpan> spans) 279protected static async Task<ImmutableArray<ClassifiedSpan>> GetSyntacticClassificationsAsync(Document document, ImmutableArray<TextSpan> spans) 289protected static async Task<ImmutableArray<ClassifiedSpan>> GetAllClassificationsAsync(Document document, ImmutableArray<TextSpan> spans)
CodeLens\AbstractCodeLensTest.cs (4)
25var document = workspace.CurrentSolution.GetDocument(annotatedDocument.Id); 53var document = workspace.CurrentSolution.GetDocument(annotatedDocument.Id); 79var document = workspace.CurrentSolution.GetDocument(annotatedDocument.Id); 105var document = workspace.CurrentSolution.GetDocument(annotatedDocument.Id);
Completion\AbstractCompletionProviderTests.cs (15)
94protected static async Task<bool> CanUseSpeculativeSemanticModelAsync(Document document, int position) 112internal static ImmutableHashSet<string> GetRoles(Document document) 134Document document, 141Document document, int position, string expectedItemOrNull, 168Document document, int position, bool usePreviousCharAsTrigger, 370var currentDocument = workspace.CurrentSolution.GetDocument(workspaceFixture.Target.CurrentDocument.Id); 610private async Task VerifyCustomCommitProviderCheckResultsAsync(Document document, string codeBeforeCommit, int position, string itemToCommit, string expectedCodeAfterCommit, char? commitChar) 631Document document, 658var newDoc = document.WithText(newText); 734Document document, int position, string itemToCommit, string expectedCodeAfterCommit, char? commitCharOpt) 959var document = solution.GetDocument(documentId); 1015var document = solution.GetDocument(documentId); 1045var document = solution.GetDocument(currentContextDocumentId); 1277var document = workspace.CurrentSolution.GetDocument(hostDocument.Id); 1322var document = workspace.CurrentSolution.GetDocument(documentId);
Debugging\AbstractDataTipInfoGetterTests.cs (1)
60private async Task TestSpanGetterAsync(string markup, Func<EditorTestWorkspace, Document, int, TextSpan?, Task> continuation)
Diagnostics\GenerateType\GenerateTypeTestState.cs (2)
21public Document InvocationDocument { get; } 22public Document ExistingDocument { get; }
Diagnostics\GenerateType\TestGenerateTypeOptionsService.cs (3)
29public Document ExistingDocument = null; 47Document document, 81Document existingDocument = null,
ExtractInterface\AbstractExtractInterfaceTests.cs (1)
163var updatedDocument = updatedSolution.GetDocument(testState.ExtractFromDocument.Id);
ExtractInterface\ExtractInterfaceTestState.cs (1)
29public Document ExtractFromDocument { get; }
Formatting\AbstractNewDocumentFormattingServiceTests.cs (1)
30var document = workspace.CurrentSolution.Projects.First().Documents.First();
Formatting\CoreFormatterTestsBase.cs (1)
183var document = workspace.CurrentSolution.GetDocument(hostdoc.Id);
GoToAdjacentMember\AbstractGoToAdjacentMemberTests.cs (2)
38var document = workspace.CurrentSolution.GetDocument(hostDocument.Id); 62var document = workspace.CurrentSolution.GetDocument(hostDocument.Id);
KeywordHighlighting\AbstractKeywordHighlighterTests.cs (1)
50var document = workspace.CurrentSolution.GetDocument(testDocument.Id);
LanguageServer\AbstractLanguageServerProtocolTests.cs (6)
85public Task<ImmutableArray<MappedSpanResult>> MapSpansAsync(Document document, IEnumerable<TextSpan> spans, CancellationToken cancellationToken) 97Document oldDocument, 98Document newDocument, 258Document document, 653public async Task<Document> GetDocumentAsync(Uri uri) 662var document = await GetDocumentAsync(uri).ConfigureAwait(false);
MoveStaticMembers\TestMoveStaticMembersService.cs (1)
37public MoveStaticMembersOptions GetMoveMembersToTypeOptions(Document document, INamedTypeSymbol selectedType, ImmutableArray<ISymbol> selectedNodeSymbols)
ObsoleteSymbol\AbstractObsoleteSymbolTests.cs (1)
33var document = documents[i];
PullMemberUp\TestPullMemberUpService.cs (1)
29public PullMembersUpOptions GetPullMemberUpOptions(Document document, ImmutableArray<ISymbol> selectedNodeSymbols)
QuickInfo\AbstractQuickInfoSourceTests.cs (2)
48Document document, 53Document document,
QuickInfo\AbstractSemanticQuickInfoSourceTests.cs (1)
153protected static async Task<bool> CanUseSpeculativeSemanticModelAsync(Document document, int position)
ReassignedVariable\AbstractReassignedVariableTests.cs (1)
32var document = documents[i];
Rename\RenamerTests.cs (4)
73var document = solution.GetDocument(documentId); 89var updatedDocument = solution.GetDocument(documentId); 206var document = solution.GetDocument(documentId); 237var document = solution.GetDocument(documentId);
SignatureHelp\AbstractSignatureHelpProviderTests.cs (5)
118private static async Task<bool> CanUseSpeculativeSemanticModelAsync(Document document, int position) 159private static async Task<SignatureHelpState?> GetArgumentStateAsync(int cursorPosition, Document document, ISignatureHelpProvider signatureHelpProvider, SignatureHelpTriggerInfo triggerInfo, MemberDisplayOptions options) 350var document = testWorkspace.CurrentSolution.GetDocument(documentId); 377Document document, 469var document = testWorkspace.CurrentSolution.GetDocument(documentId);
SpellCheck\AbstractSpellCheckSpanTests.cs (1)
28var document = workspace.CurrentSolution.Projects.Single().Documents.Single();
Structure\AbstractSyntaxNodeStructureProviderTests.cs (1)
23internal sealed override async Task<ImmutableArray<BlockSpan>> GetBlockSpansWorkerAsync(Document document, BlockStructureOptions options, int position)
Structure\AbstractSyntaxStructureProviderTests.cs (2)
33private Task<ImmutableArray<BlockSpan>> GetBlockSpansAsync(Document document, BlockStructureOptions options, int position) 36internal abstract Task<ImmutableArray<BlockSpan>> GetBlockSpansWorkerAsync(Document document, BlockStructureOptions options, int position);
Structure\AbstractSyntaxTriviaStructureProviderTests.cs (1)
20internal sealed override async Task<ImmutableArray<BlockSpan>> GetBlockSpansWorkerAsync(Document document, BlockStructureOptions options, int position)
TypeInferrer\TypeInferrerTestBase.cs (2)
26private static async Task<bool> CanUseSpeculativeSemanticModelAsync(Document document, int position) 67protected abstract Task TestWorkerAsync(Document document, TextSpan textSpan, string expectedType, TestMode mode);
Workspaces\NoCompilationDocumentDiagnosticAnalyzer.cs (2)
24public override Task<ImmutableArray<Diagnostic>> AnalyzeSemanticsAsync(Document document, CancellationToken cancellationToken) 27public override Task<ImmutableArray<Diagnostic>> AnalyzeSyntaxAsync(Document document, CancellationToken cancellationToken)
Workspaces\TestWorkspaceFixture.cs (1)
78public Document UpdateDocument(string text, SourceCodeKind sourceCodeKind, bool cleanBeforeUpdate = true)
Microsoft.CodeAnalysis.EditorFeatures.Text (10)
Extensions.cs (10)
63/// Gets the <see cref="Document"/>s from the corresponding <see cref="Workspace.CurrentSolution"/> that are associated with the <see cref="ITextSnapshot"/>'s buffer, 64/// updated to contain the same text as the snapshot if necessary. There may be multiple <see cref="Document"/>s associated with the buffer 67public static IEnumerable<Document> GetRelatedDocumentsWithChanges(this ITextSnapshot text) 71/// Gets the <see cref="Document"/> from the corresponding <see cref="Workspace.CurrentSolution"/> that is associated with the <see cref="ITextSnapshot"/>'s buffer 72/// in its current project context, updated to contain the same text as the snapshot if necessary. There may be multiple <see cref="Document"/>s 74/// is responsible for keeping track of which of these <see cref="Document"/>s is in the current project context. 76public static Document? GetOpenDocumentInCurrentContextWithChanges(this ITextSnapshot text) 83/// Gets the <see cref="Document"/>s from the corresponding <see cref="Workspace.CurrentSolution"/> that are associated with the <see cref="ITextBuffer"/>. 84/// There may be multiple <see cref="Document"/>s associated with the buffer if it is linked into multiple projects or is part of a Shared Project. 86public static IEnumerable<Document> GetRelatedDocuments(this ITextBuffer buffer)
Microsoft.CodeAnalysis.EditorFeatures.UnitTests (66)
CodeFixes\CodeFixServiceTests.cs (7)
57var document = project.Documents.Single(); 588public override Task<ImmutableArray<Diagnostic>> AnalyzeSyntaxAsync(Document document, CancellationToken cancellationToken) 594public override Task<ImmutableArray<Diagnostic>> AnalyzeSemanticsAsync(Document document, CancellationToken cancellationToken) 781var document = project.Documents.Single(); 1040var sourceDocument = (Document)document; 1143static async Task VerifyCachedDiagnosticsAsync(Document sourceDocument, bool expectedCachedDiagnostic, TextSpan testSpan, DiagnosticIncrementalAnalyzer diagnosticIncrementalAnalyzer)
CodeGeneration\AbstractCodeGenerationTests.cs (1)
43var simplifiedDocument = Simplifier.ReduceAsync(annotatedDocument, options, CancellationToken.None).Result;
CodeGeneration\CodeGenerationTests.cs (3)
842public Document Document; 847public Document Result; 959var simplified = Simplifier.ReduceAsync(this.Document, Simplifier.Annotation, simplifierOptions, CancellationToken.None).Result;
CodeRefactorings\CodeRefactoringServiceTest.cs (4)
49var document = project.Documents.Single(); 67context.RegisterRefactoring(CodeAction.Create($"Blocking=false", _ => Task.FromResult<Document>(null))); 87var document = workspace.CurrentSolution.Projects.Single().Documents.Single(); 107var document = project.Documents.Single();
Completion\CompletionServiceTests.cs (4)
46var document = project.Documents.Single(); 119public override Task<CompletionDescription> GetDescriptionAsync(Document document, CompletionItem item, CancellationToken cancellationToken) 124public override Task<CompletionChange> GetChangeAsync(Document document, CompletionItem item, char? commitKey, CancellationToken cancellationToken) 129private static async Task<TextSpan> GetTextChangeSpanAsync(Document document, TextSpan startSpan, CancellationToken cancellationToken)
Diagnostics\DiagnosticAnalyzerServiceTests.cs (22)
47private static void OpenDocumentAndMakeActive(Document document, Workspace workspace) 63var document = GetDocumentFromIncompleteProject(workspace); 87var document = GetDocumentFromIncompleteProject(workspace); 102var document = GetDocumentFromIncompleteProject(workspace); 117var document = GetDocumentFromIncompleteProject(workspace); 137var document = GetDocumentFromIncompleteProject(workspace); 176var document = project.AddDocument("test.cs", SourceText.From("class A {}"), filePath: "z:\\test.cs"); 217Document document, 511var document = project.Documents.Single(); 626var document = isSourceGenerated ? (await project.GetSourceGeneratedDocumentsAsync(CancellationToken.None)).Single() : project.Documents.Single(); 630Assert.IsType<Document>(document); 704var document = documentAnalysis ? project.Documents.Single() : null; 752var document = project.Documents.Single(); 819var document = project.Documents.Single(); 862var document = project.Documents.Single(); 881private static Document GetDocumentFromIncompleteProject(AdhocWorkspace workspace) 951public override Task<ImmutableArray<Diagnostic>> AnalyzeSyntaxAsync(Document document, CancellationToken cancellationToken) 954public override Task<ImmutableArray<Diagnostic>> AnalyzeSemanticsAsync(Document document, CancellationToken cancellationToken) 990public override Task<ImmutableArray<Diagnostic>> AnalyzeSemanticsAsync(Document document, CancellationToken cancellationToken) 992public override Task<ImmutableArray<Diagnostic>> AnalyzeSyntaxAsync(Document document, CancellationToken cancellationToken) 1013public override async Task<ImmutableArray<Diagnostic>> AnalyzeSyntaxAsync(Document document, CancellationToken cancellationToken) 1019public override Task<ImmutableArray<Diagnostic>> AnalyzeSemanticsAsync(Document document, CancellationToken cancellationToken)
Diagnostics\DiagnosticDataTests.cs (4)
112var document = workspace.CurrentSolution.AddProject("TestProject", "TestProject", LanguageNames.CSharp).AddDocument("TestDocument", code); 142var document = additionalDocument.Project.Documents.Single(); 223var firstDocument = workspace.CurrentSolution.AddProject("TestProject", "TestProject", LanguageNames.CSharp) 225Document secondDocument;
Diagnostics\SuppressMessageAttributeWorkspaceTests.cs (1)
66var document = workspace.CurrentSolution.GetDocument(documentId);
LinkedFiles\LinkedFileDiffMergingEditorTests.cs (2)
102var document = context.Document; 103var linkedDocument = document.Project.Solution.Projects.Single(p => p != document.Project).Documents.Single();
MetadataAsSource\AbstractMetadataAsSourceTests.cs (3)
59var document = context.GetDocument(metadataAsSourceFile); 86var newDoc = metadataProject.AddDocument("MetadataSource", source); 110var generatedDocument = context.GetDocument(generatedFile);
MetadataAsSource\AbstractMetadataAsSourceTests.TestContext.cs (1)
298internal Document GetDocument(MetadataAsSourceFile file)
MetadataAsSource\MetadataAsSourceTests.cs (2)
1914var openedDocument = context.GetDocument(result); 1953var document = context.GetDocument(file);
Preview\PreviewWorkspaceTests.cs (1)
99var document = project.AddDocument("document", "");
RenameTracking\RenameTrackingTestState.cs (1)
170var document = this.Workspace.CurrentSolution.GetDocument(HostDocument.Id);
Structure\BlockStructureServiceTests.cs (1)
116var document = workspace.CurrentSolution.GetDocument(hostDocument.Id);
Structure\StructureTaggerTests.cs (1)
403var document = workspace.CurrentSolution.GetDocument(hostdoc.Id);
SymbolFinder\DependentTypeFinderTests.cs (1)
642var csDoc = csProject.Documents.Single();
SymbolKey\SymbolKeyCrossLanguageTests.cs (1)
41var csDocument = solution.Projects.Single(p => p.Language == LanguageNames.CSharp).Documents.Single();
TextEditor\OpenDocumentTests.cs (2)
60var newDocumentWithChanges = buffer.CurrentSnapshot.GetOpenDocumentInCurrentContextWithChanges(); 69var originalDocumentWithChanges = originalSnapshot.GetOpenDocumentInCurrentContextWithChanges();
TextEditor\TryGetDocumentTests.cs (4)
26var document = workspace.CurrentSolution.GetDocument(workspace.GetDocumentId(hostDocument)); 36var newDocument = buffer.CurrentSnapshot.GetRelatedDocumentsWithChanges().FirstOrDefault(); 54var document = workspace.CurrentSolution.GetDocument(workspace.GetDocumentId(hostDocument)); 77var newDocument = newText.GetRelatedDocumentsWithChanges().First();
Microsoft.CodeAnalysis.EditorFeatures.Wpf (29)
InlineDiagnostics\AbstractDiagnosticsTaggerProvider.SingleDiagnosticKindPullTaggerProvider.cs (1)
100var document = documentSpanToTag.Document;
InlineHints\InlineHintsTag.cs (1)
97if (_span.Snapshot.GetOpenDocumentInCurrentContextWithChanges() is not Document document)
InlineHints\InlineHintsTagger.cs (1)
121var document = snapshot.GetOpenDocumentInCurrentContextWithChanges();
InlineRename\UI\SmartRename\SmartRenameViewModel.cs (1)
226var document = this.BaseViewModel.Session.TriggerDocument;
Interactive\AbstractInteractiveWindowCommandCompletionProvider.cs (1)
23var document = context.Document;
Interactive\InteractiveSupportsFeatureService.cs (5)
64public bool SupportsCodeFixes(Document document) 70public bool SupportsRefactorings(Document document) 73public bool SupportsRename(Document document) 76public bool SupportsNavigationToAnyPosition(Document document) 79public bool SupportsSemanticSnippets(Document document)
LineSeparators\LineSeparatorTaggerProvider.cs (1)
79var document = documentSnapshotSpan.Document;
NavigableSymbols\NavigableSymbolService.NavigableSymbolSource.cs (1)
36var document = snapshot.GetOpenDocumentInCurrentContextWithChanges();
NavigateTo\DefaultNavigateToPreviewService.cs (1)
18public bool CanPreview(Document document)
NavigateTo\INavigateToPreviewService.cs (1)
17bool CanPreview(Document document);
Peek\PeekableItemSource.cs (2)
59var document = triggerPoint.Value.Snapshot.GetOpenDocumentInCurrentContextWithChanges(); 72IList<IPeekableItem> peekableItems, IUIThreadOperationContext context, SnapshotPoint triggerPoint, Document document)
QuickInfo\ContentControlService.cs (1)
53public DisposableToolTip CreateDisposableToolTip(Document document, ITextBuffer textBuffer, Span contentSpan, object backgroundResourceKey)
QuickInfo\Extensions.cs (3)
34public static ITextBuffer CloneTextBuffer(this Document document, SourceText sourceText) 47/// async version of <see cref="CloneTextBuffer(Document, SourceText)"/> 49public static async Task<ITextBuffer> CloneTextBufferAsync(this Document document, CancellationToken cancellationToken)
QuickInfo\IContentControlService.cs (1)
34DisposableToolTip CreateDisposableToolTip(Document baseDocument, ITextBuffer textBuffer, Span contentSpan, object backgroundResourceKey);
QuickInfo\OnTheFlyDocsView.xaml.cs (1)
39private readonly Document _document;
SignatureHelp\Controller.cs (1)
131var document = snapshot.GetOpenDocumentInCurrentContextWithChanges();
StringIndentation\StringIndentationTaggerProvider.cs (1)
74var document = documentSnapshotSpan.Document;
Suggestions\FixAll\FixMultipleOccurrencesService.cs (1)
27ImmutableDictionary<Document, ImmutableArray<Diagnostic>> diagnosticsToFix,
Suggestions\RefineUsingCopilot\RefineUsingCopilotCodeAction.cs (2)
89Document oldDocument, 90Document newDocument,
Suggestions\RefineUsingCopilot\RefineUsingCopilotSuggestedAction.cs (1)
44if (suggestedAction.OriginalDocument is not Document originalDocument)
Suggestions\SuggestedActions\SuggestedAction.cs (1)
175var document = this.SubjectBuffer.CurrentSnapshot.GetOpenDocumentInCurrentContextWithChanges();
Microsoft.CodeAnalysis.EditorFeatures2.UnitTests (51)
Classification\ClassificationTests.vb (5)
348Public Function AddSemanticClassificationsAsync(document As Document, textSpans As ImmutableArray(Of TextSpan), options As ClassificationOptions, result As SegmentedList(Of ClassifiedSpan), cancellationToken As CancellationToken) As Task Implements IClassificationService.AddSemanticClassificationsAsync 352Public Function AddSyntacticClassificationsAsync(document As Document, textSpans As ImmutableArray(Of TextSpan), result As SegmentedList(Of ClassifiedSpan), cancellationToken As CancellationToken) As Task Implements IClassificationService.AddSyntacticClassificationsAsync 359Public Function ComputeSyntacticChangeRangeAsync(oldDocument As Document, newDocument As Document, timeout As TimeSpan, cancellationToken As CancellationToken) As ValueTask(Of TextChangeRange?) Implements IClassificationService.ComputeSyntacticChangeRangeAsync 367Public Function AddEmbeddedLanguageClassificationsAsync(document As Document, textSpans As ImmutableArray(Of TextSpan), options As ClassificationOptions, result As SegmentedList(Of ClassifiedSpan), cancellationToken As CancellationToken) As Task Implements IClassificationService.AddEmbeddedLanguageClassificationsAsync
CodeDefinitionWindow\AbstractCodeDefinitionWindowTests.vb (1)
50Dim document As Document = workspace.CurrentSolution.GetDocument(hostDocument.Id)
CodeDefinitionWindow\CrossLanguageCodeDefinitionWindowTests.vb (4)
27Public Sub New(document As Document) 89Public Function GetNavigableItemsAsync(document As Document, position As Integer, cancellationToken As CancellationToken) As Task(Of ImmutableArray(Of INavigableItem)) Implements INavigableItemsService.GetNavigableItemsAsync 93Public Function GetNavigableItemsAsync(document As Document, position As Integer, forSymbolType As Boolean, cancellationToken As CancellationToken) As Task(Of ImmutableArray(Of INavigableItem)) Implements INavigableItemsService.GetNavigableItemsAsync 111Dim document As Document = workspace.CurrentSolution.GetDocument(hostDocument.Id)
CodeFixes\CodeFixServiceTests.vb (5)
338Public Function GetAvailablePromptTitlesAsync(document As Document, cancellationToken As CancellationToken) As Task(Of ImmutableArray(Of String)) Implements ICopilotCodeAnalysisService.GetAvailablePromptTitlesAsync 342Public Function AnalyzeDocumentAsync(document As Document, span As TextSpan?, promptTitle As String, cancellationToken As CancellationToken) As Task Implements ICopilotCodeAnalysisService.AnalyzeDocumentAsync 346Public Function GetCachedDocumentDiagnosticsAsync(document As Document, span As TextSpan?, promptTitles As ImmutableArray(Of String), cancellationToken As CancellationToken) As Task(Of ImmutableArray(Of Diagnostic)) Implements ICopilotCodeAnalysisService.GetCachedDocumentDiagnosticsAsync 350Public Function StartRefinementSessionAsync(oldDocument As Document, newDocument As Document, primaryDiagnostic As Diagnostic, cancellationToken As CancellationToken) As Task Implements ICopilotCodeAnalysisService.StartRefinementSessionAsync
Diagnostics\AbstractCrossLanguageUserDiagnosticTest.vb (3)
115Private Shared Async Function VerifyAsync(expected As String, verifyTokens As Boolean, updatedDocument As Document) As Task 180Private Shared Async Function GetDocumentAndDiagnosticsAsync(workspace As EditorTestWorkspace) As Task(Of Tuple(Of Document, IEnumerable(Of Diagnostic))) 237Protected Overridable Function GetNode(doc As Document, position As Integer) As SyntaxNode
Diagnostics\DiagnosticServiceTests.vb (3)
59Private Shared Async Function GetDiagnosticsForDocumentAsync(diagnosticService As IDiagnosticAnalyzerService, document As Document) As Task(Of ImmutableArray(Of DiagnosticData)) 63Private Shared Async Function GetDiagnosticsForSpanAsync(diagnosticService As IDiagnosticAnalyzerService, document As Document, range As TextSpan) As Task(Of ImmutableArray(Of DiagnosticData)) 67Private Shared Async Function GetDiagnosticsForSpanAsync(diagnosticService As IDiagnosticAnalyzerService, document As Document, range As TextSpan, diagnosticKind As DiagnosticKind) As Task(Of ImmutableArray(Of DiagnosticData))
FindReferences\FindReferencesTests.vb (5)
193Private Shared Function GetFileNameAndSpans(g As IGrouping(Of Document, DocumentSpan)) As FileNameAndSpans 257Dim scope = If(searchSingleFileOnly, ImmutableHashSet.Create(Of Document)(document), Nothing) 375document As Document, 392Private Shared Function PrintSpans(expected As IOrderedEnumerable(Of TextSpan), actual As IOrderedEnumerable(Of TextSpan), doc As Document, prefix As String, suffix As String, Optional messageOnly As Boolean = False) As String 478Private Shared Function GetFilePathAndProjectLabel(document As Document) As String
GoToBase\GoToBaseTestsBase.vb (1)
18Async Function(document As Document, position As Integer, context As SimpleFindUsagesContext)
GoToHelpers\GoToHelpers.vb (1)
16testingMethod As Func(Of Document, Integer, SimpleFindUsagesContext, Task),
GoToImplementation\GoToImplementationTests.vb (1)
18Async Function(document As Document, position As Integer, context As SimpleFindUsagesContext) As Task
InlineHints\AbstractInlineHintsTests.vb (2)
59Private Shared Async Function ValidateDoubleClick(document As Document, expectedDocument As Document, inlineHints As ImmutableArray(Of InlineHint)) As Task
IntelliSense\CompletionServiceTests.vb (1)
137Public Overrides Function GetDescriptionAsync(document As Document, item As CompletionItem, cancellationToken As Threading.CancellationToken) As Task(Of CompletionDescription)
IntelliSense\CSharpCompletionCommandHandlerTests.vb (4)
8229Public Overrides Function GetChangeAsync(document As Document, item As CompletionItem, commitKey As Char?, cancellationToken As CancellationToken) As Task(Of CompletionChange) 8274Public Overrides Function GetChangeAsync(document As Document, item As CompletionItem, commitKey As Char?, cancellationToken As CancellationToken) As Task(Of CompletionChange) 10351Public Function NotifyCommittingItemAsync(document As Document, item As CompletionItem, commitKey As Char?, cancellationToken As CancellationToken) As Task Implements INotifyCommittingItemCompletionProvider.NotifyCommittingItemAsync 10779Public Overrides Function GetChangeAsync(document As Document, item As CompletionItem, commitKey As Char?, cancellationToken As CancellationToken) As Task(Of CompletionChange)
IntelliSense\CSharpCompletionCommandHandlerTests_DefaultsSource.vb (1)
662Friend Overrides Async Function GetCompletionsAsync(document As Document,
IntelliSense\MockCompletionProvider.vb (2)
17Private ReadOnly _getItems As Func(Of Document, Integer, CancellationToken, IEnumerable(Of CompletionItem)) 21Public Sub New(Optional getItems As Func(Of Document, Integer, CancellationToken, IEnumerable(Of CompletionItem)) = Nothing,
IntelliSense\SignatureHelpControllerTests.vb (4)
30emptyProvider.Setup(Function(p) p.GetDocument(It.IsAny(Of ITextSnapshot), It.IsAny(Of CancellationToken))).Returns(DirectCast(Nothing, Document)) 65slowProvider.Setup(Function(p) p.GetItemsAsync(It.IsAny(Of Document), It.IsAny(Of Integer), It.IsAny(Of SignatureHelpTriggerInfo), options, It.IsAny(Of CancellationToken))) _ 70slowProvider.Setup(Function(p) p.GetItemsAsync(It.IsAny(Of Document), It.IsAny(Of Integer), It.IsAny(Of SignatureHelpTriggerInfo), options, It.IsAny(Of CancellationToken))) _ 210Public Function GetItemsAsync(document As Document, position As Integer, triggerInfo As SignatureHelpTriggerInfo, options As MemberDisplayOptions, cancellationToken As CancellationToken) As Task(Of SignatureHelpItems) Implements ISignatureHelpProvider.GetItemsAsync
KeywordHighlighting\AbstractKeywordHighlightingTests.vb (1)
25Dim document As Document = workspace.CurrentSolution.Projects.First.Documents.First
Rename\RenameTestHelpers.vb (2)
28Private Function GetSessionInfo(workspace As EditorTestWorkspace) As (document As Document, textSpan As TextSpan) 85Public Sub VerifyFileName(document As Document, newIdentifierName As String)
Simplification\AbstractSimplificationTests.vb (5)
39Protected Shared Function SimplifyAsync(workspace As EditorTestWorkspace) As Task(Of Document) 43Private Shared Async Function SimplifyAsync(workspace As EditorTestWorkspace, options As OptionsCollection) As Task(Of Document) 68options As OptionsCollection) As Task(Of Document) 117Dim simplifiedDocument As Document 128Protected Shared Async Function AssertCodeEqual(expected As XElement, simplifiedDocument As Document) As Task
Microsoft.CodeAnalysis.ExternalAccess.AspNetCore (1)
Internal\EmbeddedLanguages\AspNetCoreEmbeddedLanguageDocumentHighlighter.cs (1)
30Document document,
Microsoft.CodeAnalysis.ExternalAccess.Copilot (49)
Analyzer\CopilotUtilities.cs (1)
30public static async Task<SyntaxNode?> GetContainingMethodDeclarationAsync(Document document, int position, bool useFullSpan, CancellationToken cancellationToken)
Analyzer\IExternalCSharpCopilotCodeAnalysisService.cs (5)
17Task<ImmutableArray<string>> GetAvailablePromptTitlesAsync(Document document, CancellationToken cancellationToken); 18Task<ImmutableArray<Diagnostic>> AnalyzeDocumentAsync(Document document, TextSpan? span, string promptTitle, CancellationToken cancellationToken); 19Task<ImmutableArray<Diagnostic>> GetCachedDiagnosticsAsync(Document document, string promptTitle, CancellationToken cancellationToken); 20Task StartRefinementSessionAsync(Document oldDocument, Document newDocument, Diagnostic? primaryDiagnostic, CancellationToken cancellationToken);
CodeMapper\ICSharpCopilotMapCodeService.cs (2)
16Document document, 18ImmutableArray<(Document document, TextSpan textSpan)> prioritizedFocusLocations,
Internal\Analyzer\AbstractCopilotCodeAnalysisService.cs (16)
35private readonly ConditionalWeakTable<Document, ConcurrentDictionary<string, (ImmutableArray<Diagnostic> Diagnostics, bool IsCompleteResult)>> _diagnosticsCache = new(); 38protected abstract Task<ImmutableArray<string>> GetAvailablePromptTitlesCoreAsync(Document document, CancellationToken cancellationToken); 39protected abstract Task<ImmutableArray<Diagnostic>> AnalyzeDocumentCoreAsync(Document document, TextSpan? span, string promptTitle, CancellationToken cancellationToken); 40protected abstract Task<ImmutableArray<Diagnostic>> GetCachedDiagnosticsCoreAsync(Document document, string promptTitle, CancellationToken cancellationToken); 41protected abstract Task StartRefinementSessionCoreAsync(Document oldDocument, Document newDocument, Diagnostic? primaryDiagnostic, CancellationToken cancellationToken); 48public async Task<ImmutableArray<string>> GetAvailablePromptTitlesAsync(Document document, CancellationToken cancellationToken) 59private static async Task<bool> ShouldSkipAnalysisAsync(Document document, CancellationToken cancellationToken) 73public async Task AnalyzeDocumentAsync(Document document, TextSpan? span, string promptTitle, CancellationToken cancellationToken) 92private bool FullDocumentDiagnosticsCached(Document document, string promptTitle) 95private bool TryGetDiagnosticsFromCache(Document document, string promptTitle, out ImmutableArray<Diagnostic> diagnostics, out bool isCompleteResult) 110private void CacheAndRefreshDiagnosticsIfNeeded(Document document, string promptTitle, ImmutableArray<Diagnostic> diagnostics, bool isCompleteResult) 128public async Task<ImmutableArray<Diagnostic>> GetCachedDocumentDiagnosticsAsync(Document document, TextSpan? span, ImmutableArray<string> promptTitles, CancellationToken cancellationToken) 162protected virtual Task<ImmutableArray<Diagnostic>> GetDiagnosticsIntersectWithSpanAsync(Document document, IReadOnlyList<Diagnostic> diagnostics, TextSpan span, CancellationToken cancellationToken) 167public async Task StartRefinementSessionAsync(Document oldDocument, Document newDocument, Diagnostic? primaryDiagnostic, CancellationToken cancellationToken)
Internal\Analyzer\CSharp\CSharpCopilotCodeAnalysisService.cs (6)
45protected override Task<ImmutableArray<Diagnostic>> AnalyzeDocumentCoreAsync(Document document, TextSpan? span, string promptTitle, CancellationToken cancellationToken) 48protected override Task<ImmutableArray<string>> GetAvailablePromptTitlesCoreAsync(Document document, CancellationToken cancellationToken) 51protected override Task<ImmutableArray<Diagnostic>> GetCachedDiagnosticsCoreAsync(Document document, string promptTitle, CancellationToken cancellationToken) 57protected override Task StartRefinementSessionCoreAsync(Document oldDocument, Document newDocument, Diagnostic? primaryDiagnostic, CancellationToken cancellationToken) 64Document document, IReadOnlyList<Diagnostic> diagnostics, TextSpan span, CancellationToken cancellationToken)
Internal\Analyzer\CSharp\CSharpCopilotCodeAnalysisService.ReflectionWrapper.cs (15)
17using AnalyzeDocumentAsyncDelegateType = Func<Document, TextSpan?, string, CancellationToken, Task<ImmutableArray<Diagnostic>>>; 18using GetAvailablePromptTitlesAsyncDelegateType = Func<Document, CancellationToken, Task<ImmutableArray<string>>>; 19using GetCachedDiagnosticsAsyncDelegateType = Func<Document, string, CancellationToken, Task<ImmutableArray<Diagnostic>>>; 21using StartRefinementSessionAsyncDelegateType = Func<Document, Document, Diagnostic?, CancellationToken, Task>; 105=> CreateDelegate<GetAvailablePromptTitlesAsyncDelegateType>(GetAvailablePromptTitlesAsyncMethodName, [typeof(Document), typeof(CancellationToken)]); 108=> CreateDelegate<AnalyzeDocumentAsyncDelegateType>(AnalyzeDocumentAsyncMethodName, [typeof(Document), typeof(TextSpan?), typeof(string), typeof(CancellationToken)]); 111=> CreateDelegate<GetCachedDiagnosticsAsyncDelegateType>(GetCachedDiagnosticsAsyncMethodName, [typeof(Document), typeof(string), typeof(CancellationToken)]); 114=> CreateDelegate<StartRefinementSessionAsyncDelegateType>(StartRefinementSessionAsyncMethodName, [typeof(Document), typeof(Document), typeof(Diagnostic), typeof(CancellationToken)]); 130public async Task<ImmutableArray<string>> GetAvailablePromptTitlesAsync(Document document, CancellationToken cancellationToken) 138public async Task<ImmutableArray<Diagnostic>> AnalyzeDocumentAsync(Document document, TextSpan? span, string promptTitle, CancellationToken cancellationToken) 146public async Task<ImmutableArray<Diagnostic>> GetCachedDiagnosticsAsync(Document document, string promptTitle, CancellationToken cancellationToken) 154public Task StartRefinementSessionAsync(Document oldDocument, Document newDocument, Diagnostic? primaryDiagnostic, CancellationToken cancellationToken)
Internal\CodeMapper\CopilotCSharpMapCodeService.cs (2)
30public Task<ImmutableArray<TextChange>?> MapCodeAsync(Document document, ImmutableArray<string> contents, ImmutableArray<(Document, TextSpan)> focusLocations, CancellationToken cancellationToken)
Internal\RelatedDocuments\CSharpCopilotRelatedDocumentsService.cs (1)
26public ValueTask GetRelatedDocumentIdsAsync(Document document, int position, Func<ImmutableArray<DocumentId>, CancellationToken, ValueTask> callbackAsync, CancellationToken cancellationToken)
RelatedDocuments\ICopilotRelatedDocumentsService.cs (1)
16Document document, int position, Func<ImmutableArray<DocumentId>, CancellationToken, ValueTask> callbackAsync, CancellationToken cancellationToken);
Microsoft.CodeAnalysis.ExternalAccess.FSharp (100)
Classification\IFSharpClassificationService.cs (2)
36Task AddSyntacticClassificationsAsync(Document document, TextSpan textSpan, List<ClassifiedSpan> result, CancellationToken cancellationToken); 44Task AddSemanticClassificationsAsync(Document document, TextSpan textSpan, List<ClassifiedSpan> result, CancellationToken cancellationToken);
Diagnostics\IFSharpDocumentDiagnosticAnalyzer.cs (2)
15Task<ImmutableArray<Diagnostic>> AnalyzeSemanticsAsync(Document document, CancellationToken cancellationToken); 17Task<ImmutableArray<Diagnostic>> AnalyzeSyntaxAsync(Document document, CancellationToken cancellationToken);
Diagnostics\IFSharpSimplifyNameDiagnosticAnalyzer.cs (1)
15Task<ImmutableArray<Diagnostic>> AnalyzeSemanticsAsync(DiagnosticDescriptor descriptor, Document document, CancellationToken cancellationToken);
Diagnostics\IFSharpUnusedDeclarationsDiagnosticAnalyzer.cs (1)
15Task<ImmutableArray<Diagnostic>> AnalyzeSemanticsAsync(DiagnosticDescriptor descriptor, Document document, CancellationToken cancellationToken);
Diagnostics\IFSharpUnusedOpensDiagnosticAnalyzer.cs (1)
15Task<ImmutableArray<Diagnostic>> AnalyzeSemanticsAsync(DiagnosticDescriptor descriptor, Document document, CancellationToken cancellationToken);
DocumentHighlighting\IFSharpDocumentHighlightsService.cs (4)
36public Document Document { get; } 39public FSharpDocumentHighlights(Document document, ImmutableArray<FSharpHighlightSpan> highlightSpans) 53Document document, int position, IImmutableSet<Document> documentsToSearch, CancellationToken cancellationToken);
Editor\FindUsages\IFSharpFindUsagesService.cs (2)
17Task FindReferencesAsync(Document document, int position, IFSharpFindUsagesContext context); 23Task FindImplementationsAsync(Document document, int position, IFSharpFindUsagesContext context);
Editor\IFSharpBraceMatcher.cs (1)
28Task<FSharpBraceMatchingResult?> FindBracesAsync(Document document, int position, CancellationToken cancellationToken = default);
Editor\IFSharpEditorFormattingService.cs (5)
24bool SupportsFormattingOnTypedCharacter(Document document, char ch); 30Task<IList<TextChange>> GetFormattingChangesAsync(Document document, TextSpan? textSpan, CancellationToken cancellationToken); 35Task<IList<TextChange>> GetFormattingChangesOnPasteAsync(Document document, TextSpan textSpan, CancellationToken cancellationToken); 42Task<IList<TextChange>?> GetFormattingChangesAsync(Document document, char typedChar, int position, CancellationToken cancellationToken); 47Task<IList<TextChange>?> GetFormattingChangesOnReturnAsync(Document document, int position, CancellationToken cancellationToken);
Editor\IFSharpEditorFormattingServiceWithOptions.cs (1)
13bool SupportsFormattingOnTypedCharacter(Document document, AutoFormattingOptionsWrapper options, char ch);
Editor\IFSharpEditorInlineRenameService.cs (1)
150Task<IFSharpInlineRenameInfo> GetRenameInfoAsync(Document document, int position, CancellationToken cancellationToken);
Editor\IFSharpGoToDefinitionService.cs (2)
19Task<IEnumerable<FSharpNavigableItem>> FindDefinitionsAsync(Document document, int position, CancellationToken cancellationToken); 26bool TryGoToDefinition(Document document, int position, CancellationToken cancellationToken);
Editor\IFSharpIndentationService.cs (1)
54FSharpIndentationResult? GetDesiredIndentation(Document document, int lineNumber, CancellationToken cancellationToken);
Editor\IFSharpNavigationBarItemService.cs (1)
15Task<IList<FSharpNavigationBarItem>> GetItemsAsync(Document document, CancellationToken cancellationToken);
Editor\Implementation\Debugging\FSharpBreakpointResolutionResult.cs (3)
18public Document Document => UnderlyingObject.Document; 23public static FSharpBreakpointResolutionResult CreateSpanResult(Document document, TextSpan textSpan, string? locationNameOpt = null) 26public static FSharpBreakpointResolutionResult CreateLineResult(Document document, string? locationNameOpt = null)
Editor\Implementation\Debugging\IFSharpBreakpointResolutionService.cs (1)
14Task<FSharpBreakpointResolutionResult?> ResolveBreakpointAsync(Document document, TextSpan textSpan, CancellationToken cancellationToken = default);
Editor\Implementation\Debugging\IFSharpLanguageDebugInfoService.cs (2)
12Task<FSharpDebugLocationInfo> GetLocationInfoAsync(Document document, int position, CancellationToken cancellationToken); 20Task<FSharpDebugDataTipInfo> GetDataTipInfoAsync(Document document, int position, CancellationToken cancellationToken);
Editor\InlineRename\FSharpInlineRenameLocation.cs (2)
13public Document Document { get; } 16public FSharpInlineRenameLocation(Document document, TextSpan textSpan)
Editor\InlineRename\FSharpInlineRenameServiceImplementation.cs (1)
12public abstract Task<FSharpInlineRenameInfo?> GetRenameInfoAsync(Document document, int position, CancellationToken cancellationToken);
FSharpDocumentSpan.cs (2)
19public Document Document { get; } 27public FSharpDocumentSpan(Document document, TextSpan sourceSpan)
GoToDefinition\IFSharpFindDefinitionService.cs (1)
17Task<ImmutableArray<FSharpNavigableItem>> FindDefinitionsAsync(Document document, int position, CancellationToken cancellationToken);
InlineHints\FSharpInlineHint.cs (3)
20private readonly Func<Document, CancellationToken, Task<ImmutableArray<TaggedText>>>? _getDescriptionAsync; 25Func<Document, CancellationToken, Task<ImmutableArray<TaggedText>>>? getDescriptionAsync = null) 39public Task<ImmutableArray<TaggedText>> GetDescriptionAsync(Document document, CancellationToken cancellationToken)
InlineHints\IFSharpInlineHintsService.cs (1)
17Task<ImmutableArray<FSharpInlineHint>> GetInlineHintsAsync(Document document, TextSpan textSpan, CancellationToken cancellationToken);
Internal\Classification\FSharpClassificationService.cs (5)
42public async Task AddSemanticClassificationsAsync(Document document, ImmutableArray<TextSpan> textSpans, ClassificationOptions options, SegmentedList<ClassifiedSpan> result, CancellationToken cancellationToken) 52public async Task AddSyntacticClassificationsAsync(Document document, ImmutableArray<TextSpan> textSpans, SegmentedList<ClassifiedSpan> result, CancellationToken cancellationToken) 78public ValueTask<TextChangeRange?> ComputeSyntacticChangeRangeAsync(Document oldDocument, Document newDocument, TimeSpan timeout, CancellationToken cancellationToken) 84public Task AddEmbeddedLanguageClassificationsAsync(Document document, ImmutableArray<TextSpan> textSpans, ClassificationOptions options, SegmentedList<ClassifiedSpan> result, CancellationToken cancellationToken)
Internal\Diagnostics\FSharpDocumentDiagnosticAnalyzer.cs (4)
35public Task<ImmutableArray<Diagnostic>> AnalyzeSemanticsAsync(Document document, CancellationToken cancellationToken) 40public Task<ImmutableArray<Diagnostic>> AnalyzeSyntaxAsync(Document document, CancellationToken cancellationToken) 73public override Task<ImmutableArray<Diagnostic>> AnalyzeSemanticsAsync(Document document, CancellationToken cancellationToken) 84public override Task<ImmutableArray<Diagnostic>> AnalyzeSyntaxAsync(Document document, CancellationToken cancellationToken)
Internal\Diagnostics\FSharpSimplifyNameDiagnosticAnalyzer.cs (3)
35public Task<ImmutableArray<Diagnostic>> AnalyzeSemanticsAsync(DiagnosticDescriptor descriptor, Document document, CancellationToken cancellationToken) 57public override Task<ImmutableArray<Diagnostic>> AnalyzeSemanticsAsync(Document document, CancellationToken cancellationToken) 68public override Task<ImmutableArray<Diagnostic>> AnalyzeSyntaxAsync(Document document, CancellationToken cancellationToken)
Internal\Diagnostics\FSharpUnusedDeclarationsAnalyzer.cs (3)
35public Task<ImmutableArray<Diagnostic>> AnalyzeSemanticsAsync(DiagnosticDescriptor descriptor, Document document, CancellationToken cancellationToken) 59public override Task<ImmutableArray<Diagnostic>> AnalyzeSemanticsAsync(Document document, CancellationToken cancellationToken) 70public override Task<ImmutableArray<Diagnostic>> AnalyzeSyntaxAsync(Document document, CancellationToken cancellationToken)
Internal\Diagnostics\FSharpUnusedOpensDiagnosticAnalyzer.cs (3)
32public Task<ImmutableArray<Diagnostic>> AnalyzeSemanticsAsync(DiagnosticDescriptor descriptor, Document document, CancellationToken cancellationToken) 52public override Task<ImmutableArray<Diagnostic>> AnalyzeSemanticsAsync(Document document, CancellationToken cancellationToken) 63public override Task<ImmutableArray<Diagnostic>> AnalyzeSyntaxAsync(Document document, CancellationToken cancellationToken)
Internal\DocumentHighlighting\FSharpDocumentHighlightsService.cs (2)
72public async Task<ImmutableArray<DocumentHighlights>> GetDocumentHighlightsAsync(Document document, int position, IImmutableSet<Document> documentsToSearch, HighlightingOptions options, CancellationToken cancellationToken)
Internal\Editor\FindUsages\FSharpFindUsagesService.cs (2)
22public Task FindImplementationsAsync(IFindUsagesContext context, Document document, int position, OptionsProvider<ClassificationOptions> classificationOptions, CancellationToken cancellationToken) 25public Task FindReferencesAsync(IFindUsagesContext context, Document document, int position, OptionsProvider<ClassificationOptions> classificationOptions, CancellationToken cancellationToken)
Internal\Editor\FSharpBraceMatcher.cs (1)
29public async Task<BraceMatchingResult?> FindBracesAsync(Document document, int position, BraceMatchingOptions options, CancellationToken cancellationToken)
Internal\Editor\FSharpDefinitionLocationService.cs (1)
22public Task<DefinitionLocation?> GetDefinitionLocationAsync(Document document, int position, CancellationToken cancellationToken)
Internal\Editor\FSharpEditorFormattingService.cs (9)
44public Task<IList<TextChange>> GetFormattingChangesAsync(Document document, TextSpan? textSpan, CancellationToken cancellationToken) 49public Task<IList<TextChange>?> GetFormattingChangesAsync(Document document, char typedChar, int position, CancellationToken cancellationToken) 54public Task<IList<TextChange>> GetFormattingChangesOnPasteAsync(Document document, TextSpan textSpan, CancellationToken cancellationToken) 59public Task<IList<TextChange>?> GetFormattingChangesOnReturnAsync(Document document, int position, CancellationToken cancellationToken) 64public bool SupportsFormattingOnTypedCharacter(Document document, char ch) 79async Task<ImmutableArray<TextChange>> IFormattingInteractionService.GetFormattingChangesAsync(Document document, ITextBuffer textBuffer, TextSpan? textSpan, CancellationToken cancellationToken) 85async Task<ImmutableArray<TextChange>> IFormattingInteractionService.GetFormattingChangesAsync(Document document, ITextBuffer textBuffer, char typedChar, int position, CancellationToken cancellationToken) 91async Task<ImmutableArray<TextChange>> IFormattingInteractionService.GetFormattingChangesOnPasteAsync(Document document, ITextBuffer textBuffer, TextSpan textSpan, CancellationToken cancellationToken) 97async Task<ImmutableArray<TextChange>> IFormattingInteractionService.GetFormattingChangesOnReturnAsync(Document document, int position, CancellationToken cancellationToken)
Internal\Editor\FSharpEditorInlineRenameService.cs (1)
211public async Task<IInlineRenameInfo> GetRenameInfoAsync(Document document, int position, CancellationToken cancellationToken)
Internal\Editor\FSharpNavigationBarItemService.cs (3)
41public Task<ImmutableArray<NavigationBarItem>> GetItemsAsync(Document document, ITextVersion textVersion, CancellationToken cancellationToken) 48Document document, 64Document document, NavigationBarItem item, ITextView view, ITextVersion textVersion, CancellationToken cancellationToken)
Internal\Editor\FSharpSmartIndentProvider.cs (1)
77var document = line.Snapshot.GetOpenDocumentInCurrentContextWithChanges();
Internal\Editor\Implementation\Debugging\FSharpBreakpointResolutionService.cs (1)
31public async Task<BreakpointResolutionResult?> ResolveBreakpointAsync(Document document, TextSpan textSpan, CancellationToken cancellationToken = default)
Internal\Editor\Implementation\Debugging\FSharpLanguageDebugInfoService.cs (2)
24public async Task<DebugDataTipInfo> GetDataTipInfoAsync(Document document, int position, bool includeKind, CancellationToken cancellationToken) 27public async Task<DebugLocationInfo> GetLocationInfoAsync(Document document, int position, CancellationToken cancellationToken)
Internal\InlineHints\FSharpInlineHintsService.cs (1)
31Document document, TextSpan textSpan, InlineHintsOptions options, bool displayAllOverride, CancellationToken cancellationToken)
Internal\NavigateTo\FSharpNavigateToSearchService.cs (3)
36Document document, 50ImmutableArray<Document> priorityDocuments, 53Document? activeDocument,
Internal\Navigation\FSharpFindDefinitionService.cs (2)
21public async Task<ImmutableArray<INavigableItem>> GetNavigableItemsAsync(Document document, int position, CancellationToken cancellationToken) 27public Task<ImmutableArray<INavigableItem>> GetNavigableItemsAsync(Document document, int position, bool forSymbolType, CancellationToken cancellationToken)
Internal\Navigation\InternalFSharpNavigableItem.cs (1)
36public Document Document { get; }
Internal\SignatureHelp\FSharpSignatureHelpProvider.cs (1)
31public async Task<SignatureHelpItems> GetItemsAsync(Document document, int position, SignatureHelpTriggerInfo triggerInfo, MemberDisplayOptions options, CancellationToken cancellationToken)
Internal\Structure\FSharpBlockStructureService.cs (1)
32public override async Task<BlockStructure> GetBlockStructureAsync(Document document, BlockStructureOptions options, CancellationToken cancellationToken)
NavigateTo\IFSharpNavigateToSearchService.cs (2)
17Task<ImmutableArray<FSharpNavigateToSearchResult>> SearchProjectAsync(Project project, ImmutableArray<Document> priorityDocuments, string searchPattern, IImmutableSet<string> kinds, CancellationToken cancellationToken); 18Task<ImmutableArray<FSharpNavigateToSearchResult>> SearchDocumentAsync(Document document, string searchPattern, IImmutableSet<string> kinds, CancellationToken cancellationToken);
Navigation\FSharpNavigableItem.cs (2)
14public FSharpNavigableItem(FSharpGlyph glyph, ImmutableArray<TaggedText> displayTaggedParts, Document document, TextSpan sourceSpan) 26public Document Document { get; }
SignatureHelp\IFSharpSignatureHelpProvider.cs (1)
29Task<FSharpSignatureHelpItems> GetItemsAsync(Document document, int position, FSharpSignatureHelpTriggerInfo triggerInfo, CancellationToken cancellationToken);
Structure\IFSharpBlockStructureService.cs (1)
14Task<FSharpBlockStructure> GetBlockStructureAsync(Document document, CancellationToken cancellationToken);
TaskList\FSharpTaskListItem.cs (1)
9internal readonly record struct FSharpTaskListItem(FSharpTaskListDescriptor TaskDescriptor, string Message, Document Document, TextSpan Span);
TaskList\FSharpTaskListService.cs (1)
29public async Task<ImmutableArray<TaskListItem>> GetTaskListItemsAsync(Document document, ImmutableArray<TaskListItemDescriptor> descriptors, CancellationToken cancellationToken)
TaskList\IFSharpTaskListService.cs (1)
13Task<ImmutableArray<FSharpTaskListItem>> GetTaskListItemsAsync(Document document, ImmutableArray<FSharpTaskListDescriptor> descriptors, CancellationToken cancellationToken);
Microsoft.CodeAnalysis.ExternalAccess.OmniSharp (28)
CodeActions\OmniSharpCodeFixContextFactory.cs (3)
18Document document, 26Document document, 33Document? document,
Completion\OmniSharpCompletionService.cs (3)
17Document document, 30Document document, 42Document document,
DocumentationComments\OmniSharpDocumentationCommentOptionsWrapper.cs (1)
39Document document,
DocumentationComments\OmniSharpDocumentationCommentsSnippetService.cs (2)
17Document document, 29Document document,
ExtractClass\IOmniSharpExtractClassOptionsService.cs (1)
12OmniSharpExtractClassOptions? GetExtractClassOptions(Document document, INamedTypeSymbol originalType, ImmutableArray<ISymbol> selectedMembers);
Formatting\OmniSharpFormatter.cs (4)
17public static Task<Document> FormatAsync(Document document, IEnumerable<TextSpan>? spans, OmniSharpSyntaxFormattingOptionsWrapper options, CancellationToken cancellationToken) 20public static async Task<Document> OrganizeImportsAsync(Document document, OmniSharpOrganizeImportsOptionsWrapper options, CancellationToken cancellationToken)
Formatting\OmniSharpOrganizeImportsOptionsWrapper.cs (1)
35public static async ValueTask<OmniSharpOrganizeImportsOptionsWrapper> FromDocumentAsync(Document document, OmniSharpOrganizeImportsOptionsWrapper fallbackOptions, CancellationToken cancellationToken)
Formatting\OmniSharpSyntaxFormattingOptionsWrapper.cs (1)
25public static async ValueTask<OmniSharpSyntaxFormattingOptionsWrapper> FromDocumentAsync(Document document, OmniSharpLineFormattingOptions fallbackLineFormattingOptions, CancellationToken cancellationToken)
GoToDefinition\OmniSharpFindDefinitionService.cs (1)
16internal static async Task<ImmutableArray<OmniSharpNavigableItem>> FindDefinitionsAsync(Document document, int position, CancellationToken cancellationToken)
InlineHints\OmniSharpInlineHintsService.cs (4)
17public static async Task<ImmutableArray<OmniSharpInlineHint>> GetInlineHintsAsync(Document document, TextSpan textSpan, OmniSharpInlineHintsOptions options, CancellationToken cancellationToken) 34private readonly Func<Document, CancellationToken, Task<ImmutableArray<TaggedText>>> _getDescriptionAsync; 41Func<Document, CancellationToken, Task<ImmutableArray<TaggedText>>> getDescriptionAsync) 55public Task<ImmutableArray<TaggedText>> GetDescriptionAsync(Document document, CancellationToken cancellationToken)
Internal\ExtractClass\OmniSharpExtractClassOptionsService.cs (1)
26Document document,
MetadataAsSource\OmniSharpMetadataAsSourceHelpers.cs (1)
19public static Task<Location> GetLocationInGeneratedSourceAsync(ISymbol symbol, Document generatedDocument, CancellationToken cancellationToken)
MetadataAsSource\OmniSharpMetadataAsSourceService.cs (2)
33public static Task<Document> AddSourceToAsync(Document document, Compilation symbolCompilation, ISymbol symbol, OmniSharpSyntaxFormattingOptionsWrapper formattingOptions, CancellationToken cancellationToken)
Navigation\OmniSharpNavigableItem.cs (2)
12public OmniSharpNavigableItem(ImmutableArray<TaggedText> displayTaggedParts, Document document, TextSpan sourceSpan) 21public Document Document { get; }
Structure\OmniSharpBlockStructureService.cs (1)
14public static async Task<OmniSharpBlockStructure?> GetBlockStructureAsync(Document document, OmniSharpBlockStructureOptions options, CancellationToken cancellationToken)
Microsoft.CodeAnalysis.ExternalAccess.Razor (39)
Cohost\Handlers\CodeActions.cs (4)
20Document document, 33public static async Task<CodeAction> ResolveCodeActionAsync(Document document, CodeAction codeAction, ResourceOperationKind[] resourceOperations, CancellationToken cancellationToken) 76public static Task<string> GetFormattedNewFileContentAsync(Document document, CancellationToken cancellationToken) 79public static Task<TextEdit[]> GetSimplifiedEditsAsync(Document document, TextEdit textEdit, CancellationToken cancellationToken)
Cohost\Handlers\Completion.cs (3)
28Document document, 56Document document, 72Document document,
Cohost\Handlers\Diagnostics.cs (1)
18public static async Task<ImmutableArray<LSP.Diagnostic>> GetDocumentDiagnosticsAsync(Document document, bool supportsVisualStudioExtensions, CancellationToken cancellationToken)
Cohost\Handlers\DocumentHighlights.cs (1)
17public static Task<DocumentHighlight[]?> GetHighlightsAsync(Document document, LinePosition linePosition, CancellationToken cancellationToken)
Cohost\Handlers\DocumentSpellCheck.cs (1)
20public static async Task<ImmutableArray<SpellCheckSpan>> GetSpellCheckSpansAsync(Document document, CancellationToken cancellationToken)
Cohost\Handlers\DocumentSymbols.cs (1)
16Document document, bool useHierarchicalSymbols, bool supportsVSExtensions, CancellationToken cancellationToken)
Cohost\Handlers\FindAllReferences.cs (1)
20public static async Task<SumType<VSInternalReferenceItem, Location>[]?> FindReferencesAsync(Workspace workspace, Document document, LinePosition linePosition, bool supportsVSExtensions, CancellationToken cancellationToken)
Cohost\Handlers\FoldingRanges.cs (1)
15public static Task<FoldingRange[]> GetFoldingRangesAsync(Document document, CancellationToken cancellationToken)
Cohost\Handlers\GoToDefinition.cs (1)
18public static Task<Location[]?> GetDefinitionsAsync(Workspace workspace, Document document, bool typeOnly, LinePosition linePosition, CancellationToken cancellationToken)
Cohost\Handlers\GoToImplementation.cs (1)
18public static Task<Location[]> FindImplementationsAsync(Document document, LinePosition linePosition, bool supportsVisualStudioExtensions, CancellationToken cancellationToken)
Cohost\Handlers\Hover.cs (1)
17Document document,
Cohost\Handlers\InlayHints.cs (2)
21public static Task<InlayHint[]?> GetInlayHintsAsync(Document document, TextDocumentIdentifier textDocumentIdentifier, Range range, bool displayAllOverride, CancellationToken cancellationToken) 34public static Task<InlayHint> ResolveInlayHintAsync(Document document, InlayHint request, CancellationToken cancellationToken)
Cohost\Handlers\OnAutoInsert.cs (1)
20public static Task<VSInternalDocumentOnAutoInsertResponseItem?> GetOnAutoInsertResponseAsync(Document document, LinePosition linePosition, string character, FormattingOptions formattingOptions, CancellationToken cancellationToken)
Cohost\Handlers\Rename.cs (2)
15public static Task<Range?> GetRenameRangeAsync(Document document, LinePosition linePosition, CancellationToken cancellationToken) 18public static Task<WorkspaceEdit?> GetRenameEditAsync(Document document, LinePosition linePosition, string newName, CancellationToken cancellationToken)
Cohost\Handlers\SemanticTokensRange.cs (1)
17Document document,
Cohost\Handlers\SignatureHelp.cs (1)
16public static Task<LSP.SignatureHelp?> GetSignatureHelpAsync(Document document, LinePosition linePosition, bool supportsVisualStudioExtensions, CancellationToken cancellationToken)
IRazorDocumentExcerptService.cs (1)
14Task<RazorExcerptResult?> TryExcerptAsync(Document document, TextSpan span, RazorExcerptMode mode, RazorClassificationOptionsWrapper options, CancellationToken cancellationToken);
IRazorMappingService.cs (3)
15Task<ImmutableArray<RazorMappedSpanResult>> MapSpansAsync(Document document, IEnumerable<TextSpan> spans, CancellationToken cancellationToken); 16Task<ImmutableArray<RazorMappedEditoResult>> MapTextChangesAsync(Document oldDocument, Document newDocument, CancellationToken cancellationToken);
IRazorSpanMappingService.cs (1)
15Task<ImmutableArray<RazorMappedSpanResult>> MapSpansAsync(Document document, IEnumerable<TextSpan> spans, CancellationToken cancellationToken);
RazorClassifierAccessor.cs (1)
16public static async Task<IEnumerable<ClassifiedSpan>> GetClassifiedSpansAsync(Document document, TextSpan textSpan, RazorClassificationOptionsWrapper options, CancellationToken cancellationToken)
RazorCSharpFormattingInteractionService.cs (1)
33Document document,
RazorDocumentExcerptServiceWrapper.cs (1)
21public async Task<ExcerptResult?> TryExcerptAsync(Document document, TextSpan span, ExcerptMode mode, ClassificationOptions classificationOptions, CancellationToken cancellationToken)
RazorExcerptResult.cs (2)
19public readonly Document Document; 23public RazorExcerptResult(SourceText content, TextSpan mappedSpan, ImmutableArray<ClassifiedSpan> classifiedSpans, Document document, TextSpan span)
RazorMappingServiceWrapper.cs (3)
24Document oldDocument, 25Document newDocument, 52Document document,
RazorSpanMappingServiceWrapper.cs (3)
32Document oldDocument, 33Document newDocument, 48Document document,
Microsoft.CodeAnalysis.ExternalAccess.Xaml (1)
Internal\DescriptionService.cs (1)
54var codeDocument = project.Documents.FirstOrDefault();
Microsoft.CodeAnalysis.Features (1452)
AddConstructorParametersFromMembers\AddConstructorParametersFromMembersCodeRefactoringProvider.AddConstructorParametersCodeAction.cs (3)
27Document document, 34private readonly Document _document = document; 66var constructorDocument = _document.Project.GetDocument(syntaxTree);
AddConstructorParametersFromMembers\AddConstructorParametersFromMembersCodeRefactoringProvider.cs (5)
55Document document, TextSpan textSpan, CancellationToken cancellationToken) 111private static AddConstructorParameterResult CreateCodeActions(Document document, CodeGenerationContextInfo info, State state) 145static AddConstructorParametersCodeAction GetOptionalContructorParametersCodeAction(Document document, CodeGenerationContextInfo info, ConstructorCandidate constructorCandidate, INamedTypeSymbol containingType, bool useSubMenuName) 163Document priorDocument, 165Document currentDocument,
AddConstructorParametersFromMembers\AddConstructorParametersFromMembersCodeRefactoringProvider.State.cs (4)
31Document document, 46Document document, 80Document document, 98private static async Task<bool> IsApplicableConstructorAsync(IMethodSymbol constructor, Document document, ImmutableArray<string> parameterNamesForSelectedMembers, CancellationToken cancellationToken)
AddDebuggerDisplay\AbstractAddDebuggerDisplayCodeRefactoringProvider.cs (3)
29protected abstract bool SupportsConstantInterpolatedStrings(Document document); 113private async Task<Document> ApplyAsync(Document document, TTypeDeclarationSyntax type, INamedTypeSymbol debuggerAttributeTypeSymbol, CancellationToken cancellationToken)
AddFileBanner\AbstractAddFileBannerCodeRefactoringProvider.cs (5)
91private static bool HasExistingBanner(Document document, SyntaxNode root) 98private static string GetEquivalenceKey(Document document, ImmutableArray<SyntaxTrivia> banner) 109private static ImmutableArray<SyntaxTrivia> GetBannerFromEquivalenceKey(string equivalenceKey, Document document) 123Document document, SyntaxNode? root, CancellationToken cancellationToken) 149Document document,
AddFileBanner\AbstractAddFileBannerNewDocumentFormattingProvider.cs (3)
22public async Task<Document> FormatNewDocumentAsync(Document document, Document? hintDocument, CodeCleanupOptions options, CancellationToken cancellationToken)
AddFileBanner\AddFileBannerHelpers.cs (4)
19public static async Task<Document> CopyBannerAsync( 20Document destinationDocument, 22Document sourceDocument, 49Document sourceDocument,
AddImport\AbstractAddImportCodeFixProvider.cs (1)
53var document = context.Document;
AddImport\AbstractAddImportFeatureService.cs (13)
56protected abstract Task<Document> AddImportAsync(SyntaxNode contextNode, INamespaceOrTypeSymbol symbol, Document document, AddImportPlacementOptions options, CancellationToken cancellationToken); 57protected abstract Task<Document> AddImportAsync(SyntaxNode contextNode, IReadOnlyList<string> nameSpaceParts, Document document, AddImportPlacementOptions options, CancellationToken cancellationToken); 62protected abstract (string description, bool hasExistingImport) GetDescription(Document document, AddImportPlacementOptions options, INamespaceOrTypeSymbol symbol, SemanticModel semanticModel, SyntaxNode root, CancellationToken cancellationToken); 65Document document, TextSpan span, string diagnosticId, int maxResults, 89Document document, TextSpan span, string diagnosticId, int maxResults, 132Document document, 515Document document, TextSpan span, ImmutableArray<Diagnostic> diagnostics, int maxResultsPerDiagnostic, 538Document document, TextSpan span, ImmutableArray<string> diagnosticIds, 562Document document, 604Document document, ImmutableArray<AddImportFixData> fixes, 619private static CodeAction? TryCreateCodeAction(Document document, AddImportFixData fixData, IPackageInstallerService? installerService)
AddImport\AddImportOptions.cs (1)
31public static async ValueTask<AddImportOptions> GetAddImportOptionsAsync(this Document document, SymbolSearchOptions searchOptions, CancellationToken cancellationToken)
AddImport\CodeActions\AddImportCodeAction.cs (5)
33/// The <see cref="Document"/> we started the add-import analysis in. 35protected readonly Document OriginalDocument; 43Document originalDocument, 62protected async Task<Document> GetUpdatedDocumentAsync(CancellationToken cancellationToken) 66var newDocument = OriginalDocument.WithText(newText);
AddImport\CodeActions\AssemblyReferenceCodeAction.cs (2)
25Document originalDocument, 40var newDocument = await GetUpdatedDocumentAsync(cancellationToken).ConfigureAwait(false);
AddImport\CodeActions\InstallPackageAndAddImportCodeAction.cs (4)
34Document originalDocument, 66var newDocument = await GetUpdatedDocumentAsync(cancellationToken).ConfigureAwait(false); 73var updatedDocument = newDocument.WithSyntaxRoot(updatedRoot); 86var updatedDocument = await GetUpdatedDocumentAsync(cancellationToken).ConfigureAwait(false);
AddImport\CodeActions\MetadataSymbolReferenceCodeAction.cs (1)
22public MetadataSymbolReferenceCodeAction(Document originalDocument, AddImportFixData fixData)
AddImport\CodeActions\ProjectSymbolReferenceCodeAction.cs (2)
28Document originalDocument, 37private static bool ShouldAddProjectReference(Document originalDocument, AddImportFixData fixData)
AddImport\CodeActions\SymbolReference.SymbolReferenceCodeAction.cs (2)
25Document originalDocument, 52var updatedDocument = await GetUpdatedDocumentAsync(cancellationToken).ConfigureAwait(false);
AddImport\IAddImportFeatureService.cs (5)
25Document document, TextSpan span, string diagnosticId, int maxResults, 34Document document, TextSpan span, ImmutableArray<Diagnostic> diagnostics, int maxResultsPerDiagnostic, 43Document document, ImmutableArray<AddImportFixData> fixes, 48/// Similar to <see cref="GetFixesAsync(Document, TextSpan, string, int, ISymbolSearchService, AddImportOptions, ImmutableArray{PackageSource}, CancellationToken)"/> 52Document document, TextSpan span, ImmutableArray<string> diagnosticIds,
AddImport\References\AssemblyReference.cs (1)
26Document document, SyntaxNode node, CodeCleanupOptions options, CancellationToken cancellationToken)
AddImport\References\MetadataSymbolReference.cs (5)
34protected override bool ShouldAddWithExistingImport(Document document) => true; 37Document document, CodeCleanupOptions options, SyntaxNode node, 51Document document, ImmutableArray<TextChange> textChanges, string description, 60protected override CodeActionPriority GetPriority(Document document) 63protected override ImmutableArray<string> GetTags(Document document)
AddImport\References\PackageReference.cs (1)
29Document document, SyntaxNode node, CodeCleanupOptions options, CancellationToken cancellationToken)
AddImport\References\ProjectSymbolReference.cs (5)
34protected override ImmutableArray<string> GetTags(Document document) 50protected override bool ShouldAddWithExistingImport(Document document) 53protected override CodeActionPriority GetPriority(Document document) 75Document document, ImmutableArray<TextChange> textChanges, string description, 83Document document, CodeCleanupOptions options, SyntaxNode node,
AddImport\References\Reference.cs (8)
33public int CompareTo(Document document, Reference other) 57private static readonly ImmutableArray<Func<Reference, Document, IComparable>> s_comparers 77protected async Task<(SyntaxNode, Document)> ReplaceNameNodeAsync( 78SyntaxNode contextNode, Document document, CancellationToken cancellationToken) 93var newDocument = document.WithSyntaxRoot(root); 101Document document, SyntaxNode node, CodeCleanupOptions options, CancellationToken cancellationToken); 104Document document, SyntaxNode node, CodeCleanupOptions options, CancellationToken cancellationToken) 111var originalDocument = document;
AddImport\References\SymbolReference.cs (8)
28protected abstract bool ShouldAddWithExistingImport(Document document); 30protected abstract ImmutableArray<string> GetTags(Document document); 49Document document, SyntaxNode contextNode, 59(var newContextNode, var newDocument) = await ReplaceNameNodeAsync( 76Document document, SyntaxNode node, 119Document document, ImmutableArray<TextChange> textChanges, 122protected abstract CodeActionPriority GetPriority(Document document); 125Document document, CodeCleanupOptions options, SyntaxNode node,
AddImport\SymbolReferenceFinder.cs (2)
32private readonly Document _document; 51Document document,
AddImport\SymbolResult.cs (1)
48public bool DesiredNameMatchesSourceName(Document document)
AddPackage\AbstractAddPackageCodeFixProvider.cs (1)
31var document = context.Document;
AddPackage\InstallPackageDirectlyCodeAction.cs (1)
18Document document,
AddPackage\InstallPackageDirectlyCodeActionOperation.cs (2)
22private readonly Document _document; 33Document document,
AddPackage\InstallPackageParentCodeAction.cs (3)
30Document document) : CodeAction.CodeActionWithNestedActions(string.Format(FeaturesResources.Install_package_0, packageName), 43Document document) 68Document document,
AddPackage\ParentInstallPackageCodeAction.cs (1)
25/// <param name="textChanges">Additional text changes to make to the <see cref="Document"/>. Generally, this would be
BraceCompletion\AbstractBraceCompletionService.cs (2)
41public ValueTask<bool> HasBraceCompletionAsync(BraceCompletionContext context, Document document, CancellationToken cancellationToken) 103protected virtual ValueTask<bool> IsValidOpenBraceTokenAtPositionAsync(Document document, SyntaxToken token, int position, CancellationToken cancellationToken)
BraceCompletion\IBraceCompletionService.cs (1)
38ValueTask<bool> HasBraceCompletionAsync(BraceCompletionContext context, Document document, CancellationToken cancellationToken);
BraceMatching\AbstractBraceMatcher.cs (1)
59Document document,
BraceMatching\AbstractDirectiveTriviaBraceMatcher.cs (1)
29public async Task<BraceMatchingResult?> FindBracesAsync(Document document, int position, BraceMatchingOptions options, CancellationToken cancellationToken)
BraceMatching\AbstractEmbeddedLanguageBraceMatcher.cs (1)
32Document document, int position, BraceMatchingOptions options, CancellationToken cancellationToken)
BraceMatching\BraceMatchingService.cs (1)
26public async Task<BraceMatchingResult?> GetMatchingBracesAsync(Document document, int position, BraceMatchingOptions options, CancellationToken cancellationToken)
BraceMatching\IBraceMatcher.cs (1)
29Task<BraceMatchingResult?> FindBracesAsync(Document document, int position, BraceMatchingOptions options, CancellationToken cancellationToken);
BraceMatching\IBraceMatchingService.cs (1)
14Task<BraceMatchingResult?> GetMatchingBracesAsync(Document document, int position, BraceMatchingOptions options, CancellationToken cancellationToken);
BraceMatching\IBraceMatchingServiceExtensions.cs (1)
15Document document,
BracePairs\IBracePairsService.cs (2)
22Task AddBracePairsAsync(Document document, TextSpan textSpan, ArrayBuilder<BracePairData> bracePairs, CancellationToken cancellationToken); 47Document document, TextSpan span, ArrayBuilder<BracePairData> bracePairs, CancellationToken cancellationToken)
ChangeSignature\AbstractChangeSignatureService.cs (8)
41public abstract Task<(ISymbol? symbol, int selectedIndex)> GetInvocationSymbolAsync(Document document, int position, bool restrictToDeclarations, CancellationToken cancellationToken); 47public abstract SyntaxNode? FindNodeToUpdate(Document document, SyntaxNode node); 50IMethodSymbol symbol, Document document, CancellationToken cancellationToken); 61protected abstract ImmutableArray<AbstractFormattingRule> GetFormattingRules(Document document); 94public async Task<ImmutableArray<ChangeSignatureCodeAction>> GetChangeSignatureCodeActionAsync(Document document, TextSpan span, CancellationToken cancellationToken) 104Document document, int position, bool restrictToDeclarations, CancellationToken cancellationToken) 460var document = solution.GetDocument(documentId); 1071protected static int GetParameterIndexFromInvocationArgument(SyntaxNode argument, Document document, SemanticModel semanticModel, CancellationToken cancellationToken)
ChangeSignature\ChangeSignatureAnalyzedContext.cs (1)
19public Solution Solution => Document.Project.Solution;
ChangeSignature\DelegateInvokeMethodReferenceFinder.cs (4)
55foreach (var document in project.Documents) 71IImmutableSet<Document>? documents, 72Action<Document, TData> processResult, 77foreach (var document in project.Documents)
ClassifiedSpansAndHighlightSpanFactory.cs (3)
32Document document, TextSpan sourceSpan, ClassificationOptions options, CancellationToken cancellationToken) 57Document document, TextSpan narrowSpan, TextSpan widenedSpan, ClassificationOptions options, CancellationToken cancellationToken) 69Document document, TextSpan narrowSpan, TextSpan widenedSpan, ClassificationOptions options, CancellationToken cancellationToken)
CodeFixes\FixAllOccurrences\IFixMultipleOccurrencesService.cs (1)
22ImmutableDictionary<Document, ImmutableArray<Diagnostic>> diagnosticsToFix,
CodeFixes\Suppression\AbstractSuppressionBatchFixAllProvider.cs (10)
45ImmutableDictionary<Document, ImmutableArray<Diagnostic>> documentsAndDiagnosticsToFixMap, 75ImmutableDictionary<Document, ImmutableArray<Diagnostic>> documentsAndDiagnosticsToFixMap, 112Document document, ImmutableArray<Diagnostic> diagnostics, 248private static async Task<IReadOnlyDictionary<DocumentId, ConcurrentBag<(CodeAction, Document)>>> GetDocumentIdToChangedDocumentsAsync( 254var documentIdToChangedDocuments = new ConcurrentDictionary<DocumentId, ConcurrentBag<(CodeAction, Document)>>(); 272IReadOnlyDictionary<DocumentId, ConcurrentBag<(CodeAction, Document)>> documentIdToChangedDocuments, 299IEnumerable<(CodeAction action, Document document)> changedDocuments, 313var document = orderedDocuments[0].document; 340private static readonly Func<DocumentId, ConcurrentBag<(CodeAction, Document)>> s_getValue = 345ConcurrentDictionary<DocumentId, ConcurrentBag<(CodeAction, Document)>> documentIdToChangedDocuments,
CodeFixes\Suppression\AbstractSuppressionCodeFixProvider.AbstractGlobalSuppressMessageCodeAction.cs (5)
34var changedSuppressionDocument = await GetChangedSuppressionDocumentAsync(cancellationToken).ConfigureAwait(false); 43protected abstract Task<Document> GetChangedSuppressionDocumentAsync(CancellationToken cancellationToken); 64protected async Task<Document> GetOrCreateSuppressionsDocumentAsync(CancellationToken c) 70Document suppressionsDoc = null; 74foreach (var document in _project.Documents)
CodeFixes\Suppression\AbstractSuppressionCodeFixProvider.cs (5)
144if (textDocument is not Document document) 150internal async Task<ImmutableArray<PragmaWarningCodeAction>> GetPragmaSuppressionsAsync(Document document, TextSpan span, IEnumerable<Diagnostic> diagnostics, CancellationToken cancellationToken) 159Document document, TextSpan span, IEnumerable<Diagnostic> diagnostics, bool skipSuppressMessage, bool skipUnsuppress, CancellationToken cancellationToken) 188Document documentOpt, Project project, IEnumerable<Diagnostic> diagnostics, SuppressionTargetInfo suppressionTargetInfo, bool skipSuppressMessage, bool skipUnsuppress, CancellationToken cancellationToken) 265private async Task<SuppressionTargetInfo> GetSuppressionTargetInfoAsync(Document document, TextSpan span, CancellationToken cancellationToken)
CodeFixes\Suppression\AbstractSuppressionCodeFixProvider.GlobalSuppressMessageCodeAction.cs (1)
26protected override async Task<Document> GetChangedSuppressionDocumentAsync(CancellationToken cancellationToken)
CodeFixes\Suppression\AbstractSuppressionCodeFixProvider.GlobalSuppressMessageFixAllCodeAction.cs (8)
41internal static CodeAction Create(string title, AbstractSuppressionCodeFixProvider fixer, Document triggerDocument, ImmutableDictionary<Document, ImmutableArray<Diagnostic>> diagnosticsByDocument) 60protected override Task<Document> PostProcessChangesAsync(Document document, CancellationToken cancellationToken) 69Document triggerDocument, 70ImmutableDictionary<Document, ImmutableArray<Diagnostic>> diagnosticsByDocument, 128protected override async Task<Document> GetChangedSuppressionDocumentAsync(CancellationToken cancellationToken) 152private static async Task<IEnumerable<KeyValuePair<ISymbol, ImmutableArray<Diagnostic>>>> CreateDiagnosticsBySymbolAsync(AbstractSuppressionCodeFixProvider fixer, IEnumerable<KeyValuePair<Document, ImmutableArray<Diagnostic>>> diagnosticsByDocument, CancellationToken cancellationToken)
CodeFixes\Suppression\AbstractSuppressionCodeFixProvider.IPragmaBasedCodeAction.cs (1)
19Task<Document> GetChangedDocumentAsync(bool includeStartTokenChange, bool includeEndTokenChange, CancellationToken cancellationToken);
CodeFixes\Suppression\AbstractSuppressionCodeFixProvider.LocalSuppressMessageCodeAction.cs (3)
19Document document, 25private readonly Document _document = document; 28protected override async Task<Document> GetChangedDocumentAsync(CancellationToken cancellationToken)
CodeFixes\Suppression\AbstractSuppressionCodeFixProvider.PragmaBatchFixHelpers.cs (6)
28Document document, 41private static async Task<Document> BatchPragmaFixesAsync( 43Document document, 56var currentDocument = document; 121Document currentDocument, 126var newDocument = await pragmaAction.GetChangedDocumentAsync(includeStartTokenChange, includeEndTokenChange, cancellationToken).ConfigureAwait(false);
CodeFixes\Suppression\AbstractSuppressionCodeFixProvider.PragmaHelpers.cs (3)
24internal static async Task<Document> GetChangeDocumentWithPragmaAdjustedAsync( 25Document document, 204internal static void NormalizeTriviaOnTokens(AbstractSuppressionCodeFixProvider fixer, ref Document document, ref SuppressionTargetInfo suppressionTargetInfo)
CodeFixes\Suppression\AbstractSuppressionCodeFixProvider.PragmaWarningBatchFixAllProvider.cs (1)
27Document document, ImmutableArray<Diagnostic> diagnostics,
CodeFixes\Suppression\AbstractSuppressionCodeFixProvider.PragmaWarningCodeAction.cs (5)
18private readonly Document _document; 25Document document, 39Document document, 59protected override async Task<Document> GetChangedDocumentAsync(CancellationToken cancellationToken) 62public async Task<Document> GetChangedDocumentAsync(bool includeStartTokenChange, bool includeEndTokenChange, CancellationToken cancellationToken)
CodeFixes\Suppression\AbstractSuppressionCodeFixProvider.RemoveSuppressionCodeAction.BatchFixer.cs (1)
35Document document, ImmutableArray<Diagnostic> diagnostics,
CodeFixes\Suppression\AbstractSuppressionCodeFixProvider.RemoveSuppressionCodeAction.cs (1)
26Document documentOpt,
CodeFixes\Suppression\AbstractSuppressionCodeFixProvider.RemoveSuppressionCodeAction_Attribute.cs (1)
64var documentWithAttribute = _project.GetDocument(attributeNode.SyntaxTree);
CodeFixes\Suppression\AbstractSuppressionCodeFixProvider.RemoveSuppressionCodeAction_Pragma.cs (5)
27private readonly Document _document; 33Document document, 47Document document, 64protected override async Task<Document> GetChangedDocumentAsync(CancellationToken cancellationToken) 67public async Task<Document> GetChangedDocumentAsync(bool includeStartTokenChange, bool includeEndTokenChange, CancellationToken cancellationToken)
CodeLens\CodeLensFindReferenceProgress.cs (2)
61public void OnFindInDocumentStarted(Document document) 65public void OnFindInDocumentCompleted(Document document)
CodeLens\CodeLensReferencesService.cs (4)
103var document = solution.GetDocument(location.SourceTree); 170private static SyntaxNode GetEnclosingCodeElementNode(Document document, SyntaxToken token, ICodeLensDisplayInfoService langServices, CancellationToken cancellationToken) 247var document = solution.GetDocument(commonLocation.SourceTree); 278var document = solution.GetDocument(syntaxNode.GetLocation().SourceTree);
CodeLens\ICodeLensMemberFinder.cs (1)
18Task<ImmutableArray<CodeLensMember>> GetCodeLensMembersAsync(Document document, CancellationToken cancellationToken);
CodeRefactorings\AddAwait\AbstractAddAwaitCodeRefactoringProvider.cs (2)
108private static Task<Document> AddAwaitAsync( 109Document document,
CodeRefactorings\AddMissingImports\AbstractAddMissingImportsFeatureService.cs (13)
32public async Task<Document> AddMissingImportsAsync(Document document, TextSpan textSpan, IProgress<CodeAnalysisProgress> progressTracker, CancellationToken cancellationToken) 40public async Task<Document> AddMissingImportsAsync( 41Document document, 57public async Task<AddMissingImportsAnalysisResult> AnalyzeAsync(Document document, TextSpan textSpan, CancellationToken cancellationToken) 89private async Task<Document> ApplyFixesAsync( 90Document document, 155private async Task<Document> CleanUpNewLinesAsync(Document document, IEnumerable<TextSpan> insertSpans, SyntaxFormattingOptions formattingOptions, CancellationToken cancellationToken) 157var newDocument = document; 170private async Task<Document> CleanUpNewLinesAsync(Document document, TextSpan insertSpan, SyntaxFormattingOptions options, CancellationToken cancellationToken) 204Document document,
CodeRefactorings\AddMissingImports\IAddMissingImportsFeatureService.cs (6)
21Task<Document> AddMissingImportsAsync(Document document, TextSpan textSpan, IProgress<CodeAnalysisProgress> progressTracker, CancellationToken cancellationToken); 26Task<AddMissingImportsAnalysisResult> AnalyzeAsync(Document document, TextSpan textSpan, CancellationToken cancellationToken); 29/// Performs the same action as <see cref="AddMissingImportsAsync(Document, TextSpan, IProgress{CodeAnalysisProgress}, CancellationToken)"/> but with a predetermined analysis of the input 32Task<Document> AddMissingImportsAsync(Document document, AddMissingImportsAnalysisResult analysisResult, IProgress<CodeAnalysisProgress> progressTracker, CancellationToken cancellationToken);
CodeRefactorings\CodeRefactoringContextExtensions.cs (3)
58public static async Task<TSyntaxNode?> TryGetRelevantNodeAsync<TSyntaxNode>(this Document document, TextSpan span, CancellationToken cancellationToken) where TSyntaxNode : SyntaxNode 75this Document document, TextSpan span, CancellationToken cancellationToken) where TSyntaxNode : SyntaxNode 81this Document document, TextSpan span, bool allowEmptyNodes, CancellationToken cancellationToken) where TSyntaxNode : SyntaxNode
CodeRefactorings\ExtractMethod\AbstractExtractMethodCodeRefactoringProvider.cs (5)
53Document document, 69Document document, TextSpan textSpan, ExtractMethodGenerationOptions extractOptions, CancellationToken cancellationToken) 94Document document, TextSpan textSpan, ExtractMethodGenerationOptions extractOptions, CancellationToken cancellationToken) 125private static async Task<Document> AddRenameAnnotationAsync(Document document, SyntaxToken? invocationNameToken, CancellationToken cancellationToken)
CodeRefactorings\MoveType\AbstractMoveTypeService.cs (6)
30public abstract Task<Solution> GetModifiedSolutionAsync(Document document, TextSpan textSpan, MoveTypeOperationKind operationKind, CancellationToken cancellationToken); 31public abstract Task<ImmutableArray<CodeAction>> GetRefactoringAsync(Document document, TextSpan textSpan, CancellationToken cancellationToken); 41protected abstract Task<TTypeDeclarationSyntax?> GetRelevantNodeAsync(Document document, TextSpan textSpan, CancellationToken cancellationToken); 46Document document, TextSpan textSpan, CancellationToken cancellationToken) 52public override async Task<Solution> GetModifiedSolutionAsync(Document document, TextSpan textSpan, MoveTypeOperationKind operationKind, CancellationToken cancellationToken) 74private async Task<State?> CreateStateAsync(Document document, TextSpan textSpan, CancellationToken cancellationToken)
CodeRefactorings\MoveType\AbstractMoveTypeService.MoveTypeEditor.cs (6)
62var documentWithMovedType = await AddNewDocumentWithSingleTypeDeclarationAsync(newDocumentId).ConfigureAwait(false); 112private async Task<Document> AddNewDocumentWithSingleTypeDeclarationAsync(DocumentId newDocumentId) 114var document = SemanticDocument.Document; 203private async Task<SyntaxNode> AddFinalNewLineIfDesiredAsync(Document document, SyntaxNode modifiedRoot) 232private async Task<Solution> RemoveTypeFromSourceDocumentAsync(Document sourceDocument) 245var updatedDocument = documentEditor.GetChangedDocument();
CodeRefactorings\MoveType\AbstractMoveTypeService.MoveTypeNamespaceScopeEditor.cs (2)
40Document documentToEdit, 85var changedDocument = editor.GetChangedDocument();
CodeRefactorings\MoveType\IMoveTypeService.cs (2)
19Task<ImmutableArray<CodeAction>> GetRefactoringAsync(Document document, TextSpan textSpan, CancellationToken cancellationToken); 21Task<Solution> GetModifiedSolutionAsync(Document document, TextSpan textSpan, MoveTypeOperationKind operationKind, CancellationToken cancellationToken);
CodeRefactorings\SyncNamespace\AbstractChangeNamespaceService.cs (29)
39public abstract Task<bool> CanChangeNamespaceAsync(Document document, SyntaxNode container, CancellationToken cancellationToken); 41public abstract Task<Solution> ChangeNamespaceAsync(Document document, SyntaxNode container, string targetNamespace, CancellationToken cancellationToken); 43public abstract Task<Solution?> TryChangeTopLevelNamespacesAsync(Document document, string targetNamespace, CancellationToken cancellationToken); 82protected abstract Task<SyntaxNode?> TryGetApplicableContainerFromSpanAsync(Document document, TextSpan span, CancellationToken cancellationToken); 88/// <see cref="IChangeNamespaceService.CanChangeNamespaceAsync(Document, SyntaxNode, CancellationToken)"/> 95protected abstract Task<ImmutableArray<(DocumentId id, SyntaxNode container)>> GetValidContainersFromAllLinkedDocumentsAsync(Document document, SyntaxNode container, CancellationToken cancellationToken); 103public override async Task<bool> CanChangeNamespaceAsync(Document document, SyntaxNode container, CancellationToken cancellationToken) 115Document document, 163static async Task<ImmutableArray<SyntaxNode>> GetTopLevelNamespacesAsync(Document document, CancellationToken cancellationToken) 176Document document, 323Document document, SyntaxNode container, CancellationToken cancellationToken) 345protected static bool IsSupportedLinkedDocument(Document document, out ImmutableArray<DocumentId> allDocumentIds) 366Document document, 400private static ImmutableArray<SyntaxNode> CreateImports(Document document, ImmutableArray<string> names, bool withFormatterAnnotation) 511public Document Document => ReferenceLocation.Document; 515Document document, ISymbol symbol, CancellationToken cancellationToken) 548private static async Task<ImmutableArray<ReferencedSymbol>> FindReferencesAsync(ISymbol symbol, Document document, CancellationToken cancellationToken) 559private async Task<Document> FixDeclarationDocumentAsync( 560Document document, 640private static async Task<Document> FixReferencingDocumentAsync( 641Document document, 684private static async Task<(Document, ImmutableArray<SyntaxNode>)> FixReferencesAsync( 685Document document, 751var fixedDocument = editor.GetChangedDocument(); 766using var _2 = ArrayBuilder<Document>.GetInstance(out var documentsToProcess); 793async static Task<Document> RemoveUnnecessaryImportsWorkerAsync( 794Document doc, 813private static async Task<Document> AddImportsInContainersAsync( 814Document document,
CodeRefactorings\SyncNamespace\AbstractSyncNamespaceCodeRefactoringProvider.cs (1)
93protected abstract Task<SyntaxNode?> TryGetApplicableInvocationNodeAsync(Document document, TextSpan span, CancellationToken cancellationToken);
CodeRefactorings\SyncNamespace\AbstractSyncNamespaceCodeRefactoringProvider.MoveFileCodeAction.cs (3)
39var document = _state.Document; 56var document = state.Document; 164foreach (var document in project.Documents)
CodeRefactorings\SyncNamespace\AbstractSyncNamespaceCodeRefactoringProvider.State.cs (5)
32public Document Document { get; } 55Document document, 68Document document, 151private static bool IsDocumentPathRootedInProjectFolder(Document document) 169private static string? GetDefaultNamespace(Document document, ISyntaxFactsService syntaxFacts)
Common\DocumentNavigationOperation.cs (2)
15/// operations they want to apply. For example, an implementation could generate a new <see cref="Document"/> 17/// <see cref="Document"/> using this operation.
Common\StartInlineRenameSessionOperation.cs (2)
15/// operations they want to apply. For example, an implementation could generate a new <see cref="Document"/> 17/// <see cref="Document"/> and invoke rename at a given position using this operation.
Completion\CommonCompletionProvider.cs (6)
56public sealed override Task<CompletionDescription?> GetDescriptionAsync(Document document, CompletionItem item, CancellationToken cancellationToken) 64internal override async Task<CompletionDescription?> GetDescriptionAsync(Document document, CompletionItem item, CompletionOptions options, SymbolDescriptionOptions displayOptions, CancellationToken cancellationToken) 76Document document, CompletionItem item, 103Document document, CompletionItem item, CompletionOptions options, SymbolDescriptionOptions displayOptions, CancellationToken cancellationToken) 110public override async Task<CompletionChange> GetChangeAsync(Document document, CompletionItem item, char? commitKey = null, CancellationToken cancellationToken = default) 117public virtual Task<TextChange?> GetTextChangeAsync(Document document, CompletionItem selectedItem, char? ch, CancellationToken cancellationToken)
Completion\CommonCompletionService.cs (1)
44Document document,
Completion\CompletionContext.cs (5)
33public Document Document { get; } 59/// be overwritten during <see cref="CompletionService.GetCompletionsAsync(Document, int, CompletionTrigger, ImmutableHashSet{string}, OptionSet, CancellationToken)"/>. 114Document document, 140Document document, 217internal Task<SyntaxContext> GetSyntaxContextWithExistingSpeculativeModelAsync(Document document, CancellationToken cancellationToken)
Completion\CompletionHelper.cs (1)
21public static CompletionHelper GetHelper(Document document)
Completion\CompletionOptions.cs (1)
76public bool ShouldShowNewSnippetExperience(Document document)
Completion\CompletionProvider.cs (4)
57internal virtual async Task<bool> IsSyntacticTriggerCharacterAsync(Document document, int caretPosition, CompletionTrigger trigger, CompletionOptions options, CancellationToken cancellationToken) 63public virtual Task<CompletionDescription?> GetDescriptionAsync(Document document, CompletionItem item, CancellationToken cancellationToken) 66internal virtual Task<CompletionDescription?> GetDescriptionAsync(Document document, CompletionItem item, CompletionOptions options, SymbolDescriptionOptions displayOptions, CancellationToken cancellationToken) 78public virtual Task<CompletionChange> GetChangeAsync(Document document, CompletionItem item, char? commitKey, CancellationToken cancellationToken)
Completion\CompletionService.cs (7)
51public static CompletionService? GetService(Document? document) 192Document document, 209internal virtual async Task<CompletionDescription?> GetDescriptionAsync(Document document, CompletionItem item, CompletionOptions options, SymbolDescriptionOptions displayOptions, CancellationToken cancellationToken = default) 239Document document, 284Document document, 307Document document, 411Document document,
Completion\CompletionService_GetCompletions.cs (9)
38Document document, 63Document document, 130Document document, ConcatImmutableArray<CompletionProvider> providers, int caretPosition, CompletionOptions options, CompletionTrigger trigger, ImmutableHashSet<string>? roles, SourceText text) 153Document document, ImmutableArray<CompletionProvider> triggeredProviders, int caretPosition, CompletionTrigger trigger, CompletionOptions options, CancellationToken cancellationToken) 181private Document GetDocumentWithFrozenPartialSemantics(Document document, CancellationToken cancellationToken) 190Document document, SourceText text, int caretPosition, in CompletionOptions options) 232Document document, int caretPosition, CompletionTrigger trigger, 321Document document,
Completion\INotifyCommittingItemCompletionProvider.cs (1)
24Task NotifyCommittingItemAsync(Document document, CompletionItem item, char? commitKey, CancellationToken cancellationToken);
Completion\Providers\AbstractAggregateEmbeddedLanguageCompletionProvider.cs (2)
108public override Task<CompletionChange> GetChangeAsync(Document document, CompletionItem item, char? commitKey, CancellationToken cancellationToken) 111internal override Task<CompletionDescription?> GetDescriptionAsync(Document document, CompletionItem item, CompletionOptions options, SymbolDescriptionOptions displayOptions, CancellationToken cancellationToken)
Completion\Providers\AbstractAwaitCompletionProvider.cs (3)
82var document = context.Document; 166public sealed override async Task<CompletionChange> GetChangeAsync(Document document, CompletionItem item, char? commitKey, CancellationToken cancellationToken) 261var document = syntaxContext.Document;
Completion\Providers\AbstractCrefCompletionProvider.cs (2)
19Document document, CompletionItem item, CompletionOptions options, SymbolDescriptionOptions displayOptions, CancellationToken cancellationToken) 48Document document, int position, CompletionOptions options, CancellationToken cancellationToken);
Completion\Providers\AbstractDocCommentCompletionProvider.cs (2)
91protected abstract Task<IEnumerable<CompletionItem>?> GetItemsWorkerAsync(Document document, int position, CompletionTrigger trigger, CancellationToken cancellationToken); 274public override async Task<CompletionChange> GetChangeAsync(Document document, CompletionItem item, char? commitChar = null, CancellationToken cancellationToken = default)
Completion\Providers\AbstractInternalsVisibleToCompletionProvider.cs (5)
119private static async Task<bool> CheckTypeInfoOfAttributeAsync(Document document, SyntaxNode attributeNode, CancellationToken cancellationToken) 181foreach (var document in project.Documents) 227private async Task<string> GetAssemblyNameFromInternalsVisibleToAttributeAsync(Document document, SyntaxNode node, CancellationToken cancellationToken) 248private static async Task<TextSpan> GetTextChangeSpanAsync(Document document, TextSpan startSpan, CancellationToken cancellationToken) 268public override async Task<CompletionChange> GetChangeAsync(Document document, CompletionItem item, char? commitKey = null, CancellationToken cancellationToken = default)
Completion\Providers\AbstractKeywordCompletionProvider.cs (3)
43private async Task<ImmutableArray<CompletionItem>> RecommendCompletionItemsAsync(Document document, CompletionContext context, CancellationToken cancellationToken) 52Document document, 73public sealed override Task<TextChange?> GetTextChangeAsync(Document document, CompletionItem item, char? ch, CancellationToken cancellationToken)
Completion\Providers\AbstractMemberInsertingCompletionProvider.cs (11)
39Document document, CompletionItem item, Compilation compilation, ISymbol member, INamedTypeSymbol containingType, CancellationToken cancellationToken); 46public override async Task<CompletionChange> GetChangeAsync(Document document, CompletionItem item, char? commitKey = null, CancellationToken cancellationToken = default) 48var newDocument = await DetermineNewDocumentAsync(document, item, cancellationToken).ConfigureAwait(false); 76private async Task<Document> DetermineNewDocumentAsync( 77Document document, 136private async Task<Document?> GenerateMemberAndUsingsAsync( 137Document document, 190private async Task<Document> RemoveDestinationNodeAsync( 191Document memberContainingDocument, CodeCleanupOptions cleanupOptions, CancellationToken cancellationToken) 219var document = memberContainingDocument.WithSyntaxRoot(newRoot); 227internal override Task<CompletionDescription> GetDescriptionWorkerAsync(Document document, CompletionItem item, CompletionOptions options, SymbolDescriptionOptions displayOptions, CancellationToken cancellationToken)
Completion\Providers\AbstractObjectInitializerCompletionProvider.cs (4)
19protected abstract Tuple<ITypeSymbol, Location>? GetInitializedType(Document document, SemanticModel semanticModel, int position, CancellationToken cancellationToken); 25var document = context.Document; 84internal override Task<CompletionDescription> GetDescriptionWorkerAsync(Document document, CompletionItem item, CompletionOptions options, SymbolDescriptionOptions displayOptions, CancellationToken cancellationToken) 87protected abstract Task<bool> IsExclusiveAsync(Document document, int position, CancellationToken cancellationToken);
Completion\Providers\AbstractOverrideCompletionProvider.BaseItemGetter.cs (2)
31protected readonly Document Document; 38Document document,
Completion\Providers\AbstractOverrideCompletionProvider.cs (1)
35Document document, CompletionItem completionItem, Compilation compilation, ISymbol overriddenMember, INamedTypeSymbol containingType, CancellationToken cancellationToken)
Completion\Providers\AbstractOverrideCompletionProvider.ItemGetter.cs (3)
18Document document, 35Document document, 56var semanticModel = await Document.ReuseExistingSpeculativeModelAsync(startToken.Parent, CancellationToken).ConfigureAwait(false);
Completion\Providers\AbstractPartialMethodCompletionProvider.cs (3)
42var document = context.Document; 63Document document, CompletionItem item, Compilation compilation, ISymbol member, INamedTypeSymbol containingType, CancellationToken cancellationToken) 83Document document, int position, TextSpan span, DeclarationModifiers modifiers, SyntaxToken token, CancellationToken cancellationToken)
Completion\Providers\AbstractPartialTypeCompletionProvider.cs (3)
31var document = completionContext.Document; 110internal override Task<CompletionDescription> GetDescriptionWorkerAsync(Document document, CompletionItem item, CompletionOptions options, SymbolDescriptionOptions displayOptions, CancellationToken cancellationToken) 113public override Task<TextChange?> GetTextChangeAsync(Document document, CompletionItem selectedItem, char? ch, CancellationToken cancellationToken)
Completion\Providers\AbstractPreprocessorCompletionProvider.cs (1)
20var originatingDocument = context.Document;
Completion\Providers\AbstractRecommendationServiceBasedCompletionProvider.cs (3)
204Document document, CompletionItem item, CompletionOptions options, SymbolDescriptionOptions displayOptions, CancellationToken cancellationToken) 267protected sealed override async Task<bool> IsSemanticTriggerCharacterAsync(Document document, int characterPosition, CancellationToken cancellationToken) 273protected async Task<bool?> IsTriggerOnDotAsync(Document document, int characterPosition, CancellationToken cancellationToken)
Completion\Providers\AbstractSuggestionModeCompletionProvider.cs (1)
14protected abstract Task<CompletionItem?> GetSuggestionModeItemAsync(Document document, int position, TextSpan span, CompletionTrigger triggerInfo, CancellationToken cancellationToken);
Completion\Providers\AbstractSymbolCompletionProvider.cs (6)
249internal override Task<CompletionDescription> GetDescriptionWorkerAsync(Document document, CompletionItem item, CompletionOptions options, SymbolDescriptionOptions displayOptions, CancellationToken cancellationToken) 256var document = completionContext.Document; 292Document document, 329protected virtual Task<bool> IsSemanticTriggerCharacterAsync(Document document, int characterPosition, CancellationToken cancellationToken) 358CompletionContext completionContext, Document document, CompletionOptions options, IEnumerable<DocumentId> relatedDocuments, CancellationToken cancellationToken) 416public sealed override Task<TextChange?> GetTextChangeAsync(Document document, CompletionItem selectedItem, char? ch, CancellationToken cancellationToken)
Completion\Providers\EmbeddedLanguageCompletionProvider.cs (2)
24public abstract Task<CompletionChange> GetChangeAsync(Document document, CompletionItem item, char? commitKey, CancellationToken cancellationToken); 25public abstract Task<CompletionDescription?> GetDescriptionAsync(Document document, CompletionItem item, CancellationToken cancellationToken);
Completion\Providers\ImportCompletionProvider\AbstractExtensionMethodImportCompletionProvider.cs (1)
30protected override void WarmUpCacheInBackground(Document document)
Completion\Providers\ImportCompletionProvider\AbstractImportCompletionProvider.cs (9)
22protected abstract void WarmUpCacheInBackground(Document document); 25protected abstract Task<bool> ShouldProvideParenthesisCompletionAsync(Document document, CompletionItem item, char? commitKey, CancellationToken cancellationToken); 28public Task NotifyCommittingItemAsync(Document document, CompletionItem item, char? commitKey, CancellationToken cancellationToken) 42var document = completionContext.Document; 67var document = syntaxContext.Document; 116Document document, CompletionItem completionItem, char? commitKey, CancellationToken cancellationToken) 203private async Task<bool> IsInImportsDirectiveAsync(Document document, int position, CancellationToken cancellationToken) 212protected static bool IsAddingImportsSupported(Document document, CompletionOptions? completionOptions) 219internal override Task<CompletionDescription> GetDescriptionWorkerAsync(Document document, CompletionItem item, CompletionOptions options, SymbolDescriptionOptions displayOptions, CancellationToken cancellationToken)
Completion\Providers\ImportCompletionProvider\AbstractTypeImportCompletionProvider.cs (2)
27protected override void WarmUpCacheInBackground(Document document) 63Document document,
Completion\Providers\ImportCompletionProvider\ExtensionMethodImportCompletionHelper.cs (3)
58var document = syntaxContext.Document; 102Document document, 265foreach (var document in project.Documents)
Completion\Providers\ImportCompletionProvider\ExtensionMethodImportCompletionHelper.SymbolComputer.cs (2)
25private readonly Document _originatingDocument; 43Document document,
Completion\Providers\ImportCompletionProvider\ImportCompletionItem.cs (1)
137public static async Task<CompletionDescription> GetCompletionDescriptionAsync(Document document, CompletionItem item, SymbolDescriptionOptions options, CancellationToken cancellationToken)
Completion\Providers\ImportCompletionProvider\ImportCompletionProviderHelpers.cs (2)
22Document document, int completionItemPosition, string namespaceName, CancellationToken cancellationToken) 44var documentWithImport = document.WithSyntaxRoot(rootWithImport);
Completion\Providers\MemberInsertingCompletionItem.cs (1)
38public static Task<CompletionDescription> GetDescriptionAsync(CompletionItem item, Document document, SymbolDescriptionOptions options, CancellationToken cancellationToken)
Completion\Providers\Scripting\AbstractDirectivePathCompletionProvider.cs (3)
35var document = context.Document; 160Document document, 187private static string? GetBaseDirectory(Document document, string? baseDirectory)
Completion\Providers\Snippets\AbstractSnippetCompletionProvider.cs (7)
22public override async Task<CompletionChange> GetChangeAsync(Document document, CompletionItem item, char? commitKey = null, CancellationToken cancellationToken = default) 43var allChangesDocument = document.WithText(allChangesText); 73var document = context.Document; 102internal override async Task<CompletionDescription?> GetDescriptionAsync(Document document, CompletionItem item, CompletionOptions options, SymbolDescriptionOptions displayOptions, CancellationToken cancellationToken) 120private static async Task<(Document, int)> GetDocumentWithoutInvokingTextAsync(Document document, int position, CancellationToken cancellationToken) 134var newDocument = document.WithText(originalText).WithFrozenPartialSemantics(forceFreeze: true, cancellationToken);
Completion\Providers\SymbolCompletionItem.cs (7)
132public static async Task<ImmutableArray<ISymbol>> GetSymbolsAsync(CompletionItem item, Document document, CancellationToken cancellationToken) 185CompletionItem item, Document document, SymbolDescriptionOptions options, CancellationToken cancellationToken) 192CompletionItem item, Document document, ImmutableArray<ISymbol> symbols, SymbolDescriptionOptions options, CancellationToken cancellationToken) 202var contextDocument = FindAppropriateDocumentForDescriptionContext(document, supportedPlatforms); 209private static Document FindAppropriateDocumentForDescriptionContext(Document document, SupportedPlatformData? supportedPlatforms) 358CompletionItem item, ImmutableArray<ISymbol> symbols, Document document, SemanticModel semanticModel, SymbolDescriptionOptions options, CancellationToken cancellationToken)
Completion\SharedSyntaxContextsWithSpeculativeModel.cs (5)
17private readonly Document _document; 20private readonly ConcurrentDictionary<Document, AsyncLazy<SyntaxContext>> _cache; 23public SharedSyntaxContextsWithSpeculativeModel(Document document, int position) 31public Task<SyntaxContext> GetSyntaxContextAsync(Document document, CancellationToken cancellationToken) 44static AsyncLazy<SyntaxContext> GetLazySyntaxContextWithSpeculativeModel(Document document, SharedSyntaxContextsWithSpeculativeModel self)
Completion\Utilities.cs (1)
52public static async Task<SyntaxContext> CreateSyntaxContextWithExistingSpeculativeModelAsync(Document document, int position, CancellationToken cancellationToken)
ConvertAnonymousType\AbstractConvertAnonymousTypeCodeRefactoringProvider.cs (1)
18Document document, TextSpan span, CancellationToken cancellationToken)
ConvertAnonymousType\AbstractConvertAnonymousTypeToClassCodeRefactoringProvider.cs (9)
79private async Task<Document> ConvertAsync(Document document, TextSpan span, bool isRecord, CancellationToken cancellationToken) 140var updatedDocument = document.WithSyntaxRoot(editor.GetChangedRoot()); 150Document document, SyntaxEditor editor, SyntaxNode containingMember, 178Document document, SyntaxEditor editor, INamedTypeSymbol classSymbol, 243Document document, string typeName, bool isRecord, 321Document document, INamedTypeSymbol anonymousType) 342private static IPropertySymbol GenerateProperty(Document document, IPropertySymbol prop) 362private static string GetLegalName(string name, Document document)
ConvertAnonymousType\AbstractConvertAnonymousTypeToTupleCodeRefactoringProvider.cs (3)
76Document document, 97private async Task<Document> FixInCurrentMemberAsync( 98Document document, TAnonymousObjectCreationExpressionSyntax creationNode, INamedTypeSymbol anonymousType, bool allAnonymousTypes, CancellationToken cancellationToken)
ConvertAutoPropertyToFullProperty\AbstractConvertAutoPropertyToFullPropertyCodeRefactoringProvider.cs (3)
24protected abstract Task<string> GetFieldNameAsync(Document document, IPropertySymbol propertySymbol, CancellationToken cancellationToken); 72private async Task<Document> ExpandToFullPropertyAsync( 73Document document,
ConvertCast\AbstractConvertCastCodeRefactoringProvider.cs (2)
68private async Task<Document> ConvertAsync( 69Document document,
ConvertForEachToFor\AbstractConvertForEachToForCodeRefactoringProvider.cs (2)
413private async Task<Document> ConvertForeachToForAsync( 414Document document,
ConvertForToForEach\AbstractConvertForToForEachCodeRefactoringProvider.cs (2)
309private async Task<Document> ConvertForToForEachAsync( 310Document document,
ConvertIfToSwitch\AbstractConvertIfToSwitchCodeRefactoringProvider.cs (1)
180Document document,
ConvertIfToSwitch\AbstractConvertIfToSwitchCodeRefactoringProvider.Rewriting.cs (2)
28private async Task<Document> UpdateDocumentAsync( 29Document document,
ConvertLinq\ConvertForEachToLinqQuery\AbstractConvertForEachToLinqQueryProvider.cs (2)
145private Task<Document> ApplyConversionAsync( 147Document document,
ConvertNumericLiteral\AbstractConvertNumericLiteralCodeRefactoringProvider.cs (2)
121static Task<Document> ReplaceTokenAsync(Document document, SyntaxNode root, SyntaxToken numericToken, long value, string text, string suffix)
ConvertToInterpolatedString\AbstractConvertConcatenationToInterpolatedStringRefactoringProvider.cs (3)
117private async Task<Document> UpdateDocumentAsync( 118Document document, SyntaxNode top, bool isVerbatimStringLiteral, ImmutableArray<SyntaxNode> pieces, CancellationToken cancellationToken) 128Document document,
ConvertToInterpolatedString\AbstractConvertPlaceholderToInterpolatedStringRefactoringProvider.cs (2)
222private static async Task<Document> CreateInterpolatedStringAsync( 223Document document,
ConvertToInterpolatedString\ConvertRegularStringToInterpolatedStringRefactoringProvider.cs (3)
90private static SyntaxNode CreateInterpolatedString(Document document, SyntaxNode literalExpression, bool isVerbatim) 106private static Task<Document> UpdateDocumentAsync(Document document, SyntaxNode root, SyntaxToken token)
ConvertTupleToStruct\AbstractConvertTupleToStructCodeRefactoringProvider.cs (20)
119Document document, 164private static SyntaxNode? GetContainingMember(Document document, SyntaxNode tupleExprOrTypeNode) 170private CodeAction CreateAction(Document document, TextSpan span, Scope scope, bool isRecord) 184Document document, TextSpan span, CancellationToken cancellationToken) 217Document document, TextSpan span, Scope scope, bool isRecord, CancellationToken cancellationToken) 263Document document, TextSpan span, Scope scope, bool isRecord, CancellationToken cancellationToken) 302var documentToEditorMap = new Dictionary<Document, SyntaxEditor>(); 325Dictionary<Document, SyntaxEditor> documentToEditorMap, 419Document document, SyntaxNode tupleExprOrTypeNode, 491foreach (var document in project.Documents) 518Document startingDocument, SyntaxNode tupleExprOrTypeNode, CancellationToken cancellationToken) 543Document document, SyntaxNode tupleExprOrTypeNode) 553Document document, SyntaxNode tupleExprOrTypeNode, INamedTypeSymbol namedTypeSymbol, 554Dictionary<Document, SyntaxEditor> documentToEditorMap, 584Document startingDocument, Dictionary<Document, SyntaxEditor> documentToEditorMap, CancellationToken cancellationToken) 614Document document, NamingRule parameterNamingRule, bool isRecord, SyntaxEditor editor, 634Document document, NamingRule parameterNamingRule, bool isRecord, SyntaxEditor editor, 748Document document, SyntaxEditor editor, SyntaxNode startingNode, 799Document document, Scope scope, bool isRecord, string structName, ImmutableArray<ITypeParameterSymbol> typeParameters,
ConvertTupleToStruct\DocumentToUpdate.cs (2)
9internal readonly struct DocumentToUpdate(Document document, ImmutableArray<SyntaxNode> nodesToUpdate) 14public readonly Document Document = document;
ConvertTupleToStruct\IConvertTupleToStructCodeRefactoringProvider.cs (1)
16Document document, TextSpan span, Scope scope, bool isRecord, CancellationToken cancellationToken);
Copilot\Extensions.cs (1)
18if (document is not Document sourceDocument)
Copilot\ICopilotCodeAnalysisService.cs (5)
33Task<ImmutableArray<string>> GetAvailablePromptTitlesAsync(Document document, CancellationToken cancellationToken); 43Task AnalyzeDocumentAsync(Document document, TextSpan? span, string promptTitle, CancellationToken cancellationToken); 54Task<ImmutableArray<Diagnostic>> GetCachedDocumentDiagnosticsAsync(Document document, TextSpan? span, ImmutableArray<string> promptTitles, CancellationToken cancellationToken); 62Task StartRefinementSessionAsync(Document oldDocument, Document newDocument, Diagnostic? primaryDiagnostic, CancellationToken cancellationToken);
Debugging\AbstractBreakpointResolver.cs (1)
82var document = _solution.GetDocument(location.SourceTree);
Debugging\AbstractDataTipInfoGetter.cs (1)
24Document document, TExpressionSyntax expression, bool includeKind, CancellationToken cancellationToken)
Debugging\BreakpointResolutionResult.cs (4)
11public Document Document { get; } 16private BreakpointResolutionResult(Document document, TextSpan textSpan, string? locationNameOpt, bool isLineBreakpoint) 24internal static BreakpointResolutionResult CreateSpanResult(Document document, TextSpan textSpan, string? locationNameOpt = null) 27internal static BreakpointResolutionResult CreateLineResult(Document document, string? locationNameOpt = null)
Debugging\IBreakpointResolutionService.cs (1)
15Task<BreakpointResolutionResult?> ResolveBreakpointAsync(Document document, TextSpan textSpan, CancellationToken cancellationToken = default);
Debugging\ILanguageDebugInfoService.cs (2)
13Task<DebugLocationInfo> GetLocationInfoAsync(Document document, int position, CancellationToken cancellationToken); 22Task<DebugDataTipInfo> GetDataTipInfoAsync(Document document, int position, bool includeKind, CancellationToken cancellationToken);
Debugging\IProximityExpressionsService.cs (2)
16Task<IList<string>> GetProximityExpressionsAsync(Document document, int position, CancellationToken cancellationToken); 17Task<bool> IsValidAsync(Document document, int position, string expressionValue, CancellationToken cancellationToken);
DecompiledSource\IDecompilationService.cs (2)
15Document? PerformDecompilation(Document document, string fullName, Compilation compilation, MetadataReference? metadataReference, string? assemblyLocation);
DecompiledSource\IDecompiledSourceService.cs (2)
27Task<Document?> AddSourceToAsync(Document document, Compilation symbolCompilation, ISymbol symbol, MetadataReference? metadataReference, string? assemblyLocation, SyntaxFormattingOptions? formattingOptions, CancellationToken cancellationToken);
DesignerAttribute\DesignerAttributeDiscoveryService.cs (3)
198Document? specificDocument, 222Document? specificDocument, 386Document? activeDocument,
DocumentHighlighting\AbstractDocumentHighlightsService.cs (15)
37Document document, int position, IImmutableSet<Document> documentsToSearch, HighlightingOptions options, CancellationToken cancellationToken) 64Document document, int position, IImmutableSet<Document> documentsToSearch, HighlightingOptions options, CancellationToken cancellationToken) 95Document document, SemanticModel semanticModel, int position, HighlightingOptions options, CancellationToken cancellationToken) 113Document document, 114IImmutableSet<Document> documentsToSearch, 162ImmutableArray<ReferencedSymbol> references, Document startingDocument, 163IImmutableSet<Document> documentsToSearch, ISymbol symbol, 178foreach (var currentDocument in documentsToSearch) 196Document document, ISymbol symbol, CancellationToken cancellationToken) 206IImmutableSet<Document> documentToSearch, 210var tagMap = new MultiDictionary<Document, HighlightSpan>(); 236var document = solution.GetDocument(location.SourceTree); 289private static async Task AddLocationSpanAsync(Location location, Solution solution, HashSet<DocumentSpan> spanSet, MultiDictionary<Document, HighlightSpan> tagList, HighlightSpanKind kind, CancellationToken cancellationToken)
DocumentHighlighting\IDocumentHighlightsService.cs (2)
38internal readonly struct DocumentHighlights(Document document, ImmutableArray<HighlightSpan> highlightSpans) 40public Document Document { get; } = document;
DocumentHighlighting\IEmbeddedLanguageDocumentHighlighter.cs (1)
16Document document,
DocumentIdSpan.cs (1)
14/// pointing at a particular location in a <see cref="Document"/> but do not want to root a potentially
DocumentSpan.cs (1)
12internal readonly record struct DocumentSpan(Document Document, TextSpan SourceSpan);
DocumentSpanExtensions.cs (1)
32var document = documentSpan.Document;
EditAndContinue\AbstractEditAndContinueAnalyzer.cs (1)
516Document newDocument,
EditAndContinue\ActiveStatementsMap.cs (1)
172internal async ValueTask<ImmutableArray<UnmappedActiveStatement>> GetOldActiveStatementsAsync(IEditAndContinueAnalyzer analyzer, Document oldDocument, CancellationToken cancellationToken)
EditAndContinue\CommittedSolution.cs (10)
134/// Returns a document snapshot for given <see cref="Document"/> whose content exactly matches 140public async Task<(Document? Document, DocumentState State)> GetDocumentAndStateAsync(DocumentId documentId, Document? currentDocument, CancellationToken cancellationToken, bool reloadOutOfSyncDocument = false) 153var committedDocument = solution.GetDocument(documentId); 201var document = committedDocument ?? currentDocument; 239Document? matchingDocument; 309private async ValueTask<(Optional<SourceText?> matchingSourceText, bool? hasDocument)> TryGetMatchingSourceTextAsync(Document document, SourceText sourceText, Document? currentDocument, CancellationToken cancellationToken) 322SourceText sourceText, string filePath, Document? currentDocument, IPdbMatchingSourceTextProvider sourceTextProvider, ImmutableArray<byte> requiredChecksum, SourceHashAlgorithm checksumAlgorithm, CancellationToken cancellationToken) 470private bool? TryReadSourceFileChecksumFromPdb(Document document, out ImmutableArray<byte> requiredChecksum, out SourceHashAlgorithm checksumAlgorithm)
EditAndContinue\DebuggingSession.cs (1)
409public async ValueTask<ImmutableArray<Diagnostic>> GetDocumentDiagnosticsAsync(Document document, ActiveStatementSpanProvider activeStatementSpanProvider, CancellationToken cancellationToken)
EditAndContinue\EditAndContinueDocumentAnalysesCache.cs (8)
27private readonly Dictionary<DocumentId, (AsyncLazy<DocumentAnalysisResults> results, Project baseProject, Document document, ImmutableArray<ActiveStatementLineSpan> activeStatementSpans)> _analyses = []; 33IReadOnlyList<(Document? oldDocument, Document newDocument)> documents, 63Document? oldDocument, 64Document newDocument, 99private async Task<ImmutableArray<ActiveStatementLineSpan>> GetLatestUnmappedActiveStatementSpansAsync(Document? oldDocument, Document newDocument, ActiveStatementSpanProvider newActiveStatementSpanProvider, CancellationToken cancellationToken) 163private AsyncLazy<DocumentAnalysisResults> GetDocumentAnalysisNoLock(Project baseProject, Document document, ImmutableArray<ActiveStatementLineSpan> activeStatementSpans)
EditAndContinue\EditAndContinueService.cs (1)
213public ValueTask<ImmutableArray<Diagnostic>> GetDocumentDiagnosticsAsync(Document document, ActiveStatementSpanProvider activeStatementSpanProvider, CancellationToken cancellationToken)
EditAndContinue\EditSession.cs (7)
338internal static async ValueTask<bool> HasChangedOrAddedDocumentsAsync(Project oldProject, Project newProject, ArrayBuilder<Document>? changedOrAddedDocuments, CancellationToken cancellationToken) 426internal static async Task PopulateChangedAndAddedDocumentsAsync(Project oldProject, Project newProject, ArrayBuilder<Document> changedOrAddedDocuments, ArrayBuilder<ProjectDiagnostics> diagnostics, CancellationToken cancellationToken) 482/// Enumerates <see cref="DocumentId"/>s of changed (not added or removed) <see cref="Document"/>s (not additional nor analyzer config). 527ArrayBuilder<Document> changedOrAddedDocuments, 532using var _2 = ArrayBuilder<(Document? oldDocument, Document newDocument)>.GetInstance(out var documents); 811using var _5 = ArrayBuilder<Document>.GetInstance(out var changedOrAddedDocuments);
EditAndContinue\IEditAndContinueAnalyzer.cs (1)
19Document document,
EditAndContinue\IEditAndContinueService.cs (1)
22ValueTask<ImmutableArray<Diagnostic>> GetDocumentDiagnosticsAsync(Document document, ActiveStatementSpanProvider activeStatementSpanProvider, CancellationToken cancellationToken);
EditAndContinue\ProjectDiagnostics.cs (1)
26var document = solution.GetDocument(diagnostic.Location.SourceTree);
EmbeddedLanguages\Classification\AbstractEmbeddedLanguageClassificationService.cs (1)
39Document document, ImmutableArray<TextSpan> textSpans, ClassificationOptions options, SegmentedList<ClassifiedSpan> result, CancellationToken cancellationToken)
EmbeddedLanguages\DateAndTime\DateAndTimeEmbeddedCompletionProvider.cs (3)
72var document = context.Document; 215public override Task<CompletionChange> GetChangeAsync(Document document, CompletionItem item, char? commitKey, CancellationToken cancellationToken) 230public override Task<CompletionDescription?> GetDescriptionAsync(Document document, CompletionItem item, CancellationToken cancellationToken)
EmbeddedLanguages\DateAndTime\LanguageServices\DateAndTimeEmbeddedLanguage.cs (1)
27Document document, int position, CancellationToken cancellationToken)
EmbeddedLanguages\Json\LanguageServices\AbstractJsonDetectionCodeFixProvider.cs (1)
59Document document, ImmutableArray<Diagnostic> diagnostics,
EmbeddedLanguages\RegularExpressions\LanguageServices\RegexDocumentHighlighter.cs (1)
35Document document, SemanticModel semanticModel, SyntaxToken token, int position, HighlightingOptions options, CancellationToken cancellationToken)
EmbeddedLanguages\RegularExpressions\LanguageServices\RegexEmbeddedCompletionProvider.cs (2)
445public override Task<CompletionChange> GetChangeAsync(Document document, CompletionItem item, char? commitKey, CancellationToken cancellationToken) 460public override Task<CompletionDescription> GetDescriptionAsync(Document document, CompletionItem item, CancellationToken cancellationToken)
EmbeddedLanguages\RegularExpressions\LanguageServices\RegexEmbeddedLanguage.cs (1)
34Document document, int position, CancellationToken cancellationToken)
EncapsulateField\AbstractEncapsulateFieldService.cs (14)
40protected abstract Task<SyntaxNode> RewriteFieldNameAndAccessibilityAsync(string originalFieldName, bool makePrivate, Document document, SyntaxAnnotation declarationAnnotation, CancellationToken cancellationToken); 41protected abstract Task<ImmutableArray<IFieldSymbol>> GetFieldsAsync(Document document, TextSpan span, CancellationToken cancellationToken); 44public async Task<EncapsulateFieldResult?> EncapsulateFieldsInSpanAsync(Document document, TextSpan span, bool useDefaultBehavior, CancellationToken cancellationToken) 57public async Task<ImmutableArray<CodeAction>> GetEncapsulateFieldCodeActionsAsync(Document document, TextSpan span, CancellationToken cancellationToken) 81private ImmutableArray<CodeAction> EncapsulateAllFields(Document document, ImmutableArray<IFieldSymbol> fields) 93private ImmutableArray<CodeAction> EncapsulateOneField(Document document, IFieldSymbol field) 110Document document, ImmutableArray<IFieldSymbol> fields, 140private async Task<Solution> EncapsulateFieldsInCurrentProcessAsync(Document document, ImmutableArray<IFieldSymbol> fields, bool updateReferences, CancellationToken cancellationToken) 167Document document, 220var documentWithProperty = await AddPropertyAsync( 230bool updateReferences, Solution solution, Document document, IFieldSymbol field, string finalFieldName, string generatedPropertyName, CancellationToken cancellationToken) 315protected static async Task<Document> AddPropertyAsync( 316Document document, 342Document document)
EncapsulateField\IEncapsulateFieldService.cs (3)
16Task<ImmutableArray<CodeAction>> GetEncapsulateFieldCodeActionsAsync(Document document, TextSpan span, CancellationToken cancellationToken); 18Task<Solution> EncapsulateFieldsAsync(Document document, ImmutableArray<IFieldSymbol> fields, bool updateReferences, CancellationToken cancellationToken); 19Task<EncapsulateFieldResult?> EncapsulateFieldsInSpanAsync(Document document, TextSpan span, bool useDefaultBehavior, CancellationToken cancellationToken);
ExternalAccess\Pythia\Api\PythiaCompletionProviderBase.cs (4)
52public static Task<CompletionDescription> GetDescriptionAsync(CompletionItem item, Document document, SymbolDescriptionOptions displayOptions, CancellationToken cancellationToken) 61Document document, CompletionItem item, CompletionOptions options, SymbolDescriptionOptions displayOptions, CancellationToken cancellationToken) 79public override Task<CompletionChange> GetChangeAsync(Document document, CompletionItem item, char? commitKey = null, CancellationToken cancellationToken = default) 82public virtual Task NotifyCommittingItemAsync(Document document, CompletionItem item, char? commitKey, CancellationToken cancellationToken)
ExternalAccess\Razor\Api\Extensions.cs (1)
9public static bool IsRazorDocument(this Document document)
ExternalAccess\Razor\Api\IRazorDocumentOptionsService.cs (1)
12Task<IRazorDocumentOptions> GetOptionsForDocumentAsync(Document document, CancellationToken cancellationToken);
ExternalAccess\UnitTesting\API\INewUnitTestingIncrementalAnalyzerImplementation.cs (1)
13Document document,
ExternalAccess\UnitTesting\API\IUnitTestingStackTraceServiceAccessor.cs (1)
16(Document? document, int lineNumber) GetDocumentAndLine(Workspace workspace, UnitTestingParsedFrameWrapper parsedFrame);
ExternalAccess\UnitTesting\API\NewUnitTestingIncrementalAnalyzer.cs (1)
18Document document,
ExternalAccess\UnitTesting\API\UnitTestingDocumentSpan.cs (1)
21/// The raw <see cref="Document"/> and <see cref="TextSpan"/> that the symbol is located at.
ExternalAccess\UnitTesting\API\UnitTestingSearchHelpers.cs (1)
179Document document,
ExternalAccess\UnitTesting\SolutionCrawler\AbstractUnitTestingDocumentDifferenceService.cs (2)
17public UnitTestingDocumentDifferenceResult? GetDifference(Document oldDocument, Document newDocument, CancellationToken cancellationToken)
ExternalAccess\UnitTesting\SolutionCrawler\IUnitTestingIncrementalAnalyzer.cs (1)
16Document document,
ExternalAccess\UnitTesting\SolutionCrawler\IUnitTestingWorkCoordinatorPriorityService.cs (1)
18Task<bool> IsLowPriorityAsync(Document document, CancellationToken cancellationToken);
ExternalAccess\UnitTesting\SolutionCrawler\UnitTestingWorkCoordinator.cs (8)
338var sourceDocument = document as Document; 356private static Document GetRequiredDocument(Project project, DocumentId documentId, Document? document) 402IUnitTestingIncrementalAnalyzer analyzer, Project project, DocumentId documentId, Document? document, UnitTestingInvocationReasons invocationReasons) 464private async Task EnqueueChangedDocumentWorkItemAsync(Document oldDocument, Document newDocument) 581var document = solution.GetDocument(documentId);
ExternalAccess\UnitTesting\SolutionCrawler\UnitTestingWorkCoordinator.UnitTestingIncrementalAnalyzerProcessor.cs (2)
125if (textDocument is not Document document) 181private async Task RunBodyAnalyzersAsync(ImmutableArray<IUnitTestingIncrementalAnalyzer> analyzers, UnitTestingWorkItem workItem, Document document, CancellationToken cancellationToken)
ExternalAccess\UnitTesting\SolutionCrawler\UnitTestingWorkCoordinator.UnitTestingNormalPriorityProcessor.cs (1)
271if (document is Document sourceDocument &&
ExternalAccess\UnitTesting\SolutionCrawler\UnitTestingWorkCoordinator.UnitTestingSemanticChangeProcessor.cs (9)
121private async Task<bool> TryEnqueueFromTypeAsync(Document document, ISymbol symbol) 146private async Task<bool> TryEnqueueFromMemberAsync(Document document, ISymbol symbol) 171private Task EnqueueWorkItemAsync(Document document, ISymbol symbol) 174private async Task EnqueueWorkItemAsync(Document thisDocument, ImmutableArray<Location> locations) 243public void Enqueue(Project project, DocumentId documentId, Document? document, SyntaxPath? changedMember) 308private readonly struct UnitTestingData(Project project, DocumentId documentId, Document? document, SyntaxPath? changedMember, IAsyncToken asyncToken) 311private readonly Document? _document = document; 317public Document GetRequiredDocument() 382public async Task EnqueueWorkItemAsync(Project project, DocumentId documentId, Document? document)
ExternalAccess\UnitTesting\UnitTestingStackTraceServiceAccessor.cs (1)
22public (Document? document, int lineNumber) GetDocumentAndLine(Workspace workspace, UnitTestingParsedFrameWrapper parsedFrame)
ExternalAccess\VSTypeScript\Api\IVSTypeScriptCommentSlectionServiceImplementation.cs (3)
17Task<VSTypeScriptCommentSelectionInfo> GetInfoAsync(Document document, TextSpan textSpan, CancellationToken cancellationToken); 19Task<Document> FormatAsync(Document document, ImmutableArray<TextSpan> changes, CancellationToken cancellationToken);
ExternalAccess\VSTypeScript\Api\IVSTypeScriptDiagnosticAnalyzerImplementation.cs (2)
14Task<ImmutableArray<Diagnostic>> AnalyzeDocumentSyntaxAsync(Document document, CancellationToken cancellationToken); 15Task<ImmutableArray<Diagnostic>> AnalyzeDocumentSemanticsAsync(Document document, CancellationToken cancellationToken);
ExternalAccess\VSTypeScript\Api\IVSTypeScriptFormattingServiceImplementation.cs (2)
19Task<Document> FormatAsync(Document document, IEnumerable<TextSpan>? spans, VSTypeScriptIndentationOptions options, CancellationToken cancellationToken);
ExternalAccess\VSTypeScript\Api\IVSTypeScriptNavigableItem.cs (1)
32Document Document { get; }
ExternalAccess\VSTypeScript\Api\IVSTypeScriptNavigateToSearchService.cs (2)
16Task<ImmutableArray<IVSTypeScriptNavigateToSearchResult>> SearchProjectAsync(Project project, ImmutableArray<Document> priorityDocuments, string searchPattern, IImmutableSet<string> kinds, CancellationToken cancellationToken); 17Task<ImmutableArray<IVSTypeScriptNavigateToSearchResult>> SearchDocumentAsync(Document document, string searchPattern, IImmutableSet<string> kinds, CancellationToken cancellationToken);
ExternalAccess\VSTypeScript\Api\VSTypeScriptCompletionServiceWithProviders.cs (2)
29Document document, 36Document document,
ExternalAccess\VSTypeScript\Api\VSTypeScriptDocumentHighlightsServiceBase.cs (4)
19Document document, int position, IImmutableSet<Document> documentsToSearch, CancellationToken cancellationToken); 22Document document, int position, IImmutableSet<Document> documentsToSearch, HighlightingOptions options, CancellationToken cancellationToken)
ExternalAccess\VSTypeScript\Api\VSTypeScriptSignatureHelpProviderBase.cs (2)
18Task<SignatureHelpItems?> ISignatureHelpProvider.GetItemsAsync(Document document, int position, SignatureHelpTriggerInfo triggerInfo, MemberDisplayOptions options, CancellationToken cancellationToken) 24protected abstract Task<SignatureHelpItems?> GetItemsAsync(Document document, int position, SignatureHelpTriggerInfo triggerInfo, CancellationToken cancellationToken);
ExternalAccess\VSTypeScript\VSTypeScriptDocumentDiagnosticAnalyzer.cs (2)
18public override Task<ImmutableArray<Diagnostic>> AnalyzeSyntaxAsync(Document document, CancellationToken cancellationToken) 29public override Task<ImmutableArray<Diagnostic>> AnalyzeSemanticsAsync(Document document, CancellationToken cancellationToken)
ExternalAccess\VSTypeScript\VSTypeScriptFormattingService.cs (2)
24public Task<Document> FormatAsync(Document document, IEnumerable<TextSpan>? spans, LineFormattingOptions lineFormattingOptions, SyntaxFormattingOptions? syntaxFormattingOptions, CancellationToken cancellationToken)
ExternalAccess\VSTypeScript\VSTypeScriptNavigateToSearchService.cs (3)
35Document document, 52ImmutableArray<Document> priorityDocuments, 55Document? activeDocument,
ExternalAccess\VSTypeScript\VSTypeScriptTaskListService.cs (1)
24public async Task<ImmutableArray<TaskListItem>> GetTaskListItemsAsync(Document document, ImmutableArray<TaskListItemDescriptor> descriptors, CancellationToken cancellationToken)
ExtractClass\ExtractClassWithDialogCodeAction.cs (3)
27Document document, 35private readonly Document _document = document; 212private static async Task<INamedTypeSymbol> GetNewTypeSymbolAsync(Document document, SyntaxAnnotation typeAnnotation, CancellationToken cancellationToken)
ExtractClass\IExtractClassOptionsService.cs (1)
15Document document,
ExtractInterface\AbstractExtractInterfaceService.cs (5)
32Document document, 50public async Task<ImmutableArray<ExtractInterfaceCodeAction>> GetExtractInterfaceCodeActionAsync(Document document, TextSpan span, CancellationToken cancellationToken) 60Document documentWithTypeToExtractFrom, 81Document document, 257Document document,
ExtractInterface\ExtractInterfaceTypeAnalysisResult.cs (2)
15public readonly Document DocumentToExtractFrom; 23Document documentToExtractFrom,
ExtractMethod\AbstractExtractMethodService.cs (1)
27Document document,
ExtractMethod\ExtractMethodResult.cs (4)
25private readonly AsyncLazy<(Document document, SyntaxToken? invocationNameToken)>? _lazyData; 30Func<CancellationToken, Task<(Document document, SyntaxToken? invocationNameToken)>>? getDocumentAsync) 45Func<CancellationToken, Task<(Document document, SyntaxToken? invocationNameToken)>> getDocumentAsync) 50public Task<(Document document, SyntaxToken? invocationNameToken)> GetDocumentAsync(CancellationToken cancellationToken)
ExtractMethod\ExtractMethodService.cs (1)
14public static Task<ExtractMethodResult> ExtractMethodAsync(Document document, TextSpan textSpan, bool localFunction, ExtractMethodGenerationOptions options, CancellationToken cancellationToken)
ExtractMethod\IExtractMethodService.cs (1)
14Task<ExtractMethodResult> ExtractMethodAsync(Document document, TextSpan textSpan, bool localFunction, ExtractMethodGenerationOptions options, CancellationToken cancellationToken);
ExtractMethod\MethodExtractor.CodeGenerator.cs (1)
126var document = this.SemanticDocument.Document;
ExtractMethod\MethodExtractor.cs (8)
47protected abstract AbstractFormattingRule GetCustomFormattingRule(Document document); 49protected abstract Task<(Document document, SyntaxToken? invocationNameToken)> InsertNewLineBeforeLocalFunctionIfNecessaryAsync( 50Document document, SyntaxToken? invocationNameToken, SyntaxNode methodDefinition, CancellationToken cancellationToken); 113bool CanAddTo(Document document, SyntaxNode insertionPointNode, out OperationStatus status) 145private async Task<(Document document, SyntaxToken? invocationNameToken)> GetFormattedDocumentAsync( 146Document document, 157var annotatedDocument = document.WithSyntaxRoot(root); 201private ImmutableArray<AbstractFormattingRule> GetFormattingRules(Document document)
FindUsages\AbstractFindUsagesService.ProgressAdapter.cs (1)
36public async ValueTask OnReferenceFoundAsync(Document document, TextSpan span, CancellationToken cancellationToken)
FindUsages\AbstractFindUsagesService_FindImplementations.cs (1)
25IFindUsagesContext context, Document document, int position, OptionsProvider<ClassificationOptions> classificationOptions, CancellationToken cancellationToken)
FindUsages\AbstractFindUsagesService_FindReferences.cs (5)
21IFindUsagesContext context, Document document, int position, OptionsProvider<ClassificationOptions> classificationOptions, CancellationToken cancellationToken) 38IFindUsagesContext context, Document document, int position, OptionsProvider<ClassificationOptions> classificationOptions, CancellationToken cancellationToken) 49IFindUsagesContext context, Document document, int position, OptionsProvider<ClassificationOptions> classificationOptions, CancellationToken cancellationToken) 84IFindUsagesContext context, Document document, int position, OptionsProvider<ClassificationOptions> classificationOptions, CancellationToken cancellationToken) 171IFindUsagesContext context, Document document, int position, OptionsProvider<ClassificationOptions> classificationOptions, CancellationToken cancellationToken)
FindUsages\DefinitionItemFactory.cs (1)
299var document = referenceLocation.Document;
FindUsages\FindUsagesHelpers.cs (1)
32Document document, int position, CancellationToken cancellationToken)
FindUsages\IFindUsagesLSPService.cs (2)
18Task FindReferencesAsync(IFindUsagesContext context, Document document, int position, OptionsProvider<ClassificationOptions> classificationOptions, CancellationToken cancellationToken); 24Task FindImplementationsAsync(IFindUsagesContext context, Document document, int position, OptionsProvider<ClassificationOptions> classificationOptions, CancellationToken cancellationToken);
FindUsages\IFindUsagesService.cs (2)
18Task FindReferencesAsync(IFindUsagesContext context, Document document, int position, OptionsProvider<ClassificationOptions> classificationOptions, CancellationToken cancellationToken); 24Task FindImplementationsAsync(IFindUsagesContext context, Document document, int position, OptionsProvider<ClassificationOptions> classificationOptions, CancellationToken cancellationToken);
Formatting\AbstractNewDocumentFormattingService.cs (3)
35public async Task<Document> FormatNewDocumentAsync(Document document, Document? hintDocument, CodeCleanupOptions options, CancellationToken cancellationToken)
Formatting\INewDocumentFormattingProvider.cs (5)
13/// <inheritdoc cref="INewDocumentFormattingService.FormatNewDocumentAsync(Document, Document, CodeCleanupOptions, CancellationToken)"/> 14Task<Document> FormatNewDocumentAsync(Document document, Document? hintDocument, CodeCleanupOptions options, CancellationToken cancellationToken);
Formatting\INewDocumentFormattingService.cs (3)
20Task<Document> FormatNewDocumentAsync(Document document, Document? hintDocument, CodeCleanupOptions options, CancellationToken cancellationToken);
FullyQualify\AbstractFullyQualifyCodeFixProvider.cs (1)
24var document = context.Document;
FullyQualify\AbstractFullyQualifyService.cs (5)
41Document document, TextSpan span, CancellationToken cancellationToken) 61Document document, TextSpan span, CancellationToken cancellationToken) 185Document document, 220private async Task<IEnumerable<TextChange>> ProcessNodeAsync(Document document, TSimpleNameSyntax simpleName, string containerName, INamespaceOrTypeSymbol originalSymbol, CancellationToken cancellationToken) 223var newDocument = document.WithSyntaxRoot(newRoot);
GenerateComparisonOperators\GenerateComparisonOperatorsCodeRefactoringProvider.cs (2)
133private static async Task<Document> GenerateComparisonOperatorsAsync( 134Document document,
GenerateConstructors\AbstractGenerateConstructorsCodeRefactoringProvider.ConstructorDelegatingCodeAction.cs (3)
25Document document, 30private readonly Document _document = document; 34protected override async Task<Document> GetChangedDocumentAsync(CancellationToken cancellationToken)
GenerateConstructors\AbstractGenerateConstructorsCodeRefactoringProvider.cs (4)
62protected abstract ValueTask<bool> PrefersThrowExpressionAsync(Document document, CancellationToken cancellationToken); 77Document priorDocument, TextSpan priorSelection, Document currentDocument, IntentDataProvider intentDataProvider, CancellationToken cancellationToken) 109Document priorDocument, CodeAction codeAction, IProgress<CodeAnalysisProgress> progressTracker, CancellationToken cancellationToken)
GenerateConstructors\AbstractGenerateConstructorsCodeRefactoringProvider.FieldDelegatingCodeAction.cs (3)
23Document document, 28private readonly Document _document = document; 32protected override async Task<Document> GetChangedDocumentAsync(CancellationToken cancellationToken)
GenerateConstructors\AbstractGenerateConstructorsCodeRefactoringProvider.GenerateConstructorWithDialogCodeAction.cs (2)
26Document document, 33private readonly Document _document = document;
GenerateConstructors\AbstractGenerateConstructorsCodeRefactoringProvider.State.cs (2)
38Document document, 54Document document,
GenerateEqualsAndGetHashCodeFromMembers\AbstractGenerateEqualsAndGetHashCodeService.cs (6)
27public async Task<Document> FormatDocumentAsync(Document document, SyntaxFormattingOptions options, CancellationToken cancellationToken) 39Document document, INamedTypeSymbol namedType, ImmutableArray<ISymbol> members, 51Document document, INamedTypeSymbol namedType, 62Document document, INamedTypeSymbol containingType, CancellationToken cancellationToken) 118Document document, INamedTypeSymbol namedType,
GenerateEqualsAndGetHashCodeFromMembers\GenerateEqualsAndGetHashCodeAction.cs (4)
22Document document, 40private readonly Document _document = document; 47protected override async Task<Document> GetChangedDocumentAsync(CancellationToken cancellationToken) 115private async Task<Document> UpdateDocumentAndAddImportsAsync(SyntaxNode oldType, SyntaxNode newType, CancellationToken cancellationToken)
GenerateEqualsAndGetHashCodeFromMembers\GenerateEqualsAndGetHashCodeFromMembersCodeRefactoringProvider.cs (5)
170Document document, 201Document document, SyntaxNode typeDeclaration, INamedTypeSymbol containingType, ImmutableArray<ISymbol> selectedMembers, 241Document document, SyntaxNode typeDeclaration, INamedTypeSymbol containingType, ImmutableArray<ISymbol> members, 258Document document, SyntaxNode typeDeclaration, INamedTypeSymbol containingType, ImmutableArray<ISymbol> members, 295Document document, SyntaxNode typeDeclaration, INamedTypeSymbol containingType, ImmutableArray<ISymbol> members,
GenerateEqualsAndGetHashCodeFromMembers\GenerateEqualsAndHashWithDialogCodeAction.cs (2)
23Document document, 35private readonly Document _document = document;
GenerateEqualsAndGetHashCodeFromMembers\IGenerateEqualsAndGetHashCodeService.cs (6)
23Task<Document> FormatDocumentAsync(Document document, SyntaxFormattingOptions options, CancellationToken cancellationToken); 29Task<IMethodSymbol> GenerateEqualsMethodAsync(Document document, INamedTypeSymbol namedType, ImmutableArray<ISymbol> members, string? localNameOpt, CancellationToken cancellationToken); 35Task<IMethodSymbol> GenerateEqualsMethodThroughIEquatableEqualsAsync(Document document, INamedTypeSymbol namedType, CancellationToken cancellationToken); 41Task<IMethodSymbol> GenerateIEquatableEqualsMethodAsync(Document document, INamedTypeSymbol namedType, ImmutableArray<ISymbol> members, INamedTypeSymbol constructedEquatableType, CancellationToken cancellationToken); 50Task<IMethodSymbol> GenerateGetHashCodeMethodAsync(Document document, INamedTypeSymbol namedType, ImmutableArray<ISymbol> members, CancellationToken cancellationToken);
GenerateEqualsAndGetHashCodeFromMembers\IGenerateEqualsAndGetHashCodeServiceExtensions.cs (1)
14this IGenerateEqualsAndGetHashCodeService service, Document document, INamedTypeSymbol namedType,
GenerateFromMembers\GenerateFromMembersHelpers.cs (1)
23Document document, TextSpan textSpan, bool allowPartialSelection, CancellationToken cancellationToken)
GenerateOverrides\GenerateOverridesWithDialogCodeAction.cs (2)
25Document document, 31private readonly Document _document = document;
GenerateType\AbstractGenerateTypeService.CodeAction.cs (4)
27private readonly Document _document; 33Document document, 86private readonly Document _document; 89internal GenerateTypeCodeActionWithOption(TService service, Document document, State state)
GenerateType\AbstractGenerateTypeService.cs (4)
59Solution updatedSolution, SyntaxNode modifiedRoot, Document document, TSimpleNameSyntax simpleName, string includeUsingsOrImports, CancellationToken cancellationToken); 65public abstract Task<(INamespaceSymbol, INamespaceOrTypeSymbol, Location)> GetOrGenerateEnclosingNamespaceSymbolAsync(INamedTypeSymbol namedTypeSymbol, string[] containers, Document selectedDocument, SyntaxNode selectedDocumentRoot, CancellationToken cancellationToken); 68Document document, 273protected static async Task<bool> IsWithinTheImportingNamespaceAsync(Document document, int triggeringPosition, string includeUsingsOrImports, CancellationToken cancellationToken)
GenerateType\AbstractGenerateTypeService.Editor.cs (1)
279var newDocument = newSolution.GetDocument(newDocumentId);
GenerateType\GenerateTypeOptionsResult.cs (2)
16public Document ExistingDocument { get; } 37Document existingDocument,
GenerateType\IGenerateTypeOptionService.cs (1)
19Document document,
GenerateType\IGenerateTypeService.cs (2)
16Task<ImmutableArray<CodeAction>> GenerateTypeAsync(Document document, SyntaxNode node, CancellationToken cancellationToken); 17Task<(INamespaceSymbol, INamespaceOrTypeSymbol, Location)> GetOrGenerateEnclosingNamespaceSymbolAsync(INamedTypeSymbol namedTypeSymbol, string[] containers, Document selectedDocument, SyntaxNode selectedDocumentRoot, CancellationToken cancellationToken);
GoToBase\AbstractGoToBaseService.cs (1)
31public async Task FindBasesAsync(IFindUsagesContext context, Document document, int position, OptionsProvider<ClassificationOptions> classificationOptions, CancellationToken cancellationToken)
GoToBase\IGoToBaseService.cs (1)
19Task FindBasesAsync(IFindUsagesContext context, Document document, int position, OptionsProvider<ClassificationOptions> classificationOptions, CancellationToken cancellationToken);
GoToDefinition\AbstractGoToDefinitionSymbolService.cs (2)
23Document document, SemanticModel semanticModel, int position, CancellationToken cancellationToken) 65Document document, SemanticModel semanticModel, int position, CancellationToken cancellationToken)
GoToDefinition\IGoToDefinitionSymbolService.cs (2)
15Document document, SemanticModel semanticModel, int position, CancellationToken cancellationToken); 22Document document, SemanticModel semanticModel, int position, CancellationToken cancellationToken);
InheritanceMargin\AbstractInheritanceMarginService.cs (1)
30Document document,
InheritanceMargin\AbstractInheritanceMarginService_Helpers.cs (5)
45Document? document, 77Document document, 126Document document, 158Document document, 247var destinationDocument = document.Project.Solution.GetDocument(groupSyntaxTree);
InheritanceMargin\IInheritanceMarginService.cs (1)
21Document document,
InitializeParameter\AbstractAddParameterCheckCodeRefactoringProvider.cs (14)
52Document document, 83Document document, 124private async Task<Document> UpdateDocumentForRefactoringAsync( 125Document document, 244protected bool ParameterValidForNullCheck(Document document, IParameterSymbol parameter, SemanticModel semanticModel, 311private async Task<Document> AddNullCheckAsync( 312Document document, 321var modifiedDocument = await TryAddNullCheckToAssignmentAsync( 334private async Task<Document> AddStringCheckAsync( 335Document document, 350private static async Task<Document> AddNullCheckStatementAsync( 351Document document, 484private async Task<Document?> TryAddNullCheckToAssignmentAsync( 485Document document,
InitializeParameter\AbstractInitializeMemberFromParameterCodeRefactoringProviderMemberCreation.cs (13)
50Document document, SyntaxNode functionDeclaration, IMethodSymbol method, IBlockOperation? blockStatementOpt, 58Document document, 103Document document, 155Document document, 188Document document, 237Document document, 357Document document, 421Document document, 456var otherDocument = finalSolution.GetDocument(propertySyntax.SyntaxTree); 469private static async Task<(Document documentWithMemberAdded, IParameterSymbol? currentParameter, ISymbol? currentFieldOrProperty)> AddMissingFieldOrPropertyAsync( 470Document document, 525var documentWithMemberAdded = document.WithSyntaxRoot(editor.GetChangedRoot()); 615Document document, IParameterSymbol parameter, IBlockOperation? blockStatement, ImmutableArray<NamingRule> rules, ImmutableArray<string> parameterWords, CancellationToken cancellationToken)
InitializeParameter\AbstractInitializeParameterCodeRefactoringProvider.cs (2)
37Document document, 46Document document,
InlineHints\AbstractInlineHintsService.cs (1)
17Document document, TextSpan textSpan, InlineHintsOptions options, bool displayAllOverride, CancellationToken cancellationToken)
InlineHints\AbstractInlineParameterNameHintsService.cs (1)
37Document document,
InlineHints\AbstractInlineTypeHintsService.cs (1)
32Document document,
InlineHints\IInlineHintsService.cs (1)
16Document document, TextSpan textSpan, InlineHintsOptions options, bool displayAllOverride, CancellationToken cancellationToken);
InlineHints\IInlineParameterNameHintsService.cs (1)
21Document document,
InlineHints\IInlineTypeHintsService.cs (1)
21Document document,
InlineHints\InlineHint.cs (5)
20private readonly Func<Document, CancellationToken, Task<ImmutableArray<TaggedText>>>? _getDescriptionAsync; 25Func<Document, CancellationToken, Task<ImmutableArray<TaggedText>>>? getDescriptionAsync = null) 34Func<Document, CancellationToken, Task<ImmutableArray<TaggedText>>>? getDescriptionAsync = null) 44Func<Document, CancellationToken, Task<ImmutableArray<TaggedText>>>? getDescriptionAsync = null) 60public Task<ImmutableArray<TaggedText>> GetDescriptionAsync(Document document, CancellationToken cancellationToken)
InlineHints\InlineHintHelpers.cs (2)
19public static Func<Document, CancellationToken, Task<ImmutableArray<TaggedText>>>? GetDescriptionFunction(int position, SymbolKey symbolKey, SymbolDescriptionOptions options) 22private static async Task<ImmutableArray<TaggedText>> GetDescriptionAsync(Document document, int position, SymbolKey symbolKey, SymbolDescriptionOptions options, CancellationToken cancellationToken)
InlineMethod\AbstractInlineMethodRefactoringProvider.cs (3)
246private ImmutableArray<CodeAction> GenerateCodeActions(Document document, 289private async Task<Solution> InlineMethodAsync(Document document, 364private async Task<SyntaxNode> GetChangedCallerAsync(Document document,
InlineMethod\AbstractInlineMethodRefactoringProvider.InlineContext.cs (3)
43Document document, 286Document document, 297.FindReferencesAsync(symbol, document.Project.Solution, ImmutableHashSet<Document>.Empty.Add(document), cancellationToken)
InlineMethod\AbstractInlineMethodRefactoringProvider.MethodParametersInfo.cs (4)
154Document document, 431Document document, 442.FindReferencesAsync(parameterSymbol, document.Project.Solution, ImmutableHashSet<Document>.Empty.Add(document), cancellationToken).ConfigureAwait(false); 481Document calleeDocument,
InlineTemporary\AbstractInlineTemporaryCodeRefactoringProvider.cs (1)
23Document document,
Intents\IIntentProvider.cs (2)
15Document priorDocument, 17Document currentDocument,
IntroduceParameter\AbstractIntroduceParameterCodeRefactoringProvider.cs (7)
140private async Task<(ImmutableArray<CodeAction> actions, ImmutableArray<CodeAction> actionsAllOccurrences)?> GetActionsAsync(Document document, 198Document document, TExpressionSyntax expression, CancellationToken cancellationToken) 237private async Task<Solution> IntroduceParameterAsync(Document originalDocument, TExpressionSyntax expression, 238IMethodSymbol methodSymbol, SyntaxNode containingMethod, Dictionary<Document, List<TExpressionSyntax>> methodCallSites, bool allOccurrences, IntroduceParameterCodeActionKind selectedCodeAction, 270protected static async Task<Dictionary<Document, List<TExpressionSyntax>>> FindCallSitesAsync( 271Document document, IMethodSymbol methodSymbol, CancellationToken cancellationToken) 273var methodCallSites = new Dictionary<Document, List<TExpressionSyntax>>();
IntroduceParameter\IntroduceParameterDocumentRewriter.cs (5)
25Document originalDocument, 33private readonly Document _originalDocument = originalDocument; 43public async Task<SyntaxNode> RewriteDocumentAsync(Compilation compilation, Document document, List<TExpressionSyntax> invocations, CancellationToken cancellationToken) 219private async Task<SyntaxNode> ModifyDocumentInvocationsTrampolineOverloadAndIntroduceParameterAsync(Compilation compilation, Document currentDocument, 481private async Task<SyntaxNode> ModifyDocumentInvocationsAndIntroduceParameterAsync(Compilation compilation, Document document, int insertionIndex,
IntroduceUsingStatement\AbstractIntroduceUsingStatementCodeRefactoringProvider.cs (6)
146private async Task<Document> IntroduceUsingStatementAsync( 147Document document, 205private async Task<Document> IntroduceUsingStatementAsync( 206Document document, 239private async Task<Document> ReplaceWithUsingStatementAsync( 240Document document,
IntroduceVariable\AbstractIntroduceLocalForExpressionCodeRefactoringProvider.cs (4)
31Document document, INamedTypeSymbol tupleType, TExpressionSyntax expression, CancellationToken cancellationToken); 79private async Task<Document> IntroduceLocalAsync( 80Document document, 128Document document, TExpressionSyntax expression, CancellationToken cancellationToken)
IntroduceVariable\AbstractIntroduceVariableService.cs (4)
52protected abstract Document IntroduceQueryLocal(SemanticDocument document, TExpressionSyntax expression, bool allOccurrences, CancellationToken cancellationToken); 53protected abstract Document IntroduceLocal(SemanticDocument document, TExpressionSyntax expression, bool allOccurrences, bool isConstant, CancellationToken cancellationToken); 54protected abstract Task<Document> IntroduceFieldAsync(SemanticDocument document, TExpressionSyntax expression, bool allOccurrences, bool isConstant, CancellationToken cancellationToken); 63Document document,
IntroduceVariable\AbstractIntroduceVariableService.IntroduceVariableCodeAction.cs (3)
52protected override async Task<Document> GetChangedDocumentAsync(CancellationToken cancellationToken) 54var changedDocument = await GetChangedDocumentCoreAsync(cancellationToken).ConfigureAwait(false); 59private async Task<Document> GetChangedDocumentCoreAsync(CancellationToken cancellationToken)
IntroduceVariable\IIntroduceVariableService.cs (1)
18Task<CodeAction> IntroduceVariableAsync(Document document, TextSpan textSpan, CodeCleanupOptions options, CancellationToken cancellationToken);
InvertConditional\AbstractInvertConditionalCodeRefactoringProvider.cs (3)
40Document document, TextSpan span, CancellationToken cancellationToken) 43private static async Task<Document> InvertConditionalAsync( 44Document document, TConditionalExpressionSyntax conditional, CancellationToken cancellationToken)
InvertIf\AbstractInvertIfCodeRefactoringProvider.cs (2)
288private async Task<Document> InvertIfAsync( 289Document document,
InvertLogical\AbstractInvertLogicalCodeRefactoringProvider.cs (8)
82private static async Task<Document> InvertLogicalAsync( 83Document document1, SyntaxNode binaryExpression, CancellationToken cancellationToken) 94var document2 = await InvertInnerExpressionAsync(document1, binaryExpression, cancellationToken).ConfigureAwait(false); 95var document3 = await InvertOuterExpressionAsync(document2, cancellationToken).ConfigureAwait(false); 99private static async Task<Document> InvertInnerExpressionAsync( 100Document document, SyntaxNode binaryExpression, CancellationToken cancellationToken) 113private static async Task<Document> InvertOuterExpressionAsync( 114Document document, CancellationToken cancellationToken)
LineSeparators\ILineSeparatorService.cs (1)
15Task<ImmutableArray<TextSpan>> GetLineSeparatorsAsync(Document document, TextSpan textSpan, CancellationToken cancellationToken);
MapCode\IMapCodeService.cs (2)
31Document document, 33ImmutableArray<(Document, TextSpan)> prioritizedFocusLocations,
MetadataAsSource\AbstractMetadataAsSourceService.cs (10)
23public async Task<Document> AddSourceToAsync( 24Document document, 69protected abstract Task<Document> AddNullableRegionsAsync(Document document, CancellationToken cancellationToken); 74protected abstract ImmutableArray<AbstractFormattingRule> GetFormattingRules(Document document); 88protected abstract Task<Document> AddAssemblyInfoRegionAsync(Document document, Compilation symbolCompilation, ISymbol symbol, CancellationToken cancellationToken); 90protected abstract Task<Document> ConvertDocCommentsToRegularCommentsAsync(Document document, IDocumentationCommentFormattingService docCommentFormattingService, CancellationToken cancellationToken); 94private static INamespaceOrTypeSymbol CreateCodeGenerationSymbol(Document document, ISymbol symbol)
MetadataAsSource\DecompilationMetadataAsSourceFileProvider.cs (1)
334public Project? MapDocument(Document document)
MetadataAsSource\IMetadataAsSourceFileProvider.cs (1)
57Project? MapDocument(Document document);
MetadataAsSource\IMetadataAsSourceService.cs (2)
26Task<Document> AddSourceToAsync(Document document, Compilation symbolCompilation, ISymbol symbol, SyntaxFormattingOptions? formattingOptions, CancellationToken cancellationToken);
MetadataAsSource\MetadataAsSourceFileService.cs (1)
246internal async Task<SymbolMappingResult?> MapSymbolAsync(Document document, SymbolKey symbolId, CancellationToken cancellationToken)
MetadataAsSource\MetadataAsSourceHelpers.cs (1)
71public static async Task<Location> GetLocationInGeneratedSourceAsync(SymbolKey symbolId, Document generatedDocument, CancellationToken cancellationToken)
MetadataAsSource\SymbolMappingServiceFactory.cs (2)
32public Task<SymbolMappingResult?> MapSymbolAsync(Document document, SymbolKey symbolId, CancellationToken cancellationToken) 40public Task<SymbolMappingResult?> MapSymbolAsync(Document document, ISymbol symbol, CancellationToken cancellationToken)
MoveDeclarationNearReference\AbstractMoveDeclarationNearReferenceCodeRefactoringProvider.cs (2)
47private static async Task<Document> MoveDeclarationNearReferenceAsync( 48Document document, SyntaxNode statement, CancellationToken cancellationToken)
MoveStaticMembers\IMoveStaticMembersOptionsService.cs (1)
12MoveStaticMembersOptions GetMoveMembersToTypeOptions(Document document, INamedTypeSymbol selectedType, ImmutableArray<ISymbol> selectedNodeSymbols);
MoveStaticMembers\MoveStaticMembersWithDialogCodeAction.cs (3)
26Document document, 31private readonly Document _document = document; 253Document doc,
MoveToNamespace\AbstractMoveToNamespaceService.cs (13)
27Task<ImmutableArray<MoveToNamespaceCodeAction>> GetCodeActionsAsync(Document document, TextSpan span, CancellationToken cancellationToken); 28Task<MoveToNamespaceAnalysisResult> AnalyzeTypeAtPositionAsync(Document document, int position, CancellationToken cancellationToken); 30MoveToNamespaceOptionsResult GetChangeNamespaceOptions(Document document, string defaultNamespace, ImmutableArray<string> namespaces); 47Document document, 65Document document, 86Document document, SyntaxNode node, int position, CancellationToken cancellationToken) 111Document document, SyntaxNode node, CancellationToken cancellationToken) 177private static async Task<ImmutableArray<ISymbol>> GetMemberSymbolsAsync(Document document, SyntaxNode container, CancellationToken cancellationToken) 200Document document, 223Document document, 260private static async Task<Solution> PropagateChangeToLinkedDocumentsAsync(Document document, SyntaxFormattingOptions formattingOptions, CancellationToken cancellationToken) 290private static async Task<IEnumerable<string>> GetNamespacesAsync(Document document, CancellationToken cancellationToken) 300Document document,
MoveToNamespace\MoveToNamespaceAnalysisResult.cs (2)
16public Document Document { get; } 23Document document,
NameTupleElement\AbstractNameTupleElementCodeRefactoringProvider.cs (3)
41Document document, TextSpan span, CancellationToken cancellationToken) 82private async Task<Document> AddNamedElementAsync(Document document, TextSpan span, CancellationToken cancellationToken)
NavigateTo\AbstractNavigateToSearchService.CachedDocumentSearch.cs (2)
60ImmutableArray<Document> priorityDocuments, 63Document? activeDocument,
NavigateTo\AbstractNavigateToSearchService.cs (1)
36Solution solution, Document? activeDocument, Func<ImmutableArray<INavigateToSearchResult>, Task> onResultsFound)
NavigateTo\AbstractNavigateToSearchService.GeneratedDocumentSearch.cs (1)
24Document? activeDocument,
NavigateTo\AbstractNavigateToSearchService.InProcess.cs (4)
41Document document, 70Document? document, 128Document? document, 164Document? document,
NavigateTo\AbstractNavigateToSearchService.NormalSearch.cs (5)
21Document document, 48Document document, 68ImmutableArray<Document> priorityDocuments, 71Document? activeDocument, 109ImmutableArray<Document> priorityDocuments,
NavigateTo\INavigateToSearchService.cs (6)
19Document document, 38ImmutableArray<Document> priorityDocuments, 41Document? activeDocument, 65ImmutableArray<Document> priorityDocuments, 68Document? activeDocument, 86Document? activeDocument,
NavigateTo\NavigateToSearcher.cs (9)
51private readonly Document? _activeDocument; 52private readonly ImmutableArray<Document> _visibleDocuments; 299foreach (var doc in _visibleDocuments) 326private ImmutableArray<Document> GetPriorityDocuments(ImmutableArray<Project> projects) 331using var _2 = ArrayBuilder<Document>.GetInstance(out var result); 335foreach (var doc in _visibleDocuments) 531public Task SearchDocumentAsync(Document document, string searchPattern, IImmutableSet<string> kinds, Func<ImmutableArray<INavigateToSearchResult>, Task> onResultsFound, CancellationToken cancellationToken) 534public async Task SearchProjectsAsync(Solution solution, ImmutableArray<Project> projects, ImmutableArray<Document> priorityDocuments, string searchPattern, IImmutableSet<string> kinds, Document? activeDocument, Func<ImmutableArray<INavigateToSearchResult>, Task> onResultsFound, Func<Task> onProjectCompleted, CancellationToken cancellationToken)
NavigateTo\RoslynNavigateToItem.cs (7)
71Solution solution, Document? activeDocument, CancellationToken cancellationToken) 76var document = solution.GetDocument(DocumentId); 97/// The <see cref="Document"/> that <see cref="_item"/> is contained within. 111Document itemDocument, 112Document? activeDocument) 123private static string ComputeAdditionalInformation(in RoslynNavigateToItem item, Document itemDocument) 136private static string ComputeCombinedProjectName(in RoslynNavigateToItem item, Document itemDocument)
Navigation\AbstractNavigableItemsService.cs (3)
18Document document, int position, CancellationToken cancellationToken) 24Document document, int position, bool forSymbolType, CancellationToken cancellationToken) 43async Task<(ISymbol symbol, Solution solution)?> GetSymbolAsync(Document document)
Navigation\IDefinitionLocationService.cs (3)
30Document document, int position, CancellationToken cancellationToken); 47Document document, int position, Func<CancellationToken, Task<IEnumerable<(Document document, TextSpan sourceSpan)>?>> getNavigableItems, CancellationToken cancellationToken)
Navigation\INavigableItem.cs (6)
53public static NavigableDocument FromDocument(Document document) 64/// Get the <see cref="CodeAnalysis.Document"/> within <paramref name="solution"/> which is referenced by 68internal ValueTask<Document> GetRequiredDocumentAsync(Solution solution, CancellationToken cancellationToken) 72/// Get the <see cref="SourceText"/> of the <see cref="CodeAnalysis.Document"/> within 79var document = await GetRequiredDocumentAsync(solution, cancellationToken).ConfigureAwait(false); 85var document = solution.GetDocument(Id);
Navigation\INavigableItemsService.cs (2)
23Task<ImmutableArray<INavigableItem>> GetNavigableItemsAsync(Document document, int position, CancellationToken cancellationToken); 28Task<ImmutableArray<INavigableItem>> GetNavigableItemsAsync(Document document, int position, bool forSymbolType, CancellationToken cancellationToken);
NavigationBar\AbstractNavigationBarItemService.cs (2)
19protected abstract Task<ImmutableArray<RoslynNavigationBarItem>> GetItemsInCurrentProcessAsync(Document document, bool supportsCodeGeneration, CancellationToken cancellationToken); 21public async Task<ImmutableArray<RoslynNavigationBarItem>> GetItemsAsync(Document document, bool supportsCodeGeneration, bool frozenPartialSemantics, CancellationToken cancellationToken)
NavigationBar\INavigationBarItemService.cs (1)
14Task<ImmutableArray<RoslynNavigationBarItem>> GetItemsAsync(Document document, bool supportsCodeGeneration, bool frozenPartialSemantics, CancellationToken cancellationToken);
Organizing\AbstractOrganizingService.cs (4)
28protected abstract Task<Document> ProcessAsync(Document document, IEnumerable<ISyntaxOrganizer> organizers, CancellationToken cancellationToken); 30public Task<Document> OrganizeAsync(Document document, IEnumerable<ISyntaxOrganizer> organizers, CancellationToken cancellationToken)
Organizing\IOrganizingService.cs (2)
28Task<Document> OrganizeAsync(Document document, IEnumerable<ISyntaxOrganizer> organizers, CancellationToken cancellationToken);
Organizing\OrganizingService.cs (2)
22public static Task<Document> OrganizeAsync(Document document, IEnumerable<ISyntaxOrganizer> organizers = null, CancellationToken cancellationToken = default)
PdbSourceDocument\PdbSourceDocumentMetadataAsSourceFileProvider.cs (1)
431public Project? MapDocument(Document document)
PreferFrameworkType\PreferFrameworkTypeCodeFixProvider.cs (1)
47Document document, ImmutableArray<Diagnostic> diagnostics,
PullMemberUp\Dialog\IPullMemberUpOptionsService.cs (1)
15PullMembersUpOptions GetPullMemberUpOptions(Document document, ImmutableArray<ISymbol> selectedNodeSymbols);
PullMemberUp\Dialog\PullMemberUpWithDialogCodeAction.cs (2)
20Document document, 28private readonly Document _document = document;
PullMemberUp\MembersPuller.cs (4)
38Document document, 59Document document, 91Document document, 266Document document,
QuickInfo\Presentation\QuickInfoContentBuilderContext.cs (2)
11Document document, 16public Document Document { get; } = document;
QuickInfo\Presentation\QuickInfoOnTheFlyDocsElement.cs (2)
7internal sealed class QuickInfoOnTheFlyDocsElement(Document document, OnTheFlyDocsInfo info) : QuickInfoElement 9public Document Document { get; } = document;
QuickInfo\QuickInfoContext.cs (2)
18Document document, 26public Document Document { get; } = document ?? throw new ArgumentNullException(nameof(document));
QuickInfo\QuickInfoService.cs (3)
28public static QuickInfoService? GetService(Document? document) 35Document document, 44Document document,
QuickInfo\QuickInfoServiceWithProviders.cs (1)
48internal override async Task<QuickInfoItem?> GetQuickInfoAsync(Document document, int position, SymbolDescriptionOptions options, CancellationToken cancellationToken)
RelatedDocuments\AbstractRelatedDocumentsService.cs (2)
37Document document, int position, Func<ImmutableArray<DocumentId>, CancellationToken, ValueTask> callbackAsync, CancellationToken cancellationToken) 65Document document,
RelatedDocuments\IRelatedDocumentsService.cs (1)
22Document document, int position, Func<ImmutableArray<DocumentId>, CancellationToken, ValueTask> callbackAsync, CancellationToken cancellationToken);
RemoveUnusedVariable\AbstractRemoveUnusedVariableCodeFixProvider.cs (2)
43var document = context.Document; 60protected override async Task FixAllAsync(Document document, ImmutableArray<Diagnostic> diagnostics, SyntaxEditor syntaxEditor, CancellationToken cancellationToken)
Rename\SymbolicRenameInfo.cs (5)
31public Document? Document { get; } 44Document document, 114Document document, int position, CancellationToken cancellationToken) 123private static async Task<SyntaxToken> GetTriggerTokenAsync(Document document, int position, CancellationToken cancellationToken) 132Document document,
ReplaceConditionalWithStatements\AbstractReplaceConditionalWithStatementsCodeRefactoringProvider.cs (5)
113var document = context.Document; 195private static async Task<Document> ReplaceConditionalExpressionInSingleStatementAsync( 196Document document, 219private async Task<Document> ReplaceConditionalExpressionInLocalDeclarationStatementAsync( 220Document document,
ReplaceDocCommentTextWithTag\AbstractReplaceDocCommentTextWithTagCodeRefactoringProvider.cs (2)
151private static async Task<Document> ReplaceTextAsync( 152Document document, TextSpan span, string replacement, CancellationToken cancellationToken)
ReplaceMethodWithProperty\ReplaceMethodWithPropertyCodeRefactoringProvider.cs (7)
152Document document, 188private static async Task<Solution> UpdateReferencesAsync(Solution updatedSolution, string propertyName, bool nameChanged, ILookup<Document, ReferenceLocation> getReferencesByDocument, ILookup<Document, ReferenceLocation> setReferencesByDocument, CancellationToken cancellationToken) 191foreach (var referenceDocument in allReferenceDocuments) 209Document originalDocument, 387var setMethodDocument = updatedSolution.GetDocument(setMethodDeclaration?.SyntaxTree); 461var document = originalSolution.GetDocument(syntax.SyntaxTree);
ReplacePropertyWithMethods\AbstractReplacePropertyWithMethodsService.cs (2)
30Document document, IPropertySymbol property, SyntaxNode propertyDeclaration, IFieldSymbol propertyBackingField, string desiredGetMethodName, string desiredSetMethodName, CancellationToken cancellationToken); 55Document document,
ReplacePropertyWithMethods\IReplacePropertyWithMethodsService.cs (2)
22Document document, 29Document document,
ReplacePropertyWithMethods\ReplacePropertyWithMethodsCodeRefactoringProvider.cs (5)
72Document document, 193ILookup<Document, (IPropertySymbol property, ReferenceLocation location)> referencesByDocument, 212Document originalDocument, 233Document originalDocument, 327var document = originalSolution.GetDocument(syntax.SyntaxTree);
SemanticSearch\SearchCompilationFailureDefinitionItem.cs (1)
13internal sealed class SearchCompilationFailureDefinitionItem(QueryCompilationError error, Document queryDocument)
SemanticSearch\SemanticSearchDocumentSupportsFeatureService.cs (5)
17public bool SupportsCodeFixes(Document document) 20public bool SupportsRefactorings(Document document) 23public bool SupportsRename(Document document) 26public bool SupportsNavigationToAnyPosition(Document document) 29public bool SupportsSemanticSnippets(Document document)
SemanticSearch\SemanticSearchUtilities.cs (2)
66public static Document GetQueryDocument(Solution solution) 78public static bool IsQueryDocument(Document document)
SemanticSearch\SemanticSearchWorkspace.cs (2)
22public async Task<Document> UpdateQueryDocumentAsync(string? query, CancellationToken cancellationToken) 62var queryDocument = SemanticSearchUtilities.GetQueryDocument(newSolution);
Shared\Extensions\DocumentExtensions.cs (14)
22public static async Task<Document> ReplaceNodeAsync<TNode>(this Document document, TNode oldNode, TNode newNode, CancellationToken cancellationToken) 29public static Document ReplaceNodeSynchronously<TNode>(this Document document, TNode oldNode, TNode newNode, CancellationToken cancellationToken) 36public static Document ReplaceNode<TNode>(this Document document, SyntaxNode root, TNode oldNode, TNode newNode) 44public static async Task<Document> ReplaceNodesAsync(this Document document, 55this Document document, 57Func<Document, Task<ImmutableArray<T>>> getItemsWorker) 74this Document document, 75Func<Document, CancellationToken, Task<bool>> contextChecker, 96public static async Task<NamingRule> GetApplicableNamingRuleAsync(this Document document, ISymbol symbol, CancellationToken cancellationToken) 109this Document document, SymbolKindOrTypeKind kind, DeclarationModifiers modifiers, Accessibility? accessibility, CancellationToken cancellationToken)
Shared\IDocumentSupportsFeatureService.cs (10)
16bool SupportsCodeFixes(Document document); 17bool SupportsRefactorings(Document document); 18bool SupportsRename(Document document); 19bool SupportsNavigationToAnyPosition(Document document); 20bool SupportsSemanticSnippets(Document document); 32public bool SupportsCodeFixes(Document document) 35public bool SupportsNavigationToAnyPosition(Document document) 38public bool SupportsRefactorings(Document document) 41public bool SupportsRename(Document document) 44public bool SupportsSemanticSnippets(Document document)
Shared\Utilities\ExtractTypeHelpers.cs (6)
29public static async Task<(Document containingDocument, SyntaxAnnotation typeAnnotation)> AddTypeToExistingFileAsync(Document document, INamedTypeSymbol newType, AnnotatedSymbolMapping symbolMapping, CancellationToken cancellationToken) 46var newDocument = document.WithSyntaxRoot(editor.GetChangedRoot()); 50public static async Task<(Document containingDocument, SyntaxAnnotation typeAnnotation)> AddTypeToNewFileAsync( 57Document hintDocument, 115public static string GetTypeParameterSuffix(Document document, SyntaxFormattingOptions formattingOptions, INamedTypeSymbol type, IEnumerable<ISymbol> extractableMembers, CancellationToken cancellationToken)
SignatureHelp\AbstractSignatureHelpProvider.cs (6)
37protected abstract Task<SignatureHelpItems?> GetItemsWorkerAsync(Document document, int position, SignatureHelpTriggerInfo triggerInfo, MemberDisplayOptions options, CancellationToken cancellationToken); 243Document document, int position, SignatureHelpTriggerInfo triggerInfo, MemberDisplayOptions options, CancellationToken cancellationToken) 281foreach (var relatedDocument in relatedDocuments) 305private static async Task<ImmutableArray<Document>> FindActiveRelatedDocumentsAsync(int position, Document document, CancellationToken cancellationToken) 307using var _ = ArrayBuilder<Document>.GetInstance(out var builder);
SignatureHelp\CommonSignatureHelpUtilities.cs (1)
148Document document, SyntaxNode initializer, MemberDisplayOptions options, CancellationToken cancellationToken)
SignatureHelp\ISignatureHelpProvider.cs (1)
27Task<SignatureHelpItems?> GetItemsAsync(Document document, int position, SignatureHelpTriggerInfo triggerInfo, MemberDisplayOptions options, CancellationToken cancellationToken);
SignatureHelp\SignatureHelpService.cs (2)
43Document document, 62Document document,
SimplifyThisOrMe\AbstractSimplifyThisOrMeCodeFixProvider.cs (1)
43Document document, ImmutableArray<Diagnostic> diagnostics,
SimplifyTypeNames\AbstractSimplifyTypeNamesCodeFixProvider.cs (2)
77var document = context.Document; 102Document document, ImmutableArray<Diagnostic> diagnostics,
Snippets\RoslynLSPSnippetConverter.cs (2)
23public static async Task<string> GenerateLSPSnippetAsync(Document document, int caretPosition, ImmutableArray<SnippetPlaceholder> placeholders, TextChange textChange, int triggerLocation, CancellationToken cancellationToken) 109private static async Task<TextChange> ExtendSnippetTextChangeAsync(Document document, TextChange textChange, ImmutableArray<SnippetPlaceholder> placeholders, int caretPosition, int triggerLocation, CancellationToken cancellationToken)
Snippets\SnippetContext.cs (1)
24public Document Document => SyntaxContext.Document;
Snippets\SnippetFunctionService.cs (10)
32public abstract Task<string?> GetContainingClassNameAsync(Document document, int position, CancellationToken cancellationToken); 38public static async Task<string?> GetSimplifiedTypeNameAsync(Document document, TextSpan fieldSpan, string fullyQualifiedTypeName, SimplifierOptions simplifierOptions, CancellationToken cancellationToken) 45var documentWithFullyQualifiedTypeName = document.WithText(text.WithChanges(textChange)); 56public async Task<string?> GetSwitchExpansionAsync(Document document, TextSpan caseGenerationLocation, TextSpan switchExpressionLocation, SimplifierOptions simplifierOptions, CancellationToken cancellationToken) 120protected abstract Task<ITypeSymbol?> GetEnumSymbolAsync(Document document, TextSpan switchExpressionSpan, CancellationToken cancellationToken); 122protected abstract Task<(Document, TextSpan)> GetDocumentWithEnumCaseAsync(Document document, string fullyQualifiedTypeName, string firstEnumMemberName, TextSpan caseGenerationLocation, CancellationToken cancellationToken); 125Document document, 140private static async Task<string?> GetSimplifiedTypeNameAtSpanAsync(Document documentWithFullyQualifiedTypeName, TextSpan fullyQualifiedTypeSpan, SimplifierOptions simplifierOptions, CancellationToken cancellationToken) 153var documentWithAnnotations = documentWithFullyQualifiedTypeName.WithSyntaxRoot(updatedRoot);
Snippets\SnippetProviders\AbstractConsoleSnippetProvider.cs (2)
40protected sealed override async Task<TextChange> GenerateSnippetTextChangeAsync(Document document, int position, CancellationToken cancellationToken) 75Document document, int position, CancellationToken cancellationToken)
Snippets\SnippetProviders\AbstractInlineStatementSnippetProvider.cs (1)
59protected sealed override async Task<TextChange> GenerateSnippetTextChangeAsync(Document document, int position, CancellationToken cancellationToken)
Snippets\SnippetProviders\AbstractLockSnippetProvider.cs (1)
15protected sealed override Task<TextChange> GenerateSnippetTextChangeAsync(Document document, int position, CancellationToken cancellationToken)
Snippets\SnippetProviders\AbstractMainMethodSnippetProvider.cs (1)
24protected sealed override Task<TextChange> GenerateSnippetTextChangeAsync(Document document, int position, CancellationToken cancellationToken)
Snippets\SnippetProviders\AbstractPropertySnippetProvider.cs (2)
19protected abstract Task<TPropertyDeclarationSyntax> GenerateSnippetSyntaxAsync(Document document, int position, CancellationToken cancellationToken); 21protected sealed override async Task<TextChange> GenerateSnippetTextChangeAsync(Document document, int position, CancellationToken cancellationToken)
Snippets\SnippetProviders\AbstractSingleChangeSnippetProvider.cs (2)
15protected abstract Task<TextChange> GenerateSnippetTextChangeAsync(Document document, int position, CancellationToken cancellationToken); 17protected sealed override async Task<ImmutableArray<TextChange>> GenerateSnippetTextChangesAsync(Document document, int position, CancellationToken cancellationToken)
Snippets\SnippetProviders\AbstractSnippetProvider.cs (17)
41protected abstract Task<ImmutableArray<TextChange>> GenerateSnippetTextChangesAsync(Document document, int position, CancellationToken cancellationToken); 70public async Task<SnippetChange> GetSnippetChangeAsync(Document document, int position, CancellationToken cancellationToken) 78var snippetDocument = await GetDocumentWithSnippetAsync(document, textChanges, cancellationToken).ConfigureAwait(false); 139private static async Task<Document> CleanupDocumentAsync( 140Document document, CancellationToken cancellationToken) 167private async Task<Document> GetDocumentWithSnippetAndTriviaAsync(Document snippetDocument, int position, ISyntaxFacts syntaxFacts, CancellationToken cancellationToken) 188private static async Task<Document> GetDocumentWithSnippetAsync(Document document, ImmutableArray<TextChange> snippets, CancellationToken cancellationToken) 193var snippetDocument = document.WithText(originalText); 198private async Task<Document> AddFormatAnnotationAsync(Document document, int position, CancellationToken cancellationToken) 209Document document, int position, CancellationToken cancellationToken) 227private async Task<Document> AddIndentationToDocumentAsync(Document document, CancellationToken cancellationToken) 238protected virtual Task<Document> AddIndentationToDocumentAsync(Document document, TSnippetSyntax snippet, CancellationToken cancellationToken)
Snippets\SnippetProviders\AbstractTypeSnippetProvider.cs (4)
18protected abstract Task<TTypeDeclarationSyntax> GenerateTypeDeclarationAsync(Document document, int position, CancellationToken cancellationToken); 19protected abstract Task<TextChange?> GetAccessibilityModifiersChangeAsync(Document document, int position, CancellationToken cancellationToken); 21protected sealed override async Task<ImmutableArray<TextChange>> GenerateSnippetTextChangesAsync(Document document, int position, CancellationToken cancellationToken) 42protected static async Task<bool> AreAccessibilityModifiersRequiredAsync(Document document, CancellationToken cancellationToken)
Snippets\SnippetProviders\ISnippetProvider.cs (1)
36Task<SnippetChange> GetSnippetChangeAsync(Document document, int position, CancellationToken cancellationToken);
SolutionCrawler\AbstractDocumentDifferenceService.cs (2)
18public async Task<SyntaxNode?> GetChangedMemberAsync(Document oldDocument, Document newDocument, CancellationToken cancellationToken)
SolutionCrawler\IDocumentDifferenceService.cs (2)
13Task<SyntaxNode?> GetChangedMemberAsync(Document oldDocument, Document newDocument, CancellationToken cancellationToken);
SpellCheck\AbstractSpellCheckCodeFixProvider.cs (9)
39var document = context.Document; 63private async Task CheckNodeAsync(CodeFixContext context, Document document, SyntaxNode node, CancellationToken cancellationToken) 89private async Task CheckTokenAsync(CodeFixContext context, Document document, SyntaxToken token, CancellationToken cancellationToken) 110var document = context.Document; 149var document = context.Document; 200private static async Task<string> GetInsertionTextAsync(Document document, CompletionItem item, CancellationToken cancellationToken) 211private CodeAction CreateCodeAction(SyntaxToken nameToken, string oldName, string newName, Document document) 220private async Task<Document> UpdateAsync(Document document, SyntaxToken nameToken, string newName, CancellationToken cancellationToken)
SpellCheck\AbstractSpellCheckSpanService.cs (1)
23public async Task<ImmutableArray<SpellCheckSpan>> GetSpansAsync(Document document, CancellationToken cancellationToken)
SpellCheck\ISpellCheckingSpanService.cs (1)
17Task<ImmutableArray<SpellCheckSpan>> GetSpansAsync(Document document, CancellationToken cancellationToken);
SplitOrMergeIfStatements\AbstractMergeIfStatementsCodeRefactoringProvider.cs (6)
26Func<CancellationToken, Task<Document>> createChangedDocument, MergeDirection direction, string ifKeywordText); 29Document document, SyntaxNode ifOrElseIf, CancellationToken cancellationToken, out SyntaxNode upperIfOrElseIf); 32Document document, SyntaxNode ifOrElseIf, CancellationToken cancellationToken, out SyntaxNode lowerIfOrElseIf); 34protected abstract SyntaxNode GetChangedRoot(Document document, SyntaxNode root, SyntaxNode upperIfOrElseIf, SyntaxNode lowerIfOrElseIf); 65private async Task<Document> RefactorAsync(Document document, TextSpan upperIfOrElseIfSpan, TextSpan lowerIfOrElseIfSpan, CancellationToken cancellationToken)
SplitOrMergeIfStatements\AbstractSplitIfStatementCodeRefactoringProvider.cs (4)
23protected abstract CodeAction CreateCodeAction(Func<CancellationToken, Task<Document>> createChangedDocument, string ifKeywordText); 26Document document, 60private async Task<Document> RefactorAsync(Document document, TextSpan tokenSpan, TextSpan ifOrElseIfSpan, CancellationToken cancellationToken)
SplitOrMergeIfStatements\Consecutive\AbstractMergeConsecutiveIfStatementsCodeRefactoringProvider.cs (7)
48protected sealed override CodeAction CreateCodeAction(Func<CancellationToken, Task<Document>> createChangedDocument, MergeDirection direction, string ifKeywordText) 56Document document, SyntaxNode ifOrElseIf, CancellationToken cancellationToken, out SyntaxNode firstIfOrElseIf) 69Document document, SyntaxNode ifOrElseIf, CancellationToken cancellationToken, out SyntaxNode secondIfOrElseIf) 81protected sealed override SyntaxNode GetChangedRoot(Document document, SyntaxNode root, SyntaxNode firstIfOrElseIf, SyntaxNode secondIfOrElseIf) 159Document document, 173Document document, 187Document document,
SplitOrMergeIfStatements\Consecutive\AbstractSplitIntoConsecutiveIfStatementsCodeRefactoringProvider.cs (3)
48protected sealed override CodeAction CreateCodeAction(Func<CancellationToken, Task<Document>> createChangedDocument, string ifKeywordText) 55Document document, 117Document document,
SplitOrMergeIfStatements\Nested\AbstractMergeNestedIfStatementsCodeRefactoringProvider.cs (5)
36protected sealed override CodeAction CreateCodeAction(Func<CancellationToken, Task<Document>> createChangedDocument, MergeDirection direction, string ifKeywordText) 44Document document, SyntaxNode ifOrElseIf, CancellationToken cancellationToken, out SyntaxNode outerIfOrElseIf) 57Document document, SyntaxNode ifOrElseIf, CancellationToken cancellationToken, out SyntaxNode innerIfStatement) 69protected sealed override SyntaxNode GetChangedRoot(Document document, SyntaxNode root, SyntaxNode outerIfOrElseIf, SyntaxNode innerIfStatement) 145Document document,
SplitOrMergeIfStatements\Nested\AbstractSplitIntoNestedIfStatementsCodeRefactoringProvider.cs (2)
34protected sealed override CodeAction CreateCodeAction(Func<CancellationToken, Task<Document>> createChangedDocument, string ifKeywordText) 41Document document,
src\Analyzers\Core\CodeFixes\AddAccessibilityModifiers\AbstractAddAccessibilityModifiersCodeFixProvider.cs (1)
44Document document, ImmutableArray<Diagnostic> diagnostics,
src\Analyzers\Core\CodeFixes\AddAnonymousTypeMemberName\AbstractAddAnonymousTypeMemberNameCodeFixProvider.cs (4)
35var document = context.Document; 54Document document, Diagnostic diagnostic, CancellationToken cancellationToken) 84Document document, ImmutableArray<Diagnostic> diagnostics, 101Document document, SemanticModel semanticModel, Diagnostic diagnostic,
src\Analyzers\Core\CodeFixes\AddExplicitCast\AbstractAddExplicitCastCodeFixProvider.cs (6)
49Document document, SemanticModel semanticModel, SyntaxNode root, 61Document document, SemanticModel semanticModel, SyntaxNode root, 68var document = context.Document; 117Document document, 172Document document, 213Document document,
src\Analyzers\Core\CodeFixes\AddExplicitCast\Fixer.cs (2)
39Document document, 109Document document,
src\Analyzers\Core\CodeFixes\AddObsoleteAttribute\AbstractAddObsoleteAttributeCodeFixProvider.cs (3)
36var document = context.Document; 58private static async Task<INamedTypeSymbol?> GetObsoleteAttributeAsync(Document document, CancellationToken cancellationToken) 72Document document, ImmutableArray<Diagnostic> diagnostics,
src\Analyzers\Core\CodeFixes\AddParameter\AbstractAddParameterCodeFixProvider.cs (5)
66var document = context.Document; 330Document document, 374Document invocationDocument, 401private async Task<(ITypeSymbol, RefKind)> GetArgumentTypeAndRefKindAsync(Document invocationDocument, TArgumentSyntax argument, CancellationToken cancellationToken) 411Document invocationDocument, TArgumentSyntax argument, INamedTypeSymbol containingType, CancellationToken cancellationToken)
src\Analyzers\Core\CodeFixes\AddParameter\AddParameterService.cs (2)
79Document invocationDocument, 216Document invocationDocument, IMethodSymbol method, CancellationToken cancellationToken)
src\Analyzers\Core\CodeFixes\AddRequiredParentheses\AddRequiredParenthesesCodeFixProvider.cs (2)
26protected override bool IncludeDiagnosticDuringFixAll(Diagnostic diagnostic, Document document, string? equivalenceKey, CancellationToken cancellationToken) 43Document document, ImmutableArray<Diagnostic> diagnostics,
src\Analyzers\Core\CodeFixes\AliasAmbiguousType\AbstractAliasAmbiguousTypeCodeFixProvider.cs (1)
33var document = context.Document;
src\Analyzers\Core\CodeFixes\AnalyzerOptionsProviders.cs (1)
14public static async ValueTask<AnalyzerOptionsProvider> GetAnalyzerOptionsProviderAsync(this Document document, CancellationToken cancellationToken)
src\Analyzers\Core\CodeFixes\ConflictMarkerResolution\AbstractConflictMarkerCodeFixProvider.cs (14)
71var document = context.Document; 267var document = context.Document; 300static CodeAction CreateCodeAction(string title, Func<CancellationToken, Task<Document>> action, string equivalenceKey) 313private static async Task<Document> AddEditsAsync( 314Document document, int startPos, int firstMiddlePos, int secondMiddlePos, int endPos, 379private static Task<Document> TakeTopAsync(Document document, int startPos, int firstMiddlePos, int secondMiddlePos, int endPos, CancellationToken cancellationToken) 382private static Task<Document> TakeBottomAsync(Document document, int startPos, int firstMiddlePos, int secondMiddlePos, int endPos, CancellationToken cancellationToken) 385private static Task<Document> TakeBothAsync(Document document, int startPos, int firstMiddlePos, int secondMiddlePos, int endPos, CancellationToken cancellationToken) 391private async Task<Document> FixAllAsync( 392Document document, ImmutableArray<Diagnostic> diagnostics, 444var finalDoc = document.WithText(finalText);
src\Analyzers\Core\CodeFixes\ConvertToAsync\AbstractConvertToAsyncCodeFixProvider.cs (2)
62SyntaxNode node, Document document, Diagnostic diagnostic, CancellationToken cancellationToken) 72var otherDocument = document.Project.Solution.GetDocument(syntaxTree);
src\Analyzers\Core\CodeFixes\ConvertTypeOfToNameOf\AbstractConvertTypeOfToNameOfCodeFixProvider.cs (1)
35Document document, ImmutableArray<Diagnostic> diagnostics,
src\Analyzers\Core\CodeFixes\DocumentationComments\AbstractAddDocCommentNodesCodeFixProvider.cs (2)
58protected async Task<Document> AddParamTagAsync( 59Document document, TMemberDeclarationSyntax parentMethod, SyntaxNode docCommentNode, CancellationToken cancellationToken)
src\Analyzers\Core\CodeFixes\DocumentationComments\AbstractRemoveDocCommentNodeCodeFixProvider.cs (2)
59private async Task<Document> RemoveDuplicateParamTagAsync( 60Document document, TXmlElementSyntax paramNode, CancellationToken cancellationToken)
src\Analyzers\Core\CodeFixes\FileHeaders\AbstractFileHeaderCodeFixProvider.cs (4)
46private async Task<Document> GetTransformedDocumentAsync(Document document, CancellationToken cancellationToken) 49private async Task<SyntaxNode> GetTransformedSyntaxRootAsync(Document document, CancellationToken cancellationToken) 58internal static async Task<SyntaxNode> GetTransformedSyntaxRootAsync(ISyntaxFacts syntaxFacts, AbstractFileHeaderHelper fileHeaderHelper, SyntaxTrivia newLineTrivia, Document document, string? fileHeaderTemplate, CancellationToken cancellationToken)
src\Analyzers\Core\CodeFixes\ForEachCast\AbstractForEachCastCodeFixProvider.cs (1)
44Document document, ImmutableArray<Diagnostic> diagnostics,
src\Analyzers\Core\CodeFixes\Formatting\FormattingCodeFixProvider.cs (2)
62private async Task<Document> FixOneAsync(CodeFixContext context, Diagnostic diagnostic, CancellationToken cancellationToken) 80protected override async Task FixAllAsync(Document document, ImmutableArray<Diagnostic> diagnostics, SyntaxEditor editor, CancellationToken cancellationToken)
src\Analyzers\Core\CodeFixes\GenerateConstructor\AbstractGenerateConstructorService.cs (1)
78public async Task<ImmutableArray<CodeAction>> GenerateConstructorAsync(Document document, SyntaxNode node, CancellationToken cancellationToken)
src\Analyzers\Core\CodeFixes\GenerateConstructor\AbstractGenerateConstructorService.State.cs (7)
412public async Task<Document> GetChangedDocumentAsync( 413Document document, bool withFields, bool withProperties, CancellationToken cancellationToken) 428private async Task<Document?> GenerateThisOrBaseDelegatingConstructorAsync( 429Document document, bool withFields, bool withProperties, CancellationToken cancellationToken) 465Document document, bool withFields, bool withProperties, CancellationToken cancellationToken) 486private async Task<Document> GenerateMemberDelegatingConstructorAsync( 487Document document, bool withFields, bool withProperties, CancellationToken cancellationToken)
src\Analyzers\Core\CodeFixes\GenerateConstructor\IGenerateConstructorService.cs (1)
16Task<ImmutableArray<CodeAction>> GenerateConstructorAsync(Document document, SyntaxNode node, CancellationToken cancellationToken);
src\Analyzers\Core\CodeFixes\GenerateDefaultConstructors\AbstractGenerateDefaultConstructorCodeFixProvider.cs (1)
23var document = context.Document;
src\Analyzers\Core\CodeFixes\GenerateDefaultConstructors\AbstractGenerateDefaultConstructorsService.cs (1)
26Document document,
src\Analyzers\Core\CodeFixes\GenerateDefaultConstructors\GenerateDefaultConstructorsCodeAction.cs (3)
26Document document, 32private readonly Document _document = document; 37protected override async Task<Document> GetChangedDocumentAsync(CancellationToken cancellationToken)
src\Analyzers\Core\CodeFixes\GenerateDefaultConstructors\IGenerateDefaultConstructorsService.cs (1)
17Document document, TextSpan textSpan, bool forRefactoring, CancellationToken cancellationToken);
src\Analyzers\Core\CodeFixes\GenerateEnumMember\AbstractGenerateEnumMemberService.CodeAction.cs (3)
19private sealed partial class GenerateEnumMemberCodeAction(Document document, State state) : CodeAction 21private readonly Document _document = document; 24protected override async Task<Document> GetChangedDocumentAsync(CancellationToken cancellationToken)
src\Analyzers\Core\CodeFixes\GenerateEnumMember\AbstractGenerateEnumMemberService.cs (1)
24public async Task<ImmutableArray<CodeAction>> GenerateEnumMemberAsync(Document document, SyntaxNode node, CancellationToken cancellationToken)
src\Analyzers\Core\CodeFixes\GenerateEnumMember\IGenerateEnumMemberService.cs (1)
15Task<ImmutableArray<CodeAction>> GenerateEnumMemberAsync(Document document, SyntaxNode node, CancellationToken cancellationToken);
src\Analyzers\Core\CodeFixes\GenerateMember\AbstractGenerateMemberCodeFixProvider.cs (2)
27protected abstract Task<ImmutableArray<CodeAction>> GetCodeActionsAsync(Document document, SyntaxNode node, CancellationToken cancellationToken); 40var document = context.Document;
src\Analyzers\Core\CodeFixes\GenerateParameterizedMember\AbstractGenerateConversionService.cs (1)
30Document document,
src\Analyzers\Core\CodeFixes\GenerateParameterizedMember\AbstractGenerateDeconstructMethodService.cs (1)
25Document document,
src\Analyzers\Core\CodeFixes\GenerateParameterizedMember\AbstractGenerateMethodService.cs (1)
31Document document,
src\Analyzers\Core\CodeFixes\GenerateParameterizedMember\AbstractGenerateParameterizedMemberService.CodeAction.cs (3)
21private readonly Document _document; 29Document document, 65protected override async Task<Document> GetChangedDocumentAsync(CancellationToken cancellationToken)
src\Analyzers\Core\CodeFixes\GenerateParameterizedMember\AbstractGenerateParameterizedMemberService.cs (1)
42protected async ValueTask<ImmutableArray<CodeAction>> GetActionsAsync(Document document, State state, CancellationToken cancellationToken)
src\Analyzers\Core\CodeFixes\GenerateParameterizedMember\IGenerateConversionService.cs (1)
15Task<ImmutableArray<CodeAction>> GenerateConversionAsync(Document document, SyntaxNode node, CancellationToken cancellationToken);
src\Analyzers\Core\CodeFixes\GenerateParameterizedMember\IGenerateDeconstructMemberService.cs (1)
17Document document, SyntaxNode targetVariables, INamedTypeSymbol typeToGenerateIn, CancellationToken cancellationToken);
src\Analyzers\Core\CodeFixes\GenerateParameterizedMember\IGenerateParameterizedMemberService.cs (1)
16Task<ImmutableArray<CodeAction>> GenerateMethodAsync(Document document, SyntaxNode node, CancellationToken cancellationToken);
src\Analyzers\Core\CodeFixes\GenerateVariable\AbstractGenerateVariableService.CodeAction.cs (1)
55protected override async Task<Document> GetChangedDocumentAsync(CancellationToken cancellationToken)
src\Analyzers\Core\CodeFixes\GenerateVariable\AbstractGenerateVariableService.cs (4)
33Document document, 116Document document, State state, SymbolKind kind, Accessibility accessibility, CancellationToken cancellationToken) 176ArrayBuilder<CodeAction> result, Document document, State state, CancellationToken cancellationToken) 192ArrayBuilder<CodeAction> result, Document document, State state, CancellationToken cancellationToken)
src\Analyzers\Core\CodeFixes\GenerateVariable\AbstractGenerateVariableService.GenerateLocalCodeAction.cs (3)
21private sealed class GenerateLocalCodeAction(TService service, Document document, State state) : CodeAction 24private readonly Document _document = document; 39protected override async Task<Document> GetChangedDocumentAsync(CancellationToken cancellationToken)
src\Analyzers\Core\CodeFixes\GenerateVariable\AbstractGenerateVariableService.GenerateParameterCodeAction.cs (2)
18Document document, 23private readonly Document _document = document;
src\Analyzers\Core\CodeFixes\GenerateVariable\IGenerateVariableService.cs (1)
17Task<ImmutableArray<CodeAction>> GenerateVariableAsync(Document document, SyntaxNode node, CancellationToken cancellationToken);
src\Analyzers\Core\CodeFixes\ImplementAbstractClass\AbstractImplementAbstractClassCodeFixProvider.cs (1)
27var document = context.Document;
src\Analyzers\Core\CodeFixes\ImplementAbstractClass\ImplementAbstractClassData.cs (6)
33Document document, ImplementTypeOptions options, SyntaxNode classNode, SyntaxToken classIdentifier, 37private readonly Document _document = document; 47Document document, SyntaxNode classNode, SyntaxToken classIdentifier, CancellationToken cancellationToken) 78public static async Task<Document?> TryImplementAbstractClassAsync( 79Document document, SyntaxNode classNode, SyntaxToken classIdentifier, CancellationToken cancellationToken) 88public async Task<Document> ImplementAbstractClassAsync(
src\Analyzers\Core\CodeFixes\ImplementInterface\AbstractImplementInterfaceCodeFixProvider.cs (3)
32var document = context.Document; 126Document document, ImplementInterfaceInfo state, [EnumeratorCancellation] CancellationToken cancellationToken) 201Document document, ImplementInterfaceInfo state, CancellationToken cancellationToken)
src\Analyzers\Core\CodeFixes\ImplementInterface\AbstractImplementInterfaceService.cs (7)
31protected abstract bool TryInitializeState(Document document, SemanticModel model, SyntaxNode interfaceNode, CancellationToken cancellationToken, out SyntaxNode classOrStructDecl, out INamedTypeSymbol classOrStructType, out ImmutableArray<INamedTypeSymbol> interfaceTypes); 37public async Task<Document> ImplementInterfaceAsync( 38Document document, ImplementTypeOptions options, SyntaxNode node, CancellationToken cancellationToken) 57public async Task<ImplementInterfaceInfo?> AnalyzeAsync(Document document, SyntaxNode interfaceType, CancellationToken cancellationToken) 86public async Task<Document> ImplementInterfaceAsync( 87Document document, 99Document document,
src\Analyzers\Core\CodeFixes\ImplementInterface\AbstractImplementInterfaceService.State.cs (3)
15Document document, 33public readonly Document Document = document; 44Document document,
src\Analyzers\Core\CodeFixes\ImplementInterface\IImplementInterfaceService.cs (6)
24Task<Document> ImplementInterfaceAsync(Document document, ImplementTypeOptions options, SyntaxNode node, CancellationToken cancellationToken); 26Task<ImplementInterfaceInfo?> AnalyzeAsync(Document document, SyntaxNode interfaceType, CancellationToken cancellationToken); 28Task<Document> ImplementInterfaceAsync( 29Document document, 41Document document,
src\Analyzers\Core\CodeFixes\ImplementInterface\ImplementHelpers.cs (1)
19Document document,
src\Analyzers\Core\CodeFixes\ImplementInterface\ImplementInterfaceGenerator.cs (4)
35private readonly Document Document; 50Document document, 62public Task<Document> ImplementInterfaceAsync(CancellationToken cancellationToken) 75private async Task<Document> ImplementInterfaceAsync(
src\Analyzers\Core\CodeFixes\ImplementInterface\ImplementInterfaceGenerator_DisposePattern.cs (5)
45private async Task<Document> ImplementDisposePatternAsync( 49var document = this.Document; 94private async Task<Document> AddFinalizerCommentAsync( 95Document document, SyntaxNode finalizer, CancellationToken cancellationToken) 234Document document,
src\Analyzers\Core\CodeFixes\ImplementType\ImplementTypeOptions.cs (1)
77public static async ValueTask<ImplementTypeOptions> GetImplementTypeOptionsAsync(this Document document, CancellationToken cancellationToken)
src\Analyzers\Core\CodeFixes\Iterator\AbstractIteratorCodeFixProvider.cs (1)
24protected abstract Task<CodeAction> GetCodeFixAsync(SyntaxNode root, SyntaxNode node, Document document, Diagnostic diagnostics, CancellationToken cancellationToken);
src\Analyzers\Core\CodeFixes\MakeFieldReadonly\AbstractMakeFieldReadonlyCodeFixProvider.cs (2)
39Document document, 57Document document, SyntaxEditor editor, List<TSymbolSyntax> declarators, CancellationToken cancellationToken)
src\Analyzers\Core\CodeFixes\MakeMemberStatic\AbstractMakeMemberStaticCodeFixProvider.cs (1)
32protected sealed override Task FixAllAsync(Document document, ImmutableArray<Diagnostic> diagnostics, SyntaxEditor editor,
src\Analyzers\Core\CodeFixes\MakeMethodAsynchronous\AbstractMakeMethodAsynchronousCodeFixProvider.cs (6)
35var document = context.Document; 94private static bool IsLikelyEntryPointName(string name, Document document) 103Document document, 156Document document, 186Document document, 197var newDocument = document.WithSyntaxRoot(newRoot);
src\Analyzers\Core\CodeFixes\MakeMethodSynchronous\AbstractMakeMethodSynchronousCodeFixProvider.cs (7)
52Document document, SyntaxNode node, CancellationToken cancellationToken) 73private async Task<Solution> RenameThenRemoveAsyncTokenAsync(Document document, SyntaxNode node, IMethodSymbol methodSymbol, CancellationToken cancellationToken) 97Document document, IMethodSymbol methodSymbol, SyntaxNode node, CancellationToken cancellationToken) 109var newDocument = document.WithSyntaxRoot(newRoot); 120Document document, SyntaxAnnotation annotation, CancellationToken cancellationToken) 171Solution currentSolution, IGrouping<Document, ReferenceLocation> group, CancellationToken cancellationToken) 173var document = group.Key;
src\Analyzers\Core\CodeFixes\MakeTypeAbstract\AbstractMakeTypeAbstractCodeFixProvider.cs (1)
32protected sealed override Task FixAllAsync(Document document, ImmutableArray<Diagnostic> diagnostics, SyntaxEditor editor,
src\Analyzers\Core\CodeFixes\MakeTypePartial\AbstractMakeTypePartialCodeFixProvider.cs (1)
29protected override async Task FixAllAsync(Document document, ImmutableArray<Diagnostic> diagnostics, SyntaxEditor editor, CancellationToken cancellationToken)
src\Analyzers\Core\CodeFixes\MatchFolderAndNamespace\AbstractChangeNamespaceToMatchFolderCodeFixProvider.cs (2)
42private static async Task<Solution> FixAllInDocumentAsync(Document document, ImmutableArray<Diagnostic> diagnostics, CancellationToken cancellationToken) 55var documentWithInvalidFolders = document.WithFolders(document.Folders.Concat("Force-Namespace-Change"));
src\Analyzers\Core\CodeFixes\Naming\NamingExtensions.cs (2)
18this Document document, SymbolKind symbolKind, Accessibility accessibility, CancellationToken cancellationToken) 36this Document document, CancellationToken cancellationToken)
src\Analyzers\Core\CodeFixes\NamingStyle\NamingStyleCodeFixProvider.cs (2)
54var document = context.Document; 104Document document, ISymbol symbol, string fixedName, CancellationToken cancellationToken)
src\Analyzers\Core\CodeFixes\NewLines\ConsecutiveStatementPlacement\ConsecutiveStatementPlacementCodeFixProvider.cs (5)
31var document = context.Document; 41private static Task<Document> UpdateDocumentAsync(Document document, Diagnostic diagnostic, CancellationToken cancellationToken) 44public static async Task<Document> FixAllAsync(Document document, ImmutableArray<Diagnostic> diagnostics, CancellationToken cancellationToken)
src\Analyzers\Core\CodeFixes\NewLines\MultipleBlankLines\AbstractMultipleBlankLinesCodeFixProvider.cs (5)
31var document = context.Document; 41private static Task<Document> UpdateDocumentAsync(Document document, Diagnostic diagnostic, CancellationToken cancellationToken) 44private static async Task<Document> FixAllAsync( 45Document document, ImmutableArray<Diagnostic> diagnostics, CancellationToken cancellationToken)
src\Analyzers\Core\CodeFixes\OrderModifiers\AbstractOrderModifiersCodeFixProvider.cs (1)
53Document document, ImmutableArray<Diagnostic> diagnostics, SyntaxEditor editor, CancellationToken cancellationToken)
src\Analyzers\Core\CodeFixes\PopulateSwitch\AbstractPopulateSwitchCodeFixProvider.cs (10)
50Document document, SyntaxEditor editor, SemanticModel semanticModel, 64var document = context.Document; 104private Task<Document> FixAsync( 105Document document, Diagnostic diagnostic, 113private Task<Document> FixAllAsync( 114Document document, ImmutableArray<Diagnostic> diagnostics, 124Document document, SyntaxEditor editor, ImmutableArray<Diagnostic> diagnostics, 137Document document, SyntaxEditor editor, Diagnostic diagnostic, 204Document document, 220Document document,
src\Analyzers\Core\CodeFixes\PopulateSwitch\AbstractPopulateSwitchExpressionCodeFixProvider.cs (1)
30Document document, SyntaxEditor editor, SemanticModel semanticModel,
src\Analyzers\Core\CodeFixes\PopulateSwitch\AbstractPopulateSwitchStatementCodeFixProvider.cs (1)
31Document document, SyntaxEditor editor, SemanticModel semanticModel,
src\Analyzers\Core\CodeFixes\QualifyMemberAccess\AbstractQualifyMemberAccessCodeFixProvider.cs (1)
36Document document, ImmutableArray<Diagnostic> diagnostics,
src\Analyzers\Core\CodeFixes\RemoveAsyncModifier\AbstractRemoveAsyncModifierCodeFixProvider.cs (2)
31var document = context.Document; 64Document document, ImmutableArray<Diagnostic> diagnostics,
src\Analyzers\Core\CodeFixes\RemoveRedundantEquality\RemoveRedundantEqualityCodeFixProvider.cs (1)
32Document document,
src\Analyzers\Core\CodeFixes\RemoveUnnecessaryImports\AbstractRemoveUnnecessaryImportsCodeFixProvider.cs (2)
39private static Task<Document> RemoveUnnecessaryImportsAsync( 40Document document,
src\Analyzers\Core\CodeFixes\RemoveUnnecessaryParentheses\AbstractRemoveUnnecessaryParenthesesCodeFixProvider.cs (1)
35Document document, ImmutableArray<Diagnostic> diagnostics,
src\Analyzers\Core\CodeFixes\RemoveUnnecessarySuppressions\RemoveUnnecessaryAttributeSuppressionsCodeFixProvider.cs (1)
40protected override Task FixAllAsync(Document document, ImmutableArray<Diagnostic> diagnostics, SyntaxEditor editor, CancellationToken cancellationToken)
src\Analyzers\Core\CodeFixes\RemoveUnnecessarySuppressions\RemoveUnnecessaryPragmaSuppressionsCodeFixProvider.cs (1)
47protected override Task FixAllAsync(Document document, ImmutableArray<Diagnostic> diagnostics, SyntaxEditor editor, CancellationToken cancellationToken)
src\Analyzers\Core\CodeFixes\RemoveUnusedMembers\AbstractRemoveUnusedMembersCodeFixProvider.cs (1)
41Document document,
src\Analyzers\Core\CodeFixes\RemoveUnusedParametersAndValues\AbstractRemoveUnusedValuesCodeFixProvider.cs (18)
203private static bool IsForEachIterationVariableDiagnostic(Diagnostic diagnostic, Document document, CancellationToken cancellationToken) 233protected override bool IncludeDiagnosticDuringFixAll(Diagnostic diagnostic, Document document, string? equivalenceKey, CancellationToken cancellationToken) 272private static async Task<Document> PreprocessDocumentAsync(Document document, ImmutableArray<Diagnostic> diagnostics, CancellationToken cancellationToken) 284protected sealed override async Task FixAllAsync(Document document, ImmutableArray<Diagnostic> diagnostics, SyntaxEditor editor, CancellationToken cancellationToken) 287var preprocessedDocument = await PreprocessDocumentAsync(document, diagnostics, cancellationToken).ConfigureAwait(false); 293Document document, 347Document document, 384Document document, 443Document document, 745Document document, 774Func<SyntaxNode, Document, SyntaxFormattingOptions, CancellationToken, Task<SyntaxNode>> processMemberDeclarationAsync, 776Document document, 783var newDocument = document.WithSyntaxRoot(currentRoot); 805private async Task<SyntaxNode> ReplaceDiscardDeclarationsWithAssignmentsAsync(SyntaxNode memberDeclaration, Document document, SyntaxFormattingOptions options, CancellationToken cancellationToken) 823Document document, 829var originalDocument = document; 916Document document,
src\Analyzers\Core\CodeFixes\SimplifyBooleanExpression\SimplifyConditionalCodeFixProvider.cs (1)
36Document document,
src\Analyzers\Core\CodeFixes\SimplifyInterpolation\AbstractSimplifyInterpolationCodeFixProvider.cs (1)
50Document document, ImmutableArray<Diagnostic> diagnostics,
src\Analyzers\Core\CodeFixes\SimplifyLinqExpression\SimplifyLinqExpressionCodeFixProvider.cs (1)
34Document document,
src\Analyzers\Core\CodeFixes\UnsealClass\AbstractUnsealClassCodeFixProvider.cs (1)
31var document = context.Document;
src\Analyzers\Core\CodeFixes\UpdateLegacySuppressions\UpdateLegacySuppressionsCodeFixProvider.cs (1)
41protected override Task FixAllAsync(Document document, ImmutableArray<Diagnostic> diagnostics, SyntaxEditor editor, CancellationToken cancellationToken)
src\Analyzers\Core\CodeFixes\UseCoalesceExpression\AbstractUseCoalesceExpressionForIfNullStatementCheckCodeFixProvider.cs (1)
35Document document, ImmutableArray<Diagnostic> diagnostics,
src\Analyzers\Core\CodeFixes\UseCoalesceExpression\UseCoalesceExpressionForNullableTernaryConditionalCheckCodeFixProvider.cs (1)
38Document document, ImmutableArray<Diagnostic> diagnostics,
src\Analyzers\Core\CodeFixes\UseCoalesceExpression\UseCoalesceExpressionForTernaryConditionalCheckCodeFixProvider.cs (1)
39Document document, ImmutableArray<Diagnostic> diagnostics,
src\Analyzers\Core\CodeFixes\UseCollectionExpression\AbstractUseCollectionExpressionCodeFixProvider.cs (1)
27protected override bool IncludeDiagnosticDuringFixAll(Diagnostic diagnostic, Document document, string? equivalenceKey, CancellationToken cancellationToken)
src\Analyzers\Core\CodeFixes\UseCollectionInitializer\AbstractUseCollectionInitializerCodeFixProvider.cs (2)
56Document document, TObjectCreationExpressionSyntax objectCreation, bool useCollectionExpression, 61Document document,
src\Analyzers\Core\CodeFixes\UseCompoundAssignment\AbstractUseCompoundAssignmentCodeFixProvider.cs (1)
53Document document, ImmutableArray<Diagnostic> diagnostics,
src\Analyzers\Core\CodeFixes\UseConditionalExpression\AbstractUseConditionalExpressionCodeFixProvider.cs (4)
41Document document, Diagnostic diagnostic, 45Document document, ImmutableArray<Diagnostic> diagnostics, SyntaxEditor editor, 85Document document, IConditionalOperation ifOperation, 138Document document, SyntaxNode condition, SyntaxNode trueSyntax, SyntaxNode falseSyntax, SyntaxFormattingOptions formattingOptions,
src\Analyzers\Core\CodeFixes\UseConditionalExpression\ForAssignment\AbstractUseConditionalExpressionForAssignmentCodeFixProvider.cs (1)
59Document document, Diagnostic diagnostic,
src\Analyzers\Core\CodeFixes\UseConditionalExpression\ForReturn\AbstractUseConditionalExpressionForReturnCodeFixProvider.cs (1)
48Document document, Diagnostic diagnostic,
src\Analyzers\Core\CodeFixes\UseExplicitTupleName\UseExplicitTupleNameCodeFixProvider.cs (1)
35Document document, ImmutableArray<Diagnostic> diagnostics,
src\Analyzers\Core\CodeFixes\UseInferredMemberName\AbstractUseInferredMemberNameCodeFixProvider.cs (1)
32Document document, ImmutableArray<Diagnostic> diagnostics,
src\Analyzers\Core\CodeFixes\UseIsNullCheck\AbstractUseIsNullForReferenceEqualsCodeFixProvider.cs (1)
51Document document, ImmutableArray<Diagnostic> diagnostics,
src\Analyzers\Core\CodeFixes\UseNullPropagation\AbstractUseNullPropagationCodeFixProvider.cs (3)
80Document document, ImmutableArray<Diagnostic> diagnostics, 101Document document, 160Document document,
src\Analyzers\Core\CodeFixes\UseObjectInitializer\AbstractUseObjectInitializerCodeFixProvider.cs (1)
65Document document,
src\Analyzers\Core\CodeFixes\UseSystemHashCode\UseSystemHashCodeCodeFixProvider.cs (1)
36Document document, ImmutableArray<Diagnostic> diagnostics,
StackTraceExplorer\IStackTraceExplorerService.cs (1)
19(Document? document, int line) GetDocumentAndLine(Solution solution, ParsedFrame frame);
StackTraceExplorer\StackTraceExplorerService.cs (4)
28public (Document? document, int line) GetDocumentAndLine(Solution solution, ParsedFrame frame) 76private static ImmutableArray<Document> GetFileMatches(Solution solution, StackFrameCompilationUnit root, out int lineNumber) 90var potentialMatches = new HashSet<Document>(); 94foreach (var document in project.Documents)
StringIndentation\IStringIndentationService.cs (1)
15Task<ImmutableArray<StringIndentationRegion>> GetStringIndentationRegionsAsync(Document document, TextSpan textSpan, CancellationToken cancellationToken);
Structure\BlockStructureService.cs (2)
19public static BlockStructureService GetService(Document document) 27public abstract Task<BlockStructure> GetBlockStructureAsync(Document document, BlockStructureOptions options, CancellationToken cancellationToken);
Structure\BlockStructureServiceWithProviders.cs (1)
47Document document,
SymbolMapping\ISymbolMappingService.cs (2)
22Task<SymbolMappingResult?> MapSymbolAsync(Document document, SymbolKey symbolId, CancellationToken cancellationToken = default); 33Task<SymbolMappingResult?> MapSymbolAsync(Document document, ISymbol symbol, CancellationToken cancellationToken = default);
SymbolMapping\SymbolMappingServiceFactory.cs (2)
24public async Task<SymbolMappingResult> MapSymbolAsync(Document document, SymbolKey symbolId, CancellationToken cancellationToken) 36public Task<SymbolMappingResult> MapSymbolAsync(Document document, ISymbol symbol, CancellationToken cancellationToken)
SymbolSearch\SymbolSearchOptions.cs (1)
54public static async ValueTask<SymbolSearchOptions> GetSymbolSearchOptionsAsync(this Document document, CancellationToken cancellationToken)
SyncNamespaces\AbstractSyncNamespacesService.cs (1)
168public override async Task<IEnumerable<Diagnostic>> GetDocumentDiagnosticsAsync(Document document, CancellationToken cancellationToken)
TaskList\AbstractTaskListService.cs (2)
29Document document, 51Document document,
Testing\AbstractTestMethodFinder.cs (2)
33public async Task<ImmutableArray<SyntaxNode>> GetPotentialTestMethodsAsync(Document document, TextSpan textSpan, CancellationToken cancellationToken) 86private async Task<ImmutableArray<SyntaxNode>> GetPotentialTestNodesAsync(Document document, TextSpan textSpan, CancellationToken cancellationToken)
Testing\ITestMethodFinder.cs (1)
19Task<ImmutableArray<SyntaxNode>> GetPotentialTestMethodsAsync(Document document, TextSpan textSpan, CancellationToken cancellationToken);
UseAutoProperty\AbstractUseAutoPropertyCodeFixProvider.cs (4)
50Document document, SyntaxNode finalPropertyDeclaration); 53Document propertyDocument, 343var document = solution.GetDocument(documentId); 353Document document,
UseNamedArguments\AbstractUseNamedArgumentsCodeRefactoringProvider.cs (2)
136private Task<Document> AddNamedArgumentsAsync( 138Document document,
ValueTracking\IValueTrackingService.cs (1)
15Task<ImmutableArray<ValueTrackedItem>> TrackValueSourceAsync(TextSpan selection, Document document, CancellationToken cancellationToken);
ValueTracking\ValueTracker.cs (3)
21Document document, 138private static async Task AddItemsFromAssignmentAsync(Document document, SyntaxNode lhsNode, OperationCollector collector, CancellationToken cancellationToken) 255private static async Task<(ISymbol?, SyntaxNode?)> GetSelectedSymbolAsync(TextSpan textSpan, Document document, CancellationToken cancellationToken)
ValueTracking\ValueTracker.FindReferencesProgress.cs (2)
145var document = referenceLocation.Document; 168var document = referenceLocation.Document;
ValueTracking\ValueTrackingService.cs (1)
29Document document,
Workspace\CompileTimeSolutionProvider.cs (2)
171internal static async Task<Document?> TryGetCompileTimeDocumentAsync( 172Document designTimeDocument,
Wrapping\AbstractCodeActionComputer.cs (6)
49protected readonly Document OriginalDocument; 65Document document, 92var newDocument = OriginalDocument.WithText(newSourceText); 132var formattedDocument = await FormatDocumentAsync(rewrittenRoot, spanToFormat, cancellationToken).ConfigureAwait(false); 162private async Task<Document> FormatDocumentAsync( 165var newDocument = OriginalDocument.WithSyntaxRoot(rewrittenRoot);
Wrapping\AbstractWrapper.cs (2)
35Document document, int position, SyntaxNode node, SyntaxWrappingOptions options, bool containsSyntaxError, CancellationToken cancellationToken); 38Document document, IEnumerable<SyntaxNodeOrToken> nodesAndTokens, CancellationToken cancellationToken)
Wrapping\BinaryExpression\AbstractBinaryExpressionWrapper.cs (1)
44Document document, int position, SyntaxNode node, SyntaxWrappingOptions options, bool containsSyntaxError, CancellationToken cancellationToken)
Wrapping\BinaryExpression\BinaryExpressionCodeActionComputer.cs (1)
48Document document,
Wrapping\ChainedExpression\AbstractChainedExpressionWrapper.cs (1)
74Document document, int position, SyntaxNode node, SyntaxWrappingOptions options, bool containsSyntaxError, CancellationToken cancellationToken)
Wrapping\ChainedExpression\ChainedExpressionCodeActionComputer.cs (1)
69Document document,
Wrapping\ISyntaxWrapper.cs (1)
29Document document, int position, SyntaxNode node, SyntaxWrappingOptions options, bool containsSyntaxError, CancellationToken cancellationToken);
Wrapping\SeparatedSyntaxList\AbstractSeparatedSyntaxListWrapper.cs (1)
53Document document, int position, SyntaxNode declaration, SyntaxWrappingOptions options, bool containsSyntaxError, CancellationToken cancellationToken)
Wrapping\SeparatedSyntaxList\SeparatedSyntaxListCodeActionComputer.cs (1)
76Document document,
Wrapping\WrapItemsAction.cs (1)
22internal sealed class WrapItemsAction(string title, string parentTitle, Func<IProgress<CodeAnalysisProgress>, CancellationToken, Task<Document>> createChangedDocument)
Microsoft.CodeAnalysis.Features.Test.Utilities (21)
Diagnostics\DiagnosticProviderTestUtilities.cs (2)
17Document document, 28Document document,
Diagnostics\TestDiagnosticAnalyzerDriver.cs (4)
40Document document, 80public Task<IEnumerable<Diagnostic>> GetAllDiagnosticsAsync(Document document, TextSpan? filterSpan) 86foreach (var document in project.Documents) 98public Task<IEnumerable<Diagnostic>> GetDocumentDiagnosticsAsync(Document document, TextSpan span)
EditAndContinue\EditAndContinueTestVerifier.cs (4)
153var oldDocument = oldDocuments[documentIndex]; 154var newDocument = newDocuments[documentIndex]; 458foreach (var oldDocument in oldProject.Documents) 527foreach (var document in project.Documents)
EditAndContinue\EditAndContinueWorkspaceTestBase.cs (2)
84internal static (Solution, Document) AddDefaultTestProject( 131Document? document = null;
EditAndContinue\Extensions.cs (3)
67public static Document AddTestDocument(this Project project, string source, string path) 70public static Document AddTestDocument(this Project project, string source, string path, out DocumentId id) 73public static Document AddTestDocument(this Solution solution, ProjectId projectId, string source, string path, out DocumentId id)
EditAndContinue\MockEditAndContinueService.cs (4)
27public Action<Document>? OnSourceFileUpdatedImpl; 32public Func<Document, ActiveStatementSpanProvider, ImmutableArray<Diagnostic>>? GetDocumentDiagnosticsImpl; 58public ValueTask<ImmutableArray<Diagnostic>> GetDocumentDiagnosticsAsync(Document document, ActiveStatementSpanProvider activeStatementSpanProvider, CancellationToken cancellationToken) 61public void OnSourceFileUpdated(Document document)
Snippets\AbstractSnippetProviderTests.cs (2)
40var document = project.AddDocument("TestDocument", markupBeforeCommit, filePath: "/TestDocument"); 123var document = project.AddDocument("TestDocument", markup);
Microsoft.CodeAnalysis.Features.UnitTests (43)
EditAndContinue\ActiveStatementsMapTests.cs (3)
121var document = project.Documents.Single(); 176var document = project.Documents.Single(); 227var document = project.Documents.Single();
EditAndContinue\EditAndContinueWorkspaceServiceTests.cs (30)
179var document2 = solution.GetDocument(document1.Id); 208var document1 = solution.GetDocument(document.Id); 210var document2 = solution.GetDocument(document.Id); 235var document = project.AddDocument("test", "dummy1"); 245var document1 = solution.Projects.Single().Documents.Single(); 258var document2 = solution.GetDocument(document1.Id); 288var document1 = solution.Projects.Single().Documents.Single(); 321var document2 = solution.GetDocument(documentInfo.Id); 361var document1 = solution.GetDocument(documentInfo.Id); 444var designTimeOnlyDocument2 = solution.GetDocument(designTimeOnlyDocumentId); 512var document2 = solution.GetDocument(document1.Id); 569var document1 = AddEmptyTestProject(solution). 590var document2 = solution.GetDocument(document1.Id); 635var document2 = solution.GetDocument(document1.Id); 825var document1 = solution.Projects.Single().Documents.Single(); 875var document1 = solution.Projects.Single().Documents.Single(); 877var document2 = solution.GetDocument(document1.Id); 975var document1 = solution.Projects.Single().Documents.Single(); 977var document2 = solution.GetDocument(document1.Id); 1048var document2 = solution.GetDocument(document.Id); 1112var document1 = solution.Projects.Single().Documents.Single(); 1163var document2 = solution.GetDocument(document1.Id); 1259var document2 = solution.Projects.Single().Documents.Single(); 1302var document2 = solution.Projects.Single().Documents.Single(); 1458var document1 = solution.Projects.Single().Documents.Single(); 1460var document2 = solution.Projects.Single().Documents.Single(); 1498var document1 = solution.Projects.Single().Documents.Single(); 1500var document2 = solution.Projects.Single().Documents.Single(); 1558var documentC = projectC.Documents.Single(d => d.Name == "C.cs"); 1654var changedOrAddedDocuments = new PooledObjects.ArrayBuilder<Document>();
EditAndContinue\EditSessionActiveStatementsTests.cs (3)
178var document1 = project.Documents.Single(d => d.Name == "test1.cs"); 179var document2 = project.Documents.Single(d => d.Name == "test2.cs"); 654var document = project.Documents.Single();
EditAndContinue\EmitSolutionUpdateResultsTests.cs (1)
70var document = workspace.CurrentSolution.
FindUsages\DefinitionItemFactoryTests.cs (6)
928var document = project.Documents.Single(); 1333var document = project.Documents.Single(); 1393var document = project.Documents.Single(); 1444var document = project.Documents.Single(); 1508var document = project.Documents.Single(); 1579var document = project.Documents.Single();
Microsoft.CodeAnalysis.LanguageServer (8)
HostWorkspace\LanguageServerWorkspace.cs (2)
108var document = textDocument as Document;
Services\StarredCompletions\StarredCompletionProvider.cs (2)
30public override async Task<CompletionChange> GetChangeAsync(Document document, CompletionItem item, char? commitKey = null, CancellationToken cancellationToken = default) 37internal override async Task<CompletionDescription?> GetDescriptionAsync(Document document, CompletionItem item, CompletionOptions options, SymbolDescriptionOptions displayOptions, CancellationToken cancellationToken)
Testing\RunTestsHandler.cs (1)
121private async Task BuildAsync(Document document, BufferedProgress<RunTestsPartialResult> progress, CancellationToken cancellationToken)
Testing\TestDiscoverer.cs (3)
35Document document, 79async Task<ImmutableArray<SyntaxNode>> GetPotentialTestMethodsAsync(LSP.Range range, Document document, ITestMethodFinder testMethodFinder, CancellationToken cancellationToken) 89private async Task<ImmutableArray<TestCase>> MatchDiscoveredTestsToTestsInRangeAsync(ImmutableArray<TestCase> discoveredTests, ImmutableArray<SyntaxNode> testMethods, ITestMethodFinder testMethodFinder, Document document, CancellationToken cancellationToken)
Microsoft.CodeAnalysis.LanguageServer.Protocol (207)
Extensions\Extensions.cs (5)
36/// Used to generate the correct Uri when rename a document, because calling <seealso cref="Document.WithName(string)"/> doesn't update the file path. 93public static async ValueTask<Document?> GetDocumentAsync(this Solution solution, TextDocumentIdentifier documentIdentifier, CancellationToken cancellationToken) 96Contract.ThrowIfTrue(textDocument is not null && textDocument is not Document, $"{textDocument!.Id} is not a Document"); 97return textDocument as Document; 220public static string GetMarkdownLanguageName(this Document document)
Extensions\ProtocolConversions.cs (8)
123Document document, 173static async Task<char> GetInsertionCharacterAsync(Document document, int position, CancellationToken cancellationToken) 277public static LSP.TextDocumentPositionParams PositionToTextDocumentPositionParams(int position, SourceText text, Document document) 289public static LSP.VersionedTextDocumentIdentifier DocumentToVersionedTextDocumentIdentifier(Document document) 392if (newDocument is Document newDoc && oldDocument is Document oldDoc) 836Document document, 994if (textDocument is not Document document)
ExternalAccess\Razor\FormatNewFileHandler.cs (2)
65internal static async Task<string> GetFormattedNewFileContentAsync(Document document, CancellationToken cancellationToken) 72var hintDocument = project.Documents.FirstOrDefault();
ExternalAccess\Razor\FormatNewFileParams.cs (1)
13public required TextDocumentIdentifier Document { get; init; }
ExternalAccess\Razor\SimplifyMethodHandler.cs (3)
41var originalDocument = context.Document; 51internal static async Task<TextEdit[]> GetSimplifiedEditsAsync(Document originalDocument, TextEdit textEdit, CancellationToken cancellationToken) 64var annotatedDocument = originalDocument.WithSyntaxRoot(annotatedSyntaxRoot);
Features\CodeCleanup\AbstractCodeCleanupService.cs (16)
38public async Task<Document> CleanupAsync( 39Document document, 110private static async Task<Document> RemoveSortUsingsAsync( 111Document document, OrganizeUsingsSet organizeUsingsSet, CancellationToken cancellationToken) 136private async Task<Document> ApplyCodeFixesAsync( 137Document document, ImmutableArray<DiagnosticSet> enabledDiagnosticSets, 156private async Task<Document> ApplyCodeFixesForSpecificDiagnosticIdsAsync( 157Document document, ImmutableArray<string> diagnosticIds, bool isAnyDiagnosticIdExplicitlyEnabled, IProgress<CodeAnalysisProgress> progressTracker, CancellationToken cancellationToken) 175private async Task<Document> ApplyCodeFixesForSpecificDiagnosticIdAsync( 176Document document, string diagnosticId, DiagnosticSeverity minimumSeverity, IProgress<CodeAnalysisProgress> progressTracker, CancellationToken cancellationToken) 197private async Task<ImmutableArray<(string diagnosticId, string? title)>> GetThirdPartyDiagnosticIdsAndTitlesAsync(Document document, CancellationToken cancellationToken) 219private async Task<Document> ApplyThirdPartyCodeFixesAsync( 220Document document, 231var updatedDocument = await _codeFixService.ApplyCodeFixesForSpecificDiagnosticIdAsync( 248static bool ChangesMadeOutsideDocument(Document currentDocument, Document updatedDocument)
Features\CodeCleanup\ICodeCleanupService.cs (2)
15Task<Document> CleanupAsync(Document document, EnabledDiagnosticOptions enabledDiagnostics, IProgress<CodeAnalysisProgress> progressTracker, CancellationToken cancellationToken);
Features\CodeFixes\CodeFixService.cs (1)
769if (fixAllProviderInfo != null && textDocument is Document document)
Features\CodeFixes\CodeFixService.FixAllDiagnosticProvider.cs (2)
44public override async Task<IEnumerable<Diagnostic>> GetDocumentDiagnosticsAsync(Document document, CancellationToken cancellationToken) 52public override async Task<IEnumerable<Diagnostic>> GetDocumentSpanDiagnosticsAsync(Document document, TextSpan fixAllSpan, CancellationToken cancellationToken)
Features\CodeFixes\CodeFixService.FixAllPredefinedDiagnosticProvider.cs (1)
27public override Task<IEnumerable<Diagnostic>> GetDocumentDiagnosticsAsync(Document document, CancellationToken cancellationToken)
Features\DecompiledSource\CSharpCodeDecompilerDecompilationService.cs (2)
37public Document? PerformDecompilation(Document document, string fullName, Compilation compilation, MetadataReference? metadataReference, string? assemblyLocation)
Features\Diagnostics\DocumentAnalysisExecutor.cs (6)
82var document = textDocument as Document; 217RoslynDebug.Assert(AnalysisScope.TextDocument is Document); 244if (AnalysisScope.TextDocument is not Document) 277var document = (Document)AnalysisScope.TextDocument;
Features\Diagnostics\DocumentAnalysisExecutor_Helpers.cs (3)
243Document document, 363var document = TryGetDocumentWithFilePath(filePath); 388Document? TryGetDocumentWithFilePath(string path)
Features\Diagnostics\EngineV2\DiagnosticIncrementalAnalyzer.Executor.cs (5)
256foreach (var document in project.Documents) 296private async Task<(ImmutableDictionary<DiagnosticAnalyzer, DiagnosticAnalysisResult> results, ImmutableHashSet<Document>? failedDocuments)> UpdateWithDocumentLoadAndGeneratorFailuresAsync( 302ImmutableHashSet<Document>.Builder? failedDocuments = null; 305foreach (var document in project.Documents) 313failedDocuments ??= ImmutableHashSet.CreateBuilder<Document>();
Features\Diagnostics\EngineV2\DiagnosticIncrementalAnalyzer.IncrementalMemberEditAnalyzer.cs (7)
41private readonly WeakReference<Document?> _lastDocumentWithCachedDiagnostics = new(null); 43public void UpdateDocumentWithCachedDiagnostics(Document document) 62var document = (Document)analysisScope.TextDocument; 201private async Task<(SyntaxNode changedMember, int changedMemberId, ImmutableArray<TextSpan> memberSpans, Document lastDocument)?> TryGetChangedMemberAsync( 202Document document, 206if (!_lastDocumentWithCachedDiagnostics.TryGetTarget(out var lastDocument)
Features\Diagnostics\EngineV2\DiagnosticIncrementalAnalyzer.IncrementalMemberEditAnalyzer_MemberSpans.cs (2)
28private async Task<ImmutableArray<TextSpan>> GetOrCreateMemberSpansAsync(Document document, VersionStamp version, CancellationToken cancellationToken) 45static async Task<ImmutableArray<TextSpan>> CreateMemberSpansAsync(Document document, VersionStamp version, CancellationToken cancellationToken)
Features\Diagnostics\EngineV2\DiagnosticIncrementalAnalyzer.ProjectState.cs (2)
92var document = project.GetDocument(documentId); 313foreach (var document in project.Documents)
Features\Diagnostics\EngineV2\DiagnosticIncrementalAnalyzer_GetDiagnosticsForSpan.cs (3)
107&& document is Document { SupportsSyntaxTree: true }; 222includeSemantic = includeSemantic && analyzer.SupportAnalysisKind(AnalysisKind.Semantic) && _document is Document; 413_owner._incrementalMemberEditAnalyzer.UpdateDocumentWithCachedDiagnostics((Document)_document);
Features\EditAndContinue\EditAndContinueDiagnosticSource_OpenDocument.cs (5)
19private sealed class OpenDocumentSource(Document document) : AbstractDocumentDiagnosticSource<Document>(document) 26var designTimeDocument = Document; 67private static DiagnosticData RemapLocation(Document designTimeDocument, DiagnosticData data) 81public static IDiagnosticSource CreateOpenDocumentSource(Document document)
Features\Options\IndentationOptionsStorage.cs (1)
14public static async Task<IndentationOptions> GetIndentationOptionsAsync(this Document document, IGlobalOptionService globalOptions, CancellationToken cancellationToken)
Features\UnifiedSuggestions\UnifiedSuggestedActionsSource.cs (4)
228var textDocument = fixAllState.Document!; 234if (textDocument is not Document document) 564refactoring.CodeActions.Length, document as Document, selection, refactoring.Provider, 580Document? document,
Handler\Breakpoints\ValidateBreakableRangeHandler.cs (1)
33var document = context.GetRequiredDocument();
Handler\CodeActions\CodeActionFixAllResolveHandler.cs (1)
42var document = context.GetRequiredDocument();
Handler\CodeActions\CodeActionResolveHelper.cs (2)
278if (newTextDoc is Document newDoc && oldTextDoc is Document oldDoc)
Handler\CodeLens\CodeLensHandler.cs (3)
47var document = context.GetRequiredDocument(); 85Document document, 111Document document,
Handler\CodeLens\CodeLensResolveHandler.cs (1)
39var document = context.GetRequiredDocument();
Handler\Completion\CompletionHandler.cs (4)
53var document = context.Document; 72Document document, 115Document document, 168Document document,
Handler\Completion\CompletionResolveHandler.cs (3)
58var document = context.GetRequiredDocument(); 67Document document, 86Document document,
Handler\Completion\CompletionResultFactory.cs (10)
37Document document, 310Document document, 360Document document, 499Document document, 522Document document, 546private static async Task<CompletionChange> GetCompletionChangeOrDisplayNameInCaseOfExceptionAsync(CompletionService completionService, Document document, CompletionItem completionItem, CancellationToken cancellationToken) 563Document document, 579Document document, 628Document document, 666Document document,
Handler\DataTips\DataTipRangeHandler.cs (1)
31var document = context.GetRequiredDocument();
Handler\Definitions\AbstractGoToDefinitionHandler.cs (2)
41var document = context.Document; 50internal static async Task<LSP.Location[]?> GetDefinitionsAsync(IGlobalOptionService globalOptions, IMetadataAsSourceFileService? metadataAsSourceFileService, Workspace workspace, Document document, bool forSymbolType, LinePosition linePosition, CancellationToken cancellationToken)
Handler\Diagnostics\DiagnosticSources\AbstractDocumentDiagnosticSource.cs (8)
23public ProjectOrDocumentId GetId() => new(Document.Id); 24public Project GetProject() => Document.Project; 27=> !string.IsNullOrEmpty(Document.FilePath) 28? new VSTextDocumentIdentifier { ProjectContext = ProtocolConversions.ProjectToProjectContext(Document.Project), Uri = Document.GetURI() } 31public string ToDisplayString() => $"{this.GetType().Name}: {Document.FilePath ?? Document.Name} in {Document.Project.Name}";
Handler\Diagnostics\DiagnosticSources\AbstractWorkspaceDocumentDiagnosticSource.cs (6)
53return projectDiagnostics.WhereAsArray(d => d.DocumentId == Document.Id); 60if (!s_projectToDiagnostics.TryGetValue(Document.Project, out var lazyDiagnostics)) 67return result[Document.Id].ToImmutableArray(); 72Document.Project, 77Document.Project.Solution, Document.Project.Id, documentId: null,
Handler\Diagnostics\DiagnosticSources\DocumentDiagnosticSource.cs (1)
38var copilotDiagnostics = await Document.GetCachedCopilotDiagnosticsAsync(span: null, cancellationToken).ConfigureAwait(false);
Handler\Diagnostics\DiagnosticSources\IDiagnosticSource.cs (1)
14/// Wrapper around a source for diagnostics (e.g. a <see cref="Project"/> or <see cref="Document"/>)
Handler\Diagnostics\DiagnosticSources\NonLocalDocumentDiagnosticSource.cs (3)
28Document.Project.Solution, Document.Project.Id, Document.Id,
Handler\Diagnostics\DiagnosticSources\TaskListDiagnosticSource.cs (2)
19internal sealed class TaskListDiagnosticSource(Document document, IGlobalOptionService globalOptions) : AbstractDocumentDiagnosticSource<Document>(document)
Handler\EditAndContinue\DocumentEditAndContinueDiagnosticSourceProvider.cs (1)
28if (context.GetTrackedDocument<Document>() is { } document)
Handler\FoldingRanges\FoldingRangesHandler.cs (3)
41var document = context.Document; 50Document document, 69Document document,
Handler\Formatting\AbstractFormatDocumentHandlerBase.cs (1)
29var document = context.Document;
Handler\Formatting\FormatDocumentOnTypeHandler.cs (1)
43var document = context.Document;
Handler\Highlights\DocumentHighlightHandler.cs (4)
45var document = context.Document; 53internal static async Task<DocumentHighlight[]?> GetHighlightsAsync(IGlobalOptionService globalOptions, IHighlightingService highlightingService, Document document, LinePosition linePosition, CancellationToken cancellationToken) 76private static async Task<ImmutableArray<DocumentHighlight>> GetKeywordHighlightsAsync(IHighlightingService highlightingService, Document document, SourceText text, int position, CancellationToken cancellationToken) 90private static async Task<ImmutableArray<DocumentHighlight>> GetReferenceHighlightsAsync(IGlobalOptionService globalOptions, Document document, SourceText text, int position, CancellationToken cancellationToken)
Handler\Hover\HoverHandler.cs (5)
44var document = context.GetRequiredDocument(); 56Document document, 69Document document, 87Document document, 107Document document, QuickInfoItem info, SymbolDescriptionOptions options, CancellationToken cancellationToken)
Handler\InlayHint\InlayHintHandler.cs (3)
43var document = context.GetRequiredDocument(); 50internal static async Task<LSP.InlayHint[]?> GetInlayHintsAsync(Document document, TextDocumentIdentifier textDocumentIdentifier, LSP.Range range, InlineHintsOptions options, bool displayAllOverride, InlayHintCache inlayHintCache, CancellationToken cancellationToken) 97internal static async Task<ImmutableArray<InlineHint>> CalculateInlayHintsAsync(Document document, LSP.Range range, InlineHintsOptions options, bool displayAllOverride, CancellationToken cancellationToken)
Handler\InlayHint\InlayHintResolveHandler.cs (2)
35var document = context.GetRequiredDocument(); 43Document document,
Handler\InlineCompletions\InlineCompletionsHandler.cs (5)
106var document = context.GetRequiredDocument(); 118internal static async Task<VSInternalInlineCompletionItem?> GetInlineCompletionItemsAsync(ILspLogger logger, Document document, LinePosition linePosition, LSP.FormattingOptions options, XmlSnippetParser xmlSnippetParser, CancellationToken cancellationToken) 175Document originalDocument, 253Document originalDocument, 260var documentWithDefaultSnippet = originalDocument.WithText(
Handler\InlineCompletions\XmlSnippetParser.ParsedXmlSnippet.cs (1)
44public async Task<SnippetFunctionPart> WithSnippetFunctionResultAsync(Document documentWithSnippet, TextSpan fieldSpan, SimplifierOptions simplifierOptions, CancellationToken cancellationToken)
Handler\MapCode\MapCodeHandler.cs (4)
85var document = await context.Solution.GetDocumentAsync(textDocument, cancellationToken).ConfigureAwait(false); 115async Task<ImmutableArray<(Document, TextSpan)>> ConvertFocusLocationsToDocumentAndSpansAsync( 116Document document, TextDocumentIdentifier textDocumentIdentifier, LSP.Location[][]? focusLocations, CancellationToken cancellationToken) 122using var _ = ArrayBuilder<(Document, TextSpan)>.GetInstance(out var builder);
Handler\OnAutoInsert\OnAutoInsertHandler.cs (6)
49var document = context.Document; 66Document document, 114Document document, 145Document document, 224static async Task<TextChange> GetCollapsedChangeAsync(ImmutableArray<TextChange> textChanges, Document oldDocument, CancellationToken cancellationToken) 241private static async Task<(IBraceCompletionService Service, BraceCompletionContext Context)?> GetBraceCompletionContextAsync(ImmutableArray<IBraceCompletionService> servicesForDocument, int caretLocation, Document document, CancellationToken cancellationToken)
Handler\References\FindAllReferencesHandler.cs (2)
54var document = context.Document; 72Document document,
Handler\References\FindImplementationsHandler.cs (2)
39var document = context.GetRequiredDocument(); 47internal static async Task<LSP.Location[]> FindImplementationsAsync(Document document, LinePosition linePosition, OptionsProvider<ClassificationOptions> classificationOptions, bool supportsVisualStudioExtensions, CancellationToken cancellationToken)
Handler\References\FindUsagesLSPContext.cs (4)
35private readonly Document _document; 78Document document, 148var document = documentSpan.Document; 299var document = documentSpan.Value.Document;
Handler\Rename\PrepareRenameHandler.cs (1)
31internal static async Task<LSP.Range?> GetRenameRangeAsync(Document document, LinePosition linePosition, CancellationToken cancellationToken)
Handler\Rename\RenameHandler.cs (1)
34internal static async Task<WorkspaceEdit?> GetRenameEditAsync(Document document, LinePosition linePosition, string newName, CancellationToken cancellationToken)
Handler\RequestContext.cs (3)
103public Document? Document 112if (this.TextDocument is Document document) 214public Document GetRequiredDocument()
Handler\SemanticTokens\SemanticTokensHelpers.cs (4)
39var contextDocument = context.GetRequiredDocument(); 58public static async Task<int[]> HandleRequestHelperAsync(Document document, ImmutableArray<LinePositionSpan> spans, bool supportsVisualStudioExtensions, ClassificationOptions options, CancellationToken cancellationToken) 82Document document, 127Document document,
Handler\SemanticTokens\SemanticTokensRefreshQueue.cs (1)
89var oldDocument = e.OldSolution.GetDocument(e.DocumentId);
Handler\SignatureHelp\SignatureHelpHandler.cs (2)
35var document = context.Document; 44internal static async Task<LSP.SignatureHelp?> GetSignatureHelpAsync(SignatureHelpService signatureHelpService, Document document, LinePosition linePosition, bool supportsVisualStudioExtensions, CancellationToken cancellationToken)
Handler\SourceGenerators\SourceGeneratedDocumentCache.cs (1)
15internal record struct SourceGeneratedDocumentGetTextState(Document Document);
Handler\SourceGenerators\SourceGeneratedDocumentGetTextHandler.cs (1)
33var document = context.Document;
Handler\SpellCheck\AbstractSpellCheckingHandler.cs (6)
56protected abstract ImmutableArray<Document> GetOrderedDocuments(RequestContext context, CancellationToken cancellationToken); 91foreach (var document in orderedDocuments) 137private static async Task<Dictionary<Document, PreviousPullResult>> GetDocumentToPreviousParamsAsync( 142var result = new Dictionary<Document, PreviousPullResult>(); 147var document = await context.Solution.GetDocumentAsync(requestParams.TextDocument, cancellationToken).ConfigureAwait(false); 157Document document,
Handler\SpellCheck\DocumentSpellCheckHandler.cs (2)
35protected override ImmutableArray<Document> GetOrderedDocuments(RequestContext context, CancellationToken cancellationToken) 38internal static ImmutableArray<Document> GetRequestedDocument(RequestContext context)
Handler\SpellCheck\SpellCheckPullCache.cs (1)
13internal record struct SpellCheckState(ISpellCheckSpanService Service, Document Document);
Handler\SpellCheck\WorkspaceSpellCheckHandler.cs (3)
31protected override ImmutableArray<Document> GetOrderedDocuments(RequestContext context, CancellationToken cancellationToken) 35using var _ = ArrayBuilder<Document>.GetInstance(out var result); 74foreach (var document in documents)
Handler\Symbols\DocumentSymbolsHandler.cs (3)
44var document = context.GetRequiredDocument(); 53Document document, bool useHierarchicalSymbols, bool supportsVSExtensions, CancellationToken cancellationToken) 89RoslynNavigationBarItem item, Document document, SourceText text, string? containerName, bool supportsVSExtensions)
Handler\Tasks\DocumentTaskDiagnosticSourceProvider.cs (1)
28if (context.GetTrackedDocument<Document>() is { } document)
Handler\Tasks\WorkspaceTaskDiagnosticSourceProvider.cs (1)
39foreach (var document in project.Documents)
Workspaces\ILspWorkspace.cs (1)
27/// cref="Workspace.OnDocumentTextChanged(Document)"/>). However, they will be overwritten by the <see
Workspaces\LspMiscellaneousFilesWorkspace.cs (1)
39public Document? AddMiscellaneousDocument(Uri uri, SourceText documentText, string languageId, ILspLogger logger)
Microsoft.CodeAnalysis.LanguageServer.Protocol.UnitTests (31)
Completion\CompletionFeaturesTests.cs (3)
594Document document, int caretPosition, CodeAnalysis.Completion.CompletionOptions options, OptionSet passThroughOptions, 887Document document, int caretPosition, CodeAnalysis.Completion.CompletionOptions options, OptionSet passThroughOptions, 896public override Task<CompletionChange> GetChangeAsync(Document document, CodeAnalysis.Completion.CompletionItem item, char? commitCharacter = null, CancellationToken cancellationToken = default)
Completion\CompletionResolveTests.cs (3)
489internal override Task<CodeAnalysis.Completion.CompletionList> GetCompletionsAsync(Document document, 498Document document, 517internal override Task<CompletionDescription> GetDescriptionAsync(Document document, CodeAnalysis.Completion.CompletionItem item, CodeAnalysis.Completion.CompletionOptions options, SymbolDescriptionOptions displayOptions, CancellationToken cancellationToken = default)
Diagnostics\AbstractPullDiagnosticTestsBase.cs (5)
181private protected static Task CloseDocumentAsync(TestLspServer testLspServer, Document document) => testLspServer.CloseDocumentAsync(document.GetURI()); 219Document document, 229private protected static Task OpenDocumentAsync(TestLspServer testLspServer, Document document) => testLspServer.OpenDocumentAsync(document.GetURI()); 379public override Task<ImmutableArray<Diagnostic>> AnalyzeSemanticsAsync(Document document, CancellationToken cancellationToken) 382public override Task<ImmutableArray<Diagnostic>> AnalyzeSyntaxAsync(Document document, CancellationToken cancellationToken)
Diagnostics\DiagnosticsPullCacheTests.cs (2)
116private class TestDiagnosticSource(Document document, TestDiagnosticSourceProvider provider) : AbstractDocumentDiagnosticSource<Document>(document)
Diagnostics\PullDiagnosticTests.cs (2)
509static VSTextDocumentIdentifier GetVsTextDocumentIdentifier(Document document) 1278static DiagnosticData CreateDiagnostic(string id, Document? document = null, Project? project = null)
DocumentChanges\DocumentChangesTests.WithFindAllReferences.cs (1)
43var originalDocument = testLspServer.GetCurrentSolution().Projects.Single().Documents.Single();
FoldingRanges\FoldingRangesTests.cs (1)
88var document = testLspServer.GetCurrentSolution().Projects.First().Documents.First();
InlayHint\AbstractInlayHintTests.cs (1)
25var document = testLspServer.GetCurrentSolution().Projects.Single().Documents.Single();
MapCode\MapCodeTests.cs (2)
35Document document, ImmutableArray<string> contents, ImmutableArray<(Document, TextSpan)> focusLocations, CancellationToken cancellationToken)
Miscellaneous\LspMiscellaneousFilesWorkspaceTests.cs (3)
240var miscDoc = GetMiscellaneousDocument(testLspServer); 284var miscDoc = GetMiscellaneousDocument(testLspServer); 307private static Document? GetMiscellaneousDocument(TestLspServer testLspServer)
SemanticTokens\AbstractSemanticTokensTests.cs (1)
64var document = testLspServer.GetCurrentSolution().Projects.First().Documents.First();
SpellCheck\SpellCheckTests.cs (3)
594private static Task OpenDocumentAsync(TestLspServer testLspServer, Document document) 597private static Task CloseDocumentAsync(TestLspServer testLspServer, Document document) 646Document document,
Symbols\DocumentSymbolsTests.cs (1)
152var document = testLspServer.GetCurrentSolution().Projects.First().Documents.First();
Workspaces\LspWorkspaceManagerTests.cs (3)
753private static async Task<Document> OpenDocumentAndVerifyLspTextAsync(Uri documentUri, TestLspServer testLspServer, string openText = "LSP text") 769private static async Task<(Workspace? workspace, Document? document)> GetLspWorkspaceAndDocumentAsync(Uri uri, TestLspServer testLspServer) 772return (workspace, document as Document);
Microsoft.CodeAnalysis.Remote.ServiceHub (13)
Host\RemoteDocumentDifferenceService.cs (2)
46public Task<SyntaxNode?> GetChangedMemberAsync(Document oldDocument, Document newDocument, CancellationToken cancellationToken)
Host\RemoteWorkspace.SolutionCreator.cs (2)
587Contract.ThrowIfFalse(document is Document); 594Contract.ThrowIfFalse(document is Document);
Services\AssetSynchronization\RemoteAssetSynchronizationService.cs (1)
100var document = workspace.CurrentSolution.GetDocument(documentId);
Services\DiagnosticAnalyzer\RemoteDiagnosticAnalyzerService.cs (1)
97var document = solution.GetDocument(diagnostic.Location.SourceTree);
Services\SemanticClassification\RemoteSemanticClassificationService.Caching.cs (5)
55private readonly AsyncBatchingWorkQueue<(Document, ClassificationType type, ClassificationOptions)> _workQueue; 61_workQueue = new AsyncBatchingWorkQueue<(Document, ClassificationType, ClassificationOptions)>( 64EqualityComparer<(Document, ClassificationType, ClassificationOptions)>.Default, 104ImmutableSegmentedList<(Document document, ClassificationType type, ClassificationOptions options)> documents, 123Document document, ClassificationType type, ClassificationOptions options, CancellationToken cancellationToken)
Services\SemanticClassification\RemoteSemanticClassificationService.cs (1)
34var document = solution.GetDocument(documentId) ?? await solution.GetSourceGeneratedDocumentAsync(documentId, cancellationToken).ConfigureAwait(false);
Services\SymbolFinder\RemoteSymbolFinderService.cs (1)
190public ValueTask OnReferenceFoundAsync(Document document, TextSpan span, CancellationToken cancellationToken)
Microsoft.CodeAnalysis.VisualBasic.CodeStyle.Fixes (27)
src\Analyzers\VisualBasic\CodeFixes\AddExplicitCast\VisualBasicAddExplicitCastCodeFixProvider.vb (3)
57document As Document, 109document As Document, 167document As Document,
src\Analyzers\VisualBasic\CodeFixes\GenerateConstructor\GenerateConstructorCodeFixProvider.vb (1)
34Protected Overrides Function GetCodeActionsAsync(document As Document, node As SyntaxNode, cancellationToken As CancellationToken) As Task(Of ImmutableArray(Of CodeAction))
src\Analyzers\VisualBasic\CodeFixes\GenerateEnumMember\GenerateEnumMemberCodeFixProvider.vb (1)
35Protected Overrides Function GetCodeActionsAsync(document As Document, node As SyntaxNode, cancellationToken As CancellationToken) As Task(Of ImmutableArray(Of CodeAction))
src\Analyzers\VisualBasic\CodeFixes\GenerateParameterizedMember\GenerateConversionCodeFixProvider.vb (1)
35Protected Overrides Function GetCodeActionsAsync(document As Document, node As SyntaxNode, cancellationToken As CancellationToken) As Task(Of ImmutableArray(Of CodeAction))
src\Analyzers\VisualBasic\CodeFixes\GenerateParameterizedMember\GenerateParameterizedMemberCodeFixProvider.vb (1)
54Protected Overrides Function GetCodeActionsAsync(document As Document, node As SyntaxNode, cancellationToken As CancellationToken) As Task(Of ImmutableArray(Of CodeAction))
src\Analyzers\VisualBasic\CodeFixes\GenerateParameterizedMember\VisualBasicGenerateParameterizedMemberService.vb (2)
57Dim typeInference = Document.Document.GetRequiredLanguageService(Of ITypeInferenceService)() 59Document.SemanticModel, Me.InvocationExpression, objectAsDefault:=True,
src\Analyzers\VisualBasic\CodeFixes\GenerateVariable\VisualBasicGenerateVariableCodeFixProvider.vb (1)
38Protected Overrides Async Function GetCodeActionsAsync(document As Document, node As SyntaxNode, cancellationToken As CancellationToken) As Task(Of ImmutableArray(Of CodeAction))
src\Analyzers\VisualBasic\CodeFixes\ImplementInterface\VisualBasicImplementInterfaceService.vb (1)
43document As Document, model As SemanticModel, node As SyntaxNode, cancellationToken As CancellationToken,
src\Analyzers\VisualBasic\CodeFixes\Iterator\VisualBasicChangeToYieldCodeFixProvider.vb (1)
36Protected Overrides Function GetCodeFixAsync(root As SyntaxNode, node As SyntaxNode, document As Document, diagnostics As Diagnostic, cancellationToken As CancellationToken) As Task(Of CodeAction)
src\Analyzers\VisualBasic\CodeFixes\Iterator\VisualBasicConvertToIteratorCodeFixProvider.vb (1)
38Protected Overrides Async Function GetCodeFixAsync(root As SyntaxNode, node As SyntaxNode, document As Document, diagnostics As Diagnostic, cancellationToken As CancellationToken) As Task(Of CodeAction)
src\Analyzers\VisualBasic\CodeFixes\RemoveUnnecessaryByVal\VisualBasicRemoveUnnecessaryByValCodeFixProvider.vb (1)
37Protected Overrides Async Function FixAllAsync(document As Document, diagnostics As ImmutableArray(Of Diagnostic), editor As SyntaxEditor, cancellationToken As CancellationToken) As Task
src\Analyzers\VisualBasic\CodeFixes\RemoveUnnecessaryCast\VisualBasicRemoveUnnecessaryCastCodeFixProvider.vb (3)
53document As Document, 94document As Document, originalCastNodes As ImmutableArray(Of ExpressionSyntax), 116document As Document, originalNodes As ImmutableArray(Of ExpressionSyntax),
src\Analyzers\VisualBasic\CodeFixes\SimplifyObjectCreation\VisualBasicSimplifyObjectCreationCodeFixProvider.vb (1)
35Protected Overrides Async Function FixAllAsync(document As Document, diagnostics As ImmutableArray(Of Diagnostic), editor As SyntaxEditor, cancellationToken As CancellationToken) As Task
src\Analyzers\VisualBasic\CodeFixes\UseCollectionInitializer\VisualBasicUseCollectionInitializerCodeFixProvider.vb (1)
42document As Document,
src\Analyzers\VisualBasic\CodeFixes\UseIsNotExpression\VisualBasicUseIsNotExpressionCodeFixProvider.vb (1)
34document As Document,
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\Extensions\ContextQuery\VisualBasicSyntaxContext.vb (2)
52document As Document, 158Public Shared Function CreateContext(document As Document, semanticModel As SemanticModel, position As Integer, cancellationToken As CancellationToken) As VisualBasicSyntaxContext
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\Extensions\ContextQuery\VisualBasicSyntaxContextService.vb (1)
20Public Function CreateContext(document As Document, semanticModel As SemanticModel, position As Integer, cancellationToken As CancellationToken) As SyntaxContext Implements ISyntaxContextService.CreateContext
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\LanguageServices\InitializeParameter\VisualBasicInitializeParameterService.vb (1)
53Protected Overrides Function TryAddAssignmentForPrimaryConstructorAsync(document As Document, parameter As IParameterSymbol, fieldOrProperty As ISymbol, cancellationToken As CancellationToken) As Task(Of Solution)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\LanguageServices\VisualBasicMoveDeclarationNearReferenceService.vb (1)
45Protected Overrides Function TypesAreCompatibleAsync(document As Document, localSymbol As ILocalSymbol, declarationStatement As LocalDeclarationStatementSyntax, right As SyntaxNode, cancellationToken As CancellationToken) As Task(Of Boolean)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\LanguageServices\VisualBasicRemoveUnnecessaryImportsService.vb (2)
27document As Document, 29cancellationToken As CancellationToken) As Task(Of Document)
Microsoft.CodeAnalysis.VisualBasic.EditorFeatures (29)
AutomaticEndConstructCorrection\AutomaticEndConstructCorrector.vb (1)
22Private _previousDocument As Document
EndConstructGeneration\EndConstructCommandHandler.vb (1)
142document As Document,
ImplementAbstractClass\ImplementAbstractClassCommandHandler.vb (2)
37document As Document, 39cancellationToken As CancellationToken) As Task(Of Document)
ImplementInterface\ImplementInterfaceCommandHandler.vb (2)
38document As Document, 40cancellationToken As CancellationToken) As Task(Of Document)
LineCommit\CommitBufferManager.DirtyState.vb (3)
12Private ReadOnly _baseDocument As Document 14Public Sub New(span As SnapshotSpan, baseSnapshot As ITextSnapshot, baseDocument As Document) 44Public ReadOnly Property BaseDocument As Document
LineCommit\CommitBufferManager.vb (2)
33Private _documentBeforePreviousEdit As Document 306Private Shared Async Function ForceComputeInternalsVisibleToAsync(document As Document, cancellationToken As CancellationToken) As Task
LineCommit\CommitFormatter.vb (1)
93Dim finalDocument As Document
NavigationBar\VisualBasicEditorNavigationBarItemService.vb (2)
39document As Document, 64document As Document, item As WrappedNavigationBarItem, textView As ITextView, textVersion As ITextVersion, cancellationToken As CancellationToken) As Task(Of Boolean)
NavigationBar\VisualBasicEditorNavigationBarItemService_CodeGeneration.vb (13)
24Private Async Function GenerateCodeForItemAsync(document As Document, generateCodeItem As AbstractGenerateCodeItem, textView As ITextView, cancellationToken As CancellationToken) As Task 52Public Shared Async Function GetGeneratedDocumentAsync(document As Document, generateCodeItem As RoslynNavigationBarItem, cancellationToken As CancellationToken) As Task(Of Document) 86document As Document, 89cancellationToken As CancellationToken) As Task(Of Document) 110document As Document, 113cancellationToken As CancellationToken) As Task(Of Document) 154document As Document, 157cancellationToken As CancellationToken) As Task(Of Document) 209document As Document, 212cancellationToken As CancellationToken) As Task(Of Document) 253document As Document, 256cancellationToken As CancellationToken) As Task(Of Document)
Utilities\CommandHandlers\AbstractImplementAbstractClassOrInterfaceCommandHandler.vb (2)
47document As Document, 49cancellationToken As CancellationToken) As Task(Of Document)
Microsoft.CodeAnalysis.VisualBasic.Features (176)
AddDebuggerDisplay\VisualBasicAddDebuggerDisplayCodeRefactoringProvider.vb (1)
24Protected Overrides Function SupportsConstantInterpolatedStrings(document As Document) As Boolean
AddImport\VisualBasicAddImportFeatureService.vb (7)
190document As Document, 281document As Document, 283cancellationToken As CancellationToken) As Task(Of Document) 292document As Document, 295cancellationToken As CancellationToken) As Task(Of Document) 312document As Document, 314cancellationToken As CancellationToken) As Task(Of Document)
BraceMatching\InterpolatedStringBraceMatcher.vb (1)
23document As Document,
BraceMatching\StringLiteralBraceMatcher.vb (1)
21Public Async Function FindBraces(document As Document,
ChangeSignature\VisualBasicChangeSignatureService.vb (5)
97document As Document, 228Public Overrides Function FindNodeToUpdate(document As Document, node As SyntaxNode) As SyntaxNode 608document As Document, 685document As Document, 737Protected Overrides Function GetFormattingRules(document As Document) As ImmutableArray(Of AbstractFormattingRule)
CodeFixes\CorrectNextControlVariable\CorrectNextControlVariableCodeFixProvider.CodeAction.vb (3)
13Private ReadOnly _document As Document 17Public Sub New(document As Document, node As SyntaxNode, newNode As SyntaxNode) 29Protected Overrides Async Function GetChangedDocumentAsync(cancellationToken As CancellationToken) As Task(Of Document)
CodeFixes\GenerateEndConstruct\GenerateEndConstructCodeFixProvider.vb (6)
167Private Shared Async Function GeneratePropertyEndConstructAsync(document As Document, node As PropertyBlockSyntax, cancellationToken As CancellationToken) As Task(Of Document) 213Private Shared Async Function GenerateEndConstructAsync(document As Document, endStatement As SyntaxNode, cancellationToken As CancellationToken) As Task(Of Document) 231Private Shared Async Function InsertEndConstructAsync(document As Document, endStatement As SyntaxNode, cancellationToken As CancellationToken) As Task(Of Document)
CodeFixes\GenerateEvent\GenerateEventCodeFixProvider.CodeAction.vb (1)
35Protected Overrides Function GetChangedDocumentAsync(cancellationToken As CancellationToken) As Task(Of Document)
CodeFixes\GenerateEvent\GenerateEventCodeFixProvider.vb (4)
76Private Shared Async Function GenerateEventFromAddRemoveHandlerAsync(document As Document, handlerStatement As AddRemoveHandlerStatementSyntax, cancellationToken As CancellationToken) As Task(Of CodeAction) 120document As Document, 241Private Shared Async Function GenerateEventFromImplementsAsync(document As Document, node As QualifiedNameSyntax, cancellationToken As CancellationToken) As Task(Of CodeAction) 314Private Shared Async Function GenerateEventFromHandlesAsync(document As Document, handlesClauseItem As HandlesClauseItemSyntax, cancellationToken As CancellationToken) As Task(Of CodeAction)
CodeFixes\GenerateType\GenerateTypeCodeFixProvider.vb (1)
43Protected Overrides Function GetCodeActionsAsync(document As Document, node As SyntaxNode, cancellationToken As CancellationToken) As Task(Of ImmutableArray(Of CodeAction))
CodeFixes\IncorrectExitContinue\IncorrectExitContinueCodeFixProvider.AddKeywordCodeAction.vb (4)
17Private ReadOnly _document As Document 18Private ReadOnly _updateNode As Func(Of SyntaxNode, SyntaxNode, SyntaxKind, Document, CancellationToken, StatementSyntax) 25updateNode As Func(Of SyntaxNode, SyntaxNode, SyntaxKind, Document, CancellationToken, StatementSyntax)) 39Protected Overrides Async Function GetChangedDocumentAsync(cancellationToken As CancellationToken) As Task(Of Document)
CodeFixes\IncorrectExitContinue\IncorrectExitContinueCodeFixProvider.ReplaceKeywordCodeAction.vb (5)
17Private ReadOnly _document As Document 18Private ReadOnly _updateNode As Func(Of SyntaxNode, SyntaxNode, SyntaxKind, Document, CancellationToken, StatementSyntax) 22Public Sub New(createBlockKind As SyntaxKind, invalidToken As SyntaxToken, syntax As SyntaxNode, containingBlock As SyntaxNode, document As Document, 23updateNode As Func(Of SyntaxNode, SyntaxNode, SyntaxKind, Document, CancellationToken, StatementSyntax)) 38Protected Overrides Async Function GetChangedDocumentAsync(cancellationToken As CancellationToken) As Task(Of Document)
CodeFixes\IncorrectExitContinue\IncorrectExitContinueCodeFixProvider.ReplaceTokenKeywordCodeAction.vb (3)
16Private ReadOnly _document As Document 20document As Document) 32Protected Overrides Async Function GetChangedDocumentAsync(cancellationToken As CancellationToken) As Task(Of Document)
CodeFixes\IncorrectExitContinue\IncorrectExitContinueCodeFixProvider.vb (7)
192createBlockKind As SyntaxKind, document As Document, 211createBlockKind As SyntaxKind, document As Document, 306document As Document, 309updateNode As Func(Of SyntaxNode, SyntaxNode, SyntaxKind, Document, CancellationToken, StatementSyntax), 318document As Document, 319updateNode As Func(Of SyntaxNode, SyntaxNode, SyntaxKind, Document, CancellationToken, StatementSyntax), 325Private Shared Sub CreateReplaceTokenKeywordActions(blockKinds As IEnumerable(Of SyntaxKind), invalidToken As SyntaxToken, document As Document, codeActions As List(Of CodeAction))
CodeFixes\IncorrectFunctionReturnType\IncorrectFunctionReturnTypeCodeFixProvider.vb (1)
78Private Shared Async Function GetCodeActionsAsync(document As Document, node As SyntaxNode, rewrittenNode As SyntaxNode, cancellationToken As CancellationToken) As Task(Of IEnumerable(Of CodeAction))
CodeFixes\MoveToTopOfFile\MoveToTopOfFileCodeFixProvider.MoveToLineCodeAction.vb (3)
15Private ReadOnly _document As Document 19Public Sub New(document As Document, token As SyntaxToken, destinationLine As Integer, title As String) 32Protected Overrides Async Function GetChangedDocumentAsync(cancellationToken As CancellationToken) As Task(Of Document)
CodeFixes\MoveToTopOfFile\MoveToTopOfFileCodeFixProvider.vb (3)
100Private Shared Function CreateActionForImports(document As Document, node As ImportsStatementSyntax, root As CompilationUnitSyntax, cancellationToken As CancellationToken) As IEnumerable(Of CodeAction) 122Private Shared Function CreateActionForOptions(document As Document, node As OptionStatementSyntax, root As CompilationUnitSyntax, cancellationToken As CancellationToken) As IEnumerable(Of CodeAction) 138Private Shared Function CreateActionForAttribute(document As Document, node As AttributesStatementSyntax, root As CompilationUnitSyntax, cancellationToken As CancellationToken) As IEnumerable(Of CodeAction)
CodeFixes\OverloadBase\OverloadBaseCodeFixProvider.AddKeywordAction.vb (4)
19Private ReadOnly _document As Document 36Public Sub New(document As Document, node As SyntaxNode, title As String, modifier As SyntaxKind) 43Protected Overrides Async Function GetChangedDocumentAsync(cancellationToken As CancellationToken) As Task(Of Document) 53Private Async Function GetNewNodeAsync(document As Document, node As SyntaxNode, options As SyntaxFormattingOptions, cancellationToken As CancellationToken) As Task(Of SyntaxNode)
CodeLens\VisualBasicCodeLensMemberFinder.vb (1)
24Public Async Function GetCodeLensMembersAsync(document As Document, cancellationToken As CancellationToken) As Task(Of ImmutableArray(Of CodeLensMember)) Implements ICodeLensMemberFinder.GetCodeLensMembersAsync
CodeRefactorings\InlineTemporary\VisualBasicInlineTemporaryCodeRefactoringProvider.vb (7)
121Private Shared Async Function InlineTemporaryAsync(document As Document, modifiedIdentifier As ModifiedIdentifierSyntax, cancellationToken As CancellationToken) As Task(Of Document) 225Private Shared Async Function FindDefinitionAsync(document As Document, cancellationToken As CancellationToken) As Task(Of ModifiedIdentifierSyntax) 235Private Shared Async Function FindReferenceAnnotatedNodesAsync(document As Document, cancellationToken As CancellationToken) As Task(Of IEnumerable(Of IdentifierNameSyntax)) 367Private Shared Async Function CreateExpressionToInlineAsync(document As Document, cancellationToken As CancellationToken) As Task(Of ExpressionSyntax) 409inlinedDocument As Document, 414) As Task(Of Document)
CodeRefactorings\MoveType\VisualBasicMoveTypeService.vb (1)
27Protected Overrides Async Function GetRelevantNodeAsync(document As Document, textSpan As TextSpan, cancellationToken As CancellationToken) As Task(Of TypeBlockSyntax)
CodeRefactorings\NodeSelectionHelpers.vb (1)
15Dim document As Document = context.Document
CodeRefactorings\RemoveStatementCodeAction.vb (3)
13Private ReadOnly _document As Document 17Public Sub New(document As Document, node As SyntaxNode, title As String) 29Protected Overrides Async Function GetChangedDocumentAsync(cancellationToken As CancellationToken) As Task(Of Document)
CodeRefactorings\SyncNamespace\VisualBasicChangeNamespaceService.vb (2)
60Protected Overrides Function GetValidContainersFromAllLinkedDocumentsAsync(document As Document, container As SyntaxNode, cancellationToken As CancellationToken) As Task(Of ImmutableArray(Of (DocumentId, SyntaxNode))) 75Protected Overrides Function TryGetApplicableContainerFromSpanAsync(document As Document, span As TextSpan, cancellationToken As CancellationToken) As Task(Of SyntaxNode)
Completion\CompletionProviders\CrefCompletionProvider.vb (1)
100Protected Overrides Async Function GetSymbolsAsync(document As Document, position As Integer, options As CompletionOptions, cancellationToken As CancellationToken) As Task(Of (SyntaxToken, SemanticModel, ImmutableArray(Of ISymbol)))
Completion\CompletionProviders\ImportCompletionProvider\ExtensionMethodImportCompletionProvider.vb (1)
48Protected Overrides Function ShouldProvideParenthesisCompletionAsync(document As Document, item As CompletionItem, commitKey As Char?, cancellationToken As CancellationToken) As Task(Of Boolean)
Completion\CompletionProviders\ImportCompletionProvider\TypeImportCompletionProvider.vb (1)
43Protected Overrides Function ShouldProvideParenthesisCompletionAsync(document As Document, item As CompletionItem, commitKey As Char?, cancellationToken As CancellationToken) As Task(Of Boolean)
Completion\CompletionProviders\NamedParameterCompletionProvider.vb (1)
110Friend Overrides Function GetDescriptionWorkerAsync(document As Document, item As CompletionItem, options As CompletionOptions, displayOptions As SymbolDescriptionOptions, cancellationToken As CancellationToken) As Task(Of CompletionDescription)
Completion\CompletionProviders\ObjectInitializerCompletionProvider.vb (2)
54document As Document, 104Protected Overrides Function IsExclusiveAsync(document As Document, position As Integer, cancellationToken As CancellationToken) As Task(Of Boolean)
Completion\CompletionProviders\PartialTypeCompletionProvider.vb (1)
73Public Overrides Async Function GetTextChangeAsync(document As Document, selectedItem As CompletionItem, ch As Char?, cancellationToken As CancellationToken) As Task(Of TextChange?)
Completion\CompletionProviders\VisualBasicSuggestionModeCompletionProvider.vb (1)
33Protected Overrides Async Function GetSuggestionModeItemAsync(document As Document, position As Integer, itemSpan As TextSpan, trigger As CompletionTrigger, cancellationToken As CancellationToken) As Task(Of CompletionItem)
Completion\CompletionProviders\XmlDocCommentCompletionProvider.vb (1)
68Protected Overrides Async Function GetItemsWorkerAsync(document As Document, position As Integer, trigger As CompletionTrigger, cancellationToken As CancellationToken) As Task(Of IEnumerable(Of CompletionItem))
ConvertAutoPropertyToFullProperty\VisualBasicConvertAutoPropertyToFullProperty.vb (1)
31Protected Overrides Function GetFieldNameAsync(document As Document, propertySymbol As IPropertySymbol, cancellationToken As CancellationToken) As Task(Of String)
Debugging\DataTipInfoGetter.vb (1)
20document As Document,
Debugging\LocationInfoGetter.vb (1)
14Friend Async Function GetInfoAsync(document As Document, position As Integer, cancellationToken As CancellationToken) As Task(Of DebugLocationInfo)
Debugging\ProximityExpressionsGetter.vb (2)
25document As Document, 56document As Document,
Debugging\VisualBasicBreakpointService.vb (2)
26Friend Shared Async Function GetBreakpointAsync(document As Document, position As Integer, length As Integer, cancellationToken As CancellationToken) As Task(Of BreakpointResolutionResult) 76Public Function ResolveBreakpointAsync(document As Document, textSpan As TextSpan, Optional cancellationToken As CancellationToken = Nothing) As Task(Of BreakpointResolutionResult) Implements IBreakpointResolutionService.ResolveBreakpointAsync
Debugging\VisualBasicLanguageDebugInfoService.vb (2)
21Public Function GetLocationInfoAsync(document As Document, position As Integer, cancellationToken As CancellationToken) As Task(Of DebugLocationInfo) Implements ILanguageDebugInfoService.GetLocationInfoAsync 25Public Function GetDataTipInfoAsync(document As Document, position As Integer, includeKind As Boolean, cancellationToken As CancellationToken) As Task(Of DebugDataTipInfo) Implements ILanguageDebugInfoService.GetDataTipInfoAsync
EncapsulateField\VisualBasicEncapsulateFieldService.vb (2)
27document As Document, 70Protected Overrides Async Function GetFieldsAsync(document As Document, span As TextSpan, cancellationToken As CancellationToken) As Task(Of ImmutableArray(Of IFieldSymbol))
ExtractInterface\VisualBasicExtractInterfaceService.vb (1)
26document As Document, position As Integer,
ExtractMethod\VisualBasicMethodExtractor.vb (3)
65Protected Overrides Function GetCustomFormattingRule(document As Document) As AbstractFormattingRule 122document As Document, 125cancellationToken As CancellationToken) As Task(Of (document As Document, invocationNameToken As SyntaxToken?))
Formatting\VisualBasicOrganizeUsingsNewDocumentFormattingProvider.vb (3)
22Public Async Function FormatNewDocumentAsync(document As Document, hintDocument As Document, options As CodeCleanupOptions, cancellationToken As CancellationToken) As Task(Of Document) Implements INewDocumentFormattingProvider.FormatNewDocumentAsync
GenerateConstructors\VisualBasicGenerateConstructorsCodeRefactoringProvider.vb (1)
40Protected Overrides Function PrefersThrowExpressionAsync(document As Document, cancellationToken As CancellationToken) As ValueTask(Of Boolean)
GenerateType\VisualBasicGenerateTypeService.vb (2)
420Public Overrides Async Function GetOrGenerateEnclosingNamespaceSymbolAsync(namedTypeSymbol As INamedTypeSymbol, containers() As String, selectedDocument As Document, selectedDocumentRoot As SyntaxNode, cancellationToken As CancellationToken) As Task(Of (INamespaceSymbol, INamespaceOrTypeSymbol, Location)) 615document As Document,
IntroduceVariable\VisualBasicIntroduceLocalForExpressionCodeRefactoringProvider.vb (1)
51Protected Overrides Function CreateTupleDeconstructionAsync(document As Document, tupleType As INamedTypeSymbol, expression As ExpressionSyntax, cancellationToken As CancellationToken) As Task(Of ExpressionStatementSyntax)
IntroduceVariable\VisualBasicIntroduceVariableService_IntroduceField.vb (2)
20cancellationToken As CancellationToken) As Task(Of Document) 64cancellationToken As CancellationToken) As Task(Of Document)
IntroduceVariable\VisualBasicIntroduceVariableService_IntroduceLocal.vb (4)
19cancellationToken As CancellationToken) As Document 81cancellationToken As CancellationToken) As Document 123cancellationToken As CancellationToken) As Document 160cancellationToken As CancellationToken) As Document
IntroduceVariable\VisualBasicIntroduceVariableService_IntroduceQueryLocal.vb (2)
17cancellationToken As CancellationToken) As Document 73cancellationToken As CancellationToken) As Document
LineSeparators\VisualBasicLineSeparatorService.vb (1)
55document As Document,
MetadataAsSource\VisualBasicMetadataAsSourceService.vb (7)
28Protected Overrides Async Function AddAssemblyInfoRegionAsync(document As Document, symbolCompilation As Compilation, symbol As ISymbol, cancellationToken As CancellationToken) As Task(Of Document) 54Protected Overrides Function AddNullableRegionsAsync(document As Document, cancellationToken As CancellationToken) As Task(Of Document) 59Protected Overrides Async Function ConvertDocCommentsToRegularCommentsAsync(document As Document, docCommentFormattingService As IDocumentationCommentFormattingService, cancellationToken As CancellationToken) As Task(Of Document) 67Protected Overrides Function GetFormattingRules(document As Document) As ImmutableArray(Of AbstractFormattingRule)
NavigationBar\VisualBasicNavigationBarItemService.vb (1)
40document As Document,
Organizing\VisualBasicOrganizerService.vb (2)
22Protected Overrides Async Function ProcessAsync(document As Document, organizers As IEnumerable(Of ISyntaxOrganizer), cancellationToken As CancellationToken) As Task(Of Document)
RemoveSharedFromModuleMembers\VisualBasicRemoveSharedFromModuleMembersCodeFixProvider.vb (2)
62Protected Overrides Function FixAllAsync(document As Document, diagnostics As ImmutableArray(Of Diagnostic), editor As SyntaxEditor, cancellationToken As CancellationToken) As Task 72Private Shared Function GetReplacement(document As Document, node As SyntaxNode) As SyntaxNode
ReplacePropertyWithMethods\VisualBasicReplacePropertyWithMethods.vb (1)
27document As Document,
SignatureHelp\AbstractIntrinsicOperatorSignatureHelpProvider.vb (3)
17Protected MustOverride Function GetIntrinsicOperatorDocumentationAsync(node As TSyntaxNode, document As Document, cancellationToken As CancellationToken) As ValueTask(Of IEnumerable(Of AbstractIntrinsicOperatorDocumentation)) 31Protected Overrides Async Function GetItemsWorkerAsync(document As Document, position As Integer, triggerInfo As SignatureHelpTriggerInfo, options As MemberDisplayOptions, cancellationToken As CancellationToken) As Task(Of SignatureHelpItems) 55Friend Shared Function GetSignatureHelpItemForIntrinsicOperator(document As Document, semanticModel As SemanticModel, position As Integer, documentation As AbstractIntrinsicOperatorDocumentation, cancellationToken As CancellationToken) As SignatureHelpItem
SignatureHelp\AbstractOrdinaryMethodSignatureHelpProvider.vb (1)
13Protected Shared Function ConvertMemberGroupMember(document As Document,
SignatureHelp\AddRemoveHandlerSignatureHelpProvider.vb (1)
22Protected Overrides Function GetIntrinsicOperatorDocumentationAsync(node As AddRemoveHandlerStatementSyntax, document As Document, cancellationToken As CancellationToken) As ValueTask(Of IEnumerable(Of AbstractIntrinsicOperatorDocumentation))
SignatureHelp\AttributeSignatureHelpProvider.vb (1)
54Protected Overrides Async Function GetItemsWorkerAsync(document As Document, position As Integer, triggerInfo As SignatureHelpTriggerInfo, options As MemberDisplayOptions, cancellationToken As CancellationToken) As Task(Of SignatureHelpItems)
SignatureHelp\CastExpressionSignatureHelpProvider.vb (1)
22Protected Overrides Function GetIntrinsicOperatorDocumentationAsync(node As CastExpressionSyntax, document As Document, cancellationToken As CancellationToken) As ValueTask(Of IEnumerable(Of AbstractIntrinsicOperatorDocumentation))
SignatureHelp\CollectionInitializerSignatureHelpProvider.vb (1)
48Protected Overrides Async Function GetItemsWorkerAsync(document As Document, position As Integer, triggerInfo As SignatureHelpTriggerInfo, options As MemberDisplayOptions, cancellationToken As CancellationToken) As Task(Of SignatureHelpItems)
SignatureHelp\ConditionalExpressionSignatureHelpProvider.vb (1)
18Protected Overrides Function GetIntrinsicOperatorDocumentationAsync(node As T, document As Document, cancellationToken As CancellationToken) As ValueTask(Of IEnumerable(Of AbstractIntrinsicOperatorDocumentation))
SignatureHelp\FunctionAggregationSignatureHelpProvider.vb (1)
56Protected Overrides Async Function GetItemsWorkerAsync(document As Document, position As Integer, triggerInfo As SignatureHelpTriggerInfo, options As MemberDisplayOptions, cancellationToken As CancellationToken) As Task(Of SignatureHelpItems)
SignatureHelp\GenericNameSignatureHelpProvider.vb (1)
63Protected Overrides Async Function GetItemsWorkerAsync(document As Document, position As Integer, triggerInfo As SignatureHelpTriggerInfo, options As MemberDisplayOptions, cancellationToken As CancellationToken) As Task(Of SignatureHelpItems)
SignatureHelp\GetTypeExpressionSignatureHelpProvider.vb (1)
22Protected Overrides Function GetIntrinsicOperatorDocumentationAsync(node As GetTypeExpressionSyntax, document As Document, cancellationToken As CancellationToken) As ValueTask(Of IEnumerable(Of AbstractIntrinsicOperatorDocumentation))
SignatureHelp\GetXmlNamespaceExpressionSignatureHelpProvider.vb (1)
22Protected Overrides Function GetIntrinsicOperatorDocumentationAsync(node As GetXmlNamespaceExpressionSyntax, document As Document, cancellationToken As CancellationToken) As ValueTask(Of IEnumerable(Of AbstractIntrinsicOperatorDocumentation))
SignatureHelp\InvocationExpressionSignatureHelpProvider.MemberGroup.vb (1)
39document As Document,
SignatureHelp\InvocationExpressionSignatureHelpProvider.vb (1)
65Protected Overrides Async Function GetItemsWorkerAsync(document As Document, position As Integer, triggerInfo As SignatureHelpTriggerInfo, options As MemberDisplayOptions, cancellationToken As CancellationToken) As Task(Of SignatureHelpItems)
SignatureHelp\MidAssignmentSignatureHelpProvider.vb (1)
22Protected Overrides Function GetIntrinsicOperatorDocumentationAsync(node As AssignmentStatementSyntax, document As Document, cancellationToken As CancellationToken) As ValueTask(Of IEnumerable(Of AbstractIntrinsicOperatorDocumentation))
SignatureHelp\NameOfExpressionSignatureHelpProvider.vb (1)
30Protected Overrides Function GetIntrinsicOperatorDocumentationAsync(node As NameOfExpressionSyntax, document As Document, cancellationToken As CancellationToken) As ValueTask(Of IEnumerable(Of AbstractIntrinsicOperatorDocumentation))
SignatureHelp\ObjectCreationExpressionSignatureHelpProvider.NormalType.vb (1)
17document As Document,
SignatureHelp\ObjectCreationExpressionSignatureHelpProvider.vb (1)
64Protected Overrides Async Function GetItemsWorkerAsync(document As Document, position As Integer, triggerInfo As SignatureHelpTriggerInfo, options As MemberDisplayOptions, cancellationToken As CancellationToken) As Task(Of SignatureHelpItems)
SignatureHelp\PredefinedCastExpressionSignatureHelpProvider.vb (2)
22Protected Overrides Function GetIntrinsicOperatorDocumentationAsync(node As PredefinedCastExpressionSyntax, document As Document, cancellationToken As CancellationToken) As ValueTask(Of IEnumerable(Of AbstractIntrinsicOperatorDocumentation)) 26Private Shared Async Function GetIntrinsicOperatorDocumentationImplAsync(node As PredefinedCastExpressionSyntax, document As Document, cancellationToken As CancellationToken) As Task(Of IEnumerable(Of AbstractIntrinsicOperatorDocumentation))
SignatureHelp\RaiseEventStatementSignatureHelpProvider.vb (1)
64document As Document,
Snippets\VisualBasicSnippetFunctionService.vb (4)
22Public Overrides Async Function GetContainingClassNameAsync(document As Document, position As Integer, cancellationToken As CancellationToken) As Task(Of String) 29Protected Overrides Async Function GetEnumSymbolAsync(document As Document, switchExpressionSpan As TextSpan, cancellationToken As CancellationToken) As Task(Of ITypeSymbol) 44Protected Overrides Async Function GetDocumentWithEnumCaseAsync(document As Document, fullyQualifiedTypeName As String, firstEnumMemberName As String, caseGenerationLocation As TextSpan, cancellationToken As CancellationToken) As Task(Of (Document, TextSpan))
src\Analyzers\VisualBasic\CodeFixes\AddExplicitCast\VisualBasicAddExplicitCastCodeFixProvider.vb (3)
57document As Document, 109document As Document, 167document As Document,
src\Analyzers\VisualBasic\CodeFixes\GenerateConstructor\GenerateConstructorCodeFixProvider.vb (1)
34Protected Overrides Function GetCodeActionsAsync(document As Document, node As SyntaxNode, cancellationToken As CancellationToken) As Task(Of ImmutableArray(Of CodeAction))
src\Analyzers\VisualBasic\CodeFixes\GenerateEnumMember\GenerateEnumMemberCodeFixProvider.vb (1)
35Protected Overrides Function GetCodeActionsAsync(document As Document, node As SyntaxNode, cancellationToken As CancellationToken) As Task(Of ImmutableArray(Of CodeAction))
src\Analyzers\VisualBasic\CodeFixes\GenerateParameterizedMember\GenerateConversionCodeFixProvider.vb (1)
35Protected Overrides Function GetCodeActionsAsync(document As Document, node As SyntaxNode, cancellationToken As CancellationToken) As Task(Of ImmutableArray(Of CodeAction))
src\Analyzers\VisualBasic\CodeFixes\GenerateParameterizedMember\GenerateParameterizedMemberCodeFixProvider.vb (1)
54Protected Overrides Function GetCodeActionsAsync(document As Document, node As SyntaxNode, cancellationToken As CancellationToken) As Task(Of ImmutableArray(Of CodeAction))
src\Analyzers\VisualBasic\CodeFixes\GenerateParameterizedMember\VisualBasicGenerateParameterizedMemberService.vb (2)
57Dim typeInference = Document.Document.GetRequiredLanguageService(Of ITypeInferenceService)() 59Document.SemanticModel, Me.InvocationExpression, objectAsDefault:=True,
src\Analyzers\VisualBasic\CodeFixes\GenerateVariable\VisualBasicGenerateVariableCodeFixProvider.vb (1)
38Protected Overrides Async Function GetCodeActionsAsync(document As Document, node As SyntaxNode, cancellationToken As CancellationToken) As Task(Of ImmutableArray(Of CodeAction))
src\Analyzers\VisualBasic\CodeFixes\ImplementInterface\VisualBasicImplementInterfaceService.vb (1)
43document As Document, model As SemanticModel, node As SyntaxNode, cancellationToken As CancellationToken,
src\Analyzers\VisualBasic\CodeFixes\Iterator\VisualBasicChangeToYieldCodeFixProvider.vb (1)
36Protected Overrides Function GetCodeFixAsync(root As SyntaxNode, node As SyntaxNode, document As Document, diagnostics As Diagnostic, cancellationToken As CancellationToken) As Task(Of CodeAction)
src\Analyzers\VisualBasic\CodeFixes\Iterator\VisualBasicConvertToIteratorCodeFixProvider.vb (1)
38Protected Overrides Async Function GetCodeFixAsync(root As SyntaxNode, node As SyntaxNode, document As Document, diagnostics As Diagnostic, cancellationToken As CancellationToken) As Task(Of CodeAction)
src\Analyzers\VisualBasic\CodeFixes\RemoveUnnecessaryByVal\VisualBasicRemoveUnnecessaryByValCodeFixProvider.vb (1)
37Protected Overrides Async Function FixAllAsync(document As Document, diagnostics As ImmutableArray(Of Diagnostic), editor As SyntaxEditor, cancellationToken As CancellationToken) As Task
src\Analyzers\VisualBasic\CodeFixes\RemoveUnnecessaryCast\VisualBasicRemoveUnnecessaryCastCodeFixProvider.vb (3)
53document As Document, 94document As Document, originalCastNodes As ImmutableArray(Of ExpressionSyntax), 116document As Document, originalNodes As ImmutableArray(Of ExpressionSyntax),
src\Analyzers\VisualBasic\CodeFixes\SimplifyObjectCreation\VisualBasicSimplifyObjectCreationCodeFixProvider.vb (1)
35Protected Overrides Async Function FixAllAsync(document As Document, diagnostics As ImmutableArray(Of Diagnostic), editor As SyntaxEditor, cancellationToken As CancellationToken) As Task
src\Analyzers\VisualBasic\CodeFixes\UseCollectionInitializer\VisualBasicUseCollectionInitializerCodeFixProvider.vb (1)
42document As Document,
src\Analyzers\VisualBasic\CodeFixes\UseIsNotExpression\VisualBasicUseIsNotExpressionCodeFixProvider.vb (1)
34document As Document,
UseAutoProperty\VisualBasicUseAutoPropertyCodeFixProvider.vb (2)
38Protected Overrides Function GetFormattingRules(document As Document, finalProperty As SyntaxNode) As ImmutableArray(Of AbstractFormattingRule) 48propertyDocument As Document,
Microsoft.CodeAnalysis.VisualBasic.Features.UnitTests (1)
EditAndContinue\VisualBasicEditAndContinueAnalyzerTests.vb (1)
122Private Shared Async Function AnalyzeDocumentAsync(oldProject As Project, newDocument As Document, Optional activeStatementMap As ActiveStatementsMap = Nothing) As Task(Of DocumentAnalysisResults)
Microsoft.CodeAnalysis.VisualBasic.Workspaces (27)
CodeCleanup\Providers\AbstractTokensCodeCleanupProvider.vb (3)
20document As Document, root As SyntaxNode, spans As ImmutableArray(Of TextSpan), cancellationToken As CancellationToken) As Task(Of Rewriter) 22Public Async Function CleanupAsync(document As Document, spans As ImmutableArray(Of TextSpan), options As CodeCleanupOptions, cancellationToken As CancellationToken) As Task(Of Document) Implements ICodeCleanupProvider.CleanupAsync
CodeCleanup\Providers\AddMissingTokensCodeCleanupProvider.vb (2)
29Protected Overrides Async Function GetRewriterAsync(document As Document, root As SyntaxNode, spans As ImmutableArray(Of TextSpan), cancellationToken As CancellationToken) As Task(Of Rewriter) 44Public Shared Async Function CreateAsync(document As Document, spans As ImmutableArray(Of TextSpan), cancellationToken As CancellationToken) As Task(Of AddMissingTokensRewriter)
CodeCleanup\Providers\CaseCorrectionCodeCleanupProvider.vb (2)
31Public Function CleanupAsync(document As Document, spans As ImmutableArray(Of TextSpan), options As CodeCleanupOptions, cancellationToken As CancellationToken) As Task(Of Document) Implements ICodeCleanupProvider.CleanupAsync
CodeCleanup\Providers\FixIncorrectTokensCodeCleanupProvider.vb (2)
38Protected Overrides Function GetRewriterAsync(document As Document, root As SyntaxNode, spans As ImmutableArray(Of TextSpan), cancellationToken As CancellationToken) As Task(Of Rewriter) 55Public Shared Async Function CreateAsync(document As Document, spans As ImmutableArray(Of TextSpan), cancellationToken As CancellationToken) As Task(Of Rewriter)
CodeCleanup\Providers\NormalizeModifiersOrOperatorsCodeCleanupProvider.vb (2)
35Public Async Function CleanupAsync(document As Document, spans As ImmutableArray(Of TextSpan), options As CodeCleanupOptions, cancellationToken As CancellationToken) As Task(Of Document) Implements ICodeCleanupProvider.CleanupAsync
CodeCleanup\Providers\ReduceTokensCodeCleanupProvider.vb (1)
33Protected Overrides Function GetRewriterAsync(document As Document, root As SyntaxNode, spans As ImmutableArray(Of TextSpan), cancellationToken As CancellationToken) As Task(Of Rewriter)
CodeCleanup\Providers\RemoveUnnecessaryLineContinuationCodeCleanupProvider.vb (2)
32Public Async Function CleanupAsync(document As Document, spans As ImmutableArray(Of TextSpan), options As CodeCleanupOptions, cancellationToken As CancellationToken) As Task(Of Document) Implements ICodeCleanupProvider.CleanupAsync
LanguageServices\FixAllSpanMappingService\VisualBasicFixAllSpanMappingService.vb (3)
22Protected Overrides Function GetFixAllSpansIfWithinGlobalStatementAsync(document As Document, diagnosticSpan As TextSpan, cancellationToken As CancellationToken) As Task(Of ImmutableDictionary(Of Document, ImmutableArray(Of TextSpan))) 24Return Task.FromResult(ImmutableDictionary(Of Document, ImmutableArray(Of TextSpan)).Empty)
OrganizeImports\VisualBasicOrganizeImportsService.vb (2)
20Public Async Function OrganizeImportsAsync(document As Document, options As OrganizeImportsOptions, cancellationToken As CancellationToken) As Task(Of Document) Implements IOrganizeImportsService.OrganizeImportsAsync
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\VisualBasic\Services\SemanticFacts\VisualBasicSemanticFacts.vb (1)
333Public Function GetInterceptorSymbolAsync(document As Document, position As Integer, cancellationToken As CancellationToken) As Task(Of ISymbol) Implements ISemanticFacts.GetInterceptorSymbolAsync
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\Extensions\ContextQuery\VisualBasicSyntaxContext.vb (2)
52document As Document, 158Public Shared Function CreateContext(document As Document, semanticModel As SemanticModel, position As Integer, cancellationToken As CancellationToken) As VisualBasicSyntaxContext
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\Extensions\ContextQuery\VisualBasicSyntaxContextService.vb (1)
20Public Function CreateContext(document As Document, semanticModel As SemanticModel, position As Integer, cancellationToken As CancellationToken) As SyntaxContext Implements ISyntaxContextService.CreateContext
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\LanguageServices\InitializeParameter\VisualBasicInitializeParameterService.vb (1)
53Protected Overrides Function TryAddAssignmentForPrimaryConstructorAsync(document As Document, parameter As IParameterSymbol, fieldOrProperty As ISymbol, cancellationToken As CancellationToken) As Task(Of Solution)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\LanguageServices\VisualBasicMoveDeclarationNearReferenceService.vb (1)
45Protected Overrides Function TypesAreCompatibleAsync(document As Document, localSymbol As ILocalSymbol, declarationStatement As LocalDeclarationStatementSyntax, right As SyntaxNode, cancellationToken As CancellationToken) As Task(Of Boolean)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\LanguageServices\VisualBasicRemoveUnnecessaryImportsService.vb (2)
27document As Document, 29cancellationToken As CancellationToken) As Task(Of Document)
Microsoft.CodeAnalysis.VisualBasic.Workspaces.UnitTests (1)
CodeGeneration\AddImportsTests.vb (1)
30Private Shared Async Function GetDocument(code As String, withAnnotations As Boolean, Optional globalImports As String() = Nothing) As Task(Of Document)
Microsoft.CodeAnalysis.Workspaces (839)
CaseCorrection\AbstractCaseCorrectionService.cs (2)
22public async Task<Document> CaseCorrectAsync(Document document, ImmutableArray<TextSpan> spans, CancellationToken cancellationToken)
CaseCorrection\CaseCorrector.cs (8)
26public static async Task<Document> CaseCorrectAsync(Document document, CancellationToken cancellationToken = default) 41public static async Task<Document> CaseCorrectAsync(Document document, SyntaxAnnotation annotation, CancellationToken cancellationToken = default) 55public static async Task<Document> CaseCorrectAsync(Document document, TextSpan span, CancellationToken cancellationToken = default) 63public static Task<Document> CaseCorrectAsync(Document document, ImmutableArray<TextSpan> spans, CancellationToken cancellationToken = default)
CaseCorrection\ICaseCorrectionService.cs (2)
18Task<Document> CaseCorrectAsync(Document document, ImmutableArray<TextSpan> spans, CancellationToken cancellationToken);
ChangeNamespace\IChangeNamespaceService.cs (4)
40Task<bool> CanChangeNamespaceAsync(Document document, SyntaxNode container, CancellationToken cancellationToken); 56Task<Solution> ChangeNamespaceAsync(Document document, SyntaxNode container, string targetNamespace, CancellationToken cancellationToken); 60/// use namespace containers considered valid by <see cref="CanChangeNamespaceAsync(Document, SyntaxNode, CancellationToken)"/> 62Task<Solution?> TryChangeTopLevelNamespacesAsync(Document document, string targetNamespace, CancellationToken cancellationToken);
Classification\AbstractClassificationService.cs (9)
35Document document, ImmutableArray<TextSpan> textSpans, ClassificationOptions options, SegmentedList<ClassifiedSpan> result, CancellationToken cancellationToken) 41Document document, ImmutableArray<TextSpan> textSpans, ClassificationOptions options, SegmentedList<ClassifiedSpan> result, CancellationToken cancellationToken) 47Document document, 108Document document, 138Document document, 187Document document, ISyntaxClassificationService classificationService) 202public async Task AddSyntacticClassificationsAsync(Document document, ImmutableArray<TextSpan> textSpans, SegmentedList<ClassifiedSpan> result, CancellationToken cancellationToken) 229public ValueTask<TextChangeRange?> ComputeSyntacticChangeRangeAsync(Document oldDocument, Document newDocument, TimeSpan timeout, CancellationToken cancellationToken)
Classification\ClassificationServiceExtensions.cs (3)
28Document document, 38Document document, 49Document document,
Classification\Classifier.cs (1)
28Document document,
Classification\ClassifierHelper.cs (2)
30Document document, 53Document document,
Classification\IClassificationService.cs (5)
46Task AddSyntacticClassificationsAsync(Document document, ImmutableArray<TextSpan> textSpans, SegmentedList<ClassifiedSpan> result, CancellationToken cancellationToken); 63Task AddSemanticClassificationsAsync(Document document, ImmutableArray<TextSpan> textSpans, ClassificationOptions options, SegmentedList<ClassifiedSpan> result, CancellationToken cancellationToken); 74Task AddEmbeddedLanguageClassificationsAsync(Document document, ImmutableArray<TextSpan> textSpans, ClassificationOptions options, SegmentedList<ClassifiedSpan> result, CancellationToken cancellationToken); 104Document oldDocument, Document newDocument,
Classification\IEmbeddedLanguageClassificationService.cs (1)
17Document document,
Classification\SemanticClassificationCacheUtilities.cs (1)
14Document document, CancellationToken cancellationToken)
Classification\SyntaxClassification\AbstractSyntaxClassificationService.cs (1)
27Document document,
Classification\SyntaxClassification\ISyntaxClassificationService.cs (1)
35Document document,
Classification\SyntaxClassification\SyntaxClassificationExtensions.cs (1)
29Document document,
CodeActions\CodeAction.cs (22)
331var changedDocument = await GetChangedDocumentAsync(cancellationToken).ConfigureAwait(false); 353var changedDocument = await GetChangedDocumentAsync(progress, cancellationToken).ConfigureAwait(false); 377protected virtual Task<Document> GetChangedDocumentAsync(CancellationToken cancellationToken) 393protected virtual Task<Document> GetChangedDocumentAsync(IProgress<CodeAnalysisProgress> progress, CancellationToken cancellationToken) 411internal Task<Document> GetChangedDocumentInternalAsync(CancellationToken cancellation) 477protected virtual async Task<Document> PostProcessChangesAsync(Document document, CancellationToken cancellationToken) 491/// Creates a <see cref="CodeAction"/> for a change to a single <see cref="Document"/>. 495/// <param name="createChangedDocument">Function to create the <see cref="Document"/>.</param> 498public static CodeAction Create(string title, Func<CancellationToken, Task<Document>> createChangedDocument, string? equivalenceKey) 502internal static CodeAction Create(string title, Func<IProgress<CodeAnalysisProgress>, CancellationToken, Task<Document>> createChangedDocument, string? equivalenceKey) 505/// <inheritdoc cref="Create(string, Func{CancellationToken, Task{Document}}, string?)"/> 508public static CodeAction Create(string title, Func<CancellationToken, Task<Document>> createChangedDocument, string? equivalenceKey = null, CodeActionPriority priority = CodeActionPriority.Default) 511/// <inheritdoc cref="Create(string, Func{CancellationToken, Task{Document}}, string?, CodeActionPriority)"/> 513public static CodeAction Create(string title, Func<IProgress<CodeAnalysisProgress>, CancellationToken, Task<Document>> createChangedDocument, string? equivalenceKey = null, CodeActionPriority priority = CodeActionPriority.Default) 525/// Creates a <see cref="CodeAction"/> for a change to more than one <see cref="Document"/> within a <see cref="Solution"/>. 536/// Creates a <see cref="CodeAction"/> for a change to more than one <see cref="Document"/> within a <see cref="Solution"/>. 660private readonly Func<IProgress<CodeAnalysisProgress>, CancellationToken, Task<Document>> _createChangedDocument; 664Func<IProgress<CodeAnalysisProgress>, CancellationToken, Task<Document>> createChangedDocument, 675Func<IProgress<CodeAnalysisProgress>, CancellationToken, Task<Document>> createChangedDocument, 684Func<IProgress<CodeAnalysisProgress>, CancellationToken, Task<Document>> createChangedDocument, 689protected sealed override Task<Document> GetChangedDocumentAsync(IProgress<CodeAnalysisProgress> progress, CancellationToken cancellationToken)
CodeActions\CodeAction_Cleanup.cs (11)
29private static readonly ImmutableArray<Func<Document, CodeCleanupOptions, CancellationToken, Task<Document>>> s_cleanupPasses = 47private static async Task<Document> CleanupSyntaxAsync(Document document, CodeCleanupOptions options, CancellationToken cancellationToken) 92var document = changedSolution.GetRequiredDocument(documentId); 106internal static async ValueTask<Document> CleanupDocumentAsync(Document document, CodeCleanupOptions options, CancellationToken cancellationToken) 136Solution solution, Func<Document, CodeCleanupOptions, CancellationToken, Task<Document>> cleanupDocumentAsync) 155var document = solution.GetRequiredDocument(documentId); 159var cleanedDocument = await cleanupDocumentAsync(document, options, cancellationToken).ConfigureAwait(false);
CodeCleanup\AbstractCodeCleanerService.cs (8)
29public async Task<Document> CleanupAsync(Document document, ImmutableArray<TextSpan> spans, CodeCleanupOptions options, ImmutableArray<ICodeCleanupProvider> providers, CancellationToken cancellationToken) 63var annotatedDocument = document.WithSyntaxRoot(annotatedRoot); 454private async Task<Document> IterateAllCodeCleanupProvidersAsync( 455Document originalDocument, 456Document annotatedDocument, 464var currentDocument = annotatedDocument; 465Document? previousDocument = null;
CodeCleanup\CodeCleaner.cs (9)
28public static ImmutableArray<ICodeCleanupProvider> GetDefaultProviders(Document document) 50public static async Task<Document> CleanupAsync(Document document, CodeCleanupOptions options, ImmutableArray<ICodeCleanupProvider> providers = default, CancellationToken cancellationToken = default) 60public static async Task<Document> CleanupAsync(Document document, SyntaxAnnotation annotation, CodeCleanupOptions options, ImmutableArray<ICodeCleanupProvider> providers = default, CancellationToken cancellationToken = default) 70public static Task<Document> CleanupAsync(Document document, TextSpan span, CodeCleanupOptions options, ImmutableArray<ICodeCleanupProvider> providers = default, CancellationToken cancellationToken = default) 77public static async Task<Document> CleanupAsync(Document document, ImmutableArray<TextSpan> spans, CodeCleanupOptions options, ImmutableArray<ICodeCleanupProvider> providers = default, CancellationToken cancellationToken = default)
CodeCleanup\ICodeCleanerService.cs (2)
30Task<Document> CleanupAsync(Document document, ImmutableArray<TextSpan> spans, CodeCleanupOptions options, ImmutableArray<ICodeCleanupProvider> providers, CancellationToken cancellationToken);
CodeCleanup\Providers\FormatCodeCleanupProvider.cs (2)
20public async Task<Document> CleanupAsync(Document document, ImmutableArray<TextSpan> spans, CodeCleanupOptions options, CancellationToken cancellationToken)
CodeCleanup\Providers\ICodeCleanupProvider.cs (2)
27Task<Document> CleanupAsync(Document document, ImmutableArray<TextSpan> spans, CodeCleanupOptions options, CancellationToken cancellationToken);
CodeCleanup\Providers\SimplificationCodeCleanupProvider.cs (2)
19public Task<Document> CleanupAsync(Document document, ImmutableArray<TextSpan> spans, CodeCleanupOptions options, CancellationToken cancellationToken)
CodeFixes\CodeFix.cs (2)
64var document = Project.GetDocument(diagnostic.Location.SourceTree); 72var document = Project.Documents.FirstOrDefault(d => d.FilePath == diagnostic.Location.GetLineSpan().Path);
CodeFixes\CodeFixContext.cs (4)
30public Document Document 34if (TextDocument is not Document document) 86Document document, 145Document document,
CodeFixes\FixAllOccurrences\BatchFixAllProvider.cs (9)
87private static async Task<ImmutableDictionary<Document, ImmutableArray<Diagnostic>>> DetermineDiagnosticsAsync(FixAllContext fixAllContext, IProgress<CodeAnalysisProgress> progressTracker) 111ImmutableDictionary<Document, ImmutableArray<Diagnostic>> documentToDiagnostics) 137private static async Task<ImmutableArray<Document>> GetAllChangedDocumentsInDiagnosticsOrderAsync( 145using var _1 = ArrayBuilder<Task<ImmutableArray<Document>>>.GetInstance(out var tasks); 148var document = solution.GetRequiredDocument(diagnostic.Location.SourceTree!); 163using var _3 = ArrayBuilder<Document>.GetInstance(out var changedDocuments); 185using var _4 = ArrayBuilder<Document>.GetInstance(out var result); 199ImmutableArray<Document> allChangedDocumentsInDiagnosticsOrder, 216var originalDocument = fixAllContext.Solution.GetRequiredDocument(docId);
CodeFixes\FixAllOccurrences\DocumentBasedFixAllProvider.cs (7)
20/// cref="Diagnostic"/> only affect the <see cref="Document"/> the diagnostic was produced in. 26/// cref="FixAllAsync(FixAllContext, Document, ImmutableArray{Diagnostic})"/> for implementors to process. 54/// <para>The new <see cref="Document"/> representing the content fixed document.</para> 58protected abstract Task<Document?> FixAllAsync(FixAllContext fixAllContext, Document document, ImmutableArray<Diagnostic> diagnostics); 76FixAllContext fixAllContext, Func<Document, Document?, ValueTask> onDocumentFixed)
CodeFixes\FixAllOccurrences\FixAllContext.cs (9)
40public Document? Document => State.Document; 54/// Note that <see cref="GetDocumentDiagnosticsAsync(Document)"/>, <see cref="GetProjectDiagnosticsAsync(Project)"/> and <see cref="GetAllDiagnosticsAsync(Project)"/> methods 85Optional<(Document? document, Project project)> documentAndProject, 113Document document, 150Document document, 225public async Task<ImmutableArray<Diagnostic>> GetDocumentDiagnosticsAsync(Document document) 262internal async Task<ImmutableArray<Diagnostic>> GetDocumentSpanDiagnosticsAsync(Document document, TextSpan filterSpan) 334Optional<(Document? document, Project project)> documentAndProject = default, 347internal Task<ImmutableDictionary<Document, ImmutableArray<Diagnostic>>> GetDocumentDiagnosticsToFixAsync()
CodeFixes\FixAllOccurrences\FixAllContext.DiagnosticProvider.cs (3)
30public abstract Task<IEnumerable<Diagnostic>> GetDocumentDiagnosticsAsync(Document document, CancellationToken cancellationToken); 43internal static async Task<ImmutableDictionary<Document, ImmutableArray<Diagnostic>>> GetDocumentDiagnosticsToFixAsync(FixAllContext fixAllContext) 50static async Task<ImmutableDictionary<Document, ImmutableArray<Diagnostic>>> GetDocumentDiagnosticsToFixWorkerAsync(FixAllContext fixAllContext)
CodeFixes\FixAllOccurrences\FixAllContext.SpanBasedDiagnosticProvider.cs (3)
19/// which supports a <see cref="GetDocumentSpanDiagnosticsAsync(Document, TextSpan, CancellationToken)"/> 26/// <see cref="GetDocumentSpanDiagnosticsAsync(Document, TextSpan, CancellationToken)"/> method to compute 34public abstract Task<IEnumerable<Diagnostic>> GetDocumentSpanDiagnosticsAsync(Document document, TextSpan fixAllSpan, CancellationToken cancellationToken);
CodeFixes\FixAllOccurrences\FixAllContextHelper.cs (10)
21public static async Task<ImmutableDictionary<Document, ImmutableArray<Diagnostic>>> GetDocumentDiagnosticsToFixAsync( 28var document = fixAllContext.Document; 40return ImmutableDictionary<Document, ImmutableArray<Diagnostic>>.Empty.SetItem(document, documentDiagnostics); 102return ImmutableDictionary<Document, ImmutableArray<Diagnostic>>.Empty; 108static async Task<ImmutableDictionary<Document, ImmutableArray<Diagnostic>>> GetSpanDiagnosticsAsync( 110IEnumerable<KeyValuePair<Document, ImmutableArray<TextSpan>>> documentsAndSpans) 112var builder = PooledDictionary<Document, ArrayBuilder<Diagnostic>>.GetInstance(); 126private static async Task<ImmutableDictionary<Document, ImmutableArray<Diagnostic>>> GetDocumentDiagnosticsToFixAsync( 131var builder = ImmutableDictionary.CreateBuilder<Document, ImmutableArray<Diagnostic>>(); 136if (textDocument is not Document document)
CodeFixes\FixAllOccurrences\FixAllProvider.cs (10)
50/// only affect the <see cref="Document"/> the diagnostic was produced in. 58public static FixAllProvider Create(Func<FixAllContext, Document, ImmutableArray<Diagnostic>, Task<Document?>> fixAllAsync) 64/// fixes for a <see cref="Diagnostic"/> only affect the <see cref="Document"/> the diagnostic was produced in. 78Func<FixAllContext, Document, ImmutableArray<Diagnostic>, Task<Document?>> fixAllAsync, 99Func<FixAllContext, Document, ImmutableArray<Diagnostic>, Task<Document?>> fixAllAsync, 102protected override Task<Document?> FixAllAsync(FixAllContext context, Document document, ImmutableArray<Diagnostic> diagnostics)
CodeFixes\FixAllOccurrences\FixAllState.cs (4)
30Document? document, 49protected override FixAllState With(Document? document, Project project, FixAllScope scope, string? codeActionEquivalenceKey) 65ImmutableDictionary<Document, ImmutableArray<Diagnostic>> diagnosticsToFix, 69var triggerDocument = diagnosticsToFix.First().Key;
CodeFixes\FixAllOccurrences\FixAllState.FixMultipleDiagnosticProvider.cs (5)
21public ImmutableDictionary<Document, ImmutableArray<Diagnostic>> DocumentDiagnosticsMap { get; } 24public FixMultipleDiagnosticProvider(ImmutableDictionary<Document, ImmutableArray<Diagnostic>> diagnosticsMap) 33DocumentDiagnosticsMap = ImmutableDictionary<Document, ImmutableArray<Diagnostic>>.Empty; 42foreach (var document in project.Documents) 59public override Task<IEnumerable<Diagnostic>> GetDocumentDiagnosticsAsync(Document document, CancellationToken cancellationToken)
CodeFixes\FixAllOccurrences\TextChangeMerger.cs (5)
27private readonly Document _oldDocument; 33public TextChangeMerger(Document document) 43public async Task TryMergeChangesAsync(Document newDocument, CancellationToken cancellationToken) 63public async Task TryMergeChangesAsync(ImmutableArray<Document> newDocuments, CancellationToken cancellationToken) 65foreach (var newDocument in newDocuments)
CodeFixesAndRefactorings\CommonFixAllState.cs (5)
20public Document? Document { get; } 28Document? document, 44protected abstract TFixAllState With(Document? document, Project project, FixAllScope scope, string? codeActionEquivalenceKey); 47Optional<(Document? document, Project project)> documentAndProject = default, 72Optional<(Document? document, Project project)> documentAndProject,
CodeFixesAndRefactorings\DocumentBasedFixAllProviderHelpers.cs (2)
28Func<TFixAllContext, Func<Document, Document?, ValueTask>, Task> getFixedDocumentsAsync)
CodeFixesAndRefactorings\FixAllLogger.cs (1)
156public static void LogDiagnosticsStats(int correlationId, ImmutableDictionary<Document, ImmutableArray<Diagnostic>> documentsAndDiagnosticsToFixMap)
CodeFixesAndRefactorings\IFixAllContext.cs (2)
20Document? Document { get; } 29Optional<(Document? document, Project project)> documentAndProject = default,
CodeFixesAndRefactorings\IFixAllState.cs (2)
20Document? Document { get; } 30Optional<(Document? document, Project project)> documentAndProject = default,
CodeRefactorings\CodeRefactoringContext.cs (4)
25public Document Document 29if (TextDocument is not Document document) 63Document document, 125internal void Deconstruct(out Document document, out TextSpan span, out CancellationToken cancellationToken)
CodeRefactorings\FixAllOccurences\DocumentBasedFixAllProvider.cs (7)
20/// This type should be used in the case where the code refactoring(s) only affect individual <see cref="Document"/>s. 25/// <see cref="FixAllAsync(FixAllContext, Document, Optional{ImmutableArray{TextSpan}})"/> is invoked for each document for implementors to process. 55/// <para>The new <see cref="Document"/> representing the content fixed document.</para> 59protected abstract Task<Document?> FixAllAsync(FixAllContext fixAllContext, Document document, Optional<ImmutableArray<TextSpan>> fixAllSpans); 82FixAllContext fixAllContext, Func<Document, Document?, ValueTask> onDocumentFixed)
CodeRefactorings\FixAllOccurences\FixAllContext.cs (4)
31public Document Document => State.Document!; 75Optional<(Document? document, Project project)> documentAndProject, 96public Task<ImmutableDictionary<Document, Optional<ImmutableArray<TextSpan>>>> GetFixAllSpansAsync(CancellationToken cancellationToken) 100Optional<(Document? document, Project project)> documentAndProject = default,
CodeRefactorings\FixAllOccurences\FixAllProvider.cs (10)
50/// only affect a single <see cref="Document"/>. 58public static FixAllProvider Create(Func<FixAllContext, Document, Optional<ImmutableArray<TextSpan>>, Task<Document?>> fixAllAsync) 64/// only affect a single <see cref="Document"/>. 78Func<FixAllContext, Document, Optional<ImmutableArray<TextSpan>>, Task<Document?>> fixAllAsync, 94Func<FixAllContext, Document, Optional<ImmutableArray<TextSpan>>, Task<Document?>> fixAllAsync, 97protected override Task<Document?> FixAllAsync(FixAllContext context, Document document, Optional<ImmutableArray<TextSpan>> fixAllSpans)
CodeRefactorings\FixAllOccurences\FixAllState.cs (7)
36Document document, 60Document? document, 73protected override FixAllState With(Document? document, Project project, FixAllScope scope, string? codeActionEquivalenceKey) 90internal async Task<ImmutableDictionary<Document, Optional<ImmutableArray<TextSpan>>>> GetFixAllSpansAsync(CancellationToken cancellationToken) 92IEnumerable<Document>? documentsToFix = null; 99return ImmutableDictionary<Document, Optional<ImmutableArray<TextSpan>>>.Empty; 120return ImmutableDictionary<Document, Optional<ImmutableArray<TextSpan>>>.Empty;
CodeRefactorings\SyntaxEditorBasedCodeRefactoringProvider.cs (7)
37protected Task<Document> FixAsync( 38Document document, 48protected Task<Document> FixAllAsync( 49Document document, 65internal static async Task<Document> FixAllWithEditorAsync( 66Document document, 80Document document,
Diagnostics\DocumentDiagnosticAnalyzer.cs (2)
20public abstract Task<ImmutableArray<Diagnostic>> AnalyzeSyntaxAsync(Document document, CancellationToken cancellationToken); 22public abstract Task<ImmutableArray<Diagnostic>> AnalyzeSemanticsAsync(Document document, CancellationToken cancellationToken);
Diagnostics\Extensions.cs (7)
50var tree = textDocument is Document { SupportsSyntaxTree: true } document 117if (documentAnalysisScope.TextDocument is Document document) 351if (documentAnalysisScope.TextDocument is Document document) 362var model = await ((Document)documentAnalysisScope.TextDocument).GetRequiredSemanticModelAsync(cancellationToken).ConfigureAwait(false); 386if (documentAnalysisScope.TextDocument is not Document document) 414await foreach (var document in project.GetAllRegularAndSourceGeneratedDocumentsAsync(cancellationToken)) 429Document document,
Editing\DocumentEditor.cs (6)
18private DocumentEditor(Document document, SemanticModel model, SyntaxNode root) 28public static async Task<DocumentEditor> CreateAsync(Document document, CancellationToken cancellationToken = default) 41/// The <see cref="Document"/> specified when the editor was first created. 43public Document OriginalDocument { get; } 51/// Returns the changed <see cref="Document"/>. 53public Document GetChangedDocument()
Editing\ImportAdder.cs (24)
19private static async ValueTask<IEnumerable<TextSpan>> GetSpansAsync(Document document, CancellationToken cancellationToken) 25private static async ValueTask<IEnumerable<TextSpan>> GetSpansAsync(Document document, SyntaxAnnotation annotation, CancellationToken cancellationToken) 34public static async Task<Document> AddImportsAsync(Document document, OptionSet? options = null, CancellationToken cancellationToken = default) 40public static Task<Document> AddImportsAsync(Document document, TextSpan span, OptionSet? options = null, CancellationToken cancellationToken = default) 46public static async Task<Document> AddImportsAsync(Document document, SyntaxAnnotation annotation, OptionSet? options = null, CancellationToken cancellationToken = default) 52public static Task<Document> AddImportsAsync(Document document, IEnumerable<TextSpan> spans, OptionSet? options = null, CancellationToken cancellationToken = default) 55private static async Task<Document> AddImportsFromSyntaxesAsync(Document document, IEnumerable<TextSpan> spans, OptionSet? _, CancellationToken cancellationToken) 71internal static async Task<Document> AddImportsFromSyntaxesAsync(Document document, AddImportPlacementOptions options, CancellationToken cancellationToken) 77internal static async Task<Document> AddImportsFromSyntaxesAsync(Document document, SyntaxAnnotation annotation, AddImportPlacementOptions options, CancellationToken cancellationToken) 83internal static Task<Document> AddImportsFromSyntaxesAsync(Document document, IEnumerable<TextSpan> spans, AddImportPlacementOptions options, CancellationToken cancellationToken) 89internal static async Task<Document> AddImportsFromSymbolAnnotationAsync(Document document, AddImportPlacementOptions options, CancellationToken cancellationToken) 95internal static async Task<Document> AddImportsFromSymbolAnnotationAsync(Document document, SyntaxAnnotation annotation, AddImportPlacementOptions options, CancellationToken cancellationToken) 98internal static Task<Document> AddImportsFromSymbolAnnotationAsync(Document document, IEnumerable<TextSpan> spans, AddImportPlacementOptions options, CancellationToken cancellationToken)
Editing\SymbolEditor.cs (7)
44public static SymbolEditor Create(Document document) 67public IEnumerable<Document> GetChangedDocuments() 287var doc = ChangedSolution.GetDocument(declaration.SyntaxTree); 293var newDoc = editor.GetChangedDocument(); 329var doc = ChangedSolution.GetDocument(sourceTree) ?? OriginalSolution.GetDocument(sourceTree); 376var doc = ChangedSolution.GetDocument(d.SyntaxTree); 484var doc = ChangedSolution.GetDocument(declGroup.Key);
Editing\SymbolEditorExtensions.cs (1)
40var doc = editor.OriginalSolution.GetDocument(decl.SyntaxTree);
Editing\SyntaxGenerator.cs (1)
71public static SyntaxGenerator GetGenerator(Document document)
ExternalAccess\Pythia\Api\PythiaDocumentExtensions.cs (1)
13public static Task<SemanticModel> GetSemanticModelForNodeAsync(this Document document, SyntaxNode? node, CancellationToken cancellationToken)
ExternalAccess\Pythia\Api\PythiaSyntaxFactsServiceWrapper.cs (1)
19public static PythiaSyntaxFactsServiceWrapper Create(Document document)
ExternalAccess\Pythia\Api\PythiaTypeInferenceServiceWrapper.cs (1)
19public static PythiaTypeInferenceServiceWrapper Create(Document document)
ExternalAccess\VSTypeScript\Api\VSTypeScriptTextExtensions.cs (2)
12public static IEnumerable<Document> GetRelatedDocuments(this SourceTextContainer container) 15public static Document? GetOpenDocumentInCurrentContextWithChanges(this SourceText text)
FindSymbols\FindLiterals\FindLiteralsSearchEngine.cs (3)
105private async ValueTask ProcessDocumentAsync(Document document, CancellationToken cancellationToken) 117private async Task ProcessDocumentWorkerAsync(Document document, CancellationToken cancellationToken) 137private async Task SearchDocumentAsync(Document document, CancellationToken cancellationToken)
FindSymbols\FindReferences\DependentTypeFinder.cs (1)
244var document = await solution.GetRequiredDocumentAsync(documentId, includeSourceGenerated: true, cancellationToken).ConfigureAwait(false);
FindSymbols\FindReferences\Finders\AbstractMemberScopedReferenceFinder.cs (3)
31IImmutableSet<Document>? documents, 32Action<Document, TData> processResult, 41var document = project.GetDocument(location.SourceTree);
FindSymbols\FindReferences\Finders\AbstractReferenceFinder.cs (26)
34ISymbol symbol, HashSet<string>? globalAliases, Project project, IImmutableSet<Document>? documents, Action<Document, TData> processResult, TData processResultData, FindReferencesSearchOptions options, CancellationToken cancellationToken); 85IImmutableSet<Document>? scope, 86Func<Document, T, CancellationToken, ValueTask<bool>> predicateAsync, 88Action<Document, TData> processResult, 95var document = scope.First(); 102await foreach (var document in project.GetAllRegularAndSourceGeneratedDocumentsAsync(cancellationToken)) 118IImmutableSet<Document>? documents, 119Action<Document, TData> processResult, 140Project project, IImmutableSet<Document>? documents, Action<Document, TData> processResult, TData processResultData, CancellationToken cancellationToken) 148IImmutableSet<Document>? documents, 150Action<Document, TData> processResult, 330IImmutableSet<Document>? documents, 333Action<Document, TData> processResult, 346IImmutableSet<Document>? documents, 348Action<Document, TData> processResult, 361protected static Task FindDocumentsWithForEachStatementsAsync<TData>(Project project, IImmutableSet<Document>? documents, Action<Document, TData> processResult, TData processResultData, CancellationToken cancellationToken) 364protected static Task FindDocumentsWithUsingStatementsAsync<TData>(Project project, IImmutableSet<Document>? documents, Action<Document, TData> processResult, TData processResultData, CancellationToken cancellationToken) 803TSymbol symbol, HashSet<string>? globalAliases, Project project, IImmutableSet<Document>? documents, 804Action<Document, TData> processResult, TData processResultData, 828IImmutableSet<Document>? documents, Action<Document, TData> processResult, 875await foreach (var document in project.GetAllRegularAndSourceGeneratedDocumentsAsync(cancellationToken))
FindSymbols\FindReferences\Finders\AbstractReferenceFinder_GlobalSuppressions.cs (1)
205Document document,
FindSymbols\FindReferences\Finders\ConstructorInitializerSymbolReferenceFinder.cs (2)
25IImmutableSet<Document>? documents, 26Action<Document, TData> processResult,
FindSymbols\FindReferences\Finders\ConstructorSymbolReferenceFinder.cs (6)
37IImmutableSet<Document>? documents, 38Action<Document, TData> processResult, 71private static Task FindDocumentsWithImplicitObjectCreationExpressionAsync<TData>(Project project, IImmutableSet<Document>? documents, Action<Document, TData> processResult, TData processResultData, CancellationToken cancellationToken) 76IImmutableSet<Document>? documents, 78Action<Document, TData> processResult,
FindSymbols\FindReferences\Finders\DestructorSymbolReferenceFinder.cs (2)
22IImmutableSet<Document>? documents, 23Action<Document, TData> processResult,
FindSymbols\FindReferences\Finders\DynamicTypeSymbolReferenceFinder.cs (2)
29IImmutableSet<Document>? documents, 30Action<Document, TData> processResult,
FindSymbols\FindReferences\Finders\EventSymbolReferenceFinder.cs (2)
42IImmutableSet<Document>? documents, 43Action<Document, TData> processResult,
FindSymbols\FindReferences\Finders\ExplicitConversionSymbolReferenceFinder.cs (6)
30IImmutableSet<Document>? documents, 31Action<Document, TData> processResult, 49using var _ = PooledHashSet<Document>.GetInstance(out var result); 50await FindDocumentsAsync(project, documents, StandardCallbacks<Document>.AddToHashSet, result, cancellationToken, underlyingNamedType.Name).ConfigureAwait(false); 51await FindDocumentsAsync(project, documents, underlyingNamedType.SpecialType.ToPredefinedType(), StandardCallbacks<Document>.AddToHashSet, result, cancellationToken).ConfigureAwait(false); 54foreach (var document in result)
FindSymbols\FindReferences\Finders\ExplicitInterfaceMethodReferenceFinder.cs (2)
22IImmutableSet<Document>? documents, 23Action<Document, TData> processResult,
FindSymbols\FindReferences\Finders\FieldSymbolReferenceFinder.cs (2)
33IImmutableSet<Document>? documents, 34Action<Document, TData> processResult,
FindSymbols\FindReferences\Finders\IReferenceFinder.cs (2)
55Project project, IImmutableSet<Document>? documents, 56Action<Document, TData> processResult, TData processResultData,
FindSymbols\FindReferences\Finders\MethodTypeParameterSymbolReferenceFinder.cs (2)
44IImmutableSet<Document>? documents, 45Action<Document, TData> processResult,
FindSymbols\FindReferences\Finders\NamedTypeSymbolReferenceFinder.cs (4)
56IImmutableSet<Document>? documents, 57Action<Document, TData> processResult, 83IImmutableSet<Document>? documents, 84Action<Document, TData> processResult,
FindSymbols\FindReferences\Finders\NamespaceSymbolReferenceFinder.cs (2)
30IImmutableSet<Document>? documents, 31Action<Document, TData> processResult,
FindSymbols\FindReferences\Finders\OperatorSymbolReferenceFinder.cs (4)
24IImmutableSet<Document>? documents, 25Action<Document, TData> processResult, 37IImmutableSet<Document>? documents, 39Action<Document, TData> processResult,
FindSymbols\FindReferences\Finders\OrdinaryMethodReferenceFinder.cs (8)
51IImmutableSet<Document>? documents, 52Action<Document, TData> processResult, 93private static Task FindDocumentsWithDeconstructionAsync<TData>(Project project, IImmutableSet<Document>? documents, Action<Document, TData> processResult, TData processResultData, CancellationToken cancellationToken) 96private static Task FindDocumentsWithAwaitExpressionAsync<TData>(Project project, IImmutableSet<Document>? documents, Action<Document, TData> processResult, TData processResultData, CancellationToken cancellationToken) 99private static Task FindDocumentsWithCollectionInitializersAsync<TData>(Project project, IImmutableSet<Document>? documents, Action<Document, TData> processResult, TData processResultData, CancellationToken cancellationToken)
FindSymbols\FindReferences\Finders\ParameterSymbolReferenceFinder.cs (4)
28IImmutableSet<Document>? documents, 29Action<Document, TData> processResult, 100var document = solution.GetDocument(parameterNode.SyntaxTree); 129Document document,
FindSymbols\FindReferences\Finders\PreprocessingSymbolReferenceFinder.cs (2)
24IImmutableSet<Document>? documents, 25Action<Document, TData> processResult,
FindSymbols\FindReferences\Finders\PropertyAccessorSymbolReferenceFinder.cs (2)
36IImmutableSet<Document>? documents, 37Action<Document, TData> processResult,
FindSymbols\FindReferences\Finders\PropertySymbolReferenceFinder.cs (6)
111IImmutableSet<Document>? documents, 112Action<Document, TData> processResult, 175Project project, IImmutableSet<Document>? documents, Action<Document, TData> processResult, TData processResultData, CancellationToken cancellationToken) 182Project project, IImmutableSet<Document>? documents, Action<Document, TData> processResult, TData processResultData, CancellationToken cancellationToken)
FindSymbols\FindReferences\Finders\TypeParameterSymbolReferenceFinder.cs (2)
22IImmutableSet<Document>? documents, 23Action<Document, TData> processResult,
FindSymbols\FindReferences\FindReferenceCache.cs (5)
26private static readonly ConditionalWeakTable<Document, AsyncLazy<FindReferenceCache>> s_cache = new(); 28public static async ValueTask<FindReferenceCache> GetCacheAsync(Document document, CancellationToken cancellationToken) 33static async Task<FindReferenceCache> ComputeCacheAsync(Document document, CancellationToken cancellationToken) 51public readonly Document Document; 74Document document, SourceText text, SemanticModel semanticModel, SemanticModel nullableEnabledSemanticModel, SyntaxNode root, SyntaxTreeIndex syntaxTreeIndex)
FindSymbols\FindReferences\FindReferencesDocumentState.cs (1)
24public Document Document => this.Cache.Document;
FindSymbols\FindReferences\FindReferencesProgress.cs (2)
39public void OnFindInDocumentStarted(Document document) 43public void OnFindInDocumentCompleted(Document document)
FindSymbols\FindReferences\FindReferencesSearchEngine.cs (7)
26IImmutableSet<Document>? documents, 39private readonly IImmutableSet<Document>? _documents = documents; 220using var _2 = PooledDictionary<Document, Dictionary<ISymbol, SymbolGroup>>.GetInstance(out var documentToSymbolsWithin); 224using var _3 = PooledHashSet<Document>.GetInstance(out var foundDocuments); 236StandardCallbacks<Document>.AddToHashSet, 240foreach (var document in foundDocuments) 274Document document,
FindSymbols\FindReferences\FindReferencesSearchEngine_FindReferencesInDocuments.cs (3)
22ISymbol originalSymbol, IImmutableSet<Document> documents, CancellationToken cancellationToken) 84foreach (var document in documents) 101Document document,
FindSymbols\IFindReferencesProgress.cs (2)
16void OnFindInDocumentStarted(Document document); 17void OnFindInDocumentCompleted(Document document);
FindSymbols\IStreamingFindReferencesProgress.cs (1)
84ValueTask OnReferenceFoundAsync(Document document, TextSpan span, CancellationToken cancellationToken);
FindSymbols\ReferenceLocation.cs (4)
22public Document Document { get; } 67Document document, 89internal ReferenceLocation(Document document, IAliasSymbol? alias, Location location, bool isImplicit, SymbolUsageInfo symbolUsageInfo, ImmutableArray<(string key, string value)> additionalProperties, CandidateReason candidateReason) 98internal ReferenceLocation(Document document, Location location, Location containingStringLocation)
FindSymbols\ReferenceLocationExtensions.cs (1)
35var document = documentGroup.Key;
FindSymbols\Shared\AbstractSyntaxIndex_Persistence.cs (1)
144Document document, IChecksummedPersistentStorageService persistentStorageService)
FindSymbols\SymbolFinder.cs (3)
124Document document, 197var originalDocument = solution.GetDocument(location.SyntaxTree); 210var linkedDocument = solution.GetRequiredDocument(linkedDocumentId);
FindSymbols\SymbolFinder.FindLiteralsServerCallback.cs (1)
26var document = solution.GetRequiredDocument(documentId);
FindSymbols\SymbolFinder_Callers.cs (2)
33ISymbol symbol, Solution solution, IImmutableSet<Document>? documents, CancellationToken cancellationToken = default) 78IImmutableSet<Document>? documents,
FindSymbols\SymbolFinder_FindReferences_Current.cs (3)
25IImmutableSet<Document>? documents, 74IImmutableSet<Document>? documents, 89IImmutableSet<Document> documents,
FindSymbols\SymbolFinder_FindReferences_Legacy.cs (3)
61IImmutableSet<Document>? documents, 84IImmutableSet<Document>? documents, 100IImmutableSet<Document>? documents,
FindSymbols\SyntaxTree\SyntaxTreeIndex.cs (3)
38public static ValueTask<SyntaxTreeIndex> GetRequiredIndexAsync(Document document, CancellationToken cancellationToken) 44public static ValueTask<SyntaxTreeIndex?> GetIndexAsync(Document document, CancellationToken cancellationToken) 50public static ValueTask<SyntaxTreeIndex?> GetIndexAsync(Document document, bool loadOnly, CancellationToken cancellationToken)
FindSymbols\TopLevelSyntaxTree\TopLevelSyntaxTreeIndex.cs (3)
46public static ValueTask<TopLevelSyntaxTreeIndex> GetRequiredIndexAsync(Document document, CancellationToken cancellationToken) 52public static ValueTask<TopLevelSyntaxTreeIndex?> GetIndexAsync(Document document, CancellationToken cancellationToken) 58public static ValueTask<TopLevelSyntaxTreeIndex?> GetIndexAsync(Document document, bool loadOnly, CancellationToken cancellationToken)
Formatting\AbstractFormattingService.cs (2)
18public Task<Document> FormatAsync(Document document, IEnumerable<TextSpan>? spans, LineFormattingOptions lineFormattingOptions, SyntaxFormattingOptions? syntaxFormattingOptions, CancellationToken cancellationToken)
Formatting\Formatter.cs (25)
34internal static ImmutableArray<AbstractFormattingRule> GetDefaultFormattingRules(Document document) 47public static Task<Document> FormatAsync(Document document, OptionSet? options = null, CancellationToken cancellationToken = default) 52internal static Task<Document> FormatAsync(Document document, SyntaxFormattingOptions options, CancellationToken cancellationToken) 63public static Task<Document> FormatAsync(Document document, TextSpan span, OptionSet? options = null, CancellationToken cancellationToken = default) 68internal static Task<Document> FormatAsync(Document document, TextSpan span, SyntaxFormattingOptions options, CancellationToken cancellationToken) 79public static async Task<Document> FormatAsync(Document document, IEnumerable<TextSpan>? spans, OptionSet? options = null, CancellationToken cancellationToken = default) 91internal static async Task<Document> FormatAsync(Document document, IEnumerable<TextSpan>? spans, SyntaxFormattingOptions? options, ImmutableArray<AbstractFormattingRule> rules, CancellationToken cancellationToken) 107public static Task<Document> FormatAsync(Document document, SyntaxAnnotation annotation, OptionSet? options = null, CancellationToken cancellationToken = default) 110internal static Task<Document> FormatAsync(Document document, SyntaxAnnotation annotation, SyntaxFormattingOptions options, CancellationToken cancellationToken) 113internal static async Task<Document> FormatAsync(Document document, SyntaxAnnotation annotation, SyntaxFormattingOptions options, ImmutableArray<AbstractFormattingRule> rules, CancellationToken cancellationToken) 120internal static async Task<Document> FormatAsync(Document document, SyntaxAnnotation annotation, OptionSet? optionSet, ImmutableArray<AbstractFormattingRule> rules, CancellationToken cancellationToken) 325internal static async ValueTask<(SyntaxFormattingOptions? Syntax, LineFormattingOptions Line)> GetFormattingOptionsAsync(Document document, OptionSet? optionSet, CancellationToken cancellationToken) 354public static async Task<Document> OrganizeImportsAsync(Document document, CancellationToken cancellationToken = default) 367internal static async ValueTask<OrganizeImportsOptions> GetOrganizeImportsOptionsAsync(Document document, CancellationToken cancellationToken)
Formatting\IFormattingService.cs (2)
24Task<Document> FormatAsync(Document document, IEnumerable<TextSpan>? spans, LineFormattingOptions lineFormattingOptions, SyntaxFormattingOptions? syntaxFormattingOptions, CancellationToken cancellationToken);
LanguageServices\FixAllSpanMappingService\AbstractFixAllSpanMappingService.cs (9)
19protected abstract Task<ImmutableDictionary<Document, ImmutableArray<TextSpan>>> GetFixAllSpansIfWithinGlobalStatementAsync( 20Document document, TextSpan span, CancellationToken cancellationToken); 22public Task<ImmutableDictionary<Document, ImmutableArray<TextSpan>>> GetFixAllSpansAsync( 23Document document, TextSpan triggerSpan, FixAllScope fixAllScope, CancellationToken cancellationToken) 31private async Task<ImmutableDictionary<Document, ImmutableArray<TextSpan>>> GetFixAllSpansAsync( 32Document document, TextSpan span, bool fixAllInContainingMember, CancellationToken cancellationToken) 49var builder = PooledDictionary<Document, ArrayBuilder<TextSpan>>.GetInstance(); 52var documentForLocation = document.Project.GetDocument(syntaxRef.SyntaxTree); 72Document document,
LanguageServices\FixAllSpanMappingService\IFixAllSpanMappingService.cs (2)
30Task<ImmutableDictionary<Document, ImmutableArray<TextSpan>>> GetFixAllSpansAsync( 31Document document, TextSpan triggerSpan, FixAllScope fixAllScope, CancellationToken cancellationToken);
LinkedFileDiffMerging\DefaultDocumentTextDifferencingService.cs (4)
24public Task<ImmutableArray<TextChange>> GetTextChangesAsync(Document oldDocument, Document newDocument, CancellationToken cancellationToken) 27public async Task<ImmutableArray<TextChange>> GetTextChangesAsync(Document oldDocument, Document newDocument, TextDifferenceTypes preferredDifferenceType, CancellationToken cancellationToken)
LinkedFileDiffMerging\LinkedFileDiffMergingSession.cs (9)
17using DocumentAndHashBuilder = ArrayBuilder<(Document newDocument, ImmutableArray<byte> newContentHash)>; 29var newDocument = newSolution.GetRequiredDocument(documentId); 58var firstNewDocument = newDocumentsAndHashes[0].newDocument; 100var firstNewDocument = newDocumentsAndHashes[0].newDocument; 101var firstOldDocument = oldSolution.GetRequiredDocument(firstNewDocument.Id); 110var siblingNewDocument = newDocumentsAndHashes[i].newDocument; 111var siblingOldDocument = oldSolution.GetRequiredDocument(siblingNewDocument.Id); 135Document oldDocument, 136Document newDocument,
ObsoleteSymbol\AbstractObsoleteSymbolService.cs (1)
30public async Task<ImmutableArray<TextSpan>> GetLocationsAsync(Document document, ImmutableArray<TextSpan> textSpans, CancellationToken cancellationToken)
ObsoleteSymbol\IObsoleteSymbolService.cs (1)
20Task<ImmutableArray<TextSpan>> GetLocationsAsync(Document document, ImmutableArray<TextSpan> textSpans, CancellationToken cancellationToken);
Options\DocumentOptionSet.cs (2)
15/// An <see cref="OptionSet"/> that comes from <see cref="Document.GetOptionsAsync(System.Threading.CancellationToken)"/>. It behaves just like a normal 16/// <see cref="OptionSet"/> but remembers which language the <see cref="Document"/> is, so you don't have to
OrganizeImports\IOrganizeImportsService.cs (2)
13Task<Document> OrganizeImportsAsync(Document document, OrganizeImportsOptions options, CancellationToken cancellationToken);
OrganizeImports\OrganizeImportsOptionsProviders.cs (1)
23public static async ValueTask<OrganizeImportsOptions> GetOrganizeImportsOptionsAsync(this Document document, CancellationToken cancellationToken)
ReassignedVariable\AbstractReassignedVariableService.cs (1)
40Document document, ImmutableArray<TextSpan> spans, CancellationToken cancellationToken)
ReassignedVariable\IReassignedVariableService.cs (1)
20Task<ImmutableArray<TextSpan>> GetLocationsAsync(Document document, ImmutableArray<TextSpan> textSpans, CancellationToken cancellationToken);
Recommendations\Recommender.cs (2)
27var document = solution.GetRequiredDocument(semanticModel.SyntaxTree); 46Document document,
Remote\RemoteArguments.cs (1)
52IAliasSymbol? alias, Document document, CancellationToken cancellationToken)
Remote\RemoteUtilities.cs (2)
34var oldDoc = oldSolution.GetDocument(docId); 35var newDoc = newSolution.GetDocument(docId);
Rename\ConflictEngine\ConflictResolver.cs (2)
138private static SyntaxNode? GetExpansionTargetForLocationPerLanguage(SyntaxToken tokenOrNode, Document document) 145private static bool LocalVariableConflictPerLanguage(SyntaxToken tokenOrNode, Document document, ImmutableArray<ISymbol> newReferencedSymbols)
Rename\ConflictEngine\ConflictResolver.Session.cs (11)
273var originalDoc = conflictResolution.OldSolution.GetRequiredDocument(documentId); 326var newDocument = conflictResolution.CurrentSolution.GetRequiredDocument(documentId); 352var newDocument = conflictResolution.CurrentSolution.GetRequiredDocument(documentId); 354var baseDocument = conflictResolution.OldSolution.GetRequiredDocument(documentId); 444var newDocument = conflictResolution.CurrentSolution.GetRequiredDocument(unprocessedDocumentIdWithPotentialDeclarationConflicts); 446var baseDocument = conflictResolution.OldSolution.GetRequiredDocument(unprocessedDocumentIdWithPotentialDeclarationConflicts); 656private ImmutableArray<ISymbol> GetSymbolsInNewSolution(Document newDocument, SemanticModel newDocumentSemanticModel, RenameActionAnnotation conflictAnnotation, SyntaxNodeOrToken tokenOrNode) 688var document = conflictResolution.CurrentSolution.GetRequiredDocument(_documentIdOfRenameSymbolDeclaration); 734IEnumerable<Document> documents, 740foreach (var document in documents) 794var document = originalSolution.GetRequiredDocument(documentId);
Rename\ConflictEngine\MutableConflictResolution.cs (2)
73var document = CurrentSolution.GetRequiredDocument(documentId); 93internal void RenameDocumentToMatchNewSymbol(Document document)
Rename\ConflictEngine\RenamedSpansTracker.cs (1)
152var document = solution.GetRequiredDocument(documentId);
Rename\IRemoteRenamerService.cs (1)
94var document = solution.GetRequiredDocument(DocumentId);
Rename\Renamer.cs (2)
71Document document, 100Document document,
Rename\Renamer.RenameDocumentAction.cs (1)
43internal abstract Task<Solution> GetModifiedSolutionAsync(Document document, DocumentRenameOptions options, CancellationToken cancellationToken);
Rename\Renamer.RenameDocumentActionSet.cs (2)
88var document = GetDocument(solution); 113private Document GetDocument(Solution solution)
Rename\Renamer.RenameSymbolDocumentAction.cs (6)
36internal override async Task<Solution> GetModifiedSolutionAsync(Document document, DocumentRenameOptions options, CancellationToken cancellationToken) 69private static async Task<SyntaxNode?> GetMatchingTypeDeclarationAsync(Document document, CancellationToken cancellationToken) 78public static async Task<RenameSymbolDocumentAction?> TryCreateAsync(Document document, string newName, CancellationToken cancellationToken) 87private static async Task<AnalysisResult?> AnalyzeAsync(Document document, string newDocumentName, CancellationToken cancellationToken) 90var documentWithNewName = document.WithName(newDocumentName); 122Document document,
Rename\Renamer.SyncNamespaceDocumentAction.cs (3)
40internal override async Task<Solution> GetModifiedSolutionAsync(Document document, DocumentRenameOptions options, CancellationToken cancellationToken) 51public static SyncNamespaceDocumentAction? TryCreate(Document document, IReadOnlyList<string> newFolders) 63private static AnalysisResult? Analyze(Document document, IReadOnlyCollection<string> newFolders)
Rename\RenameRewriterParameters.cs (2)
15Document document, 49internal readonly Document Document = document;
Rename\RenameUtilities.cs (2)
82internal static IEnumerable<Document> GetDocumentsAffectedByRename(ISymbol symbol, Solution solution, IEnumerable<RenameLocation> renameLocations) 300Document document, int position, CancellationToken cancellationToken)
Rename\SymbolicRenameLocations.ReferenceProcessing.cs (5)
234var document = solution.GetRequiredDocument(location.SourceTree); 341foreach (var document in documentsGroupedByLanguage) 363Document document, string renameText, ISyntaxFactsService syntaxFactsService, 382Document document, string renameText, ArrayBuilder<RenameLocation> renameLocations, CancellationToken cancellationToken) 400Document document,
Shared\Extensions\DocumentExtensions.cs (4)
15public static async ValueTask<SyntaxTreeIndex> GetSyntaxTreeIndexAsync(this Document document, CancellationToken cancellationToken) 22public static ValueTask<SyntaxTreeIndex?> GetSyntaxTreeIndexAsync(this Document document, bool loadOnly, CancellationToken cancellationToken) 25internal static Document WithSolutionOptions(this Document document, OptionSet options)
Shared\Extensions\ProjectExtensions.cs (3)
34public static Document GetRequiredDocument(this Project project, DocumentId documentId) 37public static Document GetRequiredDocument(this Project project, SyntaxTree tree) 49public static async ValueTask<Document> GetRequiredSourceGeneratedDocumentAsync(this Project project, DocumentId documentId, CancellationToken cancellationToken)
Shared\Extensions\SyntaxGeneratorExtensions.cs (3)
42Document document, 196Document document, 233Document newDocument,
Simplification\Simplifier.cs (21)
62public static async Task<TNode> ExpandAsync<TNode>(TNode node, Document document, Func<SyntaxNode, bool>? expandInsideNode = null, bool expandParameter = false, CancellationToken cancellationToken = default) where TNode : SyntaxNode 112public static async Task<SyntaxToken> ExpandAsync(SyntaxToken token, Document document, Func<SyntaxNode, bool>? expandInsideNode = null, CancellationToken cancellationToken = default) 152public static async Task<Document> ReduceAsync(Document document, OptionSet? optionSet = null, CancellationToken cancellationToken = default) 165internal static async Task<Document> ReduceAsync(Document document, SimplifierOptions options, CancellationToken cancellationToken) 175public static async Task<Document> ReduceAsync(Document document, SyntaxAnnotation annotation, OptionSet? optionSet = null, CancellationToken cancellationToken = default) 193internal static async Task<Document> ReduceAsync(Document document, SyntaxAnnotation annotation, SimplifierOptions options, CancellationToken cancellationToken) 203public static Task<Document> ReduceAsync(Document document, TextSpan span, OptionSet? optionSet = null, CancellationToken cancellationToken = default) 215internal static Task<Document> ReduceAsync(Document document, TextSpan span, SimplifierOptions options, CancellationToken cancellationToken) 222public static async Task<Document> ReduceAsync(Document document, IEnumerable<TextSpan> spans, OptionSet? optionSet = null, CancellationToken cancellationToken = default) 240internal static Task<Document> ReduceAsync(Document document, IEnumerable<TextSpan> spans, SimplifierOptions options, CancellationToken cancellationToken) 244internal static async Task<Document> ReduceAsync( 245Document document, ImmutableArray<AbstractReducer> reducers, CancellationToken cancellationToken) 255internal static async Task<SimplifierOptions> GetOptionsAsync(Document document, OptionSet? optionSet, CancellationToken cancellationToken)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Services\SemanticFacts\ISemanticFacts.cs (1)
130Task<ISymbol?> GetInterceptorSymbolAsync(Document document, int position, CancellationToken cancellationToken);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\AddImport\AddImportPlacementOptionsProviders.cs (2)
17public static bool AllowImportsInHiddenRegions(this Document document) 27public static async ValueTask<AddImportPlacementOptions> GetAddImportPlacementOptionsAsync(this Document document, CancellationToken cancellationToken)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeCleanup\CodeCleanupOptionsProviders.cs (1)
27public static async ValueTask<CodeCleanupOptions> GetCodeCleanupOptionsAsync(this Document document, CancellationToken cancellationToken)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeFixes\ForkingSyntaxEditorBasedCodeFixProvider.cs (2)
40Document document, 58Document document,
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeFixes\SyntaxEditorBasedCodeFixProvider.cs (8)
54protected Func<CancellationToken, Task<Document>> GetDocumentUpdater(CodeFixContext context, Diagnostic? diagnostic = null) 60private Task<Document> FixAllAsync( 61Document document, ImmutableArray<Diagnostic> diagnostics, CancellationToken cancellationToken) 69internal static async Task<Document> FixAllWithEditorAsync( 70Document document, 89Document document, ImmutableArray<Diagnostic> diagnostics, SyntaxEditor editor, CancellationToken cancellationToken); 103protected virtual bool IncludeDiagnosticDuringFixAll(Diagnostic diagnostic, Document document, string? equivalenceKey, CancellationToken cancellationToken) 116/// Document, string, CancellationToken)"/> should be overridden instead.
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeFixesAndRefactorings\FixAllHelper.cs (1)
15Document triggerDocument,
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\AbstractCodeGenerationService.cs (12)
230private async Task<Document> GetEditAsync( 243var oldDocument = context.Solution.GetRequiredDocument(destinationTree); 253var newDocument = oldDocument.WithSyntaxRoot(currentRoot); 392public virtual Task<Document> AddEventAsync( 402public Task<Document> AddFieldAsync(CodeGenerationSolutionContext context, INamedTypeSymbol destination, IFieldSymbol field, CancellationToken cancellationToken) 411public Task<Document> AddPropertyAsync(CodeGenerationSolutionContext context, INamedTypeSymbol destination, IPropertySymbol property, CancellationToken cancellationToken) 420public Task<Document> AddNamedTypeAsync(CodeGenerationSolutionContext context, INamedTypeSymbol destination, INamedTypeSymbol namedType, CancellationToken cancellationToken) 429public Task<Document> AddNamedTypeAsync(CodeGenerationSolutionContext context, INamespaceSymbol destination, INamedTypeSymbol namedType, CancellationToken cancellationToken) 438public Task<Document> AddNamespaceAsync(CodeGenerationSolutionContext context, INamespaceSymbol destination, INamespaceSymbol @namespace, CancellationToken cancellationToken) 447public Task<Document> AddMethodAsync(CodeGenerationSolutionContext context, INamedTypeSymbol destination, IMethodSymbol method, CancellationToken cancellationToken) 456public Task<Document> AddMembersAsync(CodeGenerationSolutionContext context, INamedTypeSymbol destination, IEnumerable<ISymbol> members, CancellationToken cancellationToken) 465public Task<Document> AddNamespaceOrTypeAsync(CodeGenerationSolutionContext context, INamespaceSymbol destination, INamespaceOrTypeSymbol namespaceOrType, CancellationToken cancellationToken)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\AbstractCodeGenerationService_FindDeclaration.cs (1)
67var document = solution.GetDocument(syntaxTree);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\CodeGenerationOptionsProviders.cs (2)
35public static async ValueTask<CodeGenerationOptions> GetCodeGenerationOptionsAsync(this Document document, CancellationToken cancellationToken) 41public static async ValueTask<CodeGenerationContextInfo> GetCodeGenerationInfoAsync(this Document document, CodeGenerationContext context, CancellationToken cancellationToken)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\CodeGenerator.cs (9)
30public static Task<Document> AddEventDeclarationAsync(CodeGenerationSolutionContext context, INamedTypeSymbol destination, IEventSymbol @event, CancellationToken cancellationToken) 37public static Task<Document> AddFieldDeclarationAsync(CodeGenerationSolutionContext context, INamedTypeSymbol destination, IFieldSymbol field, CancellationToken cancellationToken) 44public static Task<Document> AddMethodDeclarationAsync(CodeGenerationSolutionContext context, INamedTypeSymbol destination, IMethodSymbol method, CancellationToken cancellationToken) 51public static Task<Document> AddPropertyDeclarationAsync(CodeGenerationSolutionContext context, INamedTypeSymbol destination, IPropertySymbol property, CancellationToken cancellationToken) 58public static Task<Document> AddNamedTypeDeclarationAsync(CodeGenerationSolutionContext context, INamedTypeSymbol destination, INamedTypeSymbol namedType, CancellationToken cancellationToken) 65public static Task<Document> AddNamedTypeDeclarationAsync(CodeGenerationSolutionContext context, INamespaceSymbol destination, INamedTypeSymbol namedType, CancellationToken cancellationToken) 72public static Task<Document> AddNamespaceDeclarationAsync(CodeGenerationSolutionContext context, INamespaceSymbol destination, INamespaceSymbol @namespace, CancellationToken cancellationToken) 79public static Task<Document> AddNamespaceOrTypeDeclarationAsync(CodeGenerationSolutionContext context, INamespaceSymbol destination, INamespaceOrTypeSymbol namespaceOrType, CancellationToken cancellationToken) 86public static Task<Document> AddMemberDeclarationsAsync(CodeGenerationSolutionContext context, INamedTypeSymbol destination, IEnumerable<ISymbol> members, CancellationToken cancellationToken)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\ICodeGenerationService.cs (9)
134Task<Document> AddEventAsync(CodeGenerationSolutionContext context, INamedTypeSymbol destination, IEventSymbol @event, CancellationToken cancellationToken); 139Task<Document> AddFieldAsync(CodeGenerationSolutionContext context, INamedTypeSymbol destination, IFieldSymbol field, CancellationToken cancellationToken); 144Task<Document> AddMethodAsync(CodeGenerationSolutionContext context, INamedTypeSymbol destination, IMethodSymbol method, CancellationToken cancellationToken); 149Task<Document> AddPropertyAsync(CodeGenerationSolutionContext context, INamedTypeSymbol destination, IPropertySymbol property, CancellationToken cancellationToken); 154Task<Document> AddNamedTypeAsync(CodeGenerationSolutionContext context, INamedTypeSymbol destination, INamedTypeSymbol namedType, CancellationToken cancellationToken); 159Task<Document> AddNamedTypeAsync(CodeGenerationSolutionContext context, INamespaceSymbol destination, INamedTypeSymbol namedType, CancellationToken cancellationToken); 164Task<Document> AddNamespaceAsync(CodeGenerationSolutionContext context, INamespaceSymbol destination, INamespaceSymbol @namespace, CancellationToken cancellationToken); 169Task<Document> AddNamespaceOrTypeAsync(CodeGenerationSolutionContext context, INamespaceSymbol destination, INamespaceOrTypeSymbol namespaceOrType, CancellationToken cancellationToken); 174Task<Document> AddMembersAsync(CodeGenerationSolutionContext context, INamedTypeSymbol destination, IEnumerable<ISymbol> members, CancellationToken cancellationToken);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Editing\ImportAdderService.cs (6)
32public async Task<Document> AddImportsAsync( 33Document document, 105private async Task<Document> AddImportDirectivesFromSyntaxesAsync( 106Document document, 166private async Task<Document> AddImportDirectivesFromSymbolAnnotationsAsync( 167Document document,
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\ContextQuery\ISyntaxContextService.cs (1)
13SyntaxContext CreateContext(Document document, SemanticModel semanticModel, int position, CancellationToken cancellationToken);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\ContextQuery\SyntaxContext.cs (2)
14public Document Document { get; } 59Document document,
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\DocumentExtensions.cs (18)
32public static TLanguageService? GetLanguageService<TLanguageService>(this Document? document) where TLanguageService : class, ILanguageService 35public static TLanguageService GetRequiredLanguageService<TLanguageService>(this Document document) where TLanguageService : class, ILanguageService 38public static async ValueTask<SemanticModel> GetRequiredSemanticModelAsync(this Document document, CancellationToken cancellationToken) 49public static async ValueTask<SemanticModel> GetRequiredNullableDisabledSemanticModelAsync(this Document document, CancellationToken cancellationToken) 62public static async ValueTask<SyntaxTree> GetRequiredSyntaxTreeAsync(this Document document, CancellationToken cancellationToken) 72public static SyntaxTree GetRequiredSyntaxTreeSynchronously(this Document document, CancellationToken cancellationToken) 79public static async ValueTask<SyntaxNode> GetRequiredSyntaxRootAsync(this Document document, CancellationToken cancellationToken) 89public static SyntaxNode GetRequiredSyntaxRootSynchronously(this Document document, CancellationToken cancellationToken) 116public static ValueTask<SemanticModel> ReuseExistingSpeculativeModelAsync(this Document document, int position, CancellationToken cancellationToken) 133public static async ValueTask<SemanticModel> ReuseExistingSpeculativeModelAsync(this Document document, TextSpan span, CancellationToken cancellationToken) 158public static ValueTask<SemanticModel> ReuseExistingSpeculativeModelAsync(this Document document, SyntaxNode? node, CancellationToken cancellationToken) 169public static async Task<bool> HasAnyErrorsAsync(this Document document, CancellationToken cancellationToken, List<string>? ignoreErrorCode = null) 175public static async Task<ImmutableArray<Diagnostic>> GetErrorsAsync(this Document document, CancellationToken cancellationToken, IList<string>? ignoreErrorCode = null) 191public static async Task VerifyNoErrorsAsync(this Document newDocument, string message, CancellationToken cancellationToken, List<string>? ignoreErrorCodes = null) 203public static bool IsGeneratedCode(this Document document, CancellationToken cancellationToken) 210public static async Task<bool> IsGeneratedCodeAsync(this Document document, CancellationToken cancellationToken) 217public static IEnumerable<Document> GetLinkedDocuments(this Document document)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\ISolutionExtensions.cs (3)
35public static Document GetRequiredDocument(this Solution solution, SyntaxTree syntaxTree) 49public static Document GetRequiredDocument(this Solution solution, DocumentId documentId) 66public static async ValueTask<Document> GetRequiredDocumentAsync(this Solution solution, DocumentId documentId, bool includeSourceGenerated = false, CancellationToken cancellationToken = default)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\SyntaxEditorExtensions.cs (6)
27this SyntaxEditor editor, Document document, 50this SyntaxEditor editor, Document document, 73this SyntaxEditor editor, Document document, 94this SyntaxEditor editor, Document document, 117this SyntaxEditor editor, Document document, 151this SyntaxEditor editor, Document document,
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\TextDocumentExtensions.cs (1)
31case Document document:
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Formatting\DocumentFormattingOptionsProviders.cs (1)
22public static async ValueTask<DocumentFormattingOptions> GetDocumentFormattingOptionsAsync(this Document document, CancellationToken cancellationToken)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Formatting\LineFormattingOptionsProviders.cs (1)
17public static async ValueTask<LineFormattingOptions> GetLineFormattingOptionsAsync(this Document document, CancellationToken cancellationToken)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Formatting\SyntaxFormattingOptionsProviders.cs (2)
17public static ValueTask<SyntaxFormattingOptions> GetSyntaxFormattingOptionsAsync(this Document document, CancellationToken cancellationToken) 20public static async ValueTask<SyntaxFormattingOptions> GetSyntaxFormattingOptionsAsync(this Document document, ISyntaxFormatting formatting, CancellationToken cancellationToken)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\LanguageServices\GeneratedCodeRecognition\AbstractGeneratedCodeRecognitionService.cs (3)
18public bool IsGeneratedCode(Document document, CancellationToken cancellationToken) 25public async Task<bool> IsGeneratedCodeAsync(Document document, CancellationToken cancellationToken) 31private static bool IsGeneratedCode(SyntaxTree syntaxTree, Document document, CancellationToken cancellationToken)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\LanguageServices\GeneratedCodeRecognition\IGeneratedCodeRecognitionService.cs (2)
16bool IsGeneratedCode(Document document, CancellationToken cancellationToken); 19Task<bool> IsGeneratedCodeAsync(Document document, CancellationToken cancellationToken);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\LanguageServices\InitializeParameter\AbstractInitializerParameterService.cs (4)
31Document document, IParameterSymbol parameter, ISymbol fieldOrProperty, CancellationToken cancellationToken); 83Document document, 112Document document, 127var newDocument = document.WithSyntaxRoot(editor.GetChangedRoot());
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\LanguageServices\InitializeParameter\IInitializeParameterService.cs (1)
22Document document, IParameterSymbol parameter, ISymbol fieldOrProperty, CancellationToken cancellationToken);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\LanguageServices\MoveDeclarationNearReference\AbstractMoveDeclarationNearReferenceService.cs (9)
35protected abstract Task<bool> TypesAreCompatibleAsync(Document document, ILocalSymbol localSymbol, TLocalDeclarationStatementSyntax declarationStatement, SyntaxNode right, CancellationToken cancellationToken); 37public async Task<(bool canMove, bool mayChangeSemantics)> CanMoveDeclarationNearReferenceAsync(Document document, SyntaxNode node, CancellationToken cancellationToken) 46private async Task<State> ComputeStateAsync(Document document, SyntaxNode node, CancellationToken cancellationToken) 76public async Task<Document> MoveDeclarationNearReferenceAsync( 77Document document, SyntaxNode localDeclarationStatement, CancellationToken cancellationToken) 118Document document, State state, SyntaxEditor editor, SyntaxAnnotation warningAnnotation, CancellationToken cancellationToken) 159Document document, State state, SyntaxEditor editor, SyntaxAnnotation warningAnnotation) 204Document document, 235Document document, State state)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\LanguageServices\MoveDeclarationNearReference\AbstractMoveDeclarationNearReferenceService.State.cs (2)
40Document document, 55Document document,
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\LanguageServices\MoveDeclarationNearReference\IMoveDeclarationNearReferenceService.cs (3)
19Task<(bool canMove, bool mayChangeSemantics)> CanMoveDeclarationNearReferenceAsync(Document document, SyntaxNode localDeclarationStatement, CancellationToken cancellationToken); 26Task<Document> MoveDeclarationNearReferenceAsync(Document document, SyntaxNode localDeclarationStatement, CancellationToken cancellationToken);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\LanguageServices\RemoveUnnecessaryImports\AbstractRemoveUnnecessaryImportsService.cs (6)
23public Task<Document> RemoveUnnecessaryImportsAsync(Document document, CancellationToken cancellationToken) 26public abstract Task<Document> RemoveUnnecessaryImportsAsync(Document fromDocument, Func<SyntaxNode, bool>? predicate, CancellationToken cancellationToken); 29Document document, Func<SyntaxNode, bool> predicate, CancellationToken cancellationToken) 36foreach (var current in document.GetLinkedDocuments())
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\LanguageServices\RemoveUnnecessaryImports\IRemoveUnnecessaryImportsService.cs (4)
14Task<Document> RemoveUnnecessaryImportsAsync(Document document, CancellationToken cancellationToken); 16Task<Document> RemoveUnnecessaryImportsAsync(Document fromDocument, Func<SyntaxNode, bool>? predicate, CancellationToken cancellationToken);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\LanguageServices\ReplaceDiscardDeclarationsWithAssignments\IReplaceDiscardDeclarationsWithAssignmentsService.cs (1)
32Task<SyntaxNode> ReplaceAsync(Document document, SyntaxNode memberDeclaration, CancellationToken cancellationToken);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\LanguageServices\SemanticsFactsService\AbstractSemanticFactsService.cs (1)
262public Task<ISymbol> GetInterceptorSymbolAsync(Document document, int position, CancellationToken cancellationToken)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\NamingStyles\NamingStylePreferencesProviders.cs (1)
15public static async ValueTask<NamingStylePreferences> GetNamingStylePreferencesAsync(this Document document, CancellationToken cancellationToken)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Options\MemberDisplayOptions.cs (1)
50public static async ValueTask<MemberDisplayOptions> GetMemberDisplayOptionsAsync(this Document document, CancellationToken cancellationToken)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Simplification\AbstractSimplificationService.cs (8)
54public async Task<Document> ReduceAsync( 55Document document, 86private async Task<Document> ReduceCoreAsync( 87Document document, 151Document document, 235var newDocument = document.WithSyntaxRoot(newRoot); 286private async Task<Document> RemoveUnusedNamespaceImportsAsync( 287Document document,
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Simplification\ISimplificationService.cs (2)
30Task<Document> ReduceAsync( 31Document document,
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Simplification\SimplifierOptionsProviders.cs (2)
17public static ValueTask<SimplifierOptions> GetSimplifierOptionsAsync(this Document document, CancellationToken cancellationToken) 20public static async ValueTask<SimplifierOptions> GetSimplifierOptionsAsync(this Document document, ISimplification simplification, CancellationToken cancellationToken)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Utilities\ParsedDocument.cs (6)
19/// Represents a <see cref="Document"/> content that has been parsed. 24/// In general, any feature API that accepts <see cref="ParsedDocument"/> should be synchronous and not access <see cref="Document"/> or <see cref="Solution"/> snapshots. 35public static async ValueTask<ParsedDocument> CreateAsync(Document document, CancellationToken cancellationToken) 43public static ParsedDocument CreateSynchronously(Document document, CancellationToken cancellationToken) 70/// Equivalent semantics to <see cref="Document.GetTextChangesAsync(Document, CancellationToken)"/>
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Utilities\SemanticDocument.cs (2)
13internal sealed class SemanticDocument(Document document, SourceText text, SyntaxNode root, SemanticModel semanticModel) 18public static new async Task<SemanticDocument> CreateAsync(Document document, CancellationToken cancellationToken)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Utilities\SyntacticDocument.cs (4)
14public readonly Document Document; 18protected SyntacticDocument(Document document, SourceText text, SyntaxNode root) 28public static async ValueTask<SyntacticDocument> CreateAsync(Document document, CancellationToken cancellationToken) 37var newDocument = this.Document.WithSyntaxRoot(root);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\WorkspaceServices\SemanticModelReuse\ISemanticModelReuseWorkspaceService.cs (2)
19/// Don't call this directly. use <see cref="DocumentExtensions.ReuseExistingSpeculativeModelAsync(Document, SyntaxNode, CancellationToken)"/> (or an overload). 21ValueTask<SemanticModel> ReuseExistingSpeculativeModelAsync(Document document, SyntaxNode node, CancellationToken cancellationToken);
Storage\SQLite\v2\SQLitePersistentStorage_DocumentSerialization.cs (3)
17protected override Task<bool> ChecksumMatchesAsync(DocumentKey documentKey, Document? document, string name, Checksum checksum, CancellationToken cancellationToken) 20protected override Task<Stream?> ReadStreamAsync(DocumentKey documentKey, Document? document, string name, Checksum? checksum, CancellationToken cancellationToken) 23protected override Task<bool> WriteStreamAsync(DocumentKey documentKey, Document? document, string name, Stream stream, Checksum? checksum, CancellationToken cancellationToken)
Storage\SQLite\v2\SQLitePersistentStorageConstants.cs (1)
83/// Inside the DB we have a table for data that we want associated with a <see cref="Document"/>. The data is
TaskList\ITaskListService.cs (1)
18Task<ImmutableArray<TaskListItem>> GetTaskListItemsAsync(Document document, ImmutableArray<TaskListItemDescriptor> descriptors, CancellationToken cancellationToken);
Utilities\WorkspacePathUtilities.cs (4)
19public static bool TypeNameMatchesDocumentName(Document document, string typeName) 24/// name is null, returns false. Otherwise uses <see cref="TypeNameMatchesDocumentName(Document, string)"/> 26public static bool TypeNameMatchesDocumentName(Document document, SyntaxNode typeDeclaration, ISyntaxFacts syntaxFacts) 37public static string? GetTypeNameFromDocumentName(Document document)
Workspace\AdhocWorkspace.cs (2)
108public Document AddDocument(ProjectId projectId, string name, SourceText text) 134public Document AddDocument(DocumentInfo documentInfo)
Workspace\DocumentEventArgs.cs (2)
14public Document Document { get; } 16public DocumentEventArgs(Document document)
Workspace\DocumentTracking\IDocumentTrackingServiceExtensions.cs (3)
14/// Gets the active <see cref="Document"/> the user is currently working in. May be null if 17public static Document? GetActiveDocument(this IDocumentTrackingService service, Solution solution) 27public static ImmutableArray<Document> GetVisibleDocuments(this IDocumentTrackingService service, Solution solution)
Workspace\Host\DocumentService\AbstractSpanMappingService.cs (3)
20Document oldDocument, 21Document newDocument, 25Document document,
Workspace\Host\DocumentService\IDocumentExcerptService.cs (9)
16/// excerpt some part of <see cref="Document"/> 21/// return <see cref="ExcerptResult"/> of given <see cref="Document"/> and <see cref="TextSpan"/> 25Task<ExcerptResult?> TryExcerptAsync(Document document, TextSpan span, ExcerptMode mode, ClassificationOptions classificationOptions, CancellationToken cancellationToken); 40internal readonly struct ExcerptResult(SourceText content, TextSpan mappedSpan, ImmutableArray<ClassifiedSpan> classifiedSpans, Document document, TextSpan span) 58/// <see cref="Document"/> this excerpt is from 60/// should be same document in <see cref="IDocumentExcerptService.TryExcerptAsync(Document, TextSpan, ExcerptMode, ClassificationOptions, CancellationToken)" /> 62public readonly Document Document = document; 65/// span on <see cref="Document"/> this excerpt is from 67/// should be same text span in <see cref="IDocumentExcerptService.TryExcerptAsync(Document, TextSpan, ExcerptMode, ClassificationOptions, CancellationToken)" />
Workspace\Host\DocumentService\ISpanMappingService.cs (3)
32Document oldDocument, 33Document newDocument, 49Task<ImmutableArray<MappedSpanResult>> MapSpansAsync(Document document, IEnumerable<TextSpan> spans, CancellationToken cancellationToken);
Workspace\Host\PersistentStorage\AbstractPersistentStorage.cs (8)
51protected abstract Task<bool> ChecksumMatchesAsync(DocumentKey documentKey, Document? document, string name, Checksum checksum, CancellationToken cancellationToken); 53protected abstract Task<Stream?> ReadStreamAsync(DocumentKey documentKey, Document? document, string name, Checksum? checksum, CancellationToken cancellationToken); 55protected abstract Task<bool> WriteStreamAsync(DocumentKey documentKey, Document? document, string name, Stream stream, Checksum? checksum, CancellationToken cancellationToken); 78public Task<bool> ChecksumMatchesAsync(Document document, string name, Checksum checksum, CancellationToken cancellationToken) 84public Task<Stream?> ReadStreamAsync(Document document, string name, Checksum? checksum, CancellationToken cancellationToken) 93public Task<Stream?> ReadStreamAsync(Document document, string name, CancellationToken cancellationToken) 99public Task<bool> WriteStreamAsync(Document document, string name, Stream stream, Checksum? checksum, CancellationToken cancellationToken) 108public Task<bool> WriteStreamAsync(Document document, string name, Stream stream, CancellationToken cancellationToken)
Workspace\Host\PersistentStorage\DocumentKey.cs (3)
14/// <see cref="Document"/> without needing to have the entire <see cref="Document"/> snapshot available. 33public static DocumentKey ToDocumentKey(Document document)
Workspace\Host\PersistentStorage\IChecksummedPersistentStorage.cs (3)
35Task<bool> ChecksumMatchesAsync(Document document, string name, Checksum checksum, CancellationToken cancellationToken = default); 59Task<Stream?> ReadStreamAsync(Document document, string name, Checksum? checksum = null, CancellationToken cancellationToken = default); 95Task<bool> WriteStreamAsync(Document document, string name, Stream stream, Checksum? checksum = null, CancellationToken cancellationToken = default);
Workspace\Host\PersistentStorage\IPersistentStorage.cs (2)
20Task<Stream?> ReadStreamAsync(Document document, string name, CancellationToken cancellationToken = default); 38Task<bool> WriteStreamAsync(Document document, string name, Stream stream, CancellationToken cancellationToken = default);
Workspace\Host\PersistentStorage\NoOpPersistentStorage.cs (5)
29public Task<bool> ChecksumMatchesAsync(Document document, string name, Checksum checksum, CancellationToken cancellationToken) 38public Task<Stream?> ReadStreamAsync(Document document, string name, CancellationToken cancellationToken) 53public Task<Stream?> ReadStreamAsync(Document document, string name, Checksum? checksum, CancellationToken cancellationToken) 62public Task<bool> WriteStreamAsync(Document document, string name, Stream stream, CancellationToken cancellationToken) 77public Task<bool> WriteStreamAsync(Document document, string name, Stream stream, Checksum? checksum, CancellationToken cancellationToken)
Workspace\Solution\AssetPath.cs (1)
12/// particular, this is often used to scope to a particular <see cref="Project"/> or <see cref="Document"/> to avoid
Workspace\Solution\Document.cs (18)
63var otherDocument = otherTextDocument as Document ?? 71internal bool HasTextChanged(Document otherDocument) 385public Document WithSourceCodeKind(SourceCodeKind kind) 391public Document WithText(SourceText text) 397public Document WithSyntaxRoot(SyntaxNode root) 403public Document WithName(string name) 409public Document WithFolders(IEnumerable<string> folders) 415public Document WithFilePath(string? filePath) 422public async Task<IEnumerable<TextChange>> GetTextChangesAsync(Document oldDocument, CancellationToken cancellationToken = default) 428/// Similar to <see cref="GetTextChangesAsync(Document, CancellationToken)"/>, but should be used when in a forced 432Document oldDocument, CancellationToken cancellationToken) 440bool useAsync, Document oldDocument, CancellationToken cancellationToken) 499/// <see cref="Document" />. <see cref="Document"/>s are considered to be linked if they 510internal Document WithFrozenPartialSemantics(CancellationToken cancellationToken) 519/// <para/> Note: this will give back a solution where this <see cref="Document"/>'s project will not run generators 533internal virtual Document WithFrozenPartialSemantics(bool forceFreeze, CancellationToken cancellationToken)
Workspace\Solution\DocumentId.cs (1)
14/// An identifier that can be used to retrieve the same <see cref="Document"/> across versions of the
Workspace\Solution\IDocumentTextDifferencingService.cs (4)
24Task<ImmutableArray<TextChange>> GetTextChangesAsync(Document oldDocument, Document newDocument, CancellationToken cancellationToken); 34Task<ImmutableArray<TextChange>> GetTextChangesAsync(Document oldDocument, Document newDocument, TextDifferenceTypes preferredDifferenceType, CancellationToken cancellationToken);
Workspace\Solution\Project.cs (15)
29private ImmutableDictionary<DocumentId, Document?> _idToDocumentMap = ImmutableDictionary<DocumentId, Document?>.Empty; 196public IEnumerable<Document> Documents => DocumentIds.Select(GetDocument)!; 235public Document? GetDocument(SyntaxTree? syntaxTree) 241public Document? GetDocument(DocumentId documentId) 259internal async ValueTask<Document?> GetDocumentAsync(DocumentId documentId, bool includeSourceGenerated = false, CancellationToken cancellationToken = default) 261var document = GetDocument(documentId); 294internal async IAsyncEnumerable<Document> GetAllRegularAndSourceGeneratedDocumentsAsync([EnumeratorCancellation] CancellationToken cancellationToken) 296foreach (var document in this.Documents) 456private async Task<bool> ContainsAsync(Func<Document, Task<bool>> predicateAsync) 465private static readonly Func<DocumentId, Project, Document?> s_tryCreateDocumentFunction = 699public Document AddDocument(string name, SyntaxNode syntaxRoot, IEnumerable<string>? folders = null, string? filePath = null) 711public Document AddDocument(string name, SourceText text, IEnumerable<string>? folders = null, string? filePath = null) 720public Document AddDocument(string name, string text, IEnumerable<string>? folders = null, string? filePath = null) 836internal async ValueTask<Document?> GetDocumentAsync(ImmutableArray<byte> contentHash, CancellationToken cancellationToken)
Workspace\Solution\Solution.cs (5)
237public Document? GetDocument(DocumentId? documentId) 243internal ValueTask<Document?> GetDocumentAsync(DocumentId? documentId, bool includeSourceGenerated = false, CancellationToken cancellationToken = default) 313public Document? GetDocument(SyntaxTree? syntaxTree) 316internal Document? GetDocument(SyntaxTree? syntaxTree, ProjectId? projectId) 1616internal Document WithFrozenSourceGeneratedDocument(
Workspace\Solution\SourceGeneratedDocument.cs (2)
11/// A <see cref="Document"/> that was generated by an <see cref="ISourceGenerator" />. 29internal override Document WithFrozenPartialSemantics(bool forceFreeze, CancellationToken cancellationToken)
Workspace\Solution\TextDocument.cs (2)
85/// <remarks>This is internal for the same reason <see cref="Document.GetSyntaxTreeSynchronously(CancellationToken)"/> is internal: 99/// <remarks>This is internal for the same reason <see cref="Document.GetSyntaxTreeSynchronously(CancellationToken)"/> is internal:
Workspace\Solution\TextDocumentKind.cs (1)
13/// Indicates a regular source <see cref="CodeAnalysis.Document"/>
Workspace\TextExtensions.cs (8)
19public static ImmutableArray<Document> GetRelatedDocumentsWithChanges(this SourceText text) 46/// Gets the <see cref="Document"/> from the corresponding workspace's current solution that is associated with the source text's container 49public static Document? GetOpenDocumentInCurrentContextWithChanges(this SourceText text) 50=> (Document?)text.GetOpenTextDocumentInCurrentContextWithChanges(sourceDocumentOnly: true); 106public static ImmutableArray<Document> GetRelatedDocuments(this SourceTextContainer container) 126public static Document? GetOpenDocumentInCurrentContext(this SourceTextContainer container) 144internal static Document? GetDocumentWithFrozenPartialSemantics(this SourceText text, CancellationToken cancellationToken) 146var document = text.GetOpenDocumentInCurrentContextWithChanges();
Workspace\Workspace.cs (14)
352var relatedDocument = solution.GetRequiredDocument(relatedDocumentId); 378Document? changedDocument = null; 618protected virtual void OnDocumentTextChanged(Document document) 1239/// When a <see cref="Document"/>s text is changed, we need to make sure all of the linked files also have their 1308var newDocument = newSolution.GetRequiredDocument(documentId); 1328var newDocument = newSolution.GetDocument(updatedDocumentId); 1624using var _2 = PooledHashSet<Document>.GetInstance(out var infoChangedNewDocuments); 1631var oldDoc = projectChange.OldProject.GetRequiredDocument(docId); 1632var newDoc = projectChange.NewProject.GetRequiredDocument(docId); 1646foreach (var newDoc in infoChangedNewDocuments) 1941var document = projectChanges.NewProject.GetDocument(documentId)!; 1995var oldDoc = projectChanges.OldProject.GetDocument(documentId)!; 1996var newDoc = projectChanges.NewProject.GetDocument(documentId)!; 2051doc is Document sourceDoc ? sourceDoc.SourceCodeKind : SourceCodeKind.Regular,
Workspace\Workspace_Editor.cs (4)
368var oldDocument = oldSolution.GetDocument(documentId); 419var newDoc = newSolution.GetRequiredDocument(documentId); 656var document = oldSolution.GetDocument(documentId); 696var newDoc = newSolution.GetRequiredDocument(documentId);
Workspace\Workspace_Events.cs (5)
108/// An event that is fired when a <see cref="Document"/> is opened in the editor. 123protected Task RaiseDocumentOpenedEventAsync(Document document) 167/// An event that is fired when a <see cref="Document"/> is closed in the editor. 182protected Task RaiseDocumentClosedEventAsync(Document document) 222protected Task RaiseDocumentActiveContextChangedEventAsync(Document document)
Workspace\WorkspaceChangeEventArgs.cs (1)
52/// The id of the affected <see cref="Document"/>. Can be <see langword="null"/> if this is an change unrelated
Microsoft.CodeAnalysis.Workspaces.MSBuild (2)
MSBuild\MSBuildWorkspace.cs (2)
387var document = this.CurrentSolution.GetDocument(documentId); 513var document = this.CurrentSolution.GetDocument(documentId);
Microsoft.CodeAnalysis.Workspaces.MSBuild.UnitTests (43)
NetCoreTests.cs (6)
90var document = project.Documents.First(d => d.Name == "Program.cs"); 115var document = libraryProject.Documents.First(d => d.Name == "Class1.cs"); 155var document = project.Documents.First(d => d.Name == "Program.cs"); 215var document = project.Documents.First(d => d.Name == "Program.cs"); 322Document document; 506var document = project.Documents.First(d => d.Name == "Program.vb");
VisualStudioMSBuildWorkspaceTests.cs (37)
60var document = project.Documents.First(); 338var d1 = p1.Documents.First(); 343var newDoc = d1.WithSyntaxRoot(newRoot); 393var document = project.Documents.First(); 399var document1 = solution1.GetDocument(document.Id); 412var document2 = solution2.GetDocument(document.Id); 436var document = project.Documents.First(); 457var document = project.Documents.First(); 475var document = project.Documents.First(); 894var document = project.Documents.First(); 913var document = project.Documents.First(); 955var doc = solution.Projects.First().Documents.First(d => d.FilePath == sourceFile); 989var doc = solution.Projects.First().Documents.First(d => d.FilePath == sourceFile); 1993var fooDoc = documents.Single(d => d.Name == "Foo.cs"); 2022var document2 = documents.Single(d => d.Name == "Bar.cs"); 2041var documentB = documentsB.Single(d => d.Name == "Bar.cs"); 2054var document = project.Documents.Single(d => d.Name == "CSharpClass.cs"); 2065var document2 = documents.Single(d => d.Name == "CSharpClass.cs"); 2088var document = project.Documents.Single(d => d.Name == "CSharpClass.cs"); 2115var document = documents.Single(d => d.Name.Contains("CSharpClass")); 2124var document2 = solution2.GetDocument(document.Id); 2177var document2 = solution2.GetDocument(newDocId); 2238var doc = workspace.CurrentSolution.Projects.First().Documents.First(); 2268var doc = workspace.CurrentSolution.Projects.First().Documents.First(); 2370var document = project.Documents.Single(d => d.Name == "CSharpClass.cs"); 2390var doc = proj.Documents.First(); 2793var document = project.Documents.First(d => d.Name == "class1.cs"); 2812var document = project.Documents.First(d => d.Name == "class1.cs"); 2831var document = project.Documents.First(d => d.Name == "class1.cs"); 2880var document = project.Documents.First(d => d.Name == "class1.cs"); 2884var doc2 = document.WithSyntaxRoot(gen.CompilationUnit()); // empty CU 2897var doc3 = document.WithSyntaxRoot(gen.CompilationUnit()); // empty CU 2906var noEncodingDoc = document.WithText(SourceText.From(text.ToString(), encoding: null)); 3307var document = project.Documents.First(d => d.Name == "class1.cs"); 3326var document = project.Documents.Single(d => d.Name == "MyClass.cs"); 3339var linkedDocument = project.Documents.Single(d => d.Name == "Foo.cs"); 3352var linkedDocument = project.Documents.Single(d => d.Name == "MyClass.cs");
Microsoft.CodeAnalysis.Workspaces.Test.Utilities (6)
Formatting\FormattingTestBase.cs (1)
49var document = project.AddDocument("Document", SourceText.From(code));
SolutionUtilities.cs (2)
39public static Document GetSingleChangedDocument(Solution oldSolution, Solution newSolution) 67public static Document GetSingleAddedDocument(Solution oldSolution, Solution newSolution)
TestDocumentServiceProvider.cs (3)
66Document oldDocument, 67Document newDocument, 73public Task<ImmutableArray<MappedSpanResult>> MapSpansAsync(Document document, IEnumerable<TextSpan> spans, CancellationToken cancellationToken)
Microsoft.CodeAnalysis.Workspaces.UnitTests (212)
BatchFixAllProviderTests.cs (2)
122private static async Task<Document> CreateChangedDocument(Document document, TextSpan sourceSpan, int replacement, CancellationToken cancellationToken)
CodeCleanup\AddMissingTokensTests.cs (2)
2718var document = CreateDocument(codeWithoutMarker, LanguageNames.VisualBasic); 2726private static Document CreateDocument(string code, string language)
CodeCleanup\CodeCleanupTests.cs (16)
32var document = CreateDocument("class C { }", LanguageNames.CSharp); 40var document = CreateDocument("class C { }", LanguageNames.CSharp); 49var document = CreateDocument("class C { }", LanguageNames.CSharp); 58var document = CreateDocument("class C { }", LanguageNames.CSharp); 68var document = CreateDocument("class C { }", LanguageNames.CSharp); 82var document = CreateDocument(@"Class C 91var document = CreateDocument(@"Class C 101var document = CreateDocument(@"Class C 111var document = CreateDocument(@"Class C 122var document = CreateDocument(@"Class C 133var document = CreateDocument("class C { }", LanguageNames.CSharp); 145var document = CreateDocument(@"Class C 299var document = CreateDocument(code, LanguageNames.VisualBasic); 307var newDocument = CreateDocument(code, LanguageNames.VisualBasic); 399var document = CreateDocument(code, language); 414private static Document CreateDocument(string code, string language)
CodeCleanup\Extensions.cs (1)
26public static T GetMember<T>(this Document document, int index) where T : SyntaxNode
CodeCleanup\FixIncorrectTokenTests.cs (2)
743var document = CreateDocument(codeWithoutMarker, LanguageNames.VisualBasic); 751private static Document CreateDocument(string code, string language)
CodeCleanup\MockCodeCleanupProvider.cs (4)
23public Func<MockCodeCleanupProvider, Document, ImmutableArray<TextSpan>, SyntaxFormattingOptions, CancellationToken, Task<Document>>? CleanupDocumentAsyncImpl { get; set; } 28public Task<Document> CleanupAsync(Document document, ImmutableArray<TextSpan> spans, CodeCleanupOptions options, CancellationToken cancellationToken)
CodeCleanup\NormalizeModifiersOrOperatorsTests.cs (2)
1019var document = CreateDocument(codeWithoutMarker, LanguageNames.VisualBasic); 1027private static Document CreateDocument(string code, string language)
CodeCleanup\ReduceTokenTests.cs (2)
2006var document = CreateDocument(codeWithoutMarker, LanguageNames.VisualBasic); 2014private static Document CreateDocument(string code, string language)
CodeCleanup\RemoveUnnecessaryLineContinuationTests.cs (2)
1441var document = CreateDocument(codeWithoutMarker, LanguageNames.VisualBasic, langVersion); 1450private static Document CreateDocument(string code, string language, LanguageVersion langVersion)
CommandLineProject\CommandLineProjectWorkspaceTests.cs (3)
38var gooDoc = project.Documents.First(d => d.Name == "CSharpClass.cs"); 66var gooDoc = project.Documents.First(d => d.Name == "goo.cs"); 70var barDoc = project.Documents.First(d => d.Name == "bar.cs");
Formatter\FormatterTests.cs (7)
41public Task<Document> FormatAsync(Document document, IEnumerable<TextSpan>? spans, LineFormattingOptions lineFormattingOptions, SyntaxFormattingOptions? syntaxFormattingOptions, CancellationToken cancellationToken) 52var document = workspace.AddDocument(project.Id, "File.dummy", SourceText.From("dummy")); 55var formattedDocument = await Formatter.FormatAsync(document, spans: null, options: null, CancellationToken.None); 70var document = workspace.AddDocument(project.Id, "File.dummy", SourceText.From("dummy")); 115var csDocument = workspace.AddDocument(csProject.Id, "File.cs", SourceText.From("class C { }")); 116var vbDocument = workspace.AddDocument(vbProject.Id, "File.vb", SourceText.From("Class C : End Class"));
GeneratedCodeRecognitionTests.cs (1)
85var document = project.AddDocument(fileName, "", filePath: $"z:\\{fileName}");
SemanticModelReuse\SemanticModelReuseTests.cs (46)
23private static Document CreateDocument(string code, string language) 38var document = CreateDocument("", LanguageNames.CSharp); 49var document = CreateDocument(source, LanguageNames.CSharp); 63var document = CreateDocument(source, LanguageNames.CSharp); 84var document1 = CreateDocument(source, LanguageNames.CSharp); 90var document2 = document1.WithText(SourceText.From("class C { void M() { return null; } }")); 101var document1 = CreateDocument(source, LanguageNames.CSharp); 107var document2 = document1.WithText(SourceText.From("class C { long M() { return; } }")); 113var document3 = document2.WithText(SourceText.From("class C { long M() { return 0; } }")); 124var document1 = CreateDocument(source, LanguageNames.CSharp); 130var document2 = document1.WithText(SourceText.From("class C { void M() { return 0; } }")); 136var document3 = document1.WithText(SourceText.From("class C { void M() { return 1; } }")); 147var document1 = CreateDocument(source, LanguageNames.CSharp); 153var document2 = document1.WithText(SourceText.From("class C { int M { get { return 1; } } }")); 159var document3 = document1.WithText(SourceText.From("class C { int M { get { return 2; } } }")); 170var document1 = CreateDocument(source, LanguageNames.CSharp); 176var document2 = document1.WithText(SourceText.From("class C { event System.Action E { add { return 1; } } }")); 182var document3 = document1.WithText(SourceText.From("class C { event System.Action E { add { return 2; } } }")); 193var document1 = CreateDocument(source, LanguageNames.CSharp); 199var document2 = document1.WithText(SourceText.From("class C { int this[int i] { get { return 1; } } }")); 205var document3 = document1.WithText(SourceText.From("class C { int this[int i] { get { return 2; } } }")); 217var document1 = CreateDocument(source, LanguageNames.CSharp); 223var document2 = document1.WithText(SourceText.From("class C { void M() { return null; } }")); 246var document1 = CreateDocument(source1, LanguageNames.CSharp); 250var document2 = document1.WithText(SourceText.From(source2)); 267var document = CreateDocument("", LanguageNames.VisualBasic); 283var document = CreateDocument(source, LanguageNames.VisualBasic); 302var document = CreateDocument(source, LanguageNames.VisualBasic); 328var document1 = CreateDocument(source, LanguageNames.VisualBasic); 334var document2 = document1.WithText(SourceText.From(@" 355var document1 = CreateDocument(source1, LanguageNames.VisualBasic); 367var document2 = document1.WithText(SourceText.From(source2)); 373var document3 = document2.WithText(SourceText.From(@" 394var document1 = CreateDocument(source, LanguageNames.VisualBasic); 400var document2 = document1.WithText(SourceText.From(@" 411var document3 = document1.WithText(SourceText.From(@" 434var document1 = CreateDocument(source, LanguageNames.VisualBasic); 440var document2 = document1.WithText(SourceText.From(@" 453var document3 = document1.WithText(SourceText.From(@" 478var document1 = CreateDocument(source, LanguageNames.VisualBasic); 484var document2 = document1.WithText(SourceText.From(@" 497var document3 = document1.WithText(SourceText.From(@" 521var document1 = CreateDocument(source, LanguageNames.VisualBasic); 527var document2 = document1.WithText(SourceText.From(@" 552var document1 = CreateDocument(source, LanguageNames.VisualBasic); 558var document2 = document1.WithText(SourceText.From(@"
Simplifier\SimplifierTests.cs (4)
25private static Document GetDocument() 60var document = GetDocument(); 78var csDocument = workspace.AddDocument(csProject.Id, "File.cs", SourceText.From("class C { }")); 79var vbDocument = workspace.AddDocument(vbProject.Id, "File.vb", SourceText.From("Class C : End Class"));
SolutionTests\ProjectSemanticVersionTests.cs (16)
41var document = AddEmptyProject(workspace.CurrentSolution) 55var document = AddEmptyProject(workspace.CurrentSolution) 69var document = AddEmptyProject(workspace.CurrentSolution) 83var document = AddEmptyProject(workspace.CurrentSolution) 97var document = AddEmptyProject(workspace.CurrentSolution) 111var document = AddEmptyProject(workspace.CurrentSolution) 125var document = AddEmptyProject(workspace.CurrentSolution) 139var document = AddEmptyProject(workspace.CurrentSolution) 153var document = AddEmptyProject(workspace.CurrentSolution, LanguageNames.VisualBasic) 167var document = AddEmptyProject(workspace.CurrentSolution, LanguageNames.VisualBasic) 181var document = AddEmptyProject(workspace.CurrentSolution, LanguageNames.VisualBasic) 195var document = AddEmptyProject(workspace.CurrentSolution, LanguageNames.VisualBasic) 209var document = AddEmptyProject(workspace.CurrentSolution, LanguageNames.VisualBasic) 223var document = AddEmptyProject(workspace.CurrentSolution, LanguageNames.VisualBasic) 237var document = AddEmptyProject(workspace.CurrentSolution, LanguageNames.VisualBasic) 251var document = AddEmptyProject(workspace.CurrentSolution, LanguageNames.VisualBasic)
SolutionTests\SolutionTests.cs (55)
1649static async Task Verify(Document document, SourceHashAlgorithm expectedAlgorithm, byte[]? expectedChecksum = null) 2581var document = solution.GetDocument(did); 2598var document2 = solution.GetDocument(did2); 2621var document1 = project.GetDocument(documentInfo1.Id); 2622var document2 = project.GetDocument(documentInfo2.Id); 2647var document1 = project1.GetDocument(documentInfo1.Id); 2648var document2 = project2.GetDocument(documentInfo2.Id); 2880foreach (var doc in docs) 3142var document = sol.GetDocument(did); 3163var document = solution1.GetDocument(documentId); 3186var document = sol.GetDocument(did); 3194var doc2 = sol2.GetDocument(did); 3227var document = sol.GetDocument(did); 3244var documentWithAttribute = document.WithSyntaxRoot(newSyntaxRoot); 3270var oldDocument = solution.GetDocument(documentId); 3278var newDocument = solution.GetDocument(documentId); 3330var doc = sol.GetDocument(did); 3352var doc = sol.GetDocument(did); 3378var doc = sol.GetDocument(did); 3397var doc = sol.GetDocument(did); 3419var doc = sol.GetDocument(did); 3440var doc = sol.GetDocument(did); 3460var doc = sol.GetDocument(did); 3500var doc = sol.GetDocument(did); 3681var doc = sol.GetDocument(did); 3694var doc2 = doc.Project.Solution.WithDocumentSyntaxRoot(doc.Id, newRoot, PreservationMode.PreserveValue).GetDocument(doc.Id); 3775var document = sol.GetDocument(did); 3915var doc = solution.GetDocument(did); 3991var doc = ws.AddDocument(proj.Id, "a.cs", SourceText.From("public class c { }", Encoding.UTF32)); 3998var newDoc = doc.WithSyntaxRoot(newRoot); 4076var documentToFreeze = project.AddDocument("DocumentToFreeze.cs", SourceText.From("")); 4077var frozenDocument = documentToFreeze.WithFrozenPartialSemantics(CancellationToken.None); 4101var documentToFreeze = project.AddDocument("DocumentToFreeze.cs", SourceText.From("")); 4102var frozenDocument = documentToFreeze.WithFrozenPartialSemantics(CancellationToken.None); 4118var frozenDocument2 = frozenDocument.WithFrozenPartialSemantics(CancellationToken.None); 4129var documentToFreezeOriginal = project.AddDocument("DocumentToFreeze.cs", SourceText.From("class DocumentToFreeze { void M() { } }")); 4134var documentToFreezeChanged = solution.GetDocument(documentToFreezeOriginal.Id); 4137var frozenDocument = documentToFreezeChanged.WithFrozenPartialSemantics(CancellationToken.None); 4174var documentToFreezeOriginal = project.AddDocument("DocumentToFreeze.cs", SourceText.From("class DocumentToFreeze { void M() { } }")); 4179var documentToFreezeChanged = solution.GetDocument(documentToFreezeOriginal.Id); 4182var frozenDocument = documentToFreezeChanged.WithFrozenPartialSemantics(CancellationToken.None); 4236var document = workspace.AddDocument(project2.Id, "Test.cs", SourceText.From("")); 4258var frozenDocument = project.Documents.Single().WithFrozenPartialSemantics(CancellationToken.None); 4272var frozenDocument = project.Documents.First().WithFrozenPartialSemantics(CancellationToken.None); 4291var frozenDocument = forkedProject.Documents.Single().WithFrozenPartialSemantics(CancellationToken.None); 4315var frozenDocument = forkedProject.Documents.Single().WithFrozenPartialSemantics(CancellationToken.None); 4335var document = workspace.CurrentSolution.AddProject("TestProject", "TestProject", LanguageNames.CSharp) 4342var frozenDocument = document.WithFrozenPartialSemantics(CancellationToken.None); 4408var document1 = currentSolution.AddProject("TestProject1", "TestProject1", LanguageNames.CSharp) 4412var document2 = currentSolution.AddProject("TestProject2", "TestProject2", LanguageNames.CSharp) 4435var frozenDoc1 = document1.WithFrozenPartialSemantics(CancellationToken.None); 4450var frozenDoc2 = document2.WithFrozenPartialSemantics(CancellationToken.None); 5433var doc = solution.GetDocument(docInfo.Id); 5439var newDoc = doc.Project.Solution.WithDocumentSyntaxRoot(doc.Id, newRoot).GetDocument(doc.Id); 5716var forkedDocument1 = forkedProject1.Documents.Single();
SolutionTests\SolutionWithSourceGeneratorTests.cs (8)
725var documentToFreeze = workspace.CurrentSolution.Projects.Single().Documents.Single(); 737var frozenDocument = documentToFreeze.WithFrozenPartialSemantics(CancellationToken.None); 760var document = project.Documents.Single().WithFrozenPartialSemantics(forceFreeze: true, CancellationToken.None); 789var document = project.Documents.Single().WithFrozenPartialSemantics(CancellationToken.None); 809var originalDocument1 = AddEmptyProject(workspace.CurrentSolution, name: "Project1") 814var originalDocument2 = AddEmptyProject(originalDocument1.Project.Solution, name: "Project2") 887var frozenWithSingleDocument = project.Solution.WithFrozenSourceGeneratedDocument( 934var frozenSolution = project.Solution.WithFrozenSourceGeneratedDocument(
SymbolKeyTests.cs (2)
865var document = workspace.AddDocument(project.Id, "testdocument", sourceText); 912var document = workspace.AddDocument(project.Id, "testdocument", sourceText);
SyntaxNodeTests.cs (1)
91var doc = sol.GetDocument(did);
WorkspaceTests\AdhocWorkspaceTests.cs (20)
60var doc = ws.AddDocument(info); 73var doc = ws.AddDocument(project.Id, name, SourceText.From(source)); 180var doc = proj.Documents.First(); 226var doc = ws.CurrentSolution.GetDocument(docInfo.Id); 333var doc = ws.CurrentSolution.GetDocument(docInfo.Id); 347var newDoc = doc.WithSyntaxRoot(newRoot); 390var frozen = pws.CurrentSolution.GetDocument(docid1).WithFrozenPartialSemantics(CancellationToken.None); 415var originalDoc = ws.AddDocument(projectId, "TestDocument", SourceText.From("")); 419var changedDoc = originalDoc.WithName(newName); 434var appliedDoc = ws.CurrentSolution.GetDocument(originalDoc.Id); 446var originalDoc = ws.AddDocument(projectId, "TestDocument", SourceText.From("")); 467var appliedDoc = ws.CurrentSolution.GetDocument(originalDoc.Id); 482var originalDoc = ws.AddDocument(projectId, "TestDocument", SourceText.From("")); 486var changedDoc = originalDoc.WithFilePath(newPath); 501var appliedDoc = ws.CurrentSolution.GetDocument(originalDoc.Id); 514var originalDoc = ws.AddDocument(projectId, "TestDocument", SourceText.From("")); 517var changedDoc = originalDoc.WithSourceCodeKind(SourceCodeKind.Script); 532var appliedDoc = ws.CurrentSolution.GetDocument(originalDoc.Id); 545var originalDoc = ws.AddDocument(projectId, "TestDocument", SourceText.From("")); 562var appliedDoc = ws.CurrentSolution.GetDocument(originalDoc.Id);
WorkspaceTests\WorkspaceReferenceTests.cs (5)
37var document = ws.AddDocument(info); 77var document = ws.AddDocument(info); 117var document = ws.AddDocument(info); 157var referenceDocument = ws.AddDocument(referenceDocumentInfo); 161var document = ws.AddDocument(info);
WorkspaceTests\WorkspaceTests.cs (11)
25var originalDoc = ws.AddDocument(projectId, "TestDocument", SourceText.From("")); 27var changedDoc = originalDoc.WithText(SourceText.From("new")); 38var originalDoc = ws.AddDocument(projectId, "TestDocument", SourceText.From("")); 42var changedDoc = originalDoc.WithName(newName); 54var originalDoc = ws.AddDocument(projectId, "TestDocument", SourceText.From("")); 73var originalDoc = ws.AddDocument(projectId, "TestDocument", SourceText.From("")); 77var changedDoc = originalDoc.WithFilePath(newPath); 90var originalDoc = ws.AddDocument(projectId, "TestDocument", SourceText.From("")); 93var changedDoc = originalDoc.WithSourceCodeKind(SourceCodeKind.Script); 147public Document AddDocument(ProjectId projectId, string name, SourceText text) 173public Document AddDocument(DocumentInfo documentInfo)
Microsoft.Gen.ComplianceReports.Unit.Tests (6)
test\Generators\Shared\RoslynTestUtils.cs (6)
98public static Document FindDocument(this Project proj, string name) 100foreach (var doc in proj.Documents) 484var doc = proj.GetDocument(d.Location.SourceTree); 538var document = project.GetDocument(documentId); 546private static async Task<Document> RecreateDocumentAsync(Document document)
Microsoft.Gen.ContextualOptions.Unit.Tests (6)
test\Generators\Shared\RoslynTestUtils.cs (6)
98public static Document FindDocument(this Project proj, string name) 100foreach (var doc in proj.Documents) 484var doc = proj.GetDocument(d.Location.SourceTree); 538var document = project.GetDocument(documentId); 546private static async Task<Document> RecreateDocumentAsync(Document document)
Microsoft.Gen.Logging.Unit.Tests (6)
test\Generators\Shared\RoslynTestUtils.cs (6)
98public static Document FindDocument(this Project proj, string name) 100foreach (var doc in proj.Documents) 484var doc = proj.GetDocument(d.Location.SourceTree); 538var document = project.GetDocument(documentId); 546private static async Task<Document> RecreateDocumentAsync(Document document)
Microsoft.Gen.Metrics.Unit.Tests (6)
test\Generators\Shared\RoslynTestUtils.cs (6)
98public static Document FindDocument(this Project proj, string name) 100foreach (var doc in proj.Documents) 484var doc = proj.GetDocument(d.Location.SourceTree); 538var document = project.GetDocument(documentId); 546private static async Task<Document> RecreateDocumentAsync(Document document)
Microsoft.Gen.MetricsReports.Unit.Tests (6)
test\Generators\Shared\RoslynTestUtils.cs (6)
98public static Document FindDocument(this Project proj, string name) 100foreach (var doc in proj.Documents) 484var doc = proj.GetDocument(d.Location.SourceTree); 538var document = project.GetDocument(documentId); 546private static async Task<Document> RecreateDocumentAsync(Document document)
Microsoft.Interop.ComInterfaceGenerator (2)
Analyzers\AddMarshalAsToElementFixer.cs (1)
25Document doc = context.Document;
src\libraries\System.Runtime.InteropServices\gen\Common\ConvertToSourceGeneratedInteropFixer.cs (1)
120Document doc = context.Document;
Microsoft.Interop.LibraryImportGenerator (8)
Analyzers\AddDisableRuntimeMarshallingAttributeFixer.cs (2)
54Document? assemblyInfo = 70static bool IsPropertiesAssemblyInfo(Document document)
Analyzers\ConvertToLibraryImportFixer.cs (2)
273Document? document = editor.OriginalDocument; 629private static bool ShouldUseCollectionExpression(Document document, SyntaxTree syntaxTree)
Analyzers\CustomMarshallerAttributeFixer.cs (3)
36Document doc = fixAllContext.Solution.GetDocument(diagnostic.Location.SourceTree); 111Document doc = context.Document; 154private static async Task<Solution> AddMissingMembers(Document doc, SyntaxNode node, HashSet<string> missingMemberNames, CancellationToken ct)
src\libraries\System.Runtime.InteropServices\gen\Common\ConvertToSourceGeneratedInteropFixer.cs (1)
120Document doc = context.Document;
Microsoft.ML.InternalCodeAnalyzer (5)
ContractsCheckNameofFixProvider.cs (4)
167private async Task<Document> StringReplaceAsync(Document document, string name, ArgumentSyntax nameArg, CancellationToken cancellationToken) 176private async Task<Document> ExpressionReplaceAsync(Document document, SyntaxNode exp, ArgumentSyntax nameArg, CancellationToken cancellationToken)
NameFixProvider.cs (1)
102private async Task<Solution> RenameAsync(Document document,
Microsoft.VisualStudio.LanguageServices (184)
CallHierarchy\CallHierarchyCommandHandler.cs (1)
73Document document;
CallHierarchy\CallHierarchyDetail.cs (1)
70var document = solution.GetDocument(_documentId);
CallHierarchy\CallHierarchyItem.cs (1)
164internal void StartSearchWithDocuments(string categoryName, CallHierarchySearchScope searchScope, ICallHierarchySearchCallback callback, IImmutableSet<Document> documents)
CallHierarchy\Finders\AbstractCallFinder.cs (9)
31internal IImmutableSet<Document> Documents; 46internal void SetDocuments(IImmutableSet<Document> documents) 116private static IImmutableSet<Document> IncludeDocuments(CallHierarchySearchScope scope, Project project) 129return ImmutableHashSet.CreateRange<Document>(currentProject.Documents); 134var currentDocument = project.Solution.GetDocument(activeDocument); 137return ImmutableHashSet.Create<Document>(currentDocument); 141return ImmutableHashSet<Document>.Empty; 148protected virtual async Task SearchWorkerAsync(ISymbol symbol, Project project, ICallHierarchySearchCallback callback, IImmutableSet<Document> documents, CancellationToken cancellationToken) 180protected abstract Task<IEnumerable<SymbolCallerInfo>> GetCallersAsync(ISymbol symbol, Project project, IImmutableSet<Document> documents, CancellationToken cancellationToken);
CallHierarchy\Finders\BaseMemberFinder.cs (1)
29protected override async Task<IEnumerable<SymbolCallerInfo>> GetCallersAsync(ISymbol symbol, Project project, IImmutableSet<Document> documents, CancellationToken cancellationToken)
CallHierarchy\Finders\CallToOverrideFinder.cs (1)
25protected override async Task<IEnumerable<SymbolCallerInfo>> GetCallersAsync(ISymbol symbol, Project project, IImmutableSet<Document> documents, CancellationToken cancellationToken)
CallHierarchy\Finders\FieldReferenceFinder.cs (1)
32protected override async Task<IEnumerable<SymbolCallerInfo>> GetCallersAsync(ISymbol symbol, Project project, IImmutableSet<Document> documents, CancellationToken cancellationToken)
CallHierarchy\Finders\ImplementerFinder.cs (2)
35protected override Task<IEnumerable<SymbolCallerInfo>> GetCallersAsync(ISymbol symbol, Project project, IImmutableSet<Document> documents, CancellationToken cancellationToken) 38protected override async Task SearchWorkerAsync(ISymbol symbol, Project project, ICallHierarchySearchCallback callback, IImmutableSet<Document> documents, CancellationToken cancellationToken)
CallHierarchy\Finders\InterfaceImplementationCallFinder.cs (1)
32protected override async Task<IEnumerable<SymbolCallerInfo>> GetCallersAsync(ISymbol symbol, Project project, IImmutableSet<Document> documents, CancellationToken cancellationToken)
CallHierarchy\Finders\MethodCallFinder.cs (1)
35protected override async Task<IEnumerable<SymbolCallerInfo>> GetCallersAsync(ISymbol symbol, Project project, IImmutableSet<Document> documents, CancellationToken cancellationToken)
CallHierarchy\Finders\OverridingMemberFinder.cs (2)
31protected override Task<IEnumerable<SymbolCallerInfo>> GetCallersAsync(ISymbol symbol, Project project, IImmutableSet<Document> documents, CancellationToken cancellationToken) 34protected override async Task SearchWorkerAsync(ISymbol symbol, Project project, ICallHierarchySearchCallback callback, IImmutableSet<Document> documents, CancellationToken cancellationToken)
CodeCleanup\AbstractCodeCleanUpFixer.cs (4)
147var document = buffer.CurrentSnapshot.GetOpenDocumentInCurrentContextWithChanges(); 160var document = buffer.CurrentSnapshot.GetOpenDocumentInCurrentContextWithChanges(); 237private static async Task<Document> FixDocumentAsync( 238Document document,
CodeLens\CodeLensCallbackListener.cs (4)
149var document = await GetDocumentAsync(solution, descriptor.ProjectGuid, descriptor.FilePath, descriptorContext).ConfigureAwait(false); 206private Task<Document?> GetDocumentAsync(Solution solution, Guid projectGuid, string filePath, CodeLensDescriptorContext descriptorContext) 210return SpecializedTasks.Default<Document>(); 232return SpecializedTasks.Default<Document>();
DebuggerIntelliSense\AbstractDebuggerIntelliSenseContext.cs (3)
97protected abstract int GetAdjustedContextPoint(int contextPoint, Document document); 99protected abstract ITrackingSpan GetPreviousStatementBufferAndSpan(int lastTokenEndPoint, Document document); 125var document = ContextBuffer.CurrentSnapshot.GetOpenDocumentInCurrentContextWithChanges();
Extensions\DocumentExtensions.cs (1)
19public static IList<Tuple<TextSpan, uint>> GetVisibleCodeBlocks(this Document document, CancellationToken cancellationToken)
Extensions\VisualStudioWorkspaceImplExtensions.cs (1)
70var document = workspace.CurrentSolution.GetDocument(id);
ExtractClass\VisualStudioExtractClassOptionsService.cs (1)
42Document document,
F1Help\AbstractHelpContextService.cs (1)
46public abstract Task<string> GetHelpTermAsync(Document document, TextSpan textSpan, CancellationToken cancellationToken);
F1Help\IHelpContextService.cs (1)
18Task<string> GetHelpTermAsync(Document document, TextSpan textSpan, CancellationToken cancellationToken);
FindReferences\Contexts\AbstractTableDataSourceFindUsagesContext.cs (2)
438var document = documentSpan.Document; 470var document = documentSpan.Document;
FindReferences\Entries\AbstractDocumentSpanEntry.cs (1)
42protected abstract Document Document { get; }
FindReferences\Entries\DefinitionItemEntry.cs (1)
32protected override Document Document
FindReferences\Entries\DocumentSpanEntry.cs (2)
65protected override Document Document 179private DisposableToolTip CreateDisposableToolTip(Document document, TextSpan sourceSpan)
FindReferences\StreamingFindUsagesPresenter.cs (1)
272private static (Guid, string projectName) GetGuidAndProjectName(Document document)
GenerateType\GenerateTypeDialogViewModel.cs (7)
26private readonly Document _document; 567private Document _selectedDocument; 568public Document SelectedDocument 713Document document, 803public Document Document { get; } 807public DocumentSelectItem(Document document, string documentName) 813public DocumentSelectItem(Document document)
GenerateType\VisualStudioGenerateTypeOptionsServiceFactory.cs (1)
40Document document,
Implementation\AbstractVsTextViewFilter.cs (2)
100var document = textSnapshot.GetOpenDocumentInCurrentContextWithChanges(); 187var document = subjectBuffer.CurrentSnapshot.GetOpenDocumentInCurrentContextWithChanges();
Implementation\VisualStudioSupportsFeatureService.cs (5)
90public bool SupportsCodeFixes(Document document) 93public bool SupportsRefactorings(Document document) 96public bool SupportsRename(Document document) 99public bool SupportsSemanticSnippets(Document document) 102public bool SupportsNavigationToAnyPosition(Document document)
Implementation\VsRefactorNotifyService.cs (1)
191var document = visualStudioWorkspace.CurrentSolution.GetDocument(documentId);
InheritanceMargin\InheritanceMarginTaggerProvider.cs (2)
52var document = textView.TextBuffer.CurrentSnapshot.GetOpenDocumentInCurrentContextWithChanges(); 75var document = spanToTag.Document;
InheritanceMargin\InheritanceMarginViewMarginProvider.cs (1)
75var document = wpfTextViewHost.TextView.TextBuffer.CurrentSnapshot.GetOpenDocumentInCurrentContextWithChanges();
Interactive\VsResetInteractive.cs (1)
307var document = interactiveWindow.CurrentLanguageBuffer.CurrentSnapshot.GetOpenDocumentInCurrentContextWithChanges();
LanguageService\AbstractLanguageService`2.cs (1)
158var openDocument = wpfTextView.TextBuffer.AsTextContainer().GetRelatedDocuments().FirstOrDefault();
LanguageService\AbstractLanguageService`2.IVsLanguageBlock.cs (1)
73var document = snapshot.GetOpenDocumentInCurrentContextWithChanges();
LanguageService\AbstractLanguageService`2.IVsLanguageContextProvider.cs (1)
26var document = textBuffer.CurrentSnapshot.GetOpenDocumentInCurrentContextWithChanges();
LanguageService\AbstractLanguageService`2.IVsLanguageTextOps.cs (1)
50var document = textBuffer.CurrentSnapshot.GetOpenDocumentInCurrentContextWithChanges();
LanguageService\AbstractLanguageService`2.VsLanguageDebugInfo.cs (3)
105var document = point.Snapshot.GetOpenDocumentInCurrentContextWithChanges(); 148var document = snapshot.GetOpenDocumentInCurrentContextWithChanges(); 219var document = breakpoint.Document;
Library\ObjectBrowser\AbstractObjectBrowserLibraryManager.cs (4)
85var oldDocument = e.OldSolution.GetDocument(e.DocumentId); 86var newDocument = e.NewSolution.GetDocument(e.DocumentId); 108private void UpdateDocument(Document oldDocument, Document newDocument)
MoveStaticMembers\VisualStudioMoveStaticMembersOptionsService.cs (3)
41public MoveStaticMembersOptions GetMoveMembersToTypeOptions(Document document, INamedTypeSymbol selectedType, ImmutableArray<ISymbol> selectedNodeSymbols) 88Document document, 162Document currentDocument,
NavigateTo\VisualStudioNavigateToPreviewService.cs (1)
29public bool CanPreview(Document document)
Preview\PreviewEngine.cs (2)
174if (left is Document leftDocument) 178else if (right is Document rightDocument)
Preview\TopLevelChange.cs (3)
85if (oldTextDocument is Document oldDocument) 89var oldLinkedDocument = oldDocument.Project.Solution.GetDocument(linkedDocumentId); 98else if (updatedTextDocument is Document updatedDocument)
Progression\GraphBuilder.cs (7)
37private readonly Dictionary<GraphNode, Document> _nodeToContextDocumentMap = []; 83Document? document = null; 142var document = project.GetDocument(documentId); 166public Document GetContextDocument(GraphNode node, CancellationToken cancellationToken) 170_nodeToContextDocumentMap.TryGetValue(node, out var document); 196ISymbol symbol, Project contextProject, Document contextDocument, CancellationToken cancellationToken) 688public GraphNode? TryAddNodeForDocument(Document document, CancellationToken cancellationToken)
Progression\GraphNodeIdCreation.cs (2)
28public static GraphNodeId GetIdForDocument(Document document) 534var document = solution.GetDocument(currentNode.SyntaxTree);
Progression\GraphQueries\ContainsChildrenGraphQuery.cs (1)
36var document = graphBuilder.GetContextDocument(node, cancellationToken);
Progression\GraphQueries\ContainsGraphQuery.cs (1)
46var document = graphBuilder.GetContextDocument(node, cancellationToken);
Progression\SymbolContainment.cs (2)
19public static async Task<IEnumerable<SyntaxNode>> GetContainedSyntaxNodesAsync(Document document, CancellationToken cancellationToken) 30public static async Task<ImmutableArray<ISymbol>> GetContainedSymbolsAsync(Document document, CancellationToken cancellationToken)
ProjectSystem\VisualStudioWorkspaceImpl.cs (3)
336var document = newSolution.GetDocument(documentId) ?? currentSolution.GetDocument(documentId); 681bool ShouldApplyChangesToMappedDocuments(CodeAnalysis.Document document, [NotNullWhen(true)] out ISpanMappingService? spanMappingService) 1280private static void FailIfDocumentInfoChangesNotSupported(CodeAnalysis.Document document, DocumentInfo updatedInfo)
PullMemberUp\VisualStudioPullMemberUpService.cs (1)
40public PullMembersUpOptions GetPullMemberUpOptions(Document document, ImmutableArray<ISymbol> selectedMembers)
Snippets\AbstractSnippetCommandHandler.cs (3)
46protected ISnippetExpansionClientFactory GetSnippetExpansionClientFactory(Document document) 49protected abstract bool IsSnippetExpansionContext(Document document, int startPosition, CancellationToken cancellationToken); 256var document = subjectBuffer.CurrentSnapshot.GetOpenDocumentInCurrentContextWithChanges();
Snippets\AbstractSnippetExpansionLanguageHelper.cs (3)
33public abstract Task<Document> AddImportsAsync(Document document, AddImportPlacementOptions addImportOptions, SyntaxFormattingOptions formattingOptions, int position, XElement snippetNode, CancellationToken cancellationToken); 52protected static bool TryAddImportsToContainedDocument(Document document, IEnumerable<string> memberImportsNamespaces)
Snippets\ISnippetExpansionClientFactory.cs (1)
15SnippetExpansionClient GetOrCreateSnippetExpansionClient(Document document, ITextView textView, ITextBuffer subjectBuffer);
Snippets\ISnippetExpansionLanguageHelper.cs (2)
27Task<Document> AddImportsAsync(Document document, AddImportPlacementOptions addImportOptions, SyntaxFormattingOptions formattingOptions, int position, XElement snippetNode, CancellationToken cancellationToken);
Snippets\SnippetExpansionClient.cs (5)
535var document = SubjectBuffer.CurrentSnapshot.GetOpenDocumentInCurrentContextWithChanges(); 736var document = SubjectBuffer.CurrentSnapshot.GetOpenDocumentInCurrentContextWithChanges(); 761Document document, 784Document document, 1062var documentWithImports = SubjectBuffer.CurrentSnapshot.GetOpenDocumentInCurrentContextWithChanges();
Snippets\SnippetExpansionClientFactory.cs (2)
53public SnippetExpansionClient GetOrCreateSnippetExpansionClient(Document document, ITextView textView, ITextBuffer subjectBuffer) 66protected virtual SnippetExpansionClient CreateSnippetExpansionClient(Document document, ITextView textView, ITextBuffer subjectBuffer)
Snippets\SnippetFunctions\AbstractSnippetFunction.cs (1)
29protected Document? GetDocument(CancellationToken cancellationToken)
Snippets\SnippetFunctions\SnippetFunctionClassName.cs (1)
31var document = GetDocument(cancellationToken);
Snippets\SnippetFunctions\SnippetFunctionGenerateSwitchCases.cs (1)
44var document = GetDocument(cancellationToken);
Snippets\SnippetFunctions\SnippetFunctionSimpleTypeName.cs (1)
38var document = GetDocument(cancellationToken);
StackTraceExplorer\StackFrameViewModel.cs (2)
39private Document? _cachedDocument; 211private (Document? document, int lineNumber) GetDocumentAndLine()
TableDataSource\Suppression\VisualStudioDiagnosticListSuppressionStateService.cs (5)
196Dictionary<Project, ImmutableDictionary<string, Document>>? filePathToDocumentMap = null; 237Document? document = null; 300private static async Task<ImmutableDictionary<string, Document>> GetFilePathToDocumentMapAsync(Project project, CancellationToken cancellationToken) 302var builder = ImmutableDictionary.CreateBuilder<string, Document>(); 303foreach (var document in project.Documents)
TableDataSource\Suppression\VisualStudioSuppressionFixService.cs (9)
408private static ImmutableDictionary<Document, ImmutableArray<Diagnostic>> GetDocumentDiagnosticsMappedToNewSolution(ImmutableDictionary<Document, ImmutableArray<Diagnostic>> documentDiagnosticsToFixMap, Solution newSolution, string language) 410ImmutableDictionary<Document, ImmutableArray<Diagnostic>>.Builder? builder = null; 416var document = newSolution.GetDocument(oldDocument.Id); 419builder ??= ImmutableDictionary.CreateBuilder<Document, ImmutableArray<Diagnostic>>(); 424return builder != null ? builder.ToImmutable() : ImmutableDictionary<Document, ImmutableArray<Diagnostic>>.Empty; 452private async Task<ImmutableDictionary<Document, ImmutableArray<Diagnostic>>> GetDocumentDiagnosticsToFixAsync(IEnumerable<DiagnosticData> diagnosticsToFix, Func<Project, bool> shouldFixInProject, bool filterStaleDiagnostics, CancellationToken cancellationToken) 470return ImmutableDictionary<Document, ImmutableArray<Diagnostic>>.Empty; 473var finalBuilder = ImmutableDictionary.CreateBuilder<Document, ImmutableArray<Diagnostic>>();
TaskList\ProjectExternalErrorReporter.cs (1)
318if (workspace.CurrentSolution.GetDocument(documentId) is Document document &&
Utilities\IVsEditorAdaptersFactoryServiceExtensions.cs (1)
30var document = workspace.CurrentSolution.GetDocument(contextDocumentId);
ValueTracking\ValueTrackingCommandHandler.cs (1)
115private async Task ShowToolWindowAsync(ITextView textView, Document document, ImmutableArray<ValueTrackedItem> items, CancellationToken cancellationToken)
Venus\ContainedDocument.cs (5)
184foreach (var document in _workspace.CurrentSolution.GetProject(_project.Id).Documents) 195public uint FindItemIdOfDocument(Document document) 242var originalDocument = _workspace.CurrentSolution.GetDocument(this.Id); 763var document = _workspace.CurrentSolution.GetDocument(this.Id); 794Document document, ITextEdit edit, TextSpan visibleSpan, AbstractFormattingRule baseIndentationRule, SyntaxFormattingOptions options)
Venus\ContainedDocument.DocumentServiceProvider.cs (5)
73Document oldDocument, 74Document newDocument, 84Document document, 135public async Task<ExcerptResult?> TryExcerptAsync(Document document, TextSpan span, ExcerptMode mode, ClassificationOptions classificationOptions, CancellationToken cancellationToken) 174Document document, ITextSnapshot roslynSnapshot, SnapshotSpan contentSpanOnPrimarySnapshot, ClassificationOptions options, CancellationToken cancellationToken)
Venus\ContainedLanguage.IVsContainedCode.cs (1)
50var document = snapshot.GetOpenDocumentInCurrentContextWithChanges();
Venus\ContainedLanguage.IVsContainedLanguageCodeSupport.cs (5)
49var thisDocument = GetThisDocument(); 51var targetDocument = thisDocument.Project.Solution.GetDocument(targetDocumentId); 157if (ContainedLanguageCodeSupport.TryGetMemberNavigationPoint(GetThisDocument(), pszClassName, pszUniqueMemberID, out textSpan, out var targetDocument, c.UserCancellationToken)) 221protected Document GetThisDocument() 223var document = this.ContainedDocument.GetOpenTextContainer().CurrentText.GetOpenDocumentInCurrentContextWithChanges();
Venus\ContainedLanguageCodeSupport.cs (14)
38public static bool IsValidId(Document document, string identifier) 44public static bool TryGetBaseClassName(Document document, string className, CancellationToken cancellationToken, out string baseClassName) 58Document document, string className, string objectName, string nameOfEvent, CancellationToken cancellationToken) 88Document document, string className, string objectTypeName, string nameOfEvent, CancellationToken cancellationToken) 113public static string GetEventHandlerMemberId(Document document, string className, string objectTypeName, string nameOfEvent, string eventHandlerName, CancellationToken cancellationToken) 145Document thisDocument, 146Document targetDocument, 251Document thisDocument, 255out Document targetDocument, 273var memberNodeDocument = thisDocument.Project.Solution.GetDocument(memberNode.SyntaxTree); 292Document document, string className, CODEMEMBERTYPE codeMemberType, CancellationToken cancellationToken) 313Document document, 412Document document, ContainedLanguageRenameType renameType, string fullyQualifiedName, CancellationToken cancellationToken) 479Document document, string objectTypeName, string nameOfEvent, INamedTypeSymbol type, CancellationToken cancellationToken)
Workspace\GlobalUndoServiceFactory.WorkspaceGlobalUndoTransaction.cs (1)
65var document = solution.GetDocument(id);
Workspace\VisualStudioDocumentNavigationService.cs (10)
127static async Task<TextSpan> GetTextSpanFromPositionAsync(Document document, int position, int virtualSpace, CancellationToken cancellationToken) 159Func<Document, Task<TextSpan>> getTextSpanForMappingAsync, 183Func<Document, Task<TextSpan>> getTextSpanForMappingAsync, 192var document = solution.GetDocument(documentId); 300Workspace workspace, Document generatedDocument, MappedSpanResult mappedSpanResult, CancellationToken cancellationToken) 323ISpanMappingService spanMappingService, Document generatedDocument, TextSpan textSpan, CancellationToken cancellationToken) 338/// inside the bounds of the associated <see cref="Document"/>. This method returns a 339/// position that is guaranteed to be inside the <see cref="Document"/> bounds. If the 370/// that is not inside the bounds of the associated <see cref="Document"/>. This method 371/// returns a span that is guaranteed to be inside the <see cref="Document"/> bounds. If
Workspace\VisualStudioSymbolNavigationService.cs (3)
66var targetDocument = solution.GetDocument(sourceLocation.SourceTree); 254using var _ = ArrayBuilder<Document>.GetInstance(out var documentsBuilder); 280private bool TryGetVsHierarchyAndItemId(Document document, [NotNullWhen(true)] out IVsHierarchy? hierarchy, out uint itemID)
Microsoft.VisualStudio.LanguageServices.CSharp (27)
CodeModel\CSharpCodeModelService.cs (14)
2748private Document Delete(Document document, VariableDeclaratorSyntax node) 2768private static Document Delete(Document document, EnumMemberDeclarationSyntax node) 2788private static Document Delete(Document document, AttributeSyntax node) 2815private static Document Delete(Document document, AttributeArgumentSyntax node) 2825private static Document Delete(Document document, ParameterSyntax node) 2835private static Document DeleteMember(Document document, SyntaxNode node) 2882public override Document Delete(Document document, SyntaxNode node)
LanguageService\CSharpDebuggerIntelliSenseContext.cs (2)
63protected override int GetAdjustedContextPoint(int contextPoint, Document document) 89protected override ITrackingSpan GetPreviousStatementBufferAndSpan(int contextPoint, Document document)
LanguageService\CSharpHelpContextService.cs (4)
42public override async Task<string> GetHelpTermAsync(Document document, TextSpan span, CancellationToken cancellationToken) 91private string? TryGetText(SyntaxToken token, SemanticModel semanticModel, Document document, CancellationToken cancellationToken) 153SyntaxToken token, SemanticModel semanticModel, Document document, CancellationToken cancellationToken, 216private static bool TryGetTextForOperator(SyntaxToken token, Document document, [NotNullWhen(true)] out string? text)
SemanticSearch\SemanticSearchToolWindowImpl.cs (2)
347var queryDocument = SemanticSearchUtilities.GetQueryDocument(querySolution); 488internal sealed class ResultsObserver(Document queryDocument, IFindUsagesContext presenterContext) : ISemanticSearchResultsObserver
Snippets\CSharpSnippetExpansionLanguageHelper.cs (3)
70public override async Task<Document> AddImportsAsync( 71Document document, 99var newDocument = document.WithSyntaxRoot(newRoot);
Snippets\SnippetCommandHandler.cs (2)
109var document = subjectBuffer.CurrentSnapshot.GetOpenDocumentInCurrentContextWithChanges(); 129protected override bool IsSnippetExpansionContext(Document document, int startPosition, CancellationToken cancellationToken)
Microsoft.VisualStudio.LanguageServices.CSharp.UnitTests (29)
CodeModel\AbstractFileCodeElementTests.cs (1)
56protected Microsoft.CodeAnalysis.Document GetCurrentDocument()
Interactive\Commands\ResetInteractiveTests.cs (1)
52var document = project.Documents.FirstOrDefault(d => d.FilePath == "ResetInteractiveTestsDocument");
PersistentStorage\AbstractPersistentStorageTests.cs (18)
119var document = project.Documents.First(); 238var document = solution.Projects.Single().Documents.Single(); 482var document = solution.Projects.Single().Documents.Single(); 503var document = solution.Projects.Single().Documents.Single(); 524var document = solution.Projects.Single().Documents.Single(); 545var document = solution.Projects.Single().Documents.Single(); 566var document = solution.Projects.Single().Documents.Single(); 590var document = solution.Projects.Single().Documents.Single(); 614var document = solution.Projects.Single().Documents.Single(); 638var document = solution.Projects.Single().Documents.Single(); 662var document = solution.Projects.Single().Documents.Single(); 683var document = solution.Projects.Single().Documents.Single(); 704var document = solution.Projects.Single().Documents.Single(); 725var document = solution.Projects.Single().Documents.Single(); 746var document = solution.Projects.Single().Documents.Single(); 770var document = solution.Projects.Single().Documents.Single(); 794var document = solution.Projects.Single().Documents.Single(); 818var document = solution.Projects.Single().Documents.Single();
ProjectSystemShim\CPS\SourceFileHandlingTests.cs (9)
31IEnumerable<Document> GetCurrentDocuments() => environment.Workspace.CurrentSolution.Projects.Single().Documents; 68IEnumerable<Document> GetCurrentDocuments() => environment.Workspace.CurrentSolution.Projects.Single().Documents; 118IEnumerable<Document> GetCurrentDocuments() => environment.Workspace.CurrentSolution.Projects.Single().Documents; 160IEnumerable<Document> GetCurrentDocuments() => environment.Workspace.CurrentSolution.Projects.Single().Documents; 214IEnumerable<Document> GetCurrentDocuments() => environment.Workspace.CurrentSolution.Projects.Single().Documents; 253IEnumerable<Document> GetCurrentDocuments() => environment.Workspace.CurrentSolution.Projects.Single().Documents; 292IEnumerable<Document> GetCurrentDocuments() => environment.Workspace.CurrentSolution.Projects.Single().Documents; 328IEnumerable<Document> GetCurrentDocuments() => environment.Workspace.CurrentSolution.Projects.Single().Documents; 376IEnumerable<Document> GetCurrentDocuments() => environment.Workspace.CurrentSolution.Projects.Single().Documents;
Microsoft.VisualStudio.LanguageServices.LiveShare (8)
Client\RemoteLanguageServiceWorkspace.cs (7)
215var document = GetOrAddDocument(moniker); 239public Document? GetOrAddDocument(string filePath) 277public Document? GetOrAddExternalDocument(string filePath, string language) 290var document = GetOrAddDocument(location.Uri.LocalPath); 315private Document AddDocumentToProject(string filePath, string language, string projectName) 386var doc = CurrentSolution.GetDocument(documentId); 476var document = CurrentSolution.GetDocument(documentId);
ProjectsHandler.cs (1)
29foreach (var sourceFile in project.Documents)
Microsoft.VisualStudio.LanguageServices.UnitTests (11)
Completion\MockCompletionProvider.vb (1)
26Public Overrides Function GetTextChangeAsync(document As Document, selectedItem As CompletionItem, ch As Char?, cancellationToken As CancellationToken) As Task(Of TextChange?)
Snippets\SnippetTestState.vb (3)
199Protected Overrides Function CreateSnippetExpansionClient(document As Document, textView As ITextView, subjectBuffer As ITextBuffer) As SnippetExpansionClient 253Public Overrides Function AddImportsAsync(document As Document, addImportOptions As AddImportPlacementOptions, formattingOptions As SyntaxFormattingOptions, position As Integer, snippetNode As XElement, cancellationToken As CancellationToken) As Task(Of Document)
Venus\AbstractContainedLanguageCodeSupportTests.vb (1)
57Protected Function GetDocument(workspace As EditorTestWorkspace) As Document
Venus\CSharpContainedLanguageSupportTests.vb (1)
640Dim targetDocument As Document = Nothing
Venus\DocumentService_IntegrationTests.vb (4)
272Public Async Function MapSpansAsync(document As Document, spans As IEnumerable(Of TextSpan), cancellationToken As CancellationToken) As Task(Of ImmutableArray(Of MappedSpanResult)) Implements ISpanMappingService.MapSpansAsync 298Public Function GetMappedTextChangesAsync(oldDocument As Document, newDocument As Document, cancellationToken As CancellationToken) _ 310Public Async Function TryExcerptAsync(document As Document, span As TextSpan, mode As ExcerptMode, classificationOptions As ClassificationOptions, cancellationToken As CancellationToken) As Task(Of ExcerptResult?) Implements IDocumentExcerptService.TryExcerptAsync
Venus\VisualBasicContainedLanguageSupportTests.vb (1)
687Dim targetDocument As Document = Nothing
Microsoft.VisualStudio.LanguageServices.VisualBasic (29)
CodeModel\VisualBasicCodeModelService.vb (18)
1276Private Shared Function DeleteMember(document As Document, node As SyntaxNode) As Document 1306Public Overrides Function Delete(document As Document, node As SyntaxNode) As Document 1323Private Overloads Function Delete(document As Document, node As ModifiedIdentifierSyntax) As Document 1336Private Overloads Function Delete(document As Document, node As VariableDeclaratorSyntax) As Document 1349Private Overloads Shared Function Delete(document As Document, node As AttributeSyntax) As Document 1370Private Overloads Shared Function Delete(document As Document, node As ArgumentSyntax) As Document 1377Private Overloads Shared Function Delete(document As Document, node As ParameterSyntax) As Document 4058Public Overrides Function AddHandlesClause(document As Document, eventName As String, method As SyntaxNode, cancellationToken As CancellationToken) As Document 4086Public Overrides Function RemoveHandlesClause(document As Document, eventName As String, method As SyntaxNode, cancellationToken As CancellationToken) As Document
Help\VisualBasicHelpContextService.vb (1)
39Public Overrides Async Function GetHelpTermAsync(document As Document, span As TextSpan, cancellationToken As CancellationToken) As Task(Of String)
LanguageService\VisualBasicDebuggerIntelliSenseContext.vb (2)
61Protected Overrides Function GetAdjustedContextPoint(contextPoint As Integer, document As Document) As Integer 108Protected Overrides Function GetPreviousStatementBufferAndSpan(contextPoint As Integer, document As Document) As ITrackingSpan
Snippets\SnippetCommandHandler.vb (1)
48Protected Overrides Function IsSnippetExpansionContext(document As Document, startPosition As Integer, cancellationToken As CancellationToken) As Boolean
Snippets\SnippetCompletionProvider.vb (1)
97document As Document,
Snippets\VisualBasicSnippetExpansionLanguageHelper.vb (3)
39document As Document, 44cancellationToken As CancellationToken) As Task(Of Document) 101Private Shared Async Function GetImportsStatementsToAddAsync(document As Document, snippetNode As XElement, importsNode As XElement, cancellationToken As CancellationToken) As Task(Of IList(Of ImportsStatementSyntax))
Venus\ContainedLanguageStaticEventBinding.vb (3)
23Public Function GetStaticEventBindings(document As Document, 56Public Sub AddStaticEventBinding(document As Document, 85Public Sub RemoveStaticEventBinding(document As Document,
Microsoft.VisualStudio.LanguageServices.Xaml (43)
CodeFixes\RemoveUnnecessaryUsings\XamlRemoveUnnecessaryUsingsCodeFixProvider.cs (2)
54private static async Task<Document> RemoveUnnecessaryImportsAsync( 55Document document, CancellationToken cancellationToken)
Diagnostics\Analyzers\IXamlDocumentAnalyzerService.cs (2)
17Task<ImmutableArray<Diagnostic>> AnalyzeSyntaxAsync(Document document, CancellationToken cancellationToken); 19Task<ImmutableArray<Diagnostic>> AnalyzeSemanticsAsync(Document document, CancellationToken cancellationToken);
Diagnostics\Analyzers\XamlDocumentDiagnosticAnalyzer.cs (2)
27public override async Task<ImmutableArray<Diagnostic>> AnalyzeSyntaxAsync(Document document, CancellationToken cancellationToken) 37public override async Task<ImmutableArray<Diagnostic>> AnalyzeSemanticsAsync(Document document, CancellationToken cancellationToken)
Features\DocumentSpan.cs (2)
15public Document Document { get; } 18public DocumentSpan(Document document, TextSpan textSpan) : this()
Features\InlineRename\IXamlRenameInfoService.cs (1)
14Task<IXamlRenameInfo> GetRenameInfoAsync(Document document, int position, CancellationToken cancellationToken);
Features\InlineRename\XamlEditorInlineRenameService.cs (3)
40public async Task<IInlineRenameInfo> GetRenameInfoAsync(Document document, int position, CancellationToken cancellationToken) 49private readonly Document _document; 52public InlineRenameInfo(Document document, IXamlRenameInfo renameInfo)
Features\OrganizeImports\IXamlOrganizeNamespacesService.cs (2)
16Task<Document> OrganizeNamespacesAsync(Document document, bool placeSystemNamespaceFirst, CancellationToken cancellationToken);
Features\OrganizeImports\IXamlRemoveUnnecessaryNamespacesService.cs (2)
16Task<Document> RemoveUnnecessaryNamespacesAsync(Document document, CancellationToken cancellationToken);
Features\OrganizeImports\XamlOrganizeImportsService.cs (2)
30public async Task<Document> OrganizeImportsAsync(Document document, OrganizeImportsOptions options, CancellationToken cancellationToken)
Features\OrganizeImports\XamlRemoveUnnecessaryImportsService.cs (4)
28public Task<Document> RemoveUnnecessaryImportsAsync(Document document, CancellationToken cancellationToken) 31public Task<Document> RemoveUnnecessaryImportsAsync( 32Document document, Func<SyntaxNode, bool>? predicate, CancellationToken cancellationToken)
Implementation\LanguageServer\Extensions\SymbolExtensions.cs (1)
42var codeDocument = codeProject.Documents.FirstOrDefault();
Implementation\LanguageServer\Handler\Commands\CreateEventCommandHandler.cs (1)
48var document = context.Document;
Implementation\LanguageServer\Handler\Completion\CompletionHandler.cs (1)
59var document = context.Document;
Implementation\LanguageServer\Handler\Definitions\GoToDefinitionHandler.cs (3)
55var document = context.Document; 91private async Task<LSP.Location[]> GetLocationsAsync(XamlDefinition definition, Document document, Solution solution, CancellationToken cancellationToken) 153private static async Task<LSP.Location[]> GetSymbolDefinitionLocationsAsync(XamlSymbolDefinition symbolDefinition, Document document, Solution solution, IMetadataAsSourceFileService metadataAsSourceFileService, IGlobalOptionService globalOptions, CancellationToken cancellationToken)
Implementation\LanguageServer\Handler\Diagnostics\AbstractPullDiagnosticHandler.cs (4)
49protected abstract ImmutableArray<Document> GetDocuments(RequestContext context); 71var documentToPreviousResultId = new Dictionary<Document, string?>(); 95foreach (var document in GetDocuments(context)) 120private static VSDiagnostic[]? ConvertToVSDiagnostics(ImmutableArray<XamlDiagnostic>? xamlDiagnostics, Document document, SourceText text)
Implementation\LanguageServer\Handler\Diagnostics\DocumentPullDiagnosticHandler.cs (2)
35protected override ImmutableArray<Document> GetDocuments(RequestContext context) 42return context.Document == null ? ImmutableArray<Document>.Empty : [context.Document];
Implementation\LanguageServer\Handler\Diagnostics\WorkspacePullDiagnosticHandler.cs (2)
40protected override ImmutableArray<Document> GetDocuments(RequestContext context) 44using var _ = ArrayBuilder<Document>.GetInstance(out var result);
Implementation\LanguageServer\Handler\FoldingRanges\FoldingRangesHandler.cs (1)
36var document = context.Document;
Implementation\LanguageServer\Handler\Formatting\AbstractFormatDocumentHandlerBase.cs (1)
30var document = context.Document;
Implementation\LanguageServer\Handler\Formatting\FormatDocumentOnTypeHandler.cs (1)
42var document = context.Document;
Implementation\LanguageServer\Handler\Hover\HoverHandler.cs (1)
45var document = context.Document;
Implementation\LanguageServer\Handler\OnAutoInsert\OnAutoInsertHandler.cs (1)
35var document = context.Document;
Implementation\LanguageServer\Handler\OnTypeRename\OnTypeRenameHandler.cs (1)
67var document = context.Document;
Implementation\XamlProjectService.cs (1)
201var document = _workspace.CurrentSolution.GetDocument(documentId);
Roslyn.VisualStudio.DiagnosticsWindow (1)
Panels\WorkspacePanel.xaml.cs (1)
87async Task CompareDocumentAsync(Document document)
Roslyn.VisualStudio.Next.UnitTests (22)
Remote\RemoteHostClientServiceFactoryTests.cs (1)
48var document = workspace.AddDocument(project.Id, "doc.cs", SourceText.From("code"));
Remote\SnapshotSerializationTests.cs (2)
50var document1 = project1.AddDocument("Document1", SourceText.From(csCode)); 54var document2 = project2.AddDocument("Document2", SourceText.From(vbCode));
Services\ServiceHubServicesTests.cs (6)
85var oldDocument = solution.Projects.First().Documents.First(); 93var newDocument = oldDocument.WithText(newText); 1624private static SourceText GetNewText(Document document, string csAddition, string vbAddition) 1634private static (Project project, Document document) GetProjectAndDocument(Solution solution, string projectName, string documentName) 1637var document = project.Documents.First(d => string.Equals(d.Name, documentName, StringComparison.OrdinalIgnoreCase)); 1642private static (Project project, ImmutableArray<Document> documents) GetProjectAndDocuments(Solution solution, string projectName, ImmutableArray<string> documentNames)
Services\SolutionServiceTests.cs (13)
317var document = project.GetDocument(existingDocumentId); 989var document1 = project1.Documents.Single(); 1008var document1 = project1.Documents.Single(); 1040var document1 = project1.Documents.First(); 1041var document2 = project1.Documents.Last(); 1079var document1 = project1.Documents.First(); 1080var document2 = project1.Documents.Last(); 1081var document3 = project2.Documents.Single(); 1104var document1 = project1.Documents.Single(); 1131var document1 = project1.Documents.Single(); 1160var document1 = project1.Documents.Single(); 1207var document1 = project1.Documents.First(); 1208var document2 = project1.Documents.Last();
System.Text.RegularExpressions.Generator (4)
UpgradeToGeneratedRegexCodeFixer.cs (4)
66/// Takes a <see cref="Document"/> and a <see cref="Diagnostic"/> and returns a new <see cref="Document"/> with the replaced 75private static async Task<Document> ConvertToSourceGenerator(Document document, SyntaxNode root, SyntaxNode nodeToFix, CancellationToken cancellationToken)
System.Windows.Forms.Analyzers.CodeFixes.CSharp (2)
System\Windows\Forms\CSharp\CodeFixes\AddDesignerSerializationVisibility\AddDesignerSerializationVisibilityCodeFixProvider.cs (2)
57private static async Task<Document> AddDesignerSerializationAttribute( 58Document document,
System.Windows.Forms.Analyzers.CodeFixes.VisualBasic (2)
AddDesignerSerializationVisibility\AddDesignerSerializationVisibilityCodeFixProvider.vb (2)
68document As Document, 70cancellationToken As CancellationToken) As Task(Of Document)