1 type derived from Document
Microsoft.CodeAnalysis.Workspaces (1)
Workspace\Solution\SourceGeneratedDocument.cs (1)
14public sealed class SourceGeneratedDocument : Document
1 instantiation of Document
Microsoft.CodeAnalysis.Workspaces (1)
Workspace\Solution\Project.cs (1)
498(documentId, project) => project.State.DocumentStates.TryGetState(documentId, out var state) ? new Document(project, state) : null;
5030 references to Document
dotnet-format (40)
Analyzers\AnalyzerFormatter.cs (2)
125var document = solution.GetDocument(documentId); 178var document = solution.GetDocument(diagnostic.Location.SourceTree);
Analyzers\Extensions.cs (2)
45foreach (var document in project.Documents) 78Document document,
Analyzers\SolutionCodeFixApplier.cs (2)
41var document = solution.GetDocument(diagnostic.Location.SourceTree); 109public override async Task<IEnumerable<Diagnostic>> GetDocumentDiagnosticsAsync(Document document, CancellationToken cancellationToken)
CodeFormatter.cs (2)
84var documentWithError = solution.GetDocument(documentId); 205foreach (var document in project.Documents)
FormattedFile.cs (1)
16public FormattedFile(Document document, IEnumerable<FileChange> fileChanges)
Formatters\CharsetFormatter.cs (1)
23Document document,
Formatters\DocumentFormatter.cs (13)
46/// Applies formatting and returns the changed <see cref="SourceText"/> for a <see cref="Document"/>. 49Document document, 58/// Applies formatting and returns the changed <see cref="SourceText"/> for each <see cref="Document"/>. 60private ImmutableArray<(Document, Task<(SourceText originalText, SourceText? formattedText)>)> FormatFiles( 67var formattedDocuments = ImmutableArray.CreateBuilder<(Document, Task<(SourceText originalText, SourceText? formattedText)>)>(formattableDocuments.Length); 71var document = solution.GetDocument(formattableDocuments[index]); 100/// Get formatted <see cref="SourceText"/> for a <see cref="Document"/>. 103Document document, 119/// Applies the changed <see cref="SourceText"/> to each formatted <see cref="Document"/>. 123ImmutableArray<(Document, Task<(SourceText originalText, SourceText? formattedText)>)> formattedDocuments, 159private ImmutableArray<FileChange> GetFileChanges(FormatOptions formatOptions, Document document, SourceText originalText, SourceText formattedText, bool changesAreErrors, ILogger logger) 205protected static async Task<bool> IsSameDocumentAndVersionAsync(Document a, Document b, CancellationToken cancellationToken)
Formatters\EndOfLineFormatter.cs (1)
20Document document,
Formatters\FinalNewlineFormatter.cs (1)
19Document document,
Formatters\OrganizeImportsFormatter.cs (2)
24Document document, 41var organizedDocument = await Formatter.OrganizeImportsAsync(document, cancellationToken);
Formatters\WhitespaceFormatter.cs (4)
23Document document, 44private static async Task<SourceText> GetFormattedDocument(Document document, OptionSet optionSet, CancellationToken cancellationToken) 46var formattedDocument = await Formatter.FormatAsync(document, optionSet, cancellationToken).ConfigureAwait(false); 53private static async Task<SourceText> GetFormattedDocumentWithDetailedChanges(Document document, SourceText sourceText, OptionSet optionSet, CancellationToken cancellationToken)
Logging\IIssueFormatter.cs (1)
8string FormatIssue(Document document, string severity, string issueId, int lineNumber, int charNumber, string message);
Logging\ILoggerExtensions.cs (3)
16public static string LogFormattingIssue(this ILogger logger, Document document, string formatterName, FileChange fileChange, bool changesAreErrors) 19public static string LogDiagnosticIssue(this ILogger logger, Document document, LinePosition diagnosticPosition, Diagnostic diagnostic, bool changesAreErrors) 22private static string LogIssue(ILogger logger, Document document, string severity, string issueId, int lineNumber, int charNumber, string message, bool changesAreErrors)
Logging\MSBuildIssueFormatter.cs (1)
8public string FormatIssue(Document document, string severity, string issueId, int lineNumber, int charNumber, string message)
Reflection\RemoveUnnecessaryImportsHelper.cs (3)
14public static async Task<Document?> RemoveUnnecessaryImportsAsync(Document document, CancellationToken cancellationToken) 21return await (Task<Document>)s_removeUnnecessaryImportsAsyncMethod.Invoke(obj: null, new object[] { document, cancellationToken })!;
Workspaces\FolderWorkspace.cs (1)
54var document = CurrentSolution.GetDocument(documentId);
GenerateDocumentationAndConfigFiles (183)
src\roslyn\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\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeCleanup\CodeCleanupHelpers.cs (4)
14public static async Task<Document> CleanupSyntaxAsync( 15Document document, CodeCleanupOptions options, CancellationToken cancellationToken) 21var document1 = await syntaxFormatting.FormatAsync(document, Formatter.Annotation, options.FormattingOptions, cancellationToken).ConfigureAwait(false); 24var document2 = await syntaxFormatting.FormatAsync(document1, SyntaxAnnotation.ElasticAnnotation, options.FormattingOptions, cancellationToken).ConfigureAwait(false);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeCleanup\CodeCleanupOptionsProviders.cs (1)
27public static async ValueTask<CodeCleanupOptions> GetCodeCleanupOptionsAsync(this Document document, CancellationToken cancellationToken)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeFixes\FixAllContextHelper.cs (7)
22public static async Task<ImmutableDictionary<Document, ImmutableArray<Diagnostic>>> GetDocumentDiagnosticsToFixAsync( 29var document = fixAllContext.Document; 41return ImmutableDictionary<Document, ImmutableArray<Diagnostic>>.Empty.SetItem(document, documentDiagnostics); 106return ImmutableDictionary<Document, ImmutableArray<Diagnostic>>.Empty; 132private static async Task<ImmutableDictionary<Document, ImmutableArray<Diagnostic>>> GetDocumentDiagnosticsToFixAsync( 137var builder = ImmutableDictionary.CreateBuilder<Document, ImmutableArray<Diagnostic>>(); 142if (textDocument is not Document document)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeFixes\ForkingSyntaxEditorBasedCodeFixProvider.cs (2)
38Document document, 55Document document,
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeFixes\MultiProjectSafeFixAllProvider.cs (2)
78var document = fixAllContext.Solution.GetRequiredDocument(documentId); 91var linkedDocument = fixAllContext.Solution.GetRequiredDocument(linkedDocumentId);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeFixes\SyntaxEditorBasedCodeFixProvider.cs (8)
63protected Func<CancellationToken, Task<Document>> GetDocumentUpdater(CodeFixContext context, Diagnostic? diagnostic = null) 69private Task<Document> FixAllAsync( 70Document document, ImmutableArray<Diagnostic> diagnostics, CancellationToken cancellationToken) 78internal static async Task<Document> FixAllWithEditorAsync( 79Document document, 98Document document, ImmutableArray<Diagnostic> diagnostics, SyntaxEditor editor, CancellationToken cancellationToken); 111protected virtual bool IncludeDiagnosticDuringFixAll(Diagnostic diagnostic, Document document, string? equivalenceKey, CancellationToken cancellationToken) 122/// cref="IncludeDiagnosticDuringFixAll(Diagnostic, Document, string, CancellationToken)"/> should be overridden
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeFixesAndRefactorings\AbstractFixAllSpanMappingService.cs (9)
20protected abstract Task<ImmutableDictionary<Document, ImmutableArray<TextSpan>>> GetFixAllSpansIfWithinGlobalStatementAsync( 21Document document, TextSpan span, CancellationToken cancellationToken); 23public Task<ImmutableDictionary<Document, ImmutableArray<TextSpan>>> GetFixAllSpansAsync( 24Document document, TextSpan triggerSpan, FixAllScope fixAllScope, CancellationToken cancellationToken) 32private async Task<ImmutableDictionary<Document, ImmutableArray<TextSpan>>> GetFixAllSpansAsync( 33Document document, TextSpan span, bool fixAllInContainingMember, CancellationToken cancellationToken) 50var builder = PooledDictionary<Document, ArrayBuilder<TextSpan>>.GetInstance(); 53var documentForLocation = document.Project.GetDocument(syntaxRef.SyntaxTree); 73Document document,
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeFixesAndRefactorings\FixAllHelper.cs (1)
14Document triggerDocument,
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeFixesAndRefactorings\IFixAllSpanMappingService.cs (2)
30Task<ImmutableDictionary<Document, ImmutableArray<TextSpan>>> GetFixAllSpansAsync( 31Document document, TextSpan triggerSpan, FixAllScope fixAllScope, CancellationToken cancellationToken);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\AbstractCodeGenerationService.cs (12)
229private async Task<Document> GetEditAsync( 242var oldDocument = context.Solution.GetRequiredDocument(destinationTree); 252var newDocument = oldDocument.WithSyntaxRoot(currentRoot); 391public virtual Task<Document> AddEventAsync( 401public Task<Document> AddFieldAsync(CodeGenerationSolutionContext context, INamedTypeSymbol destination, IFieldSymbol field, CancellationToken cancellationToken) 410public Task<Document> AddPropertyAsync(CodeGenerationSolutionContext context, INamedTypeSymbol destination, IPropertySymbol property, CancellationToken cancellationToken) 419public Task<Document> AddNamedTypeAsync(CodeGenerationSolutionContext context, INamedTypeSymbol destination, INamedTypeSymbol namedType, CancellationToken cancellationToken) 428public Task<Document> AddNamedTypeAsync(CodeGenerationSolutionContext context, INamespaceSymbol destination, INamedTypeSymbol namedType, CancellationToken cancellationToken) 437public Task<Document> AddNamespaceAsync(CodeGenerationSolutionContext context, INamespaceSymbol destination, INamespaceSymbol @namespace, CancellationToken cancellationToken) 446public Task<Document> AddMethodAsync(CodeGenerationSolutionContext context, INamedTypeSymbol destination, IMethodSymbol method, CancellationToken cancellationToken) 455public Task<Document> AddMembersAsync(CodeGenerationSolutionContext context, INamedTypeSymbol destination, IEnumerable<ISymbol> members, CancellationToken cancellationToken) 464public Task<Document> AddNamespaceOrTypeAsync(CodeGenerationSolutionContext context, INamespaceSymbol destination, INamespaceOrTypeSymbol namespaceOrType, CancellationToken cancellationToken)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\AbstractCodeGenerationService_FindDeclaration.cs (1)
79var document = solution.GetDocument(syntaxTree);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\CleanCodeGenerationOptions.cs (1)
39public static async ValueTask<CleanCodeGenerationOptions> GetCleanCodeGenerationOptionsAsync(this Document document, CancellationToken cancellationToken)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\CodeGenerationContext.cs (3)
136public Func<Document, bool>? AllowGenerationIntoHiddenCode { get; } 153Func<Document, bool>? allowGenerationIntoHiddenCode = null) 201Optional<Func<Document, bool>?> allowGenerationIntoHiddenCode = default)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\CodeGenerationOptionsProviders.cs (2)
34public static async ValueTask<CodeGenerationOptions> GetCodeGenerationOptionsAsync(this Document document, CancellationToken cancellationToken) 40public static async ValueTask<CodeGenerationContextInfo> GetCodeGenerationInfoAsync(this Document document, CodeGenerationContext context, CancellationToken cancellationToken)
src\roslyn\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\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\ICodeGenerationService.cs (9)
133Task<Document> AddEventAsync(CodeGenerationSolutionContext context, INamedTypeSymbol destination, IEventSymbol @event, CancellationToken cancellationToken); 138Task<Document> AddFieldAsync(CodeGenerationSolutionContext context, INamedTypeSymbol destination, IFieldSymbol field, CancellationToken cancellationToken); 143Task<Document> AddMethodAsync(CodeGenerationSolutionContext context, INamedTypeSymbol destination, IMethodSymbol method, CancellationToken cancellationToken); 148Task<Document> AddPropertyAsync(CodeGenerationSolutionContext context, INamedTypeSymbol destination, IPropertySymbol property, CancellationToken cancellationToken); 153Task<Document> AddNamedTypeAsync(CodeGenerationSolutionContext context, INamedTypeSymbol destination, INamedTypeSymbol namedType, CancellationToken cancellationToken); 158Task<Document> AddNamedTypeAsync(CodeGenerationSolutionContext context, INamespaceSymbol destination, INamedTypeSymbol namedType, CancellationToken cancellationToken); 163Task<Document> AddNamespaceAsync(CodeGenerationSolutionContext context, INamespaceSymbol destination, INamespaceSymbol @namespace, CancellationToken cancellationToken); 168Task<Document> AddNamespaceOrTypeAsync(CodeGenerationSolutionContext context, INamespaceSymbol destination, INamespaceOrTypeSymbol namespaceOrType, CancellationToken cancellationToken); 173Task<Document> AddMembersAsync(CodeGenerationSolutionContext context, INamedTypeSymbol destination, IEnumerable<ISymbol> members, CancellationToken cancellationToken);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeRefactorings\CodeRefactoringContextExtensions.cs (3)
59public static async Task<TSyntaxNode?> TryGetRelevantNodeAsync<TSyntaxNode>(this Document document, TextSpan span, CancellationToken cancellationToken) where TSyntaxNode : SyntaxNode 76this Document document, TextSpan span, CancellationToken cancellationToken) where TSyntaxNode : SyntaxNode 82this Document document, TextSpan span, bool allowEmptyNodes, CancellationToken cancellationToken) where TSyntaxNode : SyntaxNode
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Editing\ImportAdderService.cs (6)
30public async Task<Document> AddImportsAsync( 31Document document, 109private async Task<Document> AddImportDirectivesFromSyntaxesAsync( 110Document document, 170private async Task<Document> AddImportDirectivesFromSymbolAnnotationsAsync( 171Document document,
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\ContextQuery\ISyntaxContextService.cs (1)
12SyntaxContext CreateContext(Document document, SemanticModel semanticModel, int position, CancellationToken cancellationToken);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\ContextQuery\SyntaxContext.cs (2)
14Document document, 48public Document Document { get; } = document;
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\DocumentExtensions.cs (16)
27public static TLanguageService? GetLanguageService<TLanguageService>(this Document? document) where TLanguageService : class, ILanguageService 30public static TLanguageService GetRequiredLanguageService<TLanguageService>(this Document document) where TLanguageService : class, ILanguageService 33public static async ValueTask<SemanticModel> GetRequiredSemanticModelAsync(this Document document, CancellationToken cancellationToken) 57public static async ValueTask<SyntaxTree> GetRequiredSyntaxTreeAsync(this Document document, CancellationToken cancellationToken) 74public static async ValueTask<SyntaxNode> GetRequiredSyntaxRootAsync(this Document document, CancellationToken cancellationToken) 97public static bool IsRazorSourceGeneratedDocument(this Document? document) 125public static ValueTask<SemanticModel> ReuseExistingSpeculativeModelAsync(this Document document, int position, CancellationToken cancellationToken) 142public static async ValueTask<SemanticModel> ReuseExistingSpeculativeModelAsync(this Document document, TextSpan span, CancellationToken cancellationToken) 167public static ValueTask<SemanticModel> ReuseExistingSpeculativeModelAsync(this Document document, SyntaxNode? node, CancellationToken cancellationToken) 178public static async Task<bool> HasAnyErrorsAsync(this Document document, CancellationToken cancellationToken, List<string>? ignoreErrorCode = null) 184public static async Task<ImmutableArray<Diagnostic>> GetErrorsAsync(this Document document, CancellationToken cancellationToken, IList<string>? ignoreErrorCode = null) 200public static async Task VerifyNoErrorsAsync(this Document newDocument, string message, CancellationToken cancellationToken, List<string>? ignoreErrorCodes = null) 219public static async Task<bool> IsGeneratedCodeAsync(this Document document, CancellationToken cancellationToken) 226public static IEnumerable<Document> GetLinkedDocuments(this Document document) 237public static async ValueTask<IOptionsReader> GetHostAnalyzerConfigOptionsAsync(this Document document, CancellationToken cancellationToken)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\ISolutionExtensions.cs (2)
36public static Document GetRequiredDocument(this Solution solution, SyntaxTree syntaxTree) 50public static Document GetRequiredDocument(this Solution solution, DocumentId documentId)
src\roslyn\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\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\TextDocumentExtensions.cs (1)
31case Document document:
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Formatting\DocumentFormattingOptionsProviders.cs (1)
22public static async ValueTask<DocumentFormattingOptions> GetDocumentFormattingOptionsAsync(this Document document, CancellationToken cancellationToken)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Formatting\FormatterShared.cs (4)
21public Task<Document> FormatAsync(Document document, SyntaxAnnotation annotation, SyntaxFormattingOptions options, CancellationToken cancellationToken) 24public async Task<Document> FormatAsync(Document document, SyntaxAnnotation annotation, SyntaxFormattingOptions options, ImmutableArray<AbstractFormattingRule> rules, CancellationToken cancellationToken)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Formatting\LineFormattingOptionsProviders.cs (1)
17public static async ValueTask<LineFormattingOptions> GetLineFormattingOptionsAsync(this Document document, CancellationToken cancellationToken)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Formatting\SyntaxFormattingOptionsProviders.cs (1)
17public static async ValueTask<SyntaxFormattingOptions> GetSyntaxFormattingOptionsAsync(this Document document, CancellationToken cancellationToken)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\LanguageServices\GeneratedCodeRecognition\AbstractGeneratedCodeRecognitionService.cs (2)
24public async Task<bool> IsGeneratedCodeAsync(Document document, CancellationToken cancellationToken) 30private static bool IsGeneratedCode(SyntaxTree syntaxTree, Document document, CancellationToken cancellationToken)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\LanguageServices\GeneratedCodeRecognition\IGeneratedCodeRecognitionService.cs (1)
17Task<bool> IsGeneratedCodeAsync(Document document, CancellationToken cancellationToken);
src\roslyn\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\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\LanguageServices\InitializeParameter\IInitializeParameterService.cs (1)
22Document document, IParameterSymbol parameter, ISymbol fieldOrProperty, CancellationToken cancellationToken);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\LanguageServices\MoveDeclarationNearReference\AbstractMoveDeclarationNearReferenceService.cs (9)
36protected abstract Task<bool> TypesAreCompatibleAsync(Document document, ILocalSymbol localSymbol, TLocalDeclarationStatementSyntax declarationStatement, SyntaxNode right, CancellationToken cancellationToken); 38public async Task<(bool canMove, bool mayChangeSemantics)> CanMoveDeclarationNearReferenceAsync(Document document, SyntaxNode node, CancellationToken cancellationToken) 47private async Task<State> ComputeStateAsync(Document document, SyntaxNode node, CancellationToken cancellationToken) 77public async Task<Document> MoveDeclarationNearReferenceAsync( 78Document document, SyntaxNode localDeclarationStatement, CancellationToken cancellationToken) 119Document document, State state, SyntaxEditor editor, SyntaxAnnotation warningAnnotation, CancellationToken cancellationToken) 160Document document, State state, SyntaxEditor editor, SyntaxAnnotation warningAnnotation) 205Document document, 236Document document, State state)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\LanguageServices\MoveDeclarationNearReference\AbstractMoveDeclarationNearReferenceService.State.cs (2)
40Document document, 55Document document,
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\LanguageServices\MoveDeclarationNearReference\IMoveDeclarationNearReferenceService.cs (3)
17Task<(bool canMove, bool mayChangeSemantics)> CanMoveDeclarationNearReferenceAsync(Document document, SyntaxNode localDeclarationStatement, CancellationToken cancellationToken); 24Task<Document> MoveDeclarationNearReferenceAsync(Document document, SyntaxNode localDeclarationStatement, CancellationToken cancellationToken);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\LanguageServices\RemoveUnnecessaryImports\AbstractRemoveUnnecessaryImportsService.cs (6)
19public Task<Document> RemoveUnnecessaryImportsAsync(Document document, CancellationToken cancellationToken) 22public abstract Task<Document> RemoveUnnecessaryImportsAsync(Document fromDocument, Func<SyntaxNode, bool>? predicate, CancellationToken cancellationToken); 25Document document, Func<SyntaxNode, bool> predicate, CancellationToken cancellationToken) 32foreach (var current in document.GetLinkedDocuments())
src\roslyn\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\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\LanguageServices\ReplaceDiscardDeclarationsWithAssignments\IReplaceDiscardDeclarationsWithAssignmentsService.cs (1)
30Task<SyntaxNode> ReplaceAsync(Document document, SyntaxNode memberDeclaration, CancellationToken cancellationToken);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\NamingStyles\NamingStylePreferencesProviders.cs (1)
15public static async ValueTask<NamingStylePreferences> GetNamingStylePreferencesAsync(this Document document, CancellationToken cancellationToken)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Options\MemberDisplayOptions.cs (1)
50public static async ValueTask<MemberDisplayOptions> GetMemberDisplayOptionsAsync(this Document document, CancellationToken cancellationToken)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\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);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\SemanticModelReuse\SemanticModelWorkspaceServiceFactory.SemanticModelWorkspaceService.cs (3)
94public async ValueTask<SemanticModel> ReuseExistingSpeculativeModelAsync(Document document, SyntaxNode node, CancellationToken cancellationToken) 138ImmutableDictionary<DocumentId, SemanticModelReuseInfo?> map, Document document, SyntaxNode bodyNode, CancellationToken cancellationToken) 176Document document,
src\roslyn\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, 238var newDocument = document.WithSyntaxRoot(newRoot); 294private async Task<Document> RemoveUnusedNamespaceImportsAsync( 295Document document,
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Simplification\ISimplificationService.cs (2)
30Task<Document> ReduceAsync( 31Document document,
src\roslyn\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\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Utilities\ParsedDocument.cs (5)
15/// Represents a <see cref="Document"/> content that has been parsed. 20/// In general, any feature API that accepts <see cref="ParsedDocument"/> should be synchronous and not access <see cref="Document"/> or <see cref="Solution"/> snapshots. 31public static async ValueTask<ParsedDocument> CreateAsync(Document document, CancellationToken cancellationToken) 66/// Equivalent semantics to <see cref="Document.GetTextChangesAsync(Document, CancellationToken)"/>
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Utilities\SemanticDocument.cs (3)
13internal sealed class SemanticDocument(Document document, SourceText text, SyntaxNode root, SemanticModel semanticModel) 18public static new async Task<SemanticDocument> CreateAsync(Document document, CancellationToken cancellationToken) 28var newDocument = this.Document.WithSyntaxRoot(root);
src\roslyn\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);
ILLink.CodeFixProvider (17)
BaseAttributeCodeFixProvider.cs (3)
35var document = context.Document; 53private async Task<Document> AddAttributeAsync( 54Document document,
DynamicallyAccessedMembersCodeFixProvider.cs (3)
95var document = context.Document; 120private static async Task<Document> AddAttributeAsync( 121Document document,
RequiresUnsafeCodeFixProvider.cs (11)
34var document = context.Document; 133private static async Task<Document> AddUnsafeModifierAsync( 134Document document, 166private static async Task<Document> WrapStatementsInUnsafeBlockAsync( 167Document document, 363private static async Task<Document> WrapSwitchSectionStatementInUnsafeBlockAsync( 364Document document, 387private static async Task<Document> WrapEmbeddedStatementInUnsafeBlockAsync( 388Document document, 413private static async Task<Document> ConvertExpressionBodyToUnsafeBlockAsync( 414Document 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.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.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.SdkAnalyzers (2)
ComponentParametersShouldBePublicCodeFixProvider.cs (2)
50private static Task<Document> GetTransformedDocumentAsync( 51Document document,
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.Analyzers (206)
FixAnalyzers\FixerWithFixAllAnalyzer.Fixer.cs (2)
57private static async Task<Document> AddMethodAsync(Document document, SyntaxNode classDecl, CancellationToken cancellationToken)
MetaAnalyzers\Fixers\ApplyDiagnosticAnalyzerAttributeFix.cs (2)
62private Task<Document> GetFixAsync(Document document, SyntaxNode root, SyntaxNode classDecl, SyntaxGenerator generator, params string[] languages)
MetaAnalyzers\Fixers\CompareSymbolsCorrectlyFix.cs (10)
65private async Task<Document> ConvertToEqualsAsync(Document document, TextSpan sourceSpan, CancellationToken cancellationToken) 80private async Task<Document> CallOverloadWithEqualityComparerAsync(Document document, TextSpan sourceSpan, CancellationToken cancellationToken) 116private static async Task<Document> CallOverloadWithEqualityComparerAsync(Document document, SyntaxNode nodeToReplace, IMethodSymbol? methodSymbol, 187private async Task<Document> EnsureEqualsCorrectAsync(Document document, SemanticModel semanticModel, IInvocationOperation invocationOperation, CancellationToken cancellationToken) 257private static async Task<Document> ConvertToEqualsAsync(Document document, SemanticModel semanticModel, IBinaryOperation binaryOperation, CancellationToken cancellationToken)
MetaAnalyzers\Fixers\ConfigureGeneratedCodeAnalysisFix.cs (2)
43private async Task<Document> ConfigureGeneratedCodeAnalysisAsync(Document document, TextSpan sourceSpan, CancellationToken cancellationToken)
MetaAnalyzers\Fixers\DefineDiagnosticDescriptorArgumentsCorrectlyFix.cs (1)
159private static async Task<Solution> ApplyFixAsync(Document document, SyntaxNode root, FixInfo fixInfo, CancellationToken cancellationToken)
MetaAnalyzers\Fixers\EnableConcurrentExecutionFix.cs (2)
42private async Task<Document> EnableConcurrentExecutionAsync(Document document, TextSpan sourceSpan, CancellationToken cancellationToken)
MetaAnalyzers\Fixers\PreferIsKindFix.cs (4)
37private async Task<Document> ConvertKindToIsKindAsync(Document document, TextSpan sourceSpan, CancellationToken cancellationToken) 63protected override async Task<Document?> FixAllAsync(FixAllContext fixAllContext, Document document, ImmutableArray<Diagnostic> diagnostics)
src\roslyn\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\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeCleanup\CodeCleanupHelpers.cs (4)
14public static async Task<Document> CleanupSyntaxAsync( 15Document document, CodeCleanupOptions options, CancellationToken cancellationToken) 21var document1 = await syntaxFormatting.FormatAsync(document, Formatter.Annotation, options.FormattingOptions, cancellationToken).ConfigureAwait(false); 24var document2 = await syntaxFormatting.FormatAsync(document1, SyntaxAnnotation.ElasticAnnotation, options.FormattingOptions, cancellationToken).ConfigureAwait(false);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeCleanup\CodeCleanupOptionsProviders.cs (1)
27public static async ValueTask<CodeCleanupOptions> GetCodeCleanupOptionsAsync(this Document document, CancellationToken cancellationToken)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeFixes\FixAllContextHelper.cs (7)
22public static async Task<ImmutableDictionary<Document, ImmutableArray<Diagnostic>>> GetDocumentDiagnosticsToFixAsync( 29var document = fixAllContext.Document; 41return ImmutableDictionary<Document, ImmutableArray<Diagnostic>>.Empty.SetItem(document, documentDiagnostics); 106return ImmutableDictionary<Document, ImmutableArray<Diagnostic>>.Empty; 132private static async Task<ImmutableDictionary<Document, ImmutableArray<Diagnostic>>> GetDocumentDiagnosticsToFixAsync( 137var builder = ImmutableDictionary.CreateBuilder<Document, ImmutableArray<Diagnostic>>(); 142if (textDocument is not Document document)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeFixes\ForkingSyntaxEditorBasedCodeFixProvider.cs (2)
38Document document, 55Document document,
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeFixes\MultiProjectSafeFixAllProvider.cs (2)
78var document = fixAllContext.Solution.GetRequiredDocument(documentId); 91var linkedDocument = fixAllContext.Solution.GetRequiredDocument(linkedDocumentId);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeFixes\SyntaxEditorBasedCodeFixProvider.cs (8)
63protected Func<CancellationToken, Task<Document>> GetDocumentUpdater(CodeFixContext context, Diagnostic? diagnostic = null) 69private Task<Document> FixAllAsync( 70Document document, ImmutableArray<Diagnostic> diagnostics, CancellationToken cancellationToken) 78internal static async Task<Document> FixAllWithEditorAsync( 79Document document, 98Document document, ImmutableArray<Diagnostic> diagnostics, SyntaxEditor editor, CancellationToken cancellationToken); 111protected virtual bool IncludeDiagnosticDuringFixAll(Diagnostic diagnostic, Document document, string? equivalenceKey, CancellationToken cancellationToken) 122/// cref="IncludeDiagnosticDuringFixAll(Diagnostic, Document, string, CancellationToken)"/> should be overridden
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeFixesAndRefactorings\AbstractFixAllSpanMappingService.cs (9)
20protected abstract Task<ImmutableDictionary<Document, ImmutableArray<TextSpan>>> GetFixAllSpansIfWithinGlobalStatementAsync( 21Document document, TextSpan span, CancellationToken cancellationToken); 23public Task<ImmutableDictionary<Document, ImmutableArray<TextSpan>>> GetFixAllSpansAsync( 24Document document, TextSpan triggerSpan, FixAllScope fixAllScope, CancellationToken cancellationToken) 32private async Task<ImmutableDictionary<Document, ImmutableArray<TextSpan>>> GetFixAllSpansAsync( 33Document document, TextSpan span, bool fixAllInContainingMember, CancellationToken cancellationToken) 50var builder = PooledDictionary<Document, ArrayBuilder<TextSpan>>.GetInstance(); 53var documentForLocation = document.Project.GetDocument(syntaxRef.SyntaxTree); 73Document document,
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeFixesAndRefactorings\FixAllHelper.cs (1)
14Document triggerDocument,
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeFixesAndRefactorings\IFixAllSpanMappingService.cs (2)
30Task<ImmutableDictionary<Document, ImmutableArray<TextSpan>>> GetFixAllSpansAsync( 31Document document, TextSpan triggerSpan, FixAllScope fixAllScope, CancellationToken cancellationToken);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\AbstractCodeGenerationService.cs (12)
229private async Task<Document> GetEditAsync( 242var oldDocument = context.Solution.GetRequiredDocument(destinationTree); 252var newDocument = oldDocument.WithSyntaxRoot(currentRoot); 391public virtual Task<Document> AddEventAsync( 401public Task<Document> AddFieldAsync(CodeGenerationSolutionContext context, INamedTypeSymbol destination, IFieldSymbol field, CancellationToken cancellationToken) 410public Task<Document> AddPropertyAsync(CodeGenerationSolutionContext context, INamedTypeSymbol destination, IPropertySymbol property, CancellationToken cancellationToken) 419public Task<Document> AddNamedTypeAsync(CodeGenerationSolutionContext context, INamedTypeSymbol destination, INamedTypeSymbol namedType, CancellationToken cancellationToken) 428public Task<Document> AddNamedTypeAsync(CodeGenerationSolutionContext context, INamespaceSymbol destination, INamedTypeSymbol namedType, CancellationToken cancellationToken) 437public Task<Document> AddNamespaceAsync(CodeGenerationSolutionContext context, INamespaceSymbol destination, INamespaceSymbol @namespace, CancellationToken cancellationToken) 446public Task<Document> AddMethodAsync(CodeGenerationSolutionContext context, INamedTypeSymbol destination, IMethodSymbol method, CancellationToken cancellationToken) 455public Task<Document> AddMembersAsync(CodeGenerationSolutionContext context, INamedTypeSymbol destination, IEnumerable<ISymbol> members, CancellationToken cancellationToken) 464public Task<Document> AddNamespaceOrTypeAsync(CodeGenerationSolutionContext context, INamespaceSymbol destination, INamespaceOrTypeSymbol namespaceOrType, CancellationToken cancellationToken)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\AbstractCodeGenerationService_FindDeclaration.cs (1)
79var document = solution.GetDocument(syntaxTree);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\CleanCodeGenerationOptions.cs (1)
39public static async ValueTask<CleanCodeGenerationOptions> GetCleanCodeGenerationOptionsAsync(this Document document, CancellationToken cancellationToken)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\CodeGenerationContext.cs (3)
136public Func<Document, bool>? AllowGenerationIntoHiddenCode { get; } 153Func<Document, bool>? allowGenerationIntoHiddenCode = null) 201Optional<Func<Document, bool>?> allowGenerationIntoHiddenCode = default)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\CodeGenerationOptionsProviders.cs (2)
34public static async ValueTask<CodeGenerationOptions> GetCodeGenerationOptionsAsync(this Document document, CancellationToken cancellationToken) 40public static async ValueTask<CodeGenerationContextInfo> GetCodeGenerationInfoAsync(this Document document, CodeGenerationContext context, CancellationToken cancellationToken)
src\roslyn\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\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\ICodeGenerationService.cs (9)
133Task<Document> AddEventAsync(CodeGenerationSolutionContext context, INamedTypeSymbol destination, IEventSymbol @event, CancellationToken cancellationToken); 138Task<Document> AddFieldAsync(CodeGenerationSolutionContext context, INamedTypeSymbol destination, IFieldSymbol field, CancellationToken cancellationToken); 143Task<Document> AddMethodAsync(CodeGenerationSolutionContext context, INamedTypeSymbol destination, IMethodSymbol method, CancellationToken cancellationToken); 148Task<Document> AddPropertyAsync(CodeGenerationSolutionContext context, INamedTypeSymbol destination, IPropertySymbol property, CancellationToken cancellationToken); 153Task<Document> AddNamedTypeAsync(CodeGenerationSolutionContext context, INamedTypeSymbol destination, INamedTypeSymbol namedType, CancellationToken cancellationToken); 158Task<Document> AddNamedTypeAsync(CodeGenerationSolutionContext context, INamespaceSymbol destination, INamedTypeSymbol namedType, CancellationToken cancellationToken); 163Task<Document> AddNamespaceAsync(CodeGenerationSolutionContext context, INamespaceSymbol destination, INamespaceSymbol @namespace, CancellationToken cancellationToken); 168Task<Document> AddNamespaceOrTypeAsync(CodeGenerationSolutionContext context, INamespaceSymbol destination, INamespaceOrTypeSymbol namespaceOrType, CancellationToken cancellationToken); 173Task<Document> AddMembersAsync(CodeGenerationSolutionContext context, INamedTypeSymbol destination, IEnumerable<ISymbol> members, CancellationToken cancellationToken);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeRefactorings\CodeRefactoringContextExtensions.cs (3)
59public static async Task<TSyntaxNode?> TryGetRelevantNodeAsync<TSyntaxNode>(this Document document, TextSpan span, CancellationToken cancellationToken) where TSyntaxNode : SyntaxNode 76this Document document, TextSpan span, CancellationToken cancellationToken) where TSyntaxNode : SyntaxNode 82this Document document, TextSpan span, bool allowEmptyNodes, CancellationToken cancellationToken) where TSyntaxNode : SyntaxNode
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Editing\ImportAdderService.cs (6)
30public async Task<Document> AddImportsAsync( 31Document document, 109private async Task<Document> AddImportDirectivesFromSyntaxesAsync( 110Document document, 170private async Task<Document> AddImportDirectivesFromSymbolAnnotationsAsync( 171Document document,
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\ContextQuery\ISyntaxContextService.cs (1)
12SyntaxContext CreateContext(Document document, SemanticModel semanticModel, int position, CancellationToken cancellationToken);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\ContextQuery\SyntaxContext.cs (2)
14Document document, 48public Document Document { get; } = document;
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\DocumentExtensions.cs (16)
27public static TLanguageService? GetLanguageService<TLanguageService>(this Document? document) where TLanguageService : class, ILanguageService 30public static TLanguageService GetRequiredLanguageService<TLanguageService>(this Document document) where TLanguageService : class, ILanguageService 33public static async ValueTask<SemanticModel> GetRequiredSemanticModelAsync(this Document document, CancellationToken cancellationToken) 57public static async ValueTask<SyntaxTree> GetRequiredSyntaxTreeAsync(this Document document, CancellationToken cancellationToken) 74public static async ValueTask<SyntaxNode> GetRequiredSyntaxRootAsync(this Document document, CancellationToken cancellationToken) 97public static bool IsRazorSourceGeneratedDocument(this Document? document) 125public static ValueTask<SemanticModel> ReuseExistingSpeculativeModelAsync(this Document document, int position, CancellationToken cancellationToken) 142public static async ValueTask<SemanticModel> ReuseExistingSpeculativeModelAsync(this Document document, TextSpan span, CancellationToken cancellationToken) 167public static ValueTask<SemanticModel> ReuseExistingSpeculativeModelAsync(this Document document, SyntaxNode? node, CancellationToken cancellationToken) 178public static async Task<bool> HasAnyErrorsAsync(this Document document, CancellationToken cancellationToken, List<string>? ignoreErrorCode = null) 184public static async Task<ImmutableArray<Diagnostic>> GetErrorsAsync(this Document document, CancellationToken cancellationToken, IList<string>? ignoreErrorCode = null) 200public static async Task VerifyNoErrorsAsync(this Document newDocument, string message, CancellationToken cancellationToken, List<string>? ignoreErrorCodes = null) 219public static async Task<bool> IsGeneratedCodeAsync(this Document document, CancellationToken cancellationToken) 226public static IEnumerable<Document> GetLinkedDocuments(this Document document) 237public static async ValueTask<IOptionsReader> GetHostAnalyzerConfigOptionsAsync(this Document document, CancellationToken cancellationToken)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\ISolutionExtensions.cs (2)
36public static Document GetRequiredDocument(this Solution solution, SyntaxTree syntaxTree) 50public static Document GetRequiredDocument(this Solution solution, DocumentId documentId)
src\roslyn\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\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\TextDocumentExtensions.cs (1)
31case Document document:
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Formatting\DocumentFormattingOptionsProviders.cs (1)
22public static async ValueTask<DocumentFormattingOptions> GetDocumentFormattingOptionsAsync(this Document document, CancellationToken cancellationToken)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Formatting\FormatterShared.cs (4)
21public Task<Document> FormatAsync(Document document, SyntaxAnnotation annotation, SyntaxFormattingOptions options, CancellationToken cancellationToken) 24public async Task<Document> FormatAsync(Document document, SyntaxAnnotation annotation, SyntaxFormattingOptions options, ImmutableArray<AbstractFormattingRule> rules, CancellationToken cancellationToken)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Formatting\LineFormattingOptionsProviders.cs (1)
17public static async ValueTask<LineFormattingOptions> GetLineFormattingOptionsAsync(this Document document, CancellationToken cancellationToken)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Formatting\SyntaxFormattingOptionsProviders.cs (1)
17public static async ValueTask<SyntaxFormattingOptions> GetSyntaxFormattingOptionsAsync(this Document document, CancellationToken cancellationToken)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\LanguageServices\GeneratedCodeRecognition\AbstractGeneratedCodeRecognitionService.cs (2)
24public async Task<bool> IsGeneratedCodeAsync(Document document, CancellationToken cancellationToken) 30private static bool IsGeneratedCode(SyntaxTree syntaxTree, Document document, CancellationToken cancellationToken)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\LanguageServices\GeneratedCodeRecognition\IGeneratedCodeRecognitionService.cs (1)
17Task<bool> IsGeneratedCodeAsync(Document document, CancellationToken cancellationToken);
src\roslyn\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\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\LanguageServices\InitializeParameter\IInitializeParameterService.cs (1)
22Document document, IParameterSymbol parameter, ISymbol fieldOrProperty, CancellationToken cancellationToken);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\LanguageServices\MoveDeclarationNearReference\AbstractMoveDeclarationNearReferenceService.cs (9)
36protected abstract Task<bool> TypesAreCompatibleAsync(Document document, ILocalSymbol localSymbol, TLocalDeclarationStatementSyntax declarationStatement, SyntaxNode right, CancellationToken cancellationToken); 38public async Task<(bool canMove, bool mayChangeSemantics)> CanMoveDeclarationNearReferenceAsync(Document document, SyntaxNode node, CancellationToken cancellationToken) 47private async Task<State> ComputeStateAsync(Document document, SyntaxNode node, CancellationToken cancellationToken) 77public async Task<Document> MoveDeclarationNearReferenceAsync( 78Document document, SyntaxNode localDeclarationStatement, CancellationToken cancellationToken) 119Document document, State state, SyntaxEditor editor, SyntaxAnnotation warningAnnotation, CancellationToken cancellationToken) 160Document document, State state, SyntaxEditor editor, SyntaxAnnotation warningAnnotation) 205Document document, 236Document document, State state)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\LanguageServices\MoveDeclarationNearReference\AbstractMoveDeclarationNearReferenceService.State.cs (2)
40Document document, 55Document document,
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\LanguageServices\MoveDeclarationNearReference\IMoveDeclarationNearReferenceService.cs (3)
17Task<(bool canMove, bool mayChangeSemantics)> CanMoveDeclarationNearReferenceAsync(Document document, SyntaxNode localDeclarationStatement, CancellationToken cancellationToken); 24Task<Document> MoveDeclarationNearReferenceAsync(Document document, SyntaxNode localDeclarationStatement, CancellationToken cancellationToken);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\LanguageServices\RemoveUnnecessaryImports\AbstractRemoveUnnecessaryImportsService.cs (6)
19public Task<Document> RemoveUnnecessaryImportsAsync(Document document, CancellationToken cancellationToken) 22public abstract Task<Document> RemoveUnnecessaryImportsAsync(Document fromDocument, Func<SyntaxNode, bool>? predicate, CancellationToken cancellationToken); 25Document document, Func<SyntaxNode, bool> predicate, CancellationToken cancellationToken) 32foreach (var current in document.GetLinkedDocuments())
src\roslyn\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\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\LanguageServices\ReplaceDiscardDeclarationsWithAssignments\IReplaceDiscardDeclarationsWithAssignmentsService.cs (1)
30Task<SyntaxNode> ReplaceAsync(Document document, SyntaxNode memberDeclaration, CancellationToken cancellationToken);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\NamingStyles\NamingStylePreferencesProviders.cs (1)
15public static async ValueTask<NamingStylePreferences> GetNamingStylePreferencesAsync(this Document document, CancellationToken cancellationToken)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Options\MemberDisplayOptions.cs (1)
50public static async ValueTask<MemberDisplayOptions> GetMemberDisplayOptionsAsync(this Document document, CancellationToken cancellationToken)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\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);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\SemanticModelReuse\SemanticModelWorkspaceServiceFactory.SemanticModelWorkspaceService.cs (3)
94public async ValueTask<SemanticModel> ReuseExistingSpeculativeModelAsync(Document document, SyntaxNode node, CancellationToken cancellationToken) 138ImmutableDictionary<DocumentId, SemanticModelReuseInfo?> map, Document document, SyntaxNode bodyNode, CancellationToken cancellationToken) 176Document document,
src\roslyn\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, 238var newDocument = document.WithSyntaxRoot(newRoot); 294private async Task<Document> RemoveUnusedNamespaceImportsAsync( 295Document document,
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Simplification\ISimplificationService.cs (2)
30Task<Document> ReduceAsync( 31Document document,
src\roslyn\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\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Utilities\ParsedDocument.cs (5)
15/// Represents a <see cref="Document"/> content that has been parsed. 20/// In general, any feature API that accepts <see cref="ParsedDocument"/> should be synchronous and not access <see cref="Document"/> or <see cref="Solution"/> snapshots. 31public static async ValueTask<ParsedDocument> CreateAsync(Document document, CancellationToken cancellationToken) 66/// Equivalent semantics to <see cref="Document.GetTextChangesAsync(Document, CancellationToken)"/>
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Utilities\SemanticDocument.cs (3)
13internal sealed class SemanticDocument(Document document, SourceText text, SyntaxNode root, SemanticModel semanticModel) 18public static new async Task<SemanticDocument> CreateAsync(Document document, CancellationToken cancellationToken) 28var newDocument = this.Document.WithSyntaxRoot(root);
src\roslyn\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);
Microsoft.CodeAnalysis.CodeStyle.Fixes (448)
src\roslyn\src\Analyzers\Core\CodeFixes\AddAccessibilityModifiers\AbstractAddAccessibilityModifiersCodeFixProvider.cs (1)
40Document document, ImmutableArray<Diagnostic> diagnostics,
src\roslyn\src\Analyzers\Core\CodeFixes\AddAnonymousTypeMemberName\AbstractAddAnonymousTypeMemberNameCodeFixProvider.cs (4)
34var document = context.Document; 53Document document, Diagnostic diagnostic, CancellationToken cancellationToken) 83Document document, ImmutableArray<Diagnostic> diagnostics, 100Document document, SemanticModel semanticModel, Diagnostic diagnostic,
src\roslyn\src\Analyzers\Core\CodeFixes\AddExplicitCast\AbstractAddExplicitCastCodeFixProvider.cs (6)
48Document document, SemanticModel semanticModel, SyntaxNode root, 60Document document, SemanticModel semanticModel, SyntaxNode root, 67var document = context.Document; 115Document document, 170Document document, 211Document document,
src\roslyn\src\Analyzers\Core\CodeFixes\AddExplicitCast\Fixer.cs (2)
39Document document, 109Document document,
src\roslyn\src\Analyzers\Core\CodeFixes\AddObsoleteAttribute\AbstractAddObsoleteAttributeCodeFixProvider.cs (3)
35var document = context.Document; 57private static async Task<INamedTypeSymbol?> GetObsoleteAttributeAsync(Document document, CancellationToken cancellationToken) 71Document document, ImmutableArray<Diagnostic> diagnostics,
src\roslyn\src\Analyzers\Core\CodeFixes\AddParameter\AbstractAddParameterCodeFixProvider.cs (5)
67var document = context.Document; 331Document document, 375Document invocationDocument, 402private async Task<(ITypeSymbol, RefKind)> GetArgumentTypeAndRefKindAsync(Document invocationDocument, TArgumentSyntax argument, CancellationToken cancellationToken) 412Document invocationDocument, TArgumentSyntax argument, INamedTypeSymbol containingType, CancellationToken cancellationToken)
src\roslyn\src\Analyzers\Core\CodeFixes\AddParameter\AddParameterService.cs (4)
78Document invocationDocument, 105var document = documentLookup.Key; 182var rewrittenDocument = rewrittenSolution.GetRequiredDocument(documentId); 215Document invocationDocument, IMethodSymbol method, CancellationToken cancellationToken)
src\roslyn\src\Analyzers\Core\CodeFixes\AddRequiredParentheses\AddRequiredParenthesesCodeFixProvider.cs (2)
26protected override bool IncludeDiagnosticDuringFixAll(Diagnostic diagnostic, Document document, string? equivalenceKey, CancellationToken cancellationToken) 37Document document, ImmutableArray<Diagnostic> diagnostics,
src\roslyn\src\Analyzers\Core\CodeFixes\AliasAmbiguousType\AbstractAliasAmbiguousTypeCodeFixProvider.cs (1)
32var document = context.Document;
src\roslyn\src\Analyzers\Core\CodeFixes\AnalyzerOptionsProviders.cs (1)
14public static async ValueTask<AnalyzerOptionsProvider> GetAnalyzerOptionsProviderAsync(this Document document, CancellationToken cancellationToken)
src\roslyn\src\Analyzers\Core\CodeFixes\ConflictMarkerResolution\AbstractConflictMarkerCodeFixProvider.cs (14)
72var document = context.Document; 268var document = context.Document; 301static CodeAction CreateCodeAction(string title, Func<CancellationToken, Task<Document>> action, string equivalenceKey) 314private static async Task<Document> AddEditsAsync( 315Document document, int startPos, int firstMiddlePos, int secondMiddlePos, int endPos, 380private static Task<Document> TakeTopAsync(Document document, int startPos, int firstMiddlePos, int secondMiddlePos, int endPos, CancellationToken cancellationToken) 383private static Task<Document> TakeBottomAsync(Document document, int startPos, int firstMiddlePos, int secondMiddlePos, int endPos, CancellationToken cancellationToken) 386private static Task<Document> TakeBothAsync(Document document, int startPos, int firstMiddlePos, int secondMiddlePos, int endPos, CancellationToken cancellationToken) 392private async Task<Document> FixAllAsync( 393Document document, ImmutableArray<Diagnostic> diagnostics, 445var finalDoc = document.WithText(finalText);
src\roslyn\src\Analyzers\Core\CodeFixes\ConvertToAsync\AbstractConvertToAsyncCodeFixProvider.cs (2)
52SyntaxNode node, Document document, Diagnostic diagnostic, CancellationToken cancellationToken) 60var otherDocument = document.Project.Solution.GetRequiredDocument(syntaxTree);
src\roslyn\src\Analyzers\Core\CodeFixes\ConvertTypeOfToNameOf\AbstractConvertTypeOfToNameOfCodeFixProvider.cs (1)
34Document document, ImmutableArray<Diagnostic> diagnostics,
src\roslyn\src\Analyzers\Core\CodeFixes\DocumentationComments\AbstractAddDocCommentNodesCodeFixProvider.cs (2)
57protected async Task<Document> AddParamTagAsync( 58Document document, TMemberDeclarationSyntax parentMethod, SyntaxNode docCommentNode, CancellationToken cancellationToken)
src\roslyn\src\Analyzers\Core\CodeFixes\DocumentationComments\AbstractRemoveDocCommentNodeCodeFixProvider.cs (2)
58private async Task<Document> RemoveDuplicateParamTagAsync( 59Document document, TXmlElementSyntax paramNode, CancellationToken cancellationToken)
src\roslyn\src\Analyzers\Core\CodeFixes\FileHeaders\AbstractFileHeaderCodeFixProvider.cs (4)
43private async Task<Document> GetTransformedDocumentAsync(Document document, CancellationToken cancellationToken) 46private async Task<SyntaxNode> GetTransformedSyntaxRootAsync(Document document, CancellationToken cancellationToken) 55internal static async Task<SyntaxNode> GetTransformedSyntaxRootAsync(ISyntaxFacts syntaxFacts, AbstractFileHeaderHelper fileHeaderHelper, SyntaxTrivia newLineTrivia, Document document, string? fileHeaderTemplate, CancellationToken cancellationToken)
src\roslyn\src\Analyzers\Core\CodeFixes\ForEachCast\AbstractForEachCastCodeFixProvider.cs (1)
39Document document, ImmutableArray<Diagnostic> diagnostics,
src\roslyn\src\Analyzers\Core\CodeFixes\Formatting\FormattingCodeFixProvider.cs (2)
68private async Task<Document> FixOneAsync(CodeFixContext context, Diagnostic diagnostic, CancellationToken cancellationToken) 86protected override async Task FixAllAsync(Document document, ImmutableArray<Diagnostic> diagnostics, SyntaxEditor editor, CancellationToken cancellationToken)
src\roslyn\src\Analyzers\Core\CodeFixes\GenerateConstructor\AbstractGenerateConstructorService.cs (1)
80public async Task<ImmutableArray<CodeAction>> GenerateConstructorAsync(Document document, SyntaxNode node, CancellationToken cancellationToken)
src\roslyn\src\Analyzers\Core\CodeFixes\GenerateConstructor\AbstractGenerateConstructorService.State.cs (7)
406public async Task<Document> GetChangedDocumentAsync( 407Document document, bool withFields, bool withProperties, CancellationToken cancellationToken) 422private async Task<Document?> GenerateThisOrBaseDelegatingConstructorAsync( 423Document document, bool withFields, bool withProperties, CancellationToken cancellationToken) 461Document document, bool withFields, bool withProperties, CancellationToken cancellationToken) 482private async Task<Document> GenerateMemberDelegatingConstructorAsync( 483Document document, bool withFields, bool withProperties, CancellationToken cancellationToken)
src\roslyn\src\Analyzers\Core\CodeFixes\GenerateConstructor\IGenerateConstructorService.cs (1)
15Task<ImmutableArray<CodeAction>> GenerateConstructorAsync(Document document, SyntaxNode node, CancellationToken cancellationToken);
src\roslyn\src\Analyzers\Core\CodeFixes\GenerateDefaultConstructors\AbstractGenerateDefaultConstructorCodeFixProvider.cs (1)
23var document = context.Document;
src\roslyn\src\Analyzers\Core\CodeFixes\GenerateDefaultConstructors\AbstractGenerateDefaultConstructorsService.cs (1)
26Document document,
src\roslyn\src\Analyzers\Core\CodeFixes\GenerateDefaultConstructors\GenerateDefaultConstructorsCodeAction.cs (4)
19Document document, 25private readonly Document _document = document; 30protected override async Task<Document> GetChangedDocumentAsync(CancellationToken cancellationToken) 33var result = await CodeGenerator.AddMemberDeclarationsAsync(
src\roslyn\src\Analyzers\Core\CodeFixes\GenerateDefaultConstructors\IGenerateDefaultConstructorsService.cs (1)
17Document document, TextSpan textSpan, bool forRefactoring, CancellationToken cancellationToken);
src\roslyn\src\Analyzers\Core\CodeFixes\GenerateEnumMember\AbstractGenerateEnumMemberService.CodeAction.cs (4)
18private sealed partial class GenerateEnumMemberCodeAction(Document document, State state) : CodeAction 20private readonly Document _document = document; 23protected override async Task<Document> GetChangedDocumentAsync(CancellationToken cancellationToken) 33var result = await codeGenerator.AddFieldAsync(
src\roslyn\src\Analyzers\Core\CodeFixes\GenerateEnumMember\AbstractGenerateEnumMemberService.cs (1)
25public async Task<ImmutableArray<CodeAction>> GenerateEnumMemberAsync(Document document, SyntaxNode node, CancellationToken cancellationToken)
src\roslyn\src\Analyzers\Core\CodeFixes\GenerateEnumMember\IGenerateEnumMemberService.cs (1)
15Task<ImmutableArray<CodeAction>> GenerateEnumMemberAsync(Document document, SyntaxNode node, CancellationToken cancellationToken);
src\roslyn\src\Analyzers\Core\CodeFixes\GenerateMember\AbstractGenerateMemberCodeFixProvider.cs (2)
25protected abstract Task<ImmutableArray<CodeAction>> GetCodeActionsAsync(Document document, SyntaxNode node, CancellationToken cancellationToken); 38var document = context.Document;
src\roslyn\src\Analyzers\Core\CodeFixes\GenerateParameterizedMember\AbstractGenerateConversionService.cs (1)
28Document document,
src\roslyn\src\Analyzers\Core\CodeFixes\GenerateParameterizedMember\AbstractGenerateDeconstructMethodService.cs (1)
24Document document,
src\roslyn\src\Analyzers\Core\CodeFixes\GenerateParameterizedMember\AbstractGenerateMethodService.cs (1)
29Document document,
src\roslyn\src\Analyzers\Core\CodeFixes\GenerateParameterizedMember\AbstractGenerateParameterizedMemberService.CodeAction.cs (5)
19private readonly Document _document; 27Document document, 63protected override async Task<Document> GetChangedDocumentAsync(CancellationToken cancellationToken) 71var result = await CodeGenerator.AddPropertyDeclarationAsync( 87var result = await CodeGenerator.AddMethodDeclarationAsync(
src\roslyn\src\Analyzers\Core\CodeFixes\GenerateParameterizedMember\AbstractGenerateParameterizedMemberService.cs (1)
38protected async ValueTask<ImmutableArray<CodeAction>> GetActionsAsync(Document document, State state, CancellationToken cancellationToken)
src\roslyn\src\Analyzers\Core\CodeFixes\GenerateParameterizedMember\IGenerateConversionService.cs (1)
15Task<ImmutableArray<CodeAction>> GenerateConversionAsync(Document document, SyntaxNode node, CancellationToken cancellationToken);
src\roslyn\src\Analyzers\Core\CodeFixes\GenerateParameterizedMember\IGenerateDeconstructMemberService.cs (1)
16Document document, SyntaxNode targetVariables, INamedTypeSymbol typeToGenerateIn, CancellationToken cancellationToken);
src\roslyn\src\Analyzers\Core\CodeFixes\GenerateParameterizedMember\IGenerateParameterizedMemberService.cs (1)
15Task<ImmutableArray<CodeAction>> GenerateMethodAsync(Document document, SyntaxNode node, CancellationToken cancellationToken);
src\roslyn\src\Analyzers\Core\CodeFixes\GenerateVariable\AbstractGenerateVariableService.CodeAction.cs (1)
47protected override async Task<Document> GetChangedDocumentAsync(CancellationToken cancellationToken)
src\roslyn\src\Analyzers\Core\CodeFixes\GenerateVariable\AbstractGenerateVariableService.cs (4)
33Document document, 119Document document, State state, SymbolKind kind, Accessibility accessibility, CancellationToken cancellationToken) 179ArrayBuilder<CodeAction> result, Document document, State state, CancellationToken cancellationToken) 195ArrayBuilder<CodeAction> result, Document document, State state, CancellationToken cancellationToken)
src\roslyn\src\Analyzers\Core\CodeFixes\GenerateVariable\AbstractGenerateVariableService.GenerateLocalCodeAction.cs (4)
18private sealed class GenerateLocalCodeAction(TService service, Document document, State state) : CodeAction 21private readonly Document _document = document; 36protected override async Task<Document> GetChangedDocumentAsync(CancellationToken cancellationToken) 39var newDocument = _document.WithSyntaxRoot(newRoot);
src\roslyn\src\Analyzers\Core\CodeFixes\GenerateVariable\AbstractGenerateVariableService.GenerateParameterCodeAction.cs (2)
18Document document, 23private readonly Document _document = document;
src\roslyn\src\Analyzers\Core\CodeFixes\GenerateVariable\IGenerateVariableService.cs (1)
15Task<ImmutableArray<CodeAction>> GenerateVariableAsync(Document document, SyntaxNode node, CancellationToken cancellationToken);
src\roslyn\src\Analyzers\Core\CodeFixes\ImplementAbstractClass\AbstractImplementAbstractClassCodeFixProvider.cs (1)
26var document = context.Document;
src\roslyn\src\Analyzers\Core\CodeFixes\ImplementAbstractClass\ImplementAbstractClassData.cs (6)
27Document document, ImplementTypeOptions options, SyntaxNode classNode, SyntaxToken classIdentifier, 31private readonly Document _document = document; 41Document document, SyntaxNode classNode, SyntaxToken classIdentifier, CancellationToken cancellationToken) 76public static async Task<Document?> TryImplementAbstractClassAsync( 77Document document, SyntaxNode classNode, SyntaxToken classIdentifier, CancellationToken cancellationToken) 86public async Task<Document> ImplementAbstractClassAsync(
src\roslyn\src\Analyzers\Core\CodeFixes\ImplementInterface\AbstractImplementInterfaceCodeFixProvider.cs (1)
20var document = context.Document;
src\roslyn\src\Analyzers\Core\CodeFixes\ImplementInterface\AbstractImplementInterfaceService.cs (10)
37protected abstract bool TryInitializeState(Document document, SemanticModel model, SyntaxNode interfaceNode, CancellationToken cancellationToken, 58public async Task<Document> ImplementInterfaceAsync( 59Document document, ImplementTypeOptions options, SyntaxNode node, CancellationToken cancellationToken) 78private async Task<ImplementInterfaceInfo?> AnalyzeAsync(Document document, SyntaxNode interfaceType, CancellationToken cancellationToken) 107private async Task<Document> ImplementInterfaceAsync( 108Document document, 120Document document, 146public async Task<ImmutableArray<CodeAction>> GetCodeActionsAsync(Document document, SyntaxNode? interfaceType, CancellationToken cancellationToken) 174Document document, ImplementInterfaceInfo state, [EnumeratorCancellation] CancellationToken cancellationToken) 300Document document, ImplementInterfaceInfo state, CancellationToken cancellationToken)
src\roslyn\src\Analyzers\Core\CodeFixes\ImplementInterface\AbstractImplementInterfaceService.State.cs (3)
15Document document, 33public readonly Document Document = document; 44Document document,
src\roslyn\src\Analyzers\Core\CodeFixes\ImplementInterface\IImplementInterfaceService.cs (4)
25Task<Document> ImplementInterfaceAsync(Document document, ImplementTypeOptions options, SyntaxNode node, CancellationToken cancellationToken); 33Document document, 41Document document, SyntaxNode? interfaceType, CancellationToken cancellationToken);
src\roslyn\src\Analyzers\Core\CodeFixes\ImplementInterface\ImplementHelpers.cs (1)
20Document document,
src\roslyn\src\Analyzers\Core\CodeFixes\ImplementInterface\ImplementInterfaceGenerator.cs (4)
29private readonly Document Document; 44Document document, 56public Task<Document> ImplementInterfaceAsync(CancellationToken cancellationToken) 69private async Task<Document> ImplementInterfaceAsync(
src\roslyn\src\Analyzers\Core\CodeFixes\ImplementInterface\ImplementInterfaceGenerator_DisposePattern.cs (7)
39private async Task<Document> ImplementDisposePatternAsync( 43var document = this.Document; 53var docWithCoreMembers = await ImplementInterfaceAsync( 79var docWithAllMembers = docWithCoreMembers.WithSyntaxRoot( 89private async Task<Document> AddFinalizerCommentAsync( 90Document document, SyntaxNode finalizer, CancellationToken cancellationToken) 230Document document,
src\roslyn\src\Analyzers\Core\CodeFixes\ImplementType\ImplementTypeOptions.cs (1)
77public static async ValueTask<ImplementTypeOptions> GetImplementTypeOptionsAsync(this Document document, CancellationToken cancellationToken)
src\roslyn\src\Analyzers\Core\CodeFixes\Iterator\AbstractIteratorCodeFixProvider.cs (1)
17protected abstract Task<CodeAction?> GetCodeFixAsync(SyntaxNode root, SyntaxNode node, Document document, Diagnostic diagnostics, CancellationToken cancellationToken);
src\roslyn\src\Analyzers\Core\CodeFixes\MakeFieldReadonly\AbstractMakeFieldReadonlyCodeFixProvider.cs (2)
37Document document, 55Document document, SyntaxEditor editor, List<TSymbolSyntax> declarators, CancellationToken cancellationToken)
src\roslyn\src\Analyzers\Core\CodeFixes\MakeMemberStatic\AbstractMakeMemberStaticCodeFixProvider.cs (1)
28protected sealed override async Task FixAllAsync(Document document, ImmutableArray<Diagnostic> diagnostics, SyntaxEditor editor,
src\roslyn\src\Analyzers\Core\CodeFixes\MakeMethodAsynchronous\AbstractMakeMethodAsynchronousCodeFixProvider.cs (7)
39var document = context.Document; 98private static bool IsLikelyEntryPointName(string name, Document document) 107Document document, 160Document document, 176var newDocument = newSolution.GetRequiredDocument(document.Id); 190Document document, 209var partialDefinitionDocument = solution.GetDocument(partialDefinitionNode.SyntaxTree);
src\roslyn\src\Analyzers\Core\CodeFixes\MakeMethodSynchronous\AbstractMakeMethodSynchronousCodeFixProvider.cs (8)
50Document document, SyntaxNode node, CancellationToken cancellationToken) 71private async Task<Solution> RenameThenRemoveAsyncTokenAsync(Document document, SyntaxNode node, IMethodSymbol methodSymbol, CancellationToken cancellationToken) 82var newDocument = newSolution.GetRequiredDocument(document.Id); 95Document document, IMethodSymbol methodSymbol, SyntaxNode node, CancellationToken cancellationToken) 107var newDocument = document.WithSyntaxRoot(newRoot); 118Document document, SyntaxAnnotation annotation, CancellationToken cancellationToken) 169Solution currentSolution, IGrouping<Document, ReferenceLocation> group, CancellationToken cancellationToken) 171var document = group.Key;
src\roslyn\src\Analyzers\Core\CodeFixes\MakeTypeAbstract\AbstractMakeTypeAbstractCodeFixProvider.cs (1)
28protected sealed override async Task FixAllAsync(Document document, ImmutableArray<Diagnostic> diagnostics, SyntaxEditor editor,
src\roslyn\src\Analyzers\Core\CodeFixes\MakeTypePartial\AbstractMakeTypePartialCodeFixProvider.cs (1)
23protected override async Task FixAllAsync(Document document, ImmutableArray<Diagnostic> diagnostics, SyntaxEditor editor, CancellationToken cancellationToken)
src\roslyn\src\Analyzers\Core\CodeFixes\MatchFolderAndNamespace\AbstractChangeNamespaceToMatchFolderCodeFixProvider.cs (2)
40private static async Task<Solution> FixAllInDocumentAsync(Document document, ImmutableArray<Diagnostic> diagnostics, CancellationToken cancellationToken) 53var documentWithInvalidFolders = document.WithFolders(document.Folders.Concat("Force-Namespace-Change"));
src\roslyn\src\Analyzers\Core\CodeFixes\MatchFolderAndNamespace\AbstractChangeNamespaceToMatchFolderCodeFixProvider.CustomFixAllProvider.cs (1)
89var document = newSolution.GetRequiredDocument(documentId);
src\roslyn\src\Analyzers\Core\CodeFixes\Naming\NamingExtensions.cs (2)
17this Document document, SymbolKind symbolKind, Accessibility accessibility, CancellationToken cancellationToken) 35this Document document, CancellationToken cancellationToken)
src\roslyn\src\Analyzers\Core\CodeFixes\NamingStyle\NamingStyleCodeFixProvider.cs (2)
54var document = context.Document; 104Document document, ISymbol symbol, string fixedName, CancellationToken cancellationToken)
src\roslyn\src\Analyzers\Core\CodeFixes\NewLines\ConsecutiveStatementPlacement\ConsecutiveStatementPlacementCodeFixProvider.cs (5)
31var document = context.Document; 40private static Task<Document> UpdateDocumentAsync(Document document, Diagnostic diagnostic, CancellationToken cancellationToken) 43public static async Task<Document> FixAllAsync(Document document, ImmutableArray<Diagnostic> diagnostics, CancellationToken cancellationToken)
src\roslyn\src\Analyzers\Core\CodeFixes\NewLines\MultipleBlankLines\AbstractMultipleBlankLinesCodeFixProvider.cs (5)
31var document = context.Document; 40private static Task<Document> UpdateDocumentAsync(Document document, Diagnostic diagnostic, CancellationToken cancellationToken) 43private static async Task<Document> FixAllAsync( 44Document document, ImmutableArray<Diagnostic> diagnostics, CancellationToken cancellationToken)
src\roslyn\src\Analyzers\Core\CodeFixes\OrderModifiers\AbstractOrderModifiersCodeFixProvider.cs (1)
44Document document, ImmutableArray<Diagnostic> diagnostics, SyntaxEditor editor, CancellationToken cancellationToken)
src\roslyn\src\Analyzers\Core\CodeFixes\PopulateSwitch\AbstractPopulateSwitchCodeFixProvider.cs (10)
45Document document, SyntaxEditor editor, SemanticModel semanticModel, 59var document = context.Document; 97private Task<Document> FixAsync( 98Document document, Diagnostic diagnostic, 106private Task<Document> FixAllAsync( 107Document document, ImmutableArray<Diagnostic> diagnostics, 117Document document, SyntaxEditor editor, ImmutableArray<Diagnostic> diagnostics, 130Document document, SyntaxEditor editor, Diagnostic diagnostic, 196Document document, 212Document document,
src\roslyn\src\Analyzers\Core\CodeFixes\PopulateSwitch\AbstractPopulateSwitchExpressionCodeFixProvider.cs (1)
24Document document, SyntaxEditor editor, SemanticModel semanticModel,
src\roslyn\src\Analyzers\Core\CodeFixes\PopulateSwitch\AbstractPopulateSwitchStatementCodeFixProvider.cs (1)
31Document document, SyntaxEditor editor, SemanticModel semanticModel,
src\roslyn\src\Analyzers\Core\CodeFixes\QualifyMemberAccess\AbstractQualifyMemberAccessCodeFixProvider.cs (1)
33Document document, ImmutableArray<Diagnostic> diagnostics,
src\roslyn\src\Analyzers\Core\CodeFixes\RemoveAsyncModifier\AbstractRemoveAsyncModifierCodeFixProvider.cs (2)
29var document = context.Document; 53Document document, ImmutableArray<Diagnostic> diagnostics,
src\roslyn\src\Analyzers\Core\CodeFixes\RemoveRedundantEquality\RemoveRedundantEqualityCodeFixProvider.cs (1)
30Document document,
src\roslyn\src\Analyzers\Core\CodeFixes\RemoveUnnecessaryImports\AbstractRemoveUnnecessaryImportsCodeFixProvider.cs (4)
44private static Task<Document> RemoveUnnecessaryImportsAsync( 45Document document, 53Document document, ImmutableArray<Diagnostic> diagnostics, SyntaxEditor editor, CancellationToken cancellationToken) 55var newDocument = await RemoveUnnecessaryImportsAsync(document, cancellationToken).ConfigureAwait(false);
src\roslyn\src\Analyzers\Core\CodeFixes\RemoveUnnecessaryParentheses\AbstractRemoveUnnecessaryParenthesesCodeFixProvider.cs (1)
32Document document, ImmutableArray<Diagnostic> diagnostics,
src\roslyn\src\Analyzers\Core\CodeFixes\RemoveUnnecessarySuppressions\RemoveUnnecessaryAttributeSuppressionsCodeFixProvider.cs (1)
39protected override async Task FixAllAsync(Document document, ImmutableArray<Diagnostic> diagnostics, SyntaxEditor editor, CancellationToken cancellationToken)
src\roslyn\src\Analyzers\Core\CodeFixes\RemoveUnnecessarySuppressions\RemoveUnnecessaryPragmaSuppressionsCodeFixProvider.cs (1)
45protected override async Task FixAllAsync(Document document, ImmutableArray<Diagnostic> diagnostics, SyntaxEditor editor, CancellationToken cancellationToken)
src\roslyn\src\Analyzers\Core\CodeFixes\RemoveUnusedMembers\AbstractRemoveUnusedMembersCodeFixProvider.cs (1)
40Document document,
src\roslyn\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; 915Document document,
src\roslyn\src\Analyzers\Core\CodeFixes\SimplifyBooleanExpression\SimplifyConditionalCodeFixProvider.cs (1)
35Document document,
src\roslyn\src\Analyzers\Core\CodeFixes\SimplifyInterpolation\AbstractSimplifyInterpolationCodeFixProvider.cs (1)
46Document document, ImmutableArray<Diagnostic> diagnostics,
src\roslyn\src\Analyzers\Core\CodeFixes\SimplifyLinqExpression\SimplifyLinqExpressionCodeFixProvider.cs (1)
33Document document,
src\roslyn\src\Analyzers\Core\CodeFixes\UnsealClass\AbstractUnsealClassCodeFixProvider.cs (2)
31var document = context.Document; 63var document = solution.GetRequiredDocument(documentId);
src\roslyn\src\Analyzers\Core\CodeFixes\UpdateLegacySuppressions\UpdateLegacySuppressionsCodeFixProvider.cs (1)
40protected override async Task FixAllAsync(Document document, ImmutableArray<Diagnostic> diagnostics, SyntaxEditor editor, CancellationToken cancellationToken)
src\roslyn\src\Analyzers\Core\CodeFixes\UseAutoProperty\AbstractUseAutoPropertyCodeFixProvider.cs (14)
69Document document, SyntaxNode finalPropertyDeclaration); 72Document propertyDocument, 124var fieldDocument = currentSolution.GetRequiredDocument(field.DeclaringSyntaxReferences[0].GetSyntax(cancellationToken).SyntaxTree); 125var propertyDocument = currentSolution.GetRequiredDocument(property.DeclaringSyntaxReferences[0].GetSyntax(cancellationToken).SyntaxTree); 234var updatedFieldDocument = fieldDocument.WithSyntaxRoot(editor.GetChangedRoot()); 249var updatedFieldDocument = fieldDocument.WithSyntaxRoot(newFieldTreeRoot); 250var updatedPropertyDocument = propertyDocument.WithSyntaxRoot(newPropertyTreeRoot); 326var document = group.Key; 382var document = solution.GetDocument(documentId); 405var fieldDocument = originalSolution.GetRequiredDocument(declarator.SyntaxTree); 410var propertyDocument = originalSolution.GetRequiredDocument(property.SyntaxTree); 455Document document, 469var cleanedDocument = await CodeCleanupHelpers.CleanupSyntaxAsync( 500var document = group.Key;
src\roslyn\src\Analyzers\Core\CodeFixes\UseCoalesceExpression\AbstractUseCoalesceExpressionForIfNullStatementCheckCodeFixProvider.cs (1)
33Document document, ImmutableArray<Diagnostic> diagnostics,
src\roslyn\src\Analyzers\Core\CodeFixes\UseCoalesceExpression\UseCoalesceExpressionForNullableTernaryConditionalCheckCodeFixProvider.cs (1)
36Document document, ImmutableArray<Diagnostic> diagnostics,
src\roslyn\src\Analyzers\Core\CodeFixes\UseCoalesceExpression\UseCoalesceExpressionForTernaryConditionalCheckCodeFixProvider.cs (1)
37Document document, ImmutableArray<Diagnostic> diagnostics,
src\roslyn\src\Analyzers\Core\CodeFixes\UseCollectionExpression\AbstractUseCollectionExpressionCodeFixProvider.cs (1)
27protected override bool IncludeDiagnosticDuringFixAll(Diagnostic diagnostic, Document document, string? equivalenceKey, CancellationToken cancellationToken)
src\roslyn\src\Analyzers\Core\CodeFixes\UseCollectionInitializer\AbstractUseCollectionInitializerCodeFixProvider.cs (2)
56Document document, TObjectCreationExpressionSyntax objectCreation, bool useCollectionExpression, 61Document document,
src\roslyn\src\Analyzers\Core\CodeFixes\UseCompoundAssignment\AbstractUseCompoundAssignmentCodeFixProvider.cs (1)
50Document document, ImmutableArray<Diagnostic> diagnostics,
src\roslyn\src\Analyzers\Core\CodeFixes\UseConditionalExpression\AbstractUseConditionalExpressionCodeFixProvider.cs (4)
43Document document, Diagnostic diagnostic, 47Document document, ImmutableArray<Diagnostic> diagnostics, SyntaxEditor editor, 87Document document, IConditionalOperation ifOperation, 155Document document, SyntaxNode condition, SyntaxNode trueSyntax, SyntaxNode falseSyntax, SyntaxFormattingOptions formattingOptions,
src\roslyn\src\Analyzers\Core\CodeFixes\UseConditionalExpression\ForAssignment\AbstractUseConditionalExpressionForAssignmentCodeFixProvider.cs (1)
57Document document,
src\roslyn\src\Analyzers\Core\CodeFixes\UseConditionalExpression\ForReturn\AbstractUseConditionalExpressionForReturnCodeFixProvider.cs (1)
44Document document,
src\roslyn\src\Analyzers\Core\CodeFixes\UseExplicitTupleName\UseExplicitTupleNameCodeFixProvider.cs (1)
32Document document, ImmutableArray<Diagnostic> diagnostics,
src\roslyn\src\Analyzers\Core\CodeFixes\UseInferredMemberName\AbstractUseInferredMemberNameCodeFixProvider.cs (1)
27Document document, ImmutableArray<Diagnostic> diagnostics,
src\roslyn\src\Analyzers\Core\CodeFixes\UseIsNullCheck\AbstractUseIsNullForReferenceEqualsCodeFixProvider.cs (1)
46Document document, ImmutableArray<Diagnostic> diagnostics,
src\roslyn\src\Analyzers\Core\CodeFixes\UseNullPropagation\AbstractUseNullPropagationCodeFixProvider.cs (3)
80Document document, 99Document document, 157Document document,
src\roslyn\src\Analyzers\Core\CodeFixes\UseObjectInitializer\AbstractUseObjectInitializerCodeFixProvider.cs (1)
64Document document,
src\roslyn\src\Analyzers\Core\CodeFixes\UseSystemHashCode\UseSystemHashCodeCodeFixProvider.cs (1)
34Document document, ImmutableArray<Diagnostic> diagnostics,
src\roslyn\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\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeCleanup\CodeCleanupHelpers.cs (4)
14public static async Task<Document> CleanupSyntaxAsync( 15Document document, CodeCleanupOptions options, CancellationToken cancellationToken) 21var document1 = await syntaxFormatting.FormatAsync(document, Formatter.Annotation, options.FormattingOptions, cancellationToken).ConfigureAwait(false); 24var document2 = await syntaxFormatting.FormatAsync(document1, SyntaxAnnotation.ElasticAnnotation, options.FormattingOptions, cancellationToken).ConfigureAwait(false);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeCleanup\CodeCleanupOptionsProviders.cs (1)
27public static async ValueTask<CodeCleanupOptions> GetCodeCleanupOptionsAsync(this Document document, CancellationToken cancellationToken)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeFixes\FixAllContextHelper.cs (7)
22public static async Task<ImmutableDictionary<Document, ImmutableArray<Diagnostic>>> GetDocumentDiagnosticsToFixAsync( 29var document = fixAllContext.Document; 41return ImmutableDictionary<Document, ImmutableArray<Diagnostic>>.Empty.SetItem(document, documentDiagnostics); 106return ImmutableDictionary<Document, ImmutableArray<Diagnostic>>.Empty; 132private static async Task<ImmutableDictionary<Document, ImmutableArray<Diagnostic>>> GetDocumentDiagnosticsToFixAsync( 137var builder = ImmutableDictionary.CreateBuilder<Document, ImmutableArray<Diagnostic>>(); 142if (textDocument is not Document document)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeFixes\ForkingSyntaxEditorBasedCodeFixProvider.cs (2)
38Document document, 55Document document,
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeFixes\MultiProjectSafeFixAllProvider.cs (2)
78var document = fixAllContext.Solution.GetRequiredDocument(documentId); 91var linkedDocument = fixAllContext.Solution.GetRequiredDocument(linkedDocumentId);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeFixes\SyntaxEditorBasedCodeFixProvider.cs (8)
63protected Func<CancellationToken, Task<Document>> GetDocumentUpdater(CodeFixContext context, Diagnostic? diagnostic = null) 69private Task<Document> FixAllAsync( 70Document document, ImmutableArray<Diagnostic> diagnostics, CancellationToken cancellationToken) 78internal static async Task<Document> FixAllWithEditorAsync( 79Document document, 98Document document, ImmutableArray<Diagnostic> diagnostics, SyntaxEditor editor, CancellationToken cancellationToken); 111protected virtual bool IncludeDiagnosticDuringFixAll(Diagnostic diagnostic, Document document, string? equivalenceKey, CancellationToken cancellationToken) 122/// cref="IncludeDiagnosticDuringFixAll(Diagnostic, Document, string, CancellationToken)"/> should be overridden
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeFixesAndRefactorings\AbstractFixAllSpanMappingService.cs (9)
20protected abstract Task<ImmutableDictionary<Document, ImmutableArray<TextSpan>>> GetFixAllSpansIfWithinGlobalStatementAsync( 21Document document, TextSpan span, CancellationToken cancellationToken); 23public Task<ImmutableDictionary<Document, ImmutableArray<TextSpan>>> GetFixAllSpansAsync( 24Document document, TextSpan triggerSpan, FixAllScope fixAllScope, CancellationToken cancellationToken) 32private async Task<ImmutableDictionary<Document, ImmutableArray<TextSpan>>> GetFixAllSpansAsync( 33Document document, TextSpan span, bool fixAllInContainingMember, CancellationToken cancellationToken) 50var builder = PooledDictionary<Document, ArrayBuilder<TextSpan>>.GetInstance(); 53var documentForLocation = document.Project.GetDocument(syntaxRef.SyntaxTree); 73Document document,
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeFixesAndRefactorings\FixAllHelper.cs (1)
14Document triggerDocument,
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeFixesAndRefactorings\IFixAllSpanMappingService.cs (2)
30Task<ImmutableDictionary<Document, ImmutableArray<TextSpan>>> GetFixAllSpansAsync( 31Document document, TextSpan triggerSpan, FixAllScope fixAllScope, CancellationToken cancellationToken);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\AbstractCodeGenerationService.cs (12)
229private async Task<Document> GetEditAsync( 242var oldDocument = context.Solution.GetRequiredDocument(destinationTree); 252var newDocument = oldDocument.WithSyntaxRoot(currentRoot); 391public virtual Task<Document> AddEventAsync( 401public Task<Document> AddFieldAsync(CodeGenerationSolutionContext context, INamedTypeSymbol destination, IFieldSymbol field, CancellationToken cancellationToken) 410public Task<Document> AddPropertyAsync(CodeGenerationSolutionContext context, INamedTypeSymbol destination, IPropertySymbol property, CancellationToken cancellationToken) 419public Task<Document> AddNamedTypeAsync(CodeGenerationSolutionContext context, INamedTypeSymbol destination, INamedTypeSymbol namedType, CancellationToken cancellationToken) 428public Task<Document> AddNamedTypeAsync(CodeGenerationSolutionContext context, INamespaceSymbol destination, INamedTypeSymbol namedType, CancellationToken cancellationToken) 437public Task<Document> AddNamespaceAsync(CodeGenerationSolutionContext context, INamespaceSymbol destination, INamespaceSymbol @namespace, CancellationToken cancellationToken) 446public Task<Document> AddMethodAsync(CodeGenerationSolutionContext context, INamedTypeSymbol destination, IMethodSymbol method, CancellationToken cancellationToken) 455public Task<Document> AddMembersAsync(CodeGenerationSolutionContext context, INamedTypeSymbol destination, IEnumerable<ISymbol> members, CancellationToken cancellationToken) 464public Task<Document> AddNamespaceOrTypeAsync(CodeGenerationSolutionContext context, INamespaceSymbol destination, INamespaceOrTypeSymbol namespaceOrType, CancellationToken cancellationToken)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\AbstractCodeGenerationService_FindDeclaration.cs (1)
79var document = solution.GetDocument(syntaxTree);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\CleanCodeGenerationOptions.cs (1)
39public static async ValueTask<CleanCodeGenerationOptions> GetCleanCodeGenerationOptionsAsync(this Document document, CancellationToken cancellationToken)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\CodeGenerationContext.cs (3)
136public Func<Document, bool>? AllowGenerationIntoHiddenCode { get; } 153Func<Document, bool>? allowGenerationIntoHiddenCode = null) 201Optional<Func<Document, bool>?> allowGenerationIntoHiddenCode = default)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\CodeGenerationOptionsProviders.cs (2)
34public static async ValueTask<CodeGenerationOptions> GetCodeGenerationOptionsAsync(this Document document, CancellationToken cancellationToken) 40public static async ValueTask<CodeGenerationContextInfo> GetCodeGenerationInfoAsync(this Document document, CodeGenerationContext context, CancellationToken cancellationToken)
src\roslyn\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\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\ICodeGenerationService.cs (9)
133Task<Document> AddEventAsync(CodeGenerationSolutionContext context, INamedTypeSymbol destination, IEventSymbol @event, CancellationToken cancellationToken); 138Task<Document> AddFieldAsync(CodeGenerationSolutionContext context, INamedTypeSymbol destination, IFieldSymbol field, CancellationToken cancellationToken); 143Task<Document> AddMethodAsync(CodeGenerationSolutionContext context, INamedTypeSymbol destination, IMethodSymbol method, CancellationToken cancellationToken); 148Task<Document> AddPropertyAsync(CodeGenerationSolutionContext context, INamedTypeSymbol destination, IPropertySymbol property, CancellationToken cancellationToken); 153Task<Document> AddNamedTypeAsync(CodeGenerationSolutionContext context, INamedTypeSymbol destination, INamedTypeSymbol namedType, CancellationToken cancellationToken); 158Task<Document> AddNamedTypeAsync(CodeGenerationSolutionContext context, INamespaceSymbol destination, INamedTypeSymbol namedType, CancellationToken cancellationToken); 163Task<Document> AddNamespaceAsync(CodeGenerationSolutionContext context, INamespaceSymbol destination, INamespaceSymbol @namespace, CancellationToken cancellationToken); 168Task<Document> AddNamespaceOrTypeAsync(CodeGenerationSolutionContext context, INamespaceSymbol destination, INamespaceOrTypeSymbol namespaceOrType, CancellationToken cancellationToken); 173Task<Document> AddMembersAsync(CodeGenerationSolutionContext context, INamedTypeSymbol destination, IEnumerable<ISymbol> members, CancellationToken cancellationToken);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeRefactorings\CodeRefactoringContextExtensions.cs (3)
59public static async Task<TSyntaxNode?> TryGetRelevantNodeAsync<TSyntaxNode>(this Document document, TextSpan span, CancellationToken cancellationToken) where TSyntaxNode : SyntaxNode 76this Document document, TextSpan span, CancellationToken cancellationToken) where TSyntaxNode : SyntaxNode 82this Document document, TextSpan span, bool allowEmptyNodes, CancellationToken cancellationToken) where TSyntaxNode : SyntaxNode
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Editing\ImportAdderService.cs (6)
30public async Task<Document> AddImportsAsync( 31Document document, 109private async Task<Document> AddImportDirectivesFromSyntaxesAsync( 110Document document, 170private async Task<Document> AddImportDirectivesFromSymbolAnnotationsAsync( 171Document document,
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\ContextQuery\ISyntaxContextService.cs (1)
12SyntaxContext CreateContext(Document document, SemanticModel semanticModel, int position, CancellationToken cancellationToken);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\ContextQuery\SyntaxContext.cs (2)
14Document document, 48public Document Document { get; } = document;
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\DocumentExtensions.cs (16)
27public static TLanguageService? GetLanguageService<TLanguageService>(this Document? document) where TLanguageService : class, ILanguageService 30public static TLanguageService GetRequiredLanguageService<TLanguageService>(this Document document) where TLanguageService : class, ILanguageService 33public static async ValueTask<SemanticModel> GetRequiredSemanticModelAsync(this Document document, CancellationToken cancellationToken) 57public static async ValueTask<SyntaxTree> GetRequiredSyntaxTreeAsync(this Document document, CancellationToken cancellationToken) 74public static async ValueTask<SyntaxNode> GetRequiredSyntaxRootAsync(this Document document, CancellationToken cancellationToken) 97public static bool IsRazorSourceGeneratedDocument(this Document? document) 125public static ValueTask<SemanticModel> ReuseExistingSpeculativeModelAsync(this Document document, int position, CancellationToken cancellationToken) 142public static async ValueTask<SemanticModel> ReuseExistingSpeculativeModelAsync(this Document document, TextSpan span, CancellationToken cancellationToken) 167public static ValueTask<SemanticModel> ReuseExistingSpeculativeModelAsync(this Document document, SyntaxNode? node, CancellationToken cancellationToken) 178public static async Task<bool> HasAnyErrorsAsync(this Document document, CancellationToken cancellationToken, List<string>? ignoreErrorCode = null) 184public static async Task<ImmutableArray<Diagnostic>> GetErrorsAsync(this Document document, CancellationToken cancellationToken, IList<string>? ignoreErrorCode = null) 200public static async Task VerifyNoErrorsAsync(this Document newDocument, string message, CancellationToken cancellationToken, List<string>? ignoreErrorCodes = null) 219public static async Task<bool> IsGeneratedCodeAsync(this Document document, CancellationToken cancellationToken) 226public static IEnumerable<Document> GetLinkedDocuments(this Document document) 237public static async ValueTask<IOptionsReader> GetHostAnalyzerConfigOptionsAsync(this Document document, CancellationToken cancellationToken)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\ISolutionExtensions.cs (2)
36public static Document GetRequiredDocument(this Solution solution, SyntaxTree syntaxTree) 50public static Document GetRequiredDocument(this Solution solution, DocumentId documentId)
src\roslyn\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\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\TextDocumentExtensions.cs (1)
31case Document document:
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Formatting\DocumentFormattingOptionsProviders.cs (1)
22public static async ValueTask<DocumentFormattingOptions> GetDocumentFormattingOptionsAsync(this Document document, CancellationToken cancellationToken)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Formatting\FormatterShared.cs (4)
21public Task<Document> FormatAsync(Document document, SyntaxAnnotation annotation, SyntaxFormattingOptions options, CancellationToken cancellationToken) 24public async Task<Document> FormatAsync(Document document, SyntaxAnnotation annotation, SyntaxFormattingOptions options, ImmutableArray<AbstractFormattingRule> rules, CancellationToken cancellationToken)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Formatting\LineFormattingOptionsProviders.cs (1)
17public static async ValueTask<LineFormattingOptions> GetLineFormattingOptionsAsync(this Document document, CancellationToken cancellationToken)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Formatting\SyntaxFormattingOptionsProviders.cs (1)
17public static async ValueTask<SyntaxFormattingOptions> GetSyntaxFormattingOptionsAsync(this Document document, CancellationToken cancellationToken)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\LanguageServices\GeneratedCodeRecognition\AbstractGeneratedCodeRecognitionService.cs (2)
24public async Task<bool> IsGeneratedCodeAsync(Document document, CancellationToken cancellationToken) 30private static bool IsGeneratedCode(SyntaxTree syntaxTree, Document document, CancellationToken cancellationToken)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\LanguageServices\GeneratedCodeRecognition\IGeneratedCodeRecognitionService.cs (1)
17Task<bool> IsGeneratedCodeAsync(Document document, CancellationToken cancellationToken);
src\roslyn\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\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\LanguageServices\InitializeParameter\IInitializeParameterService.cs (1)
22Document document, IParameterSymbol parameter, ISymbol fieldOrProperty, CancellationToken cancellationToken);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\LanguageServices\MoveDeclarationNearReference\AbstractMoveDeclarationNearReferenceService.cs (9)
36protected abstract Task<bool> TypesAreCompatibleAsync(Document document, ILocalSymbol localSymbol, TLocalDeclarationStatementSyntax declarationStatement, SyntaxNode right, CancellationToken cancellationToken); 38public async Task<(bool canMove, bool mayChangeSemantics)> CanMoveDeclarationNearReferenceAsync(Document document, SyntaxNode node, CancellationToken cancellationToken) 47private async Task<State> ComputeStateAsync(Document document, SyntaxNode node, CancellationToken cancellationToken) 77public async Task<Document> MoveDeclarationNearReferenceAsync( 78Document document, SyntaxNode localDeclarationStatement, CancellationToken cancellationToken) 119Document document, State state, SyntaxEditor editor, SyntaxAnnotation warningAnnotation, CancellationToken cancellationToken) 160Document document, State state, SyntaxEditor editor, SyntaxAnnotation warningAnnotation) 205Document document, 236Document document, State state)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\LanguageServices\MoveDeclarationNearReference\AbstractMoveDeclarationNearReferenceService.State.cs (2)
40Document document, 55Document document,
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\LanguageServices\MoveDeclarationNearReference\IMoveDeclarationNearReferenceService.cs (3)
17Task<(bool canMove, bool mayChangeSemantics)> CanMoveDeclarationNearReferenceAsync(Document document, SyntaxNode localDeclarationStatement, CancellationToken cancellationToken); 24Task<Document> MoveDeclarationNearReferenceAsync(Document document, SyntaxNode localDeclarationStatement, CancellationToken cancellationToken);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\LanguageServices\RemoveUnnecessaryImports\AbstractRemoveUnnecessaryImportsService.cs (6)
19public Task<Document> RemoveUnnecessaryImportsAsync(Document document, CancellationToken cancellationToken) 22public abstract Task<Document> RemoveUnnecessaryImportsAsync(Document fromDocument, Func<SyntaxNode, bool>? predicate, CancellationToken cancellationToken); 25Document document, Func<SyntaxNode, bool> predicate, CancellationToken cancellationToken) 32foreach (var current in document.GetLinkedDocuments())
src\roslyn\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\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\LanguageServices\ReplaceDiscardDeclarationsWithAssignments\IReplaceDiscardDeclarationsWithAssignmentsService.cs (1)
30Task<SyntaxNode> ReplaceAsync(Document document, SyntaxNode memberDeclaration, CancellationToken cancellationToken);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\NamingStyles\NamingStylePreferencesProviders.cs (1)
15public static async ValueTask<NamingStylePreferences> GetNamingStylePreferencesAsync(this Document document, CancellationToken cancellationToken)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Options\MemberDisplayOptions.cs (1)
50public static async ValueTask<MemberDisplayOptions> GetMemberDisplayOptionsAsync(this Document document, CancellationToken cancellationToken)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\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);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\SemanticModelReuse\SemanticModelWorkspaceServiceFactory.SemanticModelWorkspaceService.cs (3)
94public async ValueTask<SemanticModel> ReuseExistingSpeculativeModelAsync(Document document, SyntaxNode node, CancellationToken cancellationToken) 138ImmutableDictionary<DocumentId, SemanticModelReuseInfo?> map, Document document, SyntaxNode bodyNode, CancellationToken cancellationToken) 176Document document,
src\roslyn\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, 238var newDocument = document.WithSyntaxRoot(newRoot); 294private async Task<Document> RemoveUnusedNamespaceImportsAsync( 295Document document,
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Simplification\ISimplificationService.cs (2)
30Task<Document> ReduceAsync( 31Document document,
src\roslyn\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\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Utilities\ParsedDocument.cs (5)
15/// Represents a <see cref="Document"/> content that has been parsed. 20/// In general, any feature API that accepts <see cref="ParsedDocument"/> should be synchronous and not access <see cref="Document"/> or <see cref="Solution"/> snapshots. 31public static async ValueTask<ParsedDocument> CreateAsync(Document document, CancellationToken cancellationToken) 66/// Equivalent semantics to <see cref="Document.GetTextChangesAsync(Document, CancellationToken)"/>
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Utilities\SemanticDocument.cs (3)
13internal sealed class SemanticDocument(Document document, SourceText text, SyntaxNode root, SemanticModel semanticModel) 18public static new async Task<SemanticDocument> CreateAsync(Document document, CancellationToken cancellationToken) 28var newDocument = this.Document.WithSyntaxRoot(root);
src\roslyn\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);
Microsoft.CodeAnalysis.CSharp.CodeStyle.Fixes (213)
src\roslyn\src\Analyzers\CSharp\CodeFixes\AddBraces\CSharpAddBracesCodeFixProvider.cs (1)
31Document document, ImmutableArray<Diagnostic> diagnostics,
src\roslyn\src\Analyzers\CSharp\CodeFixes\AddExplicitCast\CSharpAddExplicitCastCodeFixProvider.cs (1)
51Document document,
src\roslyn\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\roslyn\src\Analyzers\CSharp\CodeFixes\AssignOutParameters\AbstractAssignOutParametersCodeFixProvider.cs (4)
31var document = context.Document; 46protected abstract void TryRegisterFix(CodeFixContext context, Document document, SyntaxNode container, SyntaxNode location); 95Document document, ImmutableArray<Diagnostic> diagnostics, CancellationToken cancellationToken) 134Document document, ImmutableArray<Diagnostic> diagnostics,
src\roslyn\src\Analyzers\CSharp\CodeFixes\AssignOutParameters\AssignOutParametersAboveReturnCodeFixProvider.cs (1)
26protected override void TryRegisterFix(CodeFixContext context, Document document, SyntaxNode container, SyntaxNode location)
src\roslyn\src\Analyzers\CSharp\CodeFixes\AssignOutParameters\AssignOutParametersAtStartCodeFixProvider.cs (1)
24protected override void TryRegisterFix(CodeFixContext context, Document document, SyntaxNode container, SyntaxNode location)
src\roslyn\src\Analyzers\CSharp\CodeFixes\ConditionalExpressionInStringInterpolation\CSharpAddParenthesesAroundConditionalExpressionInInterpolatedStringCodeFixProvider.cs (5)
50private static async Task<Document> GetChangedDocumentAsync(Document document, int conditionalExpressionSyntaxStartPosition, CancellationToken cancellationToken) 64var documentWithOpenParenthesis = document.WithText(textWithOpenParenthesis); 79private static async Task<Document> InsertCloseParenthesisAsync( 80Document document,
src\roslyn\src\Analyzers\CSharp\CodeFixes\ConvertNamespace\ConvertNamespaceCodeFixProvider.cs (2)
47Document document, ImmutableArray<Diagnostic> diagnostics, 55var converted = await ConvertNamespaceTransform.ConvertAsync(document, namespaceDecl, options, cancellationToken).ConfigureAwait(false);
src\roslyn\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\roslyn\src\Analyzers\CSharp\CodeFixes\ConvertSwitchStatementToExpression\ConvertSwitchStatementToExpressionCodeFixProvider.cs (1)
41Document document, ImmutableArray<Diagnostic> diagnostics,
src\roslyn\src\Analyzers\CSharp\CodeFixes\ConvertToRecord\ConvertToRecordEngine.cs (2)
34Document document, TypeDeclarationSyntax typeDeclaration, CancellationToken cancellationToken) 80Document document,
src\roslyn\src\Analyzers\CSharp\CodeFixes\ConvertToRecord\CSharpConvertToRecordCodeFixProvider.cs (1)
31var document = context.Document;
src\roslyn\src\Analyzers\CSharp\CodeFixes\DisambiguateSameVariable\CSharpDisambiguateSameVariableCodeFixProvider.cs (2)
39var document = context.Document; 133Document document, ImmutableArray<Diagnostic> diagnostics,
src\roslyn\src\Analyzers\CSharp\CodeFixes\FixIncorrectConstraint\CSharpFixIncorrectConstraintCodeFixProvider.cs (1)
75Document document, ImmutableArray<Diagnostic> diagnostics,
src\roslyn\src\Analyzers\CSharp\CodeFixes\FixReturnType\CSharpFixReturnTypeCodeFixProvider.cs (3)
38var document = context.Document; 62Document document, ImmutableArray<Diagnostic> diagnostics, CancellationToken cancellationToken) 126protected override async Task FixAllAsync(Document document, ImmutableArray<Diagnostic> diagnostics, SyntaxEditor editor, CancellationToken cancellationToken)
src\roslyn\src\Analyzers\CSharp\CodeFixes\GenerateConstructor\GenerateConstructorCodeFixProvider.cs (1)
41Document document, SyntaxNode node, CancellationToken cancellationToken)
src\roslyn\src\Analyzers\CSharp\CodeFixes\GenerateEnumMember\GenerateEnumMemberCodeFixProvider.cs (1)
31protected override Task<ImmutableArray<CodeAction>> GetCodeActionsAsync(Document document, SyntaxNode node, CancellationToken cancellationToken)
src\roslyn\src\Analyzers\CSharp\CodeFixes\GenerateMethod\GenerateConversionCodeFixProvider.cs (1)
58Document document, SyntaxNode node, CancellationToken cancellationToken)
src\roslyn\src\Analyzers\CSharp\CodeFixes\GenerateMethod\GenerateDeconstructMethodCodeFixProvider.cs (1)
39var document = context.Document;
src\roslyn\src\Analyzers\CSharp\CodeFixes\GenerateMethod\GenerateMethodCodeFixProvider.cs (1)
81Document document, SyntaxNode node, CancellationToken cancellationToken)
src\roslyn\src\Analyzers\CSharp\CodeFixes\GenerateVariable\CSharpGenerateVariableCodeFixProvider.cs (1)
48Document document, SyntaxNode node, CancellationToken cancellationToken)
src\roslyn\src\Analyzers\CSharp\CodeFixes\HiddenExplicitCast\CSharpHiddenExplicitCastCodeFixProvider.cs (1)
36Document document,
src\roslyn\src\Analyzers\CSharp\CodeFixes\HideBase\HideBaseCodeFixProvider.AddNewKeywordAction.cs (2)
22private static async Task<Document> GetChangedDocumentAsync( 23Document document, SyntaxNode node, CancellationToken cancellationToken)
src\roslyn\src\Analyzers\CSharp\CodeFixes\HideBase\HideBaseCodeFixProvider.cs (2)
59Document document, ImmutableArray<Diagnostic> diagnostics, SyntaxEditor editor, CancellationToken cancellationToken) 75private static async Task<Dictionary<int, int>?> GetModifierOrderAsync(Document document, CancellationToken cancellationToken)
src\roslyn\src\Analyzers\CSharp\CodeFixes\ImplementInterface\CSharpImplementInterfaceService.cs (1)
49Document document, SemanticModel model, SyntaxNode node, CancellationToken cancellationToken,
src\roslyn\src\Analyzers\CSharp\CodeFixes\InlineDeclaration\CSharpInlineDeclarationCodeFixProvider.cs (2)
45Document document, ImmutableArray<Diagnostic> diagnostics, 95Document document,
src\roslyn\src\Analyzers\CSharp\CodeFixes\InvokeDelegateWithConditionalAccess\InvokeDelegateWithConditionalAccessCodeFixProvider.cs (1)
44Document document, ImmutableArray<Diagnostic> diagnostics,
src\roslyn\src\Analyzers\CSharp\CodeFixes\Iterator\CSharpAddYieldCodeFixProvider.cs (1)
45protected override async Task<CodeAction?> GetCodeFixAsync(SyntaxNode root, SyntaxNode node, Document document, Diagnostic diagnostics, CancellationToken cancellationToken)
src\roslyn\src\Analyzers\CSharp\CodeFixes\Iterator\CSharpChangeToIEnumerableCodeFixProvider.cs (2)
36protected override async Task<CodeAction?> GetCodeFixAsync(SyntaxNode root, SyntaxNode node, Document document, Diagnostic diagnostics, CancellationToken cancellationToken) 75Document? newDocument = null;
src\roslyn\src\Analyzers\CSharp\CodeFixes\MakeAnonymousFunctionStatic\CSharpMakeAnonymousFunctionStaticCodeFixProvider.cs (1)
36protected override async Task FixAllAsync(Document document, ImmutableArray<Diagnostic> diagnostics, SyntaxEditor editor, CancellationToken cancellationToken)
src\roslyn\src\Analyzers\CSharp\CodeFixes\MakeLocalFunctionStatic\MakeLocalFunctionStaticCodeFixHelper.cs (3)
26public static async Task<Document> MakeLocalFunctionStaticAsync( 27Document document, 39Document document,
src\roslyn\src\Analyzers\CSharp\CodeFixes\MakeLocalFunctionStatic\MakeLocalFunctionStaticCodeFixProvider.cs (1)
31Document document, ImmutableArray<Diagnostic> diagnostics, SyntaxEditor editor, CancellationToken cancellationToken)
src\roslyn\src\Analyzers\CSharp\CodeFixes\MakeLocalFunctionStatic\PassInCapturedVariablesAsArgumentsCodeFixProvider.cs (3)
50protected override Task FixAllAsync(Document document, ImmutableArray<Diagnostic> diagnostics, SyntaxEditor editor, CancellationToken cancellationToken) 61Document document, 63Func<Document, LocalFunctionStatementSyntax, ImmutableArray<ISymbol>, Task> fixer,
src\roslyn\src\Analyzers\CSharp\CodeFixes\MakeMemberRequired\CSharpMakeMemberRequiredCodeFixProvider.cs (2)
33var document = context.Document; 109protected override async Task FixAllAsync(Document document, ImmutableArray<Diagnostic> diagnostics, SyntaxEditor editor, CancellationToken cancellationToken)
src\roslyn\src\Analyzers\CSharp\CodeFixes\MakeRefStruct\MakeRefStructCodeFixProvider.cs (3)
37var document = context.Document; 63private static async Task<Document> FixCodeAsync( 64Document document,
src\roslyn\src\Analyzers\CSharp\CodeFixes\MakeStatementAsynchronous\CSharpMakeStatementAsynchronousCodeFixProvider.cs (1)
48Document document, ImmutableArray<Diagnostic> diagnostics,
src\roslyn\src\Analyzers\CSharp\CodeFixes\MakeStructFieldsWritable\CSharpMakeStructFieldsWritableCodeFixProvider.cs (1)
34Document document,
src\roslyn\src\Analyzers\CSharp\CodeFixes\MakeStructMemberReadOnly\CSharpMakeStructMemberReadOnlyCodeFixProvider.cs (1)
35Document document,
src\roslyn\src\Analyzers\CSharp\CodeFixes\MakeStructReadOnly\CSharpMakeStructReadOnlyCodeFixProvider.cs (1)
33Document document,
src\roslyn\src\Analyzers\CSharp\CodeFixes\MisplacedUsingDirectives\MisplacedUsingDirectivesCodeFixProvider.cs (8)
59var document = context.Document; 84internal static async Task<Document> TransformDocumentIfRequiredAsync( 85Document document, 134private static async Task<Document> GetTransformedDocumentAsync( 135Document document, 158var newDocument = document.WithSyntaxRoot(newCompilationUnitWithHeader); 171Document document, CompilationUnitSyntax compilationUnit, ImmutableArray<UsingDirectiveSyntax> allUsingDirectives, CancellationToken cancellationToken) 187private static async Task<SyntaxNode> ExpandUsingDirectiveAsync(Document document, UsingDirectiveSyntax usingDirective, CancellationToken cancellationToken)
src\roslyn\src\Analyzers\CSharp\CodeFixes\NewLines\ArrowExpressionClausePlacement\ArrowExpressionClausePlacementCodeFixProvider.cs (3)
32var document = context.Document; 42private static async Task<Document> UpdateDocumentAsync( 43Document document, ImmutableArray<Diagnostic> diagnostics, CancellationToken cancellationToken)
src\roslyn\src\Analyzers\CSharp\CodeFixes\NewLines\ConditionalExpressionPlacement\ConditionalExpressionPlacementCodeFixProvider.cs (3)
32var document = context.Document; 42private static async Task<Document> UpdateDocumentAsync( 43Document document, ImmutableArray<Diagnostic> diagnostics, CancellationToken cancellationToken)
src\roslyn\src\Analyzers\CSharp\CodeFixes\NewLines\ConsecutiveBracePlacement\ConsecutiveBracePlacementCodeFixProvider.cs (5)
33var document = context.Document; 43private static Task<Document> UpdateDocumentAsync(Document document, Diagnostic diagnostic, CancellationToken cancellationToken) 46public static async Task<Document> FixAllAsync(Document document, ImmutableArray<Diagnostic> diagnostics, CancellationToken cancellationToken)
src\roslyn\src\Analyzers\CSharp\CodeFixes\NewLines\ConstructorInitializerPlacement\ConstructorInitializerPlacementCodeFixProvider.cs (3)
32var document = context.Document; 42private static async Task<Document> UpdateDocumentAsync( 43Document document, ImmutableArray<Diagnostic> diagnostics, CancellationToken cancellationToken)
src\roslyn\src\Analyzers\CSharp\CodeFixes\NewLines\EmbeddedStatementPlacement\EmbeddedStatementPlacementCodeFixProvider.cs (3)
35var document = context.Document; 45public static async Task<Document> FixAllAsync(Document document, ImmutableArray<Diagnostic> diagnostics, CancellationToken cancellationToken)
src\roslyn\src\Analyzers\CSharp\CodeFixes\Nullable\CSharpDeclareAsNullableCodeFixProvider.cs (4)
74Document document, 92protected override bool IncludeDiagnosticDuringFixAll(Diagnostic diagnostic, Document document, string? equivalenceKey, CancellationToken cancellationToken) 99Document document, SemanticModel model, SyntaxEditor editor, SyntaxNode node, HashSet<TypeSyntax> alreadyHandled, CancellationToken cancellationToken) 111Document document, SemanticModel? model, SyntaxNode node, CancellationToken cancellationToken)
src\roslyn\src\Analyzers\CSharp\CodeFixes\RemoveConfusingSuppression\CSharpRemoveConfusingSuppressionCodeFixProvider.cs (3)
35var document = context.Document; 54private static async Task<Document> FixAllAsync( 55Document document, ImmutableArray<Diagnostic> diagnostics,
src\roslyn\src\Analyzers\CSharp\CodeFixes\RemoveInKeyword\RemoveInKeywordCodeFixProvider.cs (2)
54private static async Task<Document> FixAsync( 55Document document,
src\roslyn\src\Analyzers\CSharp\CodeFixes\RemoveNewModifier\RemoveNewModifierCodeFixProvider.cs (2)
56private static async Task<Document> FixAsync( 57Document document,
src\roslyn\src\Analyzers\CSharp\CodeFixes\RemoveUnneccessaryUnsafeModifier\CSharpRemoveUnnecessaryUnsafeModifierCodeFixProvider.cs (2)
39private static async Task<Document> FixAllAsync(Document document, ImmutableArray<Diagnostic> diagnostics, CancellationToken cancellationToken)
src\roslyn\src\Analyzers\CSharp\CodeFixes\RemoveUnnecessaryCast\CSharpRemoveUnnecessaryCastCodeFixProvider.cs (1)
37Document document, ImmutableArray<Diagnostic> diagnostics,
src\roslyn\src\Analyzers\CSharp\CodeFixes\RemoveUnnecessaryDiscardDesignation\CSharpRemoveUnnecessaryDiscardDesignationCodeFixProvider.cs (1)
34Document document, ImmutableArray<Diagnostic> diagnostics,
src\roslyn\src\Analyzers\CSharp\CodeFixes\RemoveUnnecessaryLambdaExpression\CSharpRemoveUnnecessaryLambdaExpressionCodeFixProvider.cs (1)
40Document document, ImmutableArray<Diagnostic> diagnostics,
src\roslyn\src\Analyzers\CSharp\CodeFixes\RemoveUnnecessaryNullableDirective\CSharpRemoveUnnecessaryNullableDirectiveCodeFixProvider.cs (1)
46Document document,
src\roslyn\src\Analyzers\CSharp\CodeFixes\RemoveUnnecessarySuppressions\CSharpRemoveUnnecessaryNullableWarningSuppressionsCodeFixProvider.cs (3)
40private static async Task<Document> FixSingleDocumentAsync(Document document, ImmutableArray<Diagnostic> diagnostics, CancellationToken cancellationToken) 48foreach (var linkedDocument in document.GetLinkedDocuments())
src\roslyn\src\Analyzers\CSharp\CodeFixes\RemoveUnreachableCode\CSharpRemoveUnreachableCodeCodeFixProvider.cs (1)
49Document document,
src\roslyn\src\Analyzers\CSharp\CodeFixes\RemoveUnusedLocalFunction\CSharpRemoveUnusedLocalFunctionCodeFixProvider.cs (1)
36protected override async Task FixAllAsync(Document document, ImmutableArray<Diagnostic> diagnostics, SyntaxEditor editor, CancellationToken cancellationToken)
src\roslyn\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\roslyn\src\Analyzers\CSharp\CodeFixes\SimplifyLinqExpression\CSharpSimplifyLinqTypeCheckAndCastCodeFixProvider.cs (1)
36Document document,
src\roslyn\src\Analyzers\CSharp\CodeFixes\SimplifyPropertyAccessor\CSharpSimplifyPropertyAccessorCodeFixProvider.cs (1)
36protected override async Task FixAllAsync(Document document, ImmutableArray<Diagnostic> diagnostics, SyntaxEditor editor, CancellationToken cancellationToken)
src\roslyn\src\Analyzers\CSharp\CodeFixes\SimplifyPropertyPattern\CSharpSimplifyPropertyPatternCodeFixProvider.cs (1)
38Document document, ImmutableArray<Diagnostic> diagnostics,
src\roslyn\src\Analyzers\CSharp\CodeFixes\TransposeRecordKeyword\CSharpTransposeRecordKeywordCodeFixProvider.cs (1)
94Document document, ImmutableArray<Diagnostic> diagnostics,
src\roslyn\src\Analyzers\CSharp\CodeFixes\UseAutoProperty\CSharpUseAutoPropertyCodeFixProvider.cs (2)
81Document propertyDocument, 221Document document,
src\roslyn\src\Analyzers\CSharp\CodeFixes\UseCollectionExpression\CSharpCollectionExpressionRewriter.cs (1)
36Document workspaceDocument,
src\roslyn\src\Analyzers\CSharp\CodeFixes\UseCollectionExpression\CSharpUseCollectionExpressionForArrayCodeFixProvider.cs (1)
35Document document,
src\roslyn\src\Analyzers\CSharp\CodeFixes\UseCollectionExpression\CSharpUseCollectionExpressionForBuilderCodeFixProvider.cs (5)
38Document document, 55var newDocument = await CreateTrackedDocumentAsync( 105static async Task<Document> CreateTrackedDocumentAsync( 106Document document, 127var newDocument = document.WithSyntaxRoot(newRoot.ReplaceNode(creationExpression, dummyObjectCreation));
src\roslyn\src\Analyzers\CSharp\CodeFixes\UseCollectionExpression\CSharpUseCollectionExpressionForCreateCodeFixProvider.cs (1)
36Document document,
src\roslyn\src\Analyzers\CSharp\CodeFixes\UseCollectionExpression\CSharpUseCollectionExpressionForEmptyCodeFixProvider.cs (1)
34Document document,
src\roslyn\src\Analyzers\CSharp\CodeFixes\UseCollectionExpression\CSharpUseCollectionExpressionForFluentCodeFixProvider.cs (2)
44Document document, 141Document document,
src\roslyn\src\Analyzers\CSharp\CodeFixes\UseCollectionExpression\CSharpUseCollectionExpressionForNewCodeFixProvider.cs (1)
37Document document,
src\roslyn\src\Analyzers\CSharp\CodeFixes\UseCollectionExpression\CSharpUseCollectionExpressionForStackAllocCodeFixProvider.cs (1)
31Document document,
src\roslyn\src\Analyzers\CSharp\CodeFixes\UseCollectionInitializer\CSharpUseCollectionInitializerCodeFixProvider.cs (1)
38Document document,
src\roslyn\src\Analyzers\CSharp\CodeFixes\UseCollectionInitializer\CSharpUseCollectionInitializerCodeFixProvider_CollectionExpression.cs (1)
21Document document,
src\roslyn\src\Analyzers\CSharp\CodeFixes\UseCompoundAssignment\CSharpUseCompoundCoalesceAssignmentCodeFixProvider.cs (1)
40Document document, ImmutableArray<Diagnostic> diagnostics,
src\roslyn\src\Analyzers\CSharp\CodeFixes\UseDeconstruction\CSharpUseDeconstructionCodeFixProvider.cs (2)
37Document document, ImmutableArray<Diagnostic> diagnostics, 56Document document,
src\roslyn\src\Analyzers\CSharp\CodeFixes\UseDefaultLiteral\CSharpUseDefaultLiteralCodeFixProvider.cs (1)
34Document document, ImmutableArray<Diagnostic> diagnostics,
src\roslyn\src\Analyzers\CSharp\CodeFixes\UseExplicitArrayInExpressionTree\CSharpUseExplicitArrayInExpressionTreeCodeFixProvider.cs (1)
115protected override async Task FixAllAsync(Document document, ImmutableArray<Diagnostic> diagnostics, SyntaxEditor editor, CancellationToken cancellationToken)
src\roslyn\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\roslyn\src\Analyzers\CSharp\CodeFixes\UseExpressionBody\UseExpressionBodyCodeFixProvider.cs (1)
53Document document, ImmutableArray<Diagnostic> diagnostics,
src\roslyn\src\Analyzers\CSharp\CodeFixes\UseExpressionBodyForLambda\UseExpressionBodyForLambdaCodeFixProvider.cs (1)
34Document document,
src\roslyn\src\Analyzers\CSharp\CodeFixes\UseImplicitlyTypedLambdaExpression\CSharpUseImplicitObjectCreationCodeFixProvider.cs (1)
39Document document, ImmutableArray<Diagnostic> diagnostics,
src\roslyn\src\Analyzers\CSharp\CodeFixes\UseImplicitObjectCreation\CSharpUseImplicitObjectCreationCodeFixProvider.cs (1)
46Document document, ImmutableArray<Diagnostic> diagnostics,
src\roslyn\src\Analyzers\CSharp\CodeFixes\UseImplicitOrExplicitType\UseExplicitTypeCodeFixProvider.cs (7)
45protected override bool IncludeDiagnosticDuringFixAll(Diagnostic diagnostic, Document document, string? equivalenceKey, CancellationToken cancellationToken) 49Document document, ImmutableArray<Diagnostic> diagnostics, 62Document document, SyntaxEditor editor, 90private static async Task HandleDeclarationExpressionAsync(Document document, SyntaxEditor editor, DeclarationExpressionSyntax declarationExpression, CancellationToken cancellationToken) 118private static Task HandleForEachStatementAsync(Document document, SyntaxEditor editor, ForEachStatementSyntax forEach, CancellationToken cancellationToken) 126private static Task HandleVariableDeclarationAsync(Document document, SyntaxEditor editor, VariableDeclarationSyntax varDecl, CancellationToken cancellationToken) 138Document document,
src\roslyn\src\Analyzers\CSharp\CodeFixes\UseImplicitOrExplicitType\UseImplicitTypeCodeFixProvider.cs (2)
36protected override bool IncludeDiagnosticDuringFixAll(Diagnostic diagnostic, Document document, string? equivalenceKey, CancellationToken cancellationToken) 40Document document, ImmutableArray<Diagnostic> diagnostics,
src\roslyn\src\Analyzers\CSharp\CodeFixes\UseIndexOrRangeOperator\CSharpUseIndexOperatorCodeFixProvider.cs (1)
35Document document, ImmutableArray<Diagnostic> diagnostics,
src\roslyn\src\Analyzers\CSharp\CodeFixes\UseIndexOrRangeOperator\CSharpUseRangeOperatorCodeFixProvider.cs (1)
45Document document, ImmutableArray<Diagnostic> diagnostics,
src\roslyn\src\Analyzers\CSharp\CodeFixes\UseInterpolatedVerbatimString\CSharpUseInterpolatedVerbatimStringCodeFixProvider.cs (1)
35Document document, ImmutableArray<Diagnostic> diagnostics,
src\roslyn\src\Analyzers\CSharp\CodeFixes\UseIsNullCheck\CSharpUseIsNullCheckForCastAndEqualityOperatorCodeFixProvider.cs (1)
49Document document, ImmutableArray<Diagnostic> diagnostics,
src\roslyn\src\Analyzers\CSharp\CodeFixes\UseIsNullCheck\CSharpUseNullCheckOverTypeCheckCodeFixProvider.cs (1)
37Document document, ImmutableArray<Diagnostic> diagnostics,
src\roslyn\src\Analyzers\CSharp\CodeFixes\UseLocalFunction\CSharpUseLocalFunctionCodeFixProvider.cs (2)
53Document document, ImmutableArray<Diagnostic> diagnostics, 180Document document, SyntaxNode currentRoot,
src\roslyn\src\Analyzers\CSharp\CodeFixes\UseNameofInAttribute\CSharpUseNameofInAttributeCodeFixProvider.cs (1)
35Document document,
src\roslyn\src\Analyzers\CSharp\CodeFixes\UsePatternCombinators\CSharpUsePatternCombinatorsCodeFixProvider.cs (2)
52Diagnostic diagnostic, Document document, string? equivalenceKey, CancellationToken cancellationToken) 71Document document, ImmutableArray<Diagnostic> diagnostics,
src\roslyn\src\Analyzers\CSharp\CodeFixes\UsePatternMatching\CSharpAsAndMemberAccessCodeFixProvider.cs (1)
39Document document, ImmutableArray<Diagnostic> diagnostics,
src\roslyn\src\Analyzers\CSharp\CodeFixes\UsePatternMatching\CSharpAsAndNullCheckCodeFixProvider.cs (1)
39Document document, ImmutableArray<Diagnostic> diagnostics,
src\roslyn\src\Analyzers\CSharp\CodeFixes\UsePatternMatching\CSharpIsAndCastCheckCodeFixProvider.cs (1)
36Document document, ImmutableArray<Diagnostic> diagnostics,
src\roslyn\src\Analyzers\CSharp\CodeFixes\UsePatternMatching\CSharpUseNotPatternCodeFixProvider.cs (1)
34Document document, ImmutableArray<Diagnostic> diagnostics,
src\roslyn\src\Analyzers\CSharp\CodeFixes\UsePrimaryConstructor\CSharpUsePrimaryConstructorCodeFixProvider.cs (7)
59var document = context.Document; 94Document document, 110Document document, 475var declarationDocument = solution.GetRequiredDocument(declaration.SyntaxTree); 534var memberDocument = solution.GetRequiredDocument(syntaxTree); 606var document = solution.GetDocument(group.Key); 622var document = solution.GetDocument(group.Key);
src\roslyn\src\Analyzers\CSharp\CodeFixes\UseSimpleUsingStatement\UseSimpleUsingStatementCodeFixProvider.cs (1)
43Document document, ImmutableArray<Diagnostic> diagnostics,
src\roslyn\src\Analyzers\CSharp\CodeFixes\UseSystemThreadingLock\CSharpUseSystemThreadingLockCodeFixProvider.cs (4)
43var document = context.Document; 60Document document, 75Document document, 125var groupDocument = group.Key;
src\roslyn\src\Analyzers\CSharp\CodeFixes\UseThrowExpression\UseThrowExpressionCodeFixProvider.cs (1)
39Document document, ImmutableArray<Diagnostic> diagnostics,
src\roslyn\src\Analyzers\CSharp\CodeFixes\UseTupleSwap\CSharpUseTupleSwapCodeFixProvider.cs (1)
36Document document, ImmutableArray<Diagnostic> diagnostics,
src\roslyn\src\Analyzers\CSharp\CodeFixes\UseUnboundGenericTypeInNameOf\CSharpUseUnboundGenericTypeInNameOfCodeFixProvider.cs (1)
39Document document, ImmutableArray<Diagnostic> diagnostics,
src\roslyn\src\Analyzers\CSharp\CodeFixes\UseUtf8StringLiteral\UseUtf8StringLiteralCodeFixProvider.cs (1)
42Document document, ImmutableArray<Diagnostic> diagnostics,
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\CodeFixesAndRefactorings\CSharpFixAllSpanMappingService.cs (5)
24protected override async Task<ImmutableDictionary<Document, ImmutableArray<TextSpan>>> GetFixAllSpansIfWithinGlobalStatementAsync( 25Document document, TextSpan span, CancellationToken cancellationToken) 30return ImmutableDictionary<Document, ImmutableArray<TextSpan>>.Empty; 43return ImmutableDictionary<Document, ImmutableArray<TextSpan>>.Empty; 48return ImmutableDictionary<Document, ImmutableArray<TextSpan>>.Empty
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\CodeGeneration\CSharpCodeGenerationService.cs (2)
62public override async Task<Document> AddEventAsync( 65var newDocument = await base.AddEventAsync(
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\ContextQuery\CSharpSyntaxContext.cs (3)
51Document document, 181public static CSharpSyntaxContext CreateContext(Document document, SemanticModel semanticModel, int position, CancellationToken cancellationToken) 185Document document, SemanticModel semanticModel, int position, CancellationToken cancellationToken)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\ContextQuery\CSharpSyntaxContextService.cs (1)
18public SyntaxContext CreateContext(Document document, SemanticModel semanticModel, int position, CancellationToken cancellationToken)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Formatting\CSharpSyntaxFormattingOptionsProviders.cs (1)
13public static async ValueTask<CSharpSyntaxFormattingOptions> GetCSharpSyntaxFormattingOptionsAsync(this Document document, CancellationToken cancellationToken)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\LanguageServices\CSharpMoveDeclarationNearReferenceService.cs (1)
53Document document, ILocalSymbol localSymbol,
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\LanguageServices\CSharpRemoveUnnecessaryImportsService.cs (2)
37public override async Task<Document> RemoveUnnecessaryImportsAsync( 38Document document,
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\LanguageServices\CSharpReplaceDiscardDeclarationsWithAssignmentsService.cs (1)
37Document document,
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\LanguageServices\InitializeParameter\CSharpInitializeParameterService.cs (1)
109protected override Task<Solution> TryAddAssignmentForPrimaryConstructorAsync(Document document, IParameterSymbol parameter, ISymbol fieldOrProperty, CancellationToken cancellationToken)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\LanguageServices\InitializeParameter\InitializeParameterHelpers.cs (3)
34Document document, 62var editingDocument = solution.GetRequiredDocument(propertyDeclaration.SyntaxTree); 82var editingDocument = solution.GetRequiredDocument(variableDeclarator.SyntaxTree);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Simplification\CSharpSimplifierOptionsProviders.cs (1)
13public static async ValueTask<CSharpSimplifierOptions> GetCSharpSimplifierOptionsAsync(this Document document, CancellationToken cancellationToken)
Microsoft.CodeAnalysis.CSharp.Features (504)
AddDebuggerDisplay\CSharpAddDebuggerDisplayCodeRefactoringProvider.cs (1)
24protected override bool SupportsConstantInterpolatedStrings(Document document)
AddImport\CSharpAddImportFeatureService.cs (7)
304Document document, 353protected override async Task<Document> AddImportAsync( 356Document document, 366Document document, CompilationUnitSyntax root, SyntaxNode contextNode, INamespaceOrTypeSymbol namespaceOrTypeSymbol, 401protected override async Task<Document> AddImportAsync( 403Document document, AddImportPlacementOptions options, CancellationToken cancellationToken) 450Document document,
BraceCompletion\LessAndGreaterThanBraceCompletionService.cs (1)
38protected override async ValueTask<bool> IsValidOpenBraceTokenAtPositionAsync(Document document, SyntaxToken token, int position, 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) 237public override SyntaxNode? FindNodeToUpdate(Document document, SyntaxNode node) 785Document document, 868Document document, 905protected override ImmutableArray<AbstractFormattingRule> GetFormattingRules(Document document)
CodeFixes\GenerateType\GenerateTypeCodeFixProvider.cs (1)
58Document document, SyntaxNode node, CancellationToken cancellationToken)
CodeLens\CSharpCodeLensMemberFinder.cs (1)
27public async Task<ImmutableArray<CodeLensMember>> GetCodeLensMembersAsync(Document document, CancellationToken cancellationToken)
CodeRefactorings\ConvertLocalFunctionToMethod\CSharpConvertLocalFunctionToMethodCodeRefactoringProvider.cs (2)
63private static async Task<Document> UpdateDocumentAsync( 64Document 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)
136private static async Task<Document> InlineTemporaryAsync(Document document, VariableDeclaratorSyntax declarator, CancellationToken cancellationToken) 316private static async Task<VariableDeclaratorSyntax> FindDeclaratorAsync(Document document, CancellationToken cancellationToken) 319private static async Task<T> FindNodeWithAnnotationAsync<T>(Document document, SyntaxAnnotation annotation, CancellationToken cancellationToken) 329private static async Task<ImmutableArray<IdentifierNameSyntax>> FindReferenceAnnotatedNodesAsync(Document document, CancellationToken cancellationToken) 431Document document,
CodeRefactorings\MoveType\CSharpMoveTypeService.cs (1)
29protected override async Task<BaseTypeDeclarationSyntax?> GetRelevantNodeAsync(Document document, TextSpan textSpan, CancellationToken cancellationToken)
CodeRefactorings\SyncNamespace\CSharpChangeNamespaceService.cs (2)
46Document document, 344protected override async Task<SyntaxNode?> TryGetApplicableContainerFromSpanAsync(Document document, TextSpan span, CancellationToken cancellationToken)
CodeRefactorings\SyncNamespace\CSharpSyncNamespaceCodeRefactoringProvider.cs (1)
25protected 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\AwaitCompletionProvider.cs (1)
119var document = solution.GetDocument(containingType.DeclaringSyntaxReferences.FirstOrDefault(r => r.SyntaxTree == methodDeclaration.SyntaxTree)?.SyntaxTree);
Completion\CompletionProviders\CrefCompletionProvider.cs (2)
64var document = context.Document; 89Document 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)
43public static async Task<NameDeclarationInfo> GetDeclarationInfoAsync(Document document, int position, CancellationToken cancellationToken) 65private static async Task<NameDeclarationInfo> GetDeclarationInfoWorkerAsync(Document document, int position, CancellationToken cancellationToken)
Completion\CompletionProviders\DeclarationName\DeclarationNameRecommender.cs (1)
37Document document,
Completion\CompletionProviders\DeclarationName\IDeclarationNameRecommender.cs (1)
17Document document,
Completion\CompletionProviders\EnumAndCompletionListTagCompletionProvider.cs (2)
61var document = context.Document; 309internal override Task<CompletionDescription> GetDescriptionWorkerAsync(Document document, CompletionItem item, CompletionOptions options, SymbolDescriptionOptions displayOptions, CancellationToken cancellationToken)
Completion\CompletionProviders\ExplicitInterfaceMemberCompletionProvider.cs (2)
37Document document, 127internal override Task<CompletionDescription> GetDescriptionWorkerAsync(Document document, CompletionItem item, CompletionOptions options, SymbolDescriptionOptions displayOptions, CancellationToken cancellationToken)
Completion\CompletionProviders\ExplicitInterfaceMemberCompletionProvider.ItemGetter.cs (2)
32Document document, 49Document document,
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\ExtensionMemberImportCompletionProvider.cs (1)
50Document document,
Completion\CompletionProviders\ImportCompletion\TypeImportCompletionProvider.cs (1)
52Document document,
Completion\CompletionProviders\NamedParameterCompletionProvider.cs (2)
52var document = context.Document; 117internal 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) 93Document document, SemanticModel semanticModel, int position, CancellationToken cancellationToken) 122private static ITypeSymbol? GetInitializedType(SyntaxToken token, Document document, SemanticModel semanticModel, CancellationToken cancellationToken)
Completion\CompletionProviders\OperatorsAndIndexer\UnnamedSymbolCompletionProvider.cs (5)
99var document = context.Document; 142Document document, 158Document document, 174private static Task<CompletionChange> ReplaceTextAfterOperatorAsync(Document document, CompletionItem item, string text, CancellationToken cancellationToken) 178Document 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)
79Document document, CompletionItem selectedItem, char? ch, CancellationToken cancellationToken)
Completion\CompletionProviders\PropertySubPatternCompletionProvider.cs (5)
43var document = context.Document; 103static ITypeSymbol? GetMemberAccessType(ITypeSymbol? type, ExpressionSyntax? expression, Document document, SemanticModel semanticModel, int position) 122static ITypeSymbol? GetMemberType(ITypeSymbol? type, string name, Document document, SemanticModel semanticModel, int position) 139static 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)
73var document = context.Document; 99Document document, CompletionContext completionContext, CancellationToken cancellationToken)
Completion\CompletionProviders\SpeculativeTCompletionProvider.cs (2)
42var document = context.Document; 62private 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)
70Document document, int position,
Completion\CSharpCompletionService.cs (1)
71internal override async Task<bool> IsSpeculativeTypeParameterContextAsync(Document document, int position, CancellationToken cancellationToken)
ConvertAutoPropertyToFullProperty\CSharpConvertAutoPropertyToFullPropertyCodeRefactoringProvider.cs (3)
36protected override async Task<string> GetFieldNameAsync(Document document, IPropertySymbol property, CancellationToken cancellationToken) 162protected override async Task<Document> ExpandToFieldPropertyAsync( 163Document document, PropertyDeclarationSyntax 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)
72Document document, 131async 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)
30public static async Task<Document> ConvertToTopLevelStatementsAsync( 31Document document, MethodDeclarationSyntax methodDeclaration, CancellationToken cancellationToken) 61private static async Task<Document> ConvertFileScopedNamespaceAsync(Document document, CodeCleanupOptions cleanupOptions, CancellationToken cancellationToken) 69private static async Task<Document> AddUsingDirectivesAsync( 70Document document, SyntaxNode root, BaseNamespaceDeclarationSyntax namespaceDeclaration, CodeCleanupOptions options, CancellationToken cancellationToken) 81var documentWithImportsAdded = document.WithSyntaxRoot(addImportsService.AddImports(
ConvertProgram\ConvertToProgramMainCodeFixProvider.cs (3)
34var document = context.Document; 46Document document, ImmutableArray<Diagnostic> diagnostics, SyntaxEditor editor, CancellationToken cancellationToken) 49var fixedDocument = await ConvertToProgramMainAsync(document, options.AccessibilityModifiersRequired, cancellationToken).ConfigureAwait(false);
ConvertProgram\ConvertToTopLevelStatementsCodeFixProvider.cs (3)
33var document = context.Document; 45Document document, ImmutableArray<Diagnostic> diagnostics, SyntaxEditor editor, CancellationToken cancellationToken) 49var newDocument = await ConvertToTopLevelStatementsAsync(document, methodDeclaration, cancellationToken).ConfigureAwait(false);
ConvertToExtension\ConvertToExtensionCodeRefactoringProvider.cs (3)
145var document = context.Document; 192private static async Task<Document> ConvertToExtensionAsync( 193Document document,
ConvertToExtension\ConvertToExtensionFixAllProvider.cs (2)
28protected override async Task<Document?> RefactorAllAsync( 30Document document,
ConvertToRawString\ConvertStringToRawStringCodeRefactoringProvider.cs (3)
127private static async Task<Document> UpdateDocumentAsync( 128Document document, 143Document document,
Copilot\CSharpCopilotCodeFixProvider.cs (3)
54var document = context.Document; 90Document document, 121async Task<Document> GetFixedDocumentAsync(SyntaxNode method, string fix, CancellationToken cancellationToken)
Copilot\CSharpCopilotCodeFixProvider.DocumentChangeCodeAction.cs (1)
23Func<IProgress<CodeAnalysisProgress>, CancellationToken, Task<Document>> createChangedDocument,
Copilot\CSharpCopilotProposalAdjusterService.cs (4)
28protected override async Task<Document> AddMissingTokensIfAppropriateAsync( 29Document originalDocument, Document forkedDocument, CancellationToken cancellationToken) 53var fixedDocument = forkedDocument.WithText(newText.WithChanges(insertCloseBraceTextChanges));
Copilot\CSharpImplementNotImplementedExceptionFixProvider.cs (3)
42var document = context.Document; 84Document document, ImmutableArray<Diagnostic> diagnostics, 164Func<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 (10)
31public async Task<Document?> AddSourceToAsync(Document document, Compilation symbolCompilation, ISymbol symbol, MetadataReference? metadataReference, string? assemblyLocation, SyntaxFormattingOptions? formattingOptions, CancellationToken cancellationToken) 39var decompiledDocument = decompilationService.PerformDecompilation(document, fullName, symbolCompilation, metadataReference, assemblyLocation); 55public static async Task<Document> FormatDocumentAsync(Document document, SyntaxFormattingOptions? formattingOptions, CancellationToken cancellationToken) 60var formattedDoc = await Formatter.FormatAsync( 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 (3)
36protected override async Task<SyntaxNode> RewriteFieldNameAndAccessibilityAsync(string originalFieldName, bool makePrivate, Document document, SyntaxAnnotation declarationAnnotation, CancellationToken cancellationToken) 105var withField = await codeGenService.AddFieldAsync( 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)
172protected override AbstractFormattingRule GetCustomFormattingRule(Document document) 178protected override async Task<(Document document, SyntaxToken invocationNameToken)> InsertNewLineBeforeLocalFunctionIfNecessaryAsync( 179Document document,
ExtractMethod\CSharpMethodExtractor.CSharpCodeGenerator.cs (2)
1070var newDocument = await GenerateNewDocumentAsync(methodSymbol, returnType, originalDocument, cancellationToken).ConfigureAwait(false); 1116static async Task<Document> GenerateNewDocumentAsync(
ExtractMethod\CSharpMethodExtractor.CSharpCodeGenerator.ExpressionCodeGenerator.cs (1)
149var 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 (4)
27public async Task<Document> FormatNewDocumentAsync(Document document, Document? hintDocument, CodeCleanupOptions options, CancellationToken cancellationToken) 30var organizedDocument = await organizeImportsService.OrganizeImportsAsync(document, options.GetOrganizeImportsOptions(), cancellationToken).ConfigureAwait(false);
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)
542INamedTypeSymbol namedTypeSymbol, string[] containers, Document selectedDocument, SyntaxNode selectedDocumentRoot, CancellationToken cancellationToken) 713Solution updatedSolution, SyntaxNode modifiedRoot, Document document, SimpleNameSyntax simpleName, string includeUsingsOrImports, CancellationToken cancellationToken)
ImplementInterface\AbstractChangeImplementationCodeRefactoringProvider.cs (2)
231var documentToImplDeclarations = new OrderedMultiDictionary<Document, (SyntaxNode, ISymbol impl, SetWithInsertionOrder<ISymbol> interfaceMembers)>(); 239var doc = solution.GetRequiredDocument(location.SourceTree);
ImplementInterface\CSharpImplementExplicitlyCodeRefactoringProvider.cs (1)
63var document = group.Key;
InitializeParameter\CSharpInitializeMemberFromPrimaryConstructorParameterCodeRefactoringProvider_Update.cs (4)
24Document document, 44var currentDocument = currentSolution.GetRequiredDocument(document.Id); 73Document document, 106var editingDocument = solution.GetRequiredDocument(preferredTypeDeclaration.SyntaxTree);
IntroduceVariable\CSharpIntroduceLocalForExpressionCodeRefactoringProvider.cs (1)
89Document document,
IntroduceVariable\CSharpIntroduceVariableService_IntroduceField.cs (1)
25protected override Task<Document> IntroduceFieldAsync(
IntroduceVariable\CSharpIntroduceVariableService_IntroduceLocal.cs (5)
29protected override Document IntroduceLocal( 109private Document IntroduceLocalDeclarationIntoLambda( 231private Document RewriteExpressionBodiedMemberAndIntroduceLocalDeclaration( 287private Document IntroduceLocalDeclarationIntoCompilationUnit( 357private Document IntroduceLocalDeclarationIntoBlock(
IntroduceVariable\CSharpIntroduceVariableService_IntroduceQueryLocal.cs (2)
25protected override Document IntroduceQueryLocal( 75private Document IntroduceQueryLocalForSingleOccurrence(
LineSeparators\CSharpLineSeparatorService.cs (1)
34Document 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 (1)
50Document document, bool supportsCodeGeneration, CancellationToken cancellationToken)
Organizing\CSharpOrganizingService.cs (2)
25protected override async Task<Document> ProcessAsync(Document document, IEnumerable<ISyntaxOrganizer> organizers, CancellationToken cancellationToken)
QuickInfo\CSharpDiagnosticAnalyzerQuickInfoProvider.cs (4)
34var document = context.Document; 42Document document, SyntaxToken token, CancellationToken cancellationToken) 83Document document, 126Document document, string errorCode, TextSpan location, CancellationToken cancellationToken)
QuickInfo\CSharpSemanticQuickInfoProvider.cs (2)
310var document = context.Document; 366var syntaxReferenceDocument = solution.GetDocument(reference.SyntaxTree);
QuickInfo\OnTheFlyDocsUtilities.cs (1)
26var syntaxReferenceDocument = solution.GetDocument(typeSyntaxReference.SyntaxTree);
RawStringLiteral\CSharpRawStringLiteralOnAutoInsertService.cs (4)
21public TextChange? GetTextChangeForQuote(Document document, SourceText text, int caretPosition, CancellationToken cancellationToken) 35Document document, 82Document document, 133Document document,
ReplacePropertyWithMethods\CSharpReplacePropertyWithMethodsService.cs (1)
36Document document,
ReverseForStatement\CSharpReverseForStatementCodeRefactoringProvider.cs (2)
262private static async Task<Document> ReverseForStatementAsync( 263Document document, ForStatementSyntax forStatement, CancellationToken cancellationToken)
SignatureHelp\AbstractGenericNameSignatureHelpProvider.cs (1)
39protected override async Task<SignatureHelpItems?> GetItemsWorkerAsync(Document document, int position, SignatureHelpTriggerInfo triggerInfo, MemberDisplayOptions options, CancellationToken cancellationToken)
SignatureHelp\AbstractOrdinaryMethodSignatureHelpProvider.cs (2)
17Document document, 26Document document,
SignatureHelp\AttributeSignatureHelpProvider.cs (1)
72protected override async Task<SignatureHelpItems?> GetItemsWorkerAsync(Document document, int position, SignatureHelpTriggerInfo triggerInfo, MemberDisplayOptions options, CancellationToken cancellationToken)
SignatureHelp\ConstructorInitializerSignatureHelpProvider.cs (3)
38Document document, 59protected override async Task<SignatureHelpItems?> GetItemsWorkerAsync(Document document, int position, SignatureHelpTriggerInfo triggerInfo, MemberDisplayOptions options, CancellationToken cancellationToken) 109Document document, int position, TextSpan currentSpan, CancellationToken cancellationToken)
SignatureHelp\ElementAccessExpressionSignatureHelpProvider.cs (1)
50protected override async Task<SignatureHelpItems?> GetItemsWorkerAsync(Document document, int position, SignatureHelpTriggerInfo triggerInfo, MemberDisplayOptions options, CancellationToken cancellationToken)
SignatureHelp\InitializerExpressionSignatureHelpProvider.cs (1)
55protected override async Task<SignatureHelpItems?> GetItemsWorkerAsync(Document document, int position, SignatureHelpTriggerInfo triggerInfo, MemberDisplayOptions options, CancellationToken cancellationToken)
SignatureHelp\InvocationExpressionSignatureHelpProvider.cs (4)
37private async Task<InvocationExpressionSyntax?> TryGetInvocationExpressionAsync(Document document, int position, SignatureHelpTriggerReason triggerReason, CancellationToken cancellationToken) 55Document document, 110Document document, 156Document document,
SignatureHelp\InvocationExpressionSignatureHelpProviderBase_MethodGroup.cs (1)
22Document document,
SignatureHelp\ObjectCreationExpressionSignatureHelpProvider.cs (4)
31Document document, 52protected override async Task<SignatureHelpItems?> GetItemsWorkerAsync(Document document, int position, SignatureHelpTriggerInfo triggerInfo, MemberDisplayOptions options, CancellationToken cancellationToken) 101private async Task<SignatureHelpItems?> GetItemsWorkerForDelegateAsync(Document document, int position, BaseObjectCreationExpressionSyntax objectCreationExpression, 126Document document, int position, TextSpan currentSpan, CancellationToken cancellationToken)
SignatureHelp\PrimaryConstructorBaseTypeSignatureHelpProvider.cs (1)
69protected override async Task<SignatureHelpItems?> GetItemsWorkerAsync(Document document, int position, SignatureHelpTriggerInfo triggerInfo, MemberDisplayOptions options, CancellationToken cancellationToken)
SignatureHelp\TupleConstructionSignatureHelpProvider.cs (1)
106protected override async Task<SignatureHelpItems?> GetItemsWorkerAsync(Document document, int position, SignatureHelpTriggerInfo triggerInfo, MemberDisplayOptions options, CancellationToken cancellationToken)
SignatureHelp\WithElementSignatureHelpProvider.cs (3)
30Document document, 51protected override async Task<SignatureHelpItems?> GetItemsWorkerAsync(Document document, int position, SignatureHelpTriggerInfo triggerInfo, MemberDisplayOptions options, CancellationToken cancellationToken) 100Document document, int position, TextSpan currentSpan, CancellationToken cancellationToken)
Snippets\AbstractCSharpAutoPropertySnippetProvider.cs (2)
42protected override async Task<PropertyDeclarationSyntax> GenerateSnippetSyntaxAsync(Document document, int position, CancellationToken cancellationToken) 79Document document, PropertyDeclarationSyntax propertyDeclaration, ISyntaxFacts syntaxFacts, CancellationToken cancellationToken)
Snippets\AbstractCSharpForLoopSnippetProvider.cs (4)
49Document document, ForStatementSyntax snippetExpressionNode, CancellationToken cancellationToken) 112Document document, ForStatementSyntax forStatement, ISyntaxFacts syntaxFacts, CancellationToken cancellationToken) 145protected override Task<Document> AddIndentationToDocumentAsync(Document document, ForStatementSyntax forStatement, CancellationToken cancellationToken)
Snippets\AbstractCSharpTypeSnippetProvider.cs (3)
47protected override async Task<TextChange?> GetAccessibilityModifiersChangeAsync(Document document, int position, CancellationToken cancellationToken) 98protected override async Task<Document> AddIndentationToDocumentAsync(Document document, TTypeDeclarationSyntax typeDeclaration, 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)
51protected 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\CSharpForEachLoopSnippetProvider.cs (3)
115Document document, ForEachStatementSyntax node, ISyntaxFacts syntaxFacts, CancellationToken cancellationToken) 132protected 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\CSharpIntMainSnippetProvider.cs (2)
50protected override async Task<Document> AddIndentationToDocumentAsync(Document document, MethodDeclarationSyntax methodDeclaration, CancellationToken cancellationToken)
Snippets\CSharpLockSnippetProvider.cs (3)
29Document document, LockStatementSyntax node, ISyntaxFacts syntaxFacts, CancellationToken cancellationToken) 41protected 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\CSharpUnsafeSnippetProvider.cs (3)
26protected override Task<TextChange> GenerateSnippetTextChangeAsync(Document document, int position, CancellationToken cancellationToken) 35protected override Task<Document> AddIndentationToDocumentAsync(Document document, UnsafeStatementSyntax unsafeStatement, CancellationToken cancellationToken)
Snippets\CSharpUsingSnippetProvider.cs (3)
29Document document, UsingStatementSyntax node, ISyntaxFacts syntaxFacts, CancellationToken cancellationToken) 41protected override Task<Document> AddIndentationToDocumentAsync(Document document, UsingStatementSyntax usingStatement, 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)
src\roslyn\src\Analyzers\CSharp\CodeFixes\AddBraces\CSharpAddBracesCodeFixProvider.cs (1)
31Document document, ImmutableArray<Diagnostic> diagnostics,
src\roslyn\src\Analyzers\CSharp\CodeFixes\AddExplicitCast\CSharpAddExplicitCastCodeFixProvider.cs (1)
51Document document,
src\roslyn\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\roslyn\src\Analyzers\CSharp\CodeFixes\AssignOutParameters\AbstractAssignOutParametersCodeFixProvider.cs (4)
31var document = context.Document; 46protected abstract void TryRegisterFix(CodeFixContext context, Document document, SyntaxNode container, SyntaxNode location); 95Document document, ImmutableArray<Diagnostic> diagnostics, CancellationToken cancellationToken) 134Document document, ImmutableArray<Diagnostic> diagnostics,
src\roslyn\src\Analyzers\CSharp\CodeFixes\AssignOutParameters\AssignOutParametersAboveReturnCodeFixProvider.cs (1)
26protected override void TryRegisterFix(CodeFixContext context, Document document, SyntaxNode container, SyntaxNode location)
src\roslyn\src\Analyzers\CSharp\CodeFixes\AssignOutParameters\AssignOutParametersAtStartCodeFixProvider.cs (1)
24protected override void TryRegisterFix(CodeFixContext context, Document document, SyntaxNode container, SyntaxNode location)
src\roslyn\src\Analyzers\CSharp\CodeFixes\ConditionalExpressionInStringInterpolation\CSharpAddParenthesesAroundConditionalExpressionInInterpolatedStringCodeFixProvider.cs (5)
50private static async Task<Document> GetChangedDocumentAsync(Document document, int conditionalExpressionSyntaxStartPosition, CancellationToken cancellationToken) 64var documentWithOpenParenthesis = document.WithText(textWithOpenParenthesis); 79private static async Task<Document> InsertCloseParenthesisAsync( 80Document document,
src\roslyn\src\Analyzers\CSharp\CodeFixes\ConvertNamespace\ConvertNamespaceCodeFixProvider.cs (2)
47Document document, ImmutableArray<Diagnostic> diagnostics, 55var converted = await ConvertNamespaceTransform.ConvertAsync(document, namespaceDecl, options, cancellationToken).ConfigureAwait(false);
src\roslyn\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\roslyn\src\Analyzers\CSharp\CodeFixes\ConvertSwitchStatementToExpression\ConvertSwitchStatementToExpressionCodeFixProvider.cs (1)
41Document document, ImmutableArray<Diagnostic> diagnostics,
src\roslyn\src\Analyzers\CSharp\CodeFixes\ConvertToRecord\ConvertToRecordEngine.cs (2)
34Document document, TypeDeclarationSyntax typeDeclaration, CancellationToken cancellationToken) 80Document document,
src\roslyn\src\Analyzers\CSharp\CodeFixes\ConvertToRecord\CSharpConvertToRecordCodeFixProvider.cs (1)
31var document = context.Document;
src\roslyn\src\Analyzers\CSharp\CodeFixes\DisambiguateSameVariable\CSharpDisambiguateSameVariableCodeFixProvider.cs (2)
39var document = context.Document; 133Document document, ImmutableArray<Diagnostic> diagnostics,
src\roslyn\src\Analyzers\CSharp\CodeFixes\FixIncorrectConstraint\CSharpFixIncorrectConstraintCodeFixProvider.cs (1)
75Document document, ImmutableArray<Diagnostic> diagnostics,
src\roslyn\src\Analyzers\CSharp\CodeFixes\FixReturnType\CSharpFixReturnTypeCodeFixProvider.cs (3)
38var document = context.Document; 62Document document, ImmutableArray<Diagnostic> diagnostics, CancellationToken cancellationToken) 126protected override async Task FixAllAsync(Document document, ImmutableArray<Diagnostic> diagnostics, SyntaxEditor editor, CancellationToken cancellationToken)
src\roslyn\src\Analyzers\CSharp\CodeFixes\GenerateConstructor\GenerateConstructorCodeFixProvider.cs (1)
41Document document, SyntaxNode node, CancellationToken cancellationToken)
src\roslyn\src\Analyzers\CSharp\CodeFixes\GenerateEnumMember\GenerateEnumMemberCodeFixProvider.cs (1)
31protected override Task<ImmutableArray<CodeAction>> GetCodeActionsAsync(Document document, SyntaxNode node, CancellationToken cancellationToken)
src\roslyn\src\Analyzers\CSharp\CodeFixes\GenerateMethod\GenerateConversionCodeFixProvider.cs (1)
58Document document, SyntaxNode node, CancellationToken cancellationToken)
src\roslyn\src\Analyzers\CSharp\CodeFixes\GenerateMethod\GenerateDeconstructMethodCodeFixProvider.cs (1)
39var document = context.Document;
src\roslyn\src\Analyzers\CSharp\CodeFixes\GenerateMethod\GenerateMethodCodeFixProvider.cs (1)
81Document document, SyntaxNode node, CancellationToken cancellationToken)
src\roslyn\src\Analyzers\CSharp\CodeFixes\GenerateVariable\CSharpGenerateVariableCodeFixProvider.cs (1)
48Document document, SyntaxNode node, CancellationToken cancellationToken)
src\roslyn\src\Analyzers\CSharp\CodeFixes\HiddenExplicitCast\CSharpHiddenExplicitCastCodeFixProvider.cs (1)
36Document document,
src\roslyn\src\Analyzers\CSharp\CodeFixes\HideBase\HideBaseCodeFixProvider.AddNewKeywordAction.cs (2)
22private static async Task<Document> GetChangedDocumentAsync( 23Document document, SyntaxNode node, CancellationToken cancellationToken)
src\roslyn\src\Analyzers\CSharp\CodeFixes\HideBase\HideBaseCodeFixProvider.cs (2)
59Document document, ImmutableArray<Diagnostic> diagnostics, SyntaxEditor editor, CancellationToken cancellationToken) 75private static async Task<Dictionary<int, int>?> GetModifierOrderAsync(Document document, CancellationToken cancellationToken)
src\roslyn\src\Analyzers\CSharp\CodeFixes\ImplementInterface\CSharpImplementInterfaceService.cs (1)
49Document document, SemanticModel model, SyntaxNode node, CancellationToken cancellationToken,
src\roslyn\src\Analyzers\CSharp\CodeFixes\InlineDeclaration\CSharpInlineDeclarationCodeFixProvider.cs (2)
45Document document, ImmutableArray<Diagnostic> diagnostics, 95Document document,
src\roslyn\src\Analyzers\CSharp\CodeFixes\InvokeDelegateWithConditionalAccess\InvokeDelegateWithConditionalAccessCodeFixProvider.cs (1)
44Document document, ImmutableArray<Diagnostic> diagnostics,
src\roslyn\src\Analyzers\CSharp\CodeFixes\Iterator\CSharpAddYieldCodeFixProvider.cs (1)
45protected override async Task<CodeAction?> GetCodeFixAsync(SyntaxNode root, SyntaxNode node, Document document, Diagnostic diagnostics, CancellationToken cancellationToken)
src\roslyn\src\Analyzers\CSharp\CodeFixes\Iterator\CSharpChangeToIEnumerableCodeFixProvider.cs (2)
36protected override async Task<CodeAction?> GetCodeFixAsync(SyntaxNode root, SyntaxNode node, Document document, Diagnostic diagnostics, CancellationToken cancellationToken) 75Document? newDocument = null;
src\roslyn\src\Analyzers\CSharp\CodeFixes\MakeAnonymousFunctionStatic\CSharpMakeAnonymousFunctionStaticCodeFixProvider.cs (1)
36protected override async Task FixAllAsync(Document document, ImmutableArray<Diagnostic> diagnostics, SyntaxEditor editor, CancellationToken cancellationToken)
src\roslyn\src\Analyzers\CSharp\CodeFixes\MakeLocalFunctionStatic\MakeLocalFunctionStaticCodeFixHelper.cs (3)
26public static async Task<Document> MakeLocalFunctionStaticAsync( 27Document document, 39Document document,
src\roslyn\src\Analyzers\CSharp\CodeFixes\MakeLocalFunctionStatic\MakeLocalFunctionStaticCodeFixProvider.cs (1)
31Document document, ImmutableArray<Diagnostic> diagnostics, SyntaxEditor editor, CancellationToken cancellationToken)
src\roslyn\src\Analyzers\CSharp\CodeFixes\MakeLocalFunctionStatic\PassInCapturedVariablesAsArgumentsCodeFixProvider.cs (3)
50protected override Task FixAllAsync(Document document, ImmutableArray<Diagnostic> diagnostics, SyntaxEditor editor, CancellationToken cancellationToken) 61Document document, 63Func<Document, LocalFunctionStatementSyntax, ImmutableArray<ISymbol>, Task> fixer,
src\roslyn\src\Analyzers\CSharp\CodeFixes\MakeMemberRequired\CSharpMakeMemberRequiredCodeFixProvider.cs (2)
33var document = context.Document; 109protected override async Task FixAllAsync(Document document, ImmutableArray<Diagnostic> diagnostics, SyntaxEditor editor, CancellationToken cancellationToken)
src\roslyn\src\Analyzers\CSharp\CodeFixes\MakeRefStruct\MakeRefStructCodeFixProvider.cs (3)
37var document = context.Document; 63private static async Task<Document> FixCodeAsync( 64Document document,
src\roslyn\src\Analyzers\CSharp\CodeFixes\MakeStatementAsynchronous\CSharpMakeStatementAsynchronousCodeFixProvider.cs (1)
48Document document, ImmutableArray<Diagnostic> diagnostics,
src\roslyn\src\Analyzers\CSharp\CodeFixes\MakeStructFieldsWritable\CSharpMakeStructFieldsWritableCodeFixProvider.cs (1)
34Document document,
src\roslyn\src\Analyzers\CSharp\CodeFixes\MakeStructMemberReadOnly\CSharpMakeStructMemberReadOnlyCodeFixProvider.cs (1)
35Document document,
src\roslyn\src\Analyzers\CSharp\CodeFixes\MakeStructReadOnly\CSharpMakeStructReadOnlyCodeFixProvider.cs (1)
33Document document,
src\roslyn\src\Analyzers\CSharp\CodeFixes\MisplacedUsingDirectives\MisplacedUsingDirectivesCodeFixProvider.cs (8)
59var document = context.Document; 84internal static async Task<Document> TransformDocumentIfRequiredAsync( 85Document document, 134private static async Task<Document> GetTransformedDocumentAsync( 135Document document, 158var newDocument = document.WithSyntaxRoot(newCompilationUnitWithHeader); 171Document document, CompilationUnitSyntax compilationUnit, ImmutableArray<UsingDirectiveSyntax> allUsingDirectives, CancellationToken cancellationToken) 187private static async Task<SyntaxNode> ExpandUsingDirectiveAsync(Document document, UsingDirectiveSyntax usingDirective, CancellationToken cancellationToken)
src\roslyn\src\Analyzers\CSharp\CodeFixes\NewLines\ArrowExpressionClausePlacement\ArrowExpressionClausePlacementCodeFixProvider.cs (3)
32var document = context.Document; 42private static async Task<Document> UpdateDocumentAsync( 43Document document, ImmutableArray<Diagnostic> diagnostics, CancellationToken cancellationToken)
src\roslyn\src\Analyzers\CSharp\CodeFixes\NewLines\ConditionalExpressionPlacement\ConditionalExpressionPlacementCodeFixProvider.cs (3)
32var document = context.Document; 42private static async Task<Document> UpdateDocumentAsync( 43Document document, ImmutableArray<Diagnostic> diagnostics, CancellationToken cancellationToken)
src\roslyn\src\Analyzers\CSharp\CodeFixes\NewLines\ConsecutiveBracePlacement\ConsecutiveBracePlacementCodeFixProvider.cs (5)
33var document = context.Document; 43private static Task<Document> UpdateDocumentAsync(Document document, Diagnostic diagnostic, CancellationToken cancellationToken) 46public static async Task<Document> FixAllAsync(Document document, ImmutableArray<Diagnostic> diagnostics, CancellationToken cancellationToken)
src\roslyn\src\Analyzers\CSharp\CodeFixes\NewLines\ConstructorInitializerPlacement\ConstructorInitializerPlacementCodeFixProvider.cs (3)
32var document = context.Document; 42private static async Task<Document> UpdateDocumentAsync( 43Document document, ImmutableArray<Diagnostic> diagnostics, CancellationToken cancellationToken)
src\roslyn\src\Analyzers\CSharp\CodeFixes\NewLines\EmbeddedStatementPlacement\EmbeddedStatementPlacementCodeFixProvider.cs (3)
35var document = context.Document; 45public static async Task<Document> FixAllAsync(Document document, ImmutableArray<Diagnostic> diagnostics, CancellationToken cancellationToken)
src\roslyn\src\Analyzers\CSharp\CodeFixes\Nullable\CSharpDeclareAsNullableCodeFixProvider.cs (4)
74Document document, 92protected override bool IncludeDiagnosticDuringFixAll(Diagnostic diagnostic, Document document, string? equivalenceKey, CancellationToken cancellationToken) 99Document document, SemanticModel model, SyntaxEditor editor, SyntaxNode node, HashSet<TypeSyntax> alreadyHandled, CancellationToken cancellationToken) 111Document document, SemanticModel? model, SyntaxNode node, CancellationToken cancellationToken)
src\roslyn\src\Analyzers\CSharp\CodeFixes\RemoveConfusingSuppression\CSharpRemoveConfusingSuppressionCodeFixProvider.cs (3)
35var document = context.Document; 54private static async Task<Document> FixAllAsync( 55Document document, ImmutableArray<Diagnostic> diagnostics,
src\roslyn\src\Analyzers\CSharp\CodeFixes\RemoveInKeyword\RemoveInKeywordCodeFixProvider.cs (2)
54private static async Task<Document> FixAsync( 55Document document,
src\roslyn\src\Analyzers\CSharp\CodeFixes\RemoveNewModifier\RemoveNewModifierCodeFixProvider.cs (2)
56private static async Task<Document> FixAsync( 57Document document,
src\roslyn\src\Analyzers\CSharp\CodeFixes\RemoveUnneccessaryUnsafeModifier\CSharpRemoveUnnecessaryUnsafeModifierCodeFixProvider.cs (2)
39private static async Task<Document> FixAllAsync(Document document, ImmutableArray<Diagnostic> diagnostics, CancellationToken cancellationToken)
src\roslyn\src\Analyzers\CSharp\CodeFixes\RemoveUnnecessaryCast\CSharpRemoveUnnecessaryCastCodeFixProvider.cs (1)
37Document document, ImmutableArray<Diagnostic> diagnostics,
src\roslyn\src\Analyzers\CSharp\CodeFixes\RemoveUnnecessaryDiscardDesignation\CSharpRemoveUnnecessaryDiscardDesignationCodeFixProvider.cs (1)
34Document document, ImmutableArray<Diagnostic> diagnostics,
src\roslyn\src\Analyzers\CSharp\CodeFixes\RemoveUnnecessaryLambdaExpression\CSharpRemoveUnnecessaryLambdaExpressionCodeFixProvider.cs (1)
40Document document, ImmutableArray<Diagnostic> diagnostics,
src\roslyn\src\Analyzers\CSharp\CodeFixes\RemoveUnnecessaryNullableDirective\CSharpRemoveUnnecessaryNullableDirectiveCodeFixProvider.cs (1)
46Document document,
src\roslyn\src\Analyzers\CSharp\CodeFixes\RemoveUnnecessarySuppressions\CSharpRemoveUnnecessaryNullableWarningSuppressionsCodeFixProvider.cs (3)
40private static async Task<Document> FixSingleDocumentAsync(Document document, ImmutableArray<Diagnostic> diagnostics, CancellationToken cancellationToken) 48foreach (var linkedDocument in document.GetLinkedDocuments())
src\roslyn\src\Analyzers\CSharp\CodeFixes\RemoveUnreachableCode\CSharpRemoveUnreachableCodeCodeFixProvider.cs (1)
49Document document,
src\roslyn\src\Analyzers\CSharp\CodeFixes\RemoveUnusedLocalFunction\CSharpRemoveUnusedLocalFunctionCodeFixProvider.cs (1)
36protected override async Task FixAllAsync(Document document, ImmutableArray<Diagnostic> diagnostics, SyntaxEditor editor, CancellationToken cancellationToken)
src\roslyn\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\roslyn\src\Analyzers\CSharp\CodeFixes\SimplifyLinqExpression\CSharpSimplifyLinqTypeCheckAndCastCodeFixProvider.cs (1)
36Document document,
src\roslyn\src\Analyzers\CSharp\CodeFixes\SimplifyPropertyAccessor\CSharpSimplifyPropertyAccessorCodeFixProvider.cs (1)
36protected override async Task FixAllAsync(Document document, ImmutableArray<Diagnostic> diagnostics, SyntaxEditor editor, CancellationToken cancellationToken)
src\roslyn\src\Analyzers\CSharp\CodeFixes\SimplifyPropertyPattern\CSharpSimplifyPropertyPatternCodeFixProvider.cs (1)
38Document document, ImmutableArray<Diagnostic> diagnostics,
src\roslyn\src\Analyzers\CSharp\CodeFixes\TransposeRecordKeyword\CSharpTransposeRecordKeywordCodeFixProvider.cs (1)
94Document document, ImmutableArray<Diagnostic> diagnostics,
src\roslyn\src\Analyzers\CSharp\CodeFixes\UseAutoProperty\CSharpUseAutoPropertyCodeFixProvider.cs (2)
81Document propertyDocument, 221Document document,
src\roslyn\src\Analyzers\CSharp\CodeFixes\UseCollectionExpression\CSharpCollectionExpressionRewriter.cs (1)
36Document workspaceDocument,
src\roslyn\src\Analyzers\CSharp\CodeFixes\UseCollectionExpression\CSharpUseCollectionExpressionForArrayCodeFixProvider.cs (1)
35Document document,
src\roslyn\src\Analyzers\CSharp\CodeFixes\UseCollectionExpression\CSharpUseCollectionExpressionForBuilderCodeFixProvider.cs (5)
38Document document, 55var newDocument = await CreateTrackedDocumentAsync( 105static async Task<Document> CreateTrackedDocumentAsync( 106Document document, 127var newDocument = document.WithSyntaxRoot(newRoot.ReplaceNode(creationExpression, dummyObjectCreation));
src\roslyn\src\Analyzers\CSharp\CodeFixes\UseCollectionExpression\CSharpUseCollectionExpressionForCreateCodeFixProvider.cs (1)
36Document document,
src\roslyn\src\Analyzers\CSharp\CodeFixes\UseCollectionExpression\CSharpUseCollectionExpressionForEmptyCodeFixProvider.cs (1)
34Document document,
src\roslyn\src\Analyzers\CSharp\CodeFixes\UseCollectionExpression\CSharpUseCollectionExpressionForFluentCodeFixProvider.cs (2)
44Document document, 141Document document,
src\roslyn\src\Analyzers\CSharp\CodeFixes\UseCollectionExpression\CSharpUseCollectionExpressionForNewCodeFixProvider.cs (1)
37Document document,
src\roslyn\src\Analyzers\CSharp\CodeFixes\UseCollectionExpression\CSharpUseCollectionExpressionForStackAllocCodeFixProvider.cs (1)
31Document document,
src\roslyn\src\Analyzers\CSharp\CodeFixes\UseCollectionInitializer\CSharpUseCollectionInitializerCodeFixProvider.cs (1)
38Document document,
src\roslyn\src\Analyzers\CSharp\CodeFixes\UseCollectionInitializer\CSharpUseCollectionInitializerCodeFixProvider_CollectionExpression.cs (1)
21Document document,
src\roslyn\src\Analyzers\CSharp\CodeFixes\UseCompoundAssignment\CSharpUseCompoundCoalesceAssignmentCodeFixProvider.cs (1)
40Document document, ImmutableArray<Diagnostic> diagnostics,
src\roslyn\src\Analyzers\CSharp\CodeFixes\UseDeconstruction\CSharpUseDeconstructionCodeFixProvider.cs (2)
37Document document, ImmutableArray<Diagnostic> diagnostics, 56Document document,
src\roslyn\src\Analyzers\CSharp\CodeFixes\UseDefaultLiteral\CSharpUseDefaultLiteralCodeFixProvider.cs (1)
34Document document, ImmutableArray<Diagnostic> diagnostics,
src\roslyn\src\Analyzers\CSharp\CodeFixes\UseExplicitArrayInExpressionTree\CSharpUseExplicitArrayInExpressionTreeCodeFixProvider.cs (1)
115protected override async Task FixAllAsync(Document document, ImmutableArray<Diagnostic> diagnostics, SyntaxEditor editor, CancellationToken cancellationToken)
src\roslyn\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\roslyn\src\Analyzers\CSharp\CodeFixes\UseExpressionBody\UseExpressionBodyCodeFixProvider.cs (1)
53Document document, ImmutableArray<Diagnostic> diagnostics,
src\roslyn\src\Analyzers\CSharp\CodeFixes\UseExpressionBodyForLambda\UseExpressionBodyForLambdaCodeFixProvider.cs (1)
34Document document,
src\roslyn\src\Analyzers\CSharp\CodeFixes\UseImplicitlyTypedLambdaExpression\CSharpUseImplicitObjectCreationCodeFixProvider.cs (1)
39Document document, ImmutableArray<Diagnostic> diagnostics,
src\roslyn\src\Analyzers\CSharp\CodeFixes\UseImplicitObjectCreation\CSharpUseImplicitObjectCreationCodeFixProvider.cs (1)
46Document document, ImmutableArray<Diagnostic> diagnostics,
src\roslyn\src\Analyzers\CSharp\CodeFixes\UseImplicitOrExplicitType\UseExplicitTypeCodeFixProvider.cs (7)
45protected override bool IncludeDiagnosticDuringFixAll(Diagnostic diagnostic, Document document, string? equivalenceKey, CancellationToken cancellationToken) 49Document document, ImmutableArray<Diagnostic> diagnostics, 62Document document, SyntaxEditor editor, 90private static async Task HandleDeclarationExpressionAsync(Document document, SyntaxEditor editor, DeclarationExpressionSyntax declarationExpression, CancellationToken cancellationToken) 118private static Task HandleForEachStatementAsync(Document document, SyntaxEditor editor, ForEachStatementSyntax forEach, CancellationToken cancellationToken) 126private static Task HandleVariableDeclarationAsync(Document document, SyntaxEditor editor, VariableDeclarationSyntax varDecl, CancellationToken cancellationToken) 138Document document,
src\roslyn\src\Analyzers\CSharp\CodeFixes\UseImplicitOrExplicitType\UseImplicitTypeCodeFixProvider.cs (2)
36protected override bool IncludeDiagnosticDuringFixAll(Diagnostic diagnostic, Document document, string? equivalenceKey, CancellationToken cancellationToken) 40Document document, ImmutableArray<Diagnostic> diagnostics,
src\roslyn\src\Analyzers\CSharp\CodeFixes\UseIndexOrRangeOperator\CSharpUseIndexOperatorCodeFixProvider.cs (1)
35Document document, ImmutableArray<Diagnostic> diagnostics,
src\roslyn\src\Analyzers\CSharp\CodeFixes\UseIndexOrRangeOperator\CSharpUseRangeOperatorCodeFixProvider.cs (1)
45Document document, ImmutableArray<Diagnostic> diagnostics,
src\roslyn\src\Analyzers\CSharp\CodeFixes\UseInterpolatedVerbatimString\CSharpUseInterpolatedVerbatimStringCodeFixProvider.cs (1)
35Document document, ImmutableArray<Diagnostic> diagnostics,
src\roslyn\src\Analyzers\CSharp\CodeFixes\UseIsNullCheck\CSharpUseIsNullCheckForCastAndEqualityOperatorCodeFixProvider.cs (1)
49Document document, ImmutableArray<Diagnostic> diagnostics,
src\roslyn\src\Analyzers\CSharp\CodeFixes\UseIsNullCheck\CSharpUseNullCheckOverTypeCheckCodeFixProvider.cs (1)
37Document document, ImmutableArray<Diagnostic> diagnostics,
src\roslyn\src\Analyzers\CSharp\CodeFixes\UseLocalFunction\CSharpUseLocalFunctionCodeFixProvider.cs (2)
53Document document, ImmutableArray<Diagnostic> diagnostics, 180Document document, SyntaxNode currentRoot,
src\roslyn\src\Analyzers\CSharp\CodeFixes\UseNameofInAttribute\CSharpUseNameofInAttributeCodeFixProvider.cs (1)
35Document document,
src\roslyn\src\Analyzers\CSharp\CodeFixes\UsePatternCombinators\CSharpUsePatternCombinatorsCodeFixProvider.cs (2)
52Diagnostic diagnostic, Document document, string? equivalenceKey, CancellationToken cancellationToken) 71Document document, ImmutableArray<Diagnostic> diagnostics,
src\roslyn\src\Analyzers\CSharp\CodeFixes\UsePatternMatching\CSharpAsAndMemberAccessCodeFixProvider.cs (1)
39Document document, ImmutableArray<Diagnostic> diagnostics,
src\roslyn\src\Analyzers\CSharp\CodeFixes\UsePatternMatching\CSharpAsAndNullCheckCodeFixProvider.cs (1)
39Document document, ImmutableArray<Diagnostic> diagnostics,
src\roslyn\src\Analyzers\CSharp\CodeFixes\UsePatternMatching\CSharpIsAndCastCheckCodeFixProvider.cs (1)
36Document document, ImmutableArray<Diagnostic> diagnostics,
src\roslyn\src\Analyzers\CSharp\CodeFixes\UsePatternMatching\CSharpUseNotPatternCodeFixProvider.cs (1)
34Document document, ImmutableArray<Diagnostic> diagnostics,
src\roslyn\src\Analyzers\CSharp\CodeFixes\UsePrimaryConstructor\CSharpUsePrimaryConstructorCodeFixProvider.cs (7)
59var document = context.Document; 94Document document, 110Document document, 475var declarationDocument = solution.GetRequiredDocument(declaration.SyntaxTree); 534var memberDocument = solution.GetRequiredDocument(syntaxTree); 606var document = solution.GetDocument(group.Key); 622var document = solution.GetDocument(group.Key);
src\roslyn\src\Analyzers\CSharp\CodeFixes\UseSimpleUsingStatement\UseSimpleUsingStatementCodeFixProvider.cs (1)
43Document document, ImmutableArray<Diagnostic> diagnostics,
src\roslyn\src\Analyzers\CSharp\CodeFixes\UseSystemThreadingLock\CSharpUseSystemThreadingLockCodeFixProvider.cs (4)
43var document = context.Document; 60Document document, 75Document document, 125var groupDocument = group.Key;
src\roslyn\src\Analyzers\CSharp\CodeFixes\UseThrowExpression\UseThrowExpressionCodeFixProvider.cs (1)
39Document document, ImmutableArray<Diagnostic> diagnostics,
src\roslyn\src\Analyzers\CSharp\CodeFixes\UseTupleSwap\CSharpUseTupleSwapCodeFixProvider.cs (1)
36Document document, ImmutableArray<Diagnostic> diagnostics,
src\roslyn\src\Analyzers\CSharp\CodeFixes\UseUnboundGenericTypeInNameOf\CSharpUseUnboundGenericTypeInNameOfCodeFixProvider.cs (1)
39Document document, ImmutableArray<Diagnostic> diagnostics,
src\roslyn\src\Analyzers\CSharp\CodeFixes\UseUtf8StringLiteral\UseUtf8StringLiteralCodeFixProvider.cs (1)
42Document document, ImmutableArray<Diagnostic> diagnostics,
StringIndentation\CSharpStringIndentationService.cs (1)
29Document document, TextSpan textSpan, CancellationToken cancellationToken)
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)
37Document document, ImmutableArray<Diagnostic> diagnostics,
Microsoft.CodeAnalysis.CSharp.NetAnalyzers (47)
Microsoft.CodeQuality.Analyzers\ApiDesignGuidelines\CSharpStaticHolderTypes.Fixer.cs (3)
32Document document = context.Document; 49private static async Task<Document> MakeClassStaticAsync(Document document, ClassDeclarationSyntax classDeclaration, CancellationToken ct)
Microsoft.CodeQuality.Analyzers\QualityGuidelines\CSharpAvoidDuplicateElementInitializationFixer.cs (2)
53private static Document RemoveElementInitializer( 57Document document)
Microsoft.CodeQuality.Analyzers\QualityGuidelines\CSharpDoNotInitializeUnnecessarily.Fixer.cs (1)
27Document doc = context.Document;
Microsoft.NetCore.Analyzers\InteropServices\CSharpDisableRuntimeMarshalling.FixAllProvider.cs (2)
26protected override async Task<Document?> FixAllAsync(FixAllContext fixAllContext, Document document, ImmutableArray<Diagnostic> diagnostics)
Microsoft.NetCore.Analyzers\InteropServices\CSharpDisableRuntimeMarshalling.Fixer.cs (2)
74private static async Task<Document> UseDisabledMarshallingEquivalentAsync(SyntaxNode node, Document document, CancellationToken ct)
Microsoft.NetCore.Analyzers\InteropServices\CSharpDynamicInterfaceCastableImplementation.Fixer.cs (4)
23protected override async Task<Document> ImplementInterfacesOnDynamicCastableImplementationAsync( 26Document document, 170protected override async Task<Document> MakeMemberDeclaredOnImplementationTypeStaticAsync(SyntaxNode declaration, Document document, CancellationToken cancellationToken)
Microsoft.NetCore.Analyzers\InteropServices\CSharpSpecifyMarshalingForPInvokeStringArguments.Fixer.cs (2)
35protected override Task<Document> FixDeclareStatementAsync(Document document, SyntaxNode node, CancellationToken cancellationToken)
Microsoft.NetCore.Analyzers\Performance\CSharpCollapseMultiplePathOperations.Fixer.cs (3)
27var document = context.Document; 53private static Task<Document> CollapsePathOperationAsync(Document document, SyntaxNode root, InvocationExpressionSyntax invocation, INamedTypeSymbol pathType, SemanticModel semanticModel, CancellationToken cancellationToken)
Microsoft.NetCore.Analyzers\Performance\CSharpDoNotGuardCall.Fixer.cs (3)
41protected override Document ReplaceConditionWithChild(Document document, SyntaxNode root, SyntaxNode conditionalOperationNode, SyntaxNode childOperationNode) 70private static SyntaxNode GetNegatedExpression(Document document, SyntaxNode newConditionNode)
Microsoft.NetCore.Analyzers\Performance\CSharpPreferDictionaryTryMethodsOverContainsKeyGuardFixer.cs (3)
35Document document = context.Document; 57private static async Task<CodeAction?> GetTryGetValueActionAsync(Diagnostic diagnostic, SyntaxNode root, Document document, MemberAccessExpressionSyntax containsKeyAccess, InvocationExpressionSyntax containsKeyInvocation, CancellationToken cancellationToken) 208private static CodeAction? GetTryAddAction(Diagnostic diagnostic, SyntaxNode root, Document document, InvocationExpressionSyntax containsKeyInvocation, MemberAccessExpressionSyntax containsKeyAccess)
Microsoft.NetCore.Analyzers\Performance\CSharpUseStringMethodCharOverloadWithSingleCharacters.Fixer.cs (2)
61protected override CodeAction CreateCodeAction(Document document, SyntaxNode argumentListNode, char sourceCharLiteral) 67Document document, SyntaxNode argumentListNode, char sourceCharLiteral)
Microsoft.NetCore.Analyzers\Runtime\CSharpAvoidRedundantRegexIsMatchBeforeMatch.Fixer.cs (7)
53Document doc = context.Document; 113Document doc, 186Document doc, 433private static async Task<Document> ApplyDeclarationFixAsync( 434Document document, 452private static async Task<Document> ApplyAssignmentFixAsync( 453Document document,
Microsoft.NetCore.Analyzers\Runtime\CSharpPreferDictionaryContainsMethods.Fixer.cs (2)
23Document doc = context.Document; 50async Task<Document> ReplaceMethodNameAsync(string methodName, CancellationToken ct)
Microsoft.NetCore.Analyzers\Runtime\CSharpSpecifyCultureForToLowerAndToUpper.Fixer.cs (4)
27protected override async Task<Document> SpecifyCurrentCultureAsync(Document document, SyntaxGenerator generator, SyntaxNode root, SyntaxNode node, CancellationToken cancellationToken) 44protected override Task<Document> UseInvariantVersionAsync(Document document, SyntaxGenerator generator, SyntaxNode root, SyntaxNode node)
Microsoft.NetCore.Analyzers\Runtime\CSharpUseOrdinalStringComparison.Fixer.cs (4)
28protected override Task<Document> FixArgumentAsync(Document document, SyntaxGenerator generator, SyntaxNode root, SyntaxNode argument) 50protected override async Task<Document> FixIdentifierNameAsync(Document document, SyntaxGenerator generator, SyntaxNode root, SyntaxNode identifier, CancellationToken cancellationToken)
Microsoft.NetCore.Analyzers\Usage\CSharpDoNotPassNonNullableValueToArgumentNullExceptionThrowIfNullFixer.cs (1)
18protected override async Task<SyntaxNode> GetNewRootForNullableStructAsync(Document document, InvocationExpressionSyntax invocation, CancellationToken cancellationToken)
Microsoft.NetCore.Analyzers\Usage\CSharpPreferGenericOverloads.Fixer.cs (2)
26protected override async Task<Document> ReplaceWithGenericCallAsync(Document document, IInvocationOperation invocation, CancellationToken cancellationToken)
Microsoft.CodeAnalysis.CSharp.Workspaces (24)
OrganizeImports\CSharpOrganizeImportsService.cs (2)
20public async Task<Document> OrganizeImportsAsync(Document document, OrganizeImportsOptions options, CancellationToken cancellationToken)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Services\SemanticFacts\CSharpSemanticFacts.cs (1)
492public async Task<ISymbol?> GetInterceptorSymbolAsync(Document document, int position, CancellationToken cancellationToken)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\CodeFixesAndRefactorings\CSharpFixAllSpanMappingService.cs (5)
24protected override async Task<ImmutableDictionary<Document, ImmutableArray<TextSpan>>> GetFixAllSpansIfWithinGlobalStatementAsync( 25Document document, TextSpan span, CancellationToken cancellationToken) 30return ImmutableDictionary<Document, ImmutableArray<TextSpan>>.Empty; 43return ImmutableDictionary<Document, ImmutableArray<TextSpan>>.Empty; 48return ImmutableDictionary<Document, ImmutableArray<TextSpan>>.Empty
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\CodeGeneration\CSharpCodeGenerationService.cs (2)
62public override async Task<Document> AddEventAsync( 65var newDocument = await base.AddEventAsync(
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\ContextQuery\CSharpSyntaxContext.cs (3)
51Document document, 181public static CSharpSyntaxContext CreateContext(Document document, SemanticModel semanticModel, int position, CancellationToken cancellationToken) 185Document document, SemanticModel semanticModel, int position, CancellationToken cancellationToken)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\ContextQuery\CSharpSyntaxContextService.cs (1)
18public SyntaxContext CreateContext(Document document, SemanticModel semanticModel, int position, CancellationToken cancellationToken)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Formatting\CSharpSyntaxFormattingOptionsProviders.cs (1)
13public static async ValueTask<CSharpSyntaxFormattingOptions> GetCSharpSyntaxFormattingOptionsAsync(this Document document, CancellationToken cancellationToken)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\LanguageServices\CSharpMoveDeclarationNearReferenceService.cs (1)
53Document document, ILocalSymbol localSymbol,
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\LanguageServices\CSharpRemoveUnnecessaryImportsService.cs (2)
37public override async Task<Document> RemoveUnnecessaryImportsAsync( 38Document document,
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\LanguageServices\CSharpReplaceDiscardDeclarationsWithAssignmentsService.cs (1)
37Document document,
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\LanguageServices\InitializeParameter\CSharpInitializeParameterService.cs (1)
109protected override Task<Solution> TryAddAssignmentForPrimaryConstructorAsync(Document document, IParameterSymbol parameter, ISymbol fieldOrProperty, CancellationToken cancellationToken)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\LanguageServices\InitializeParameter\InitializeParameterHelpers.cs (3)
34Document document, 62var editingDocument = solution.GetRequiredDocument(propertyDeclaration.SyntaxTree); 82var editingDocument = solution.GetRequiredDocument(variableDeclarator.SyntaxTree);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Simplification\CSharpSimplifierOptionsProviders.cs (1)
13public static async ValueTask<CSharpSimplifierOptions> GetCSharpSimplifierOptionsAsync(this Document document, CancellationToken cancellationToken)
Microsoft.CodeAnalysis.ExternalAccess.AspNetCore (8)
AddPackage\AspNetCoreAddPackageCodeAction.cs (7)
39Document document, 56Document document, int position, string namespaceName, CancellationToken cancellationToken) 63var updatedDocument = await AddImportAsync(document, position, generator, importDirective, cancellationToken).ConfigureAwait(false); 67var cleanedDocument = await CodeAction.CleanupDocumentAsync( 76private static async Task<Document> AddImportAsync(Document document, int position, SyntaxGenerator generator, SyntaxNode importDirective, CancellationToken cancellationToken) 89var updatedDocument = document.WithSyntaxRoot(newRoot);
Internal\EmbeddedLanguages\AspNetCoreEmbeddedLanguageDocumentHighlighter.cs (1)
30Document document,
Microsoft.CodeAnalysis.ExternalAccess.HotReload (1)
Api\HotReloadMSBuildWorkspace.cs (1)
191Document document => document.WithText(newText).Project.Solution,
Microsoft.CodeAnalysis.ExternalAccess.OmniSharp (31)
CodeActions\OmniSharpCodeFixContextFactory.cs (3)
18Document document, 26Document document, 33Document? document,
Completion\OmniSharpCompletionService.cs (3)
17Document document, 30Document document, 42Document document,
DocumentationComments\OmniSharpDocumentationCommentOptionsWrapper.cs (1)
38Document document,
DocumentationComments\OmniSharpDocumentationCommentsSnippetService.cs (2)
17Document document, 29Document document,
ExtractClass\IOmniSharpExtractClassOptionsService.cs (1)
11OmniSharpExtractClassOptions? 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)
34public static async ValueTask<OmniSharpOrganizeImportsOptionsWrapper> FromDocumentAsync(Document document, OmniSharpOrganizeImportsOptionsWrapper fallbackOptions, CancellationToken cancellationToken)
Formatting\OmniSharpSyntaxFormattingOptionsWrapper.cs (1)
23public 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)
25Document document,
Internal\ExtractInterface\OmniSharpExtractInterfaceOptionsService.cs (1)
23Document document,
MetadataAsSource\OmniSharpMetadataAsSourceHelpers.cs (1)
19public static Task<Location> GetLocationInGeneratedSourceAsync(ISymbol symbol, Document generatedDocument, CancellationToken cancellationToken)
MetadataAsSource\OmniSharpMetadataAsSourceService.cs (2)
26public static Task<Document> AddSourceToAsync(Document document, Compilation symbolCompilation, ISymbol symbol, OmniSharpSyntaxFormattingOptionsWrapper formattingOptions, CancellationToken cancellationToken)
NavigateTo\OmniSharpNavigateToSearchService.cs (2)
39public async Task AddResultsAsync(ImmutableArray<INavigateToSearchResult> results, Document? activeDocument, CancellationToken cancellationToken) 44var document = await result.NavigableItem.Document.GetRequiredDocumentAsync(project.Solution, cancellationToken).ConfigureAwait(false);
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.Features (1765)
AddConstructorParametersFromMembers\AddConstructorParametersFromMembersCodeRefactoringProvider.AddConstructorParametersCodeAction.cs (5)
26Document document, 31private readonly Document _document = document; 79var constructorDocument = _document.Project.GetDocument(syntaxTree); 116var documentToUpdate = solution.GetRequiredDocument(syntaxTree); 143var memberDocument = solution.GetRequiredDocument(memberSyntax.SyntaxTree);
AddConstructorParametersFromMembers\AddConstructorParametersFromMembersCodeRefactoringProvider.cs (5)
50Document document, TextSpan textSpan, CancellationToken cancellationToken) 106private static AddConstructorParameterResult CreateCodeActions(Document document, CodeGenerationContextInfo info, State state) 136Document document, CodeGenerationContextInfo info, ConstructorCandidate constructorCandidate, INamedTypeSymbol containingType, bool useSubMenuName) 154Document priorDocument, 156Document currentDocument,
AddConstructorParametersFromMembers\AddConstructorParametersFromMembersCodeRefactoringProvider.State.cs (4)
31Document document, 46Document document, 79Document document, 99private 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)
52var document = context.Document;
AddImport\AbstractAddImportCodeRefactoringProvider.cs (1)
158async Task<Document> AddImportAndSimplifyAsync(
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); 63protected abstract (string description, bool hasExistingImport) GetDescription(Document document, AddImportPlacementOptions options, INamespaceOrTypeSymbol symbol, SemanticModel semanticModel, SyntaxNode root, CancellationToken cancellationToken); 66Document document, TextSpan span, string diagnosticId, int maxResults, 90Document document, TextSpan span, string diagnosticId, int maxResults, 134Document document, 492Document document, TextSpan span, ImmutableArray<Diagnostic> diagnostics, int maxResultsPerDiagnostic, 515Document document, TextSpan span, ImmutableArray<string> diagnosticIds, 539Document document, 580Document document, ImmutableArray<AddImportFixData> fixes, 595private static CodeAction? TryCreateCodeAction(Document document, AddImportFixData fixData, IPackageInstallerService? installerService)
AddImport\AddImportOptions.cs (1)
39this Document document,
AddImport\CodeActions\AddImportCodeAction.cs (5)
30/// The <see cref="Document"/> we started the add-import analysis in. 32protected readonly Document OriginalDocument; 40Document originalDocument, 59protected async Task<Document> GetUpdatedDocumentAsync(CancellationToken cancellationToken) 63var newDocument = OriginalDocument.WithText(newText);
AddImport\CodeActions\AssemblyReferenceCodeAction.cs (2)
26Document originalDocument, 41var newDocument = await GetUpdatedDocumentAsync(cancellationToken).ConfigureAwait(false);
AddImport\CodeActions\InstallPackageAndAddImportCodeAction.cs (4)
32Document originalDocument, 64var newDocument = await GetUpdatedDocumentAsync(cancellationToken).ConfigureAwait(false); 71var updatedDocument = newDocument.WithSyntaxRoot(updatedRoot); 84var updatedDocument = await GetUpdatedDocumentAsync(cancellationToken).ConfigureAwait(false);
AddImport\CodeActions\MetadataSymbolReferenceCodeAction.cs (1)
21public 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)
23Document document, TextSpan span, string diagnosticId, int maxResults, 32Document document, TextSpan span, ImmutableArray<Diagnostic> diagnostics, int maxResultsPerDiagnostic, 41Document document, ImmutableArray<AddImportFixData> fixes, 46/// <see cref="GetFixesAsync(Document, TextSpan, string, int, ISymbolSearchService, AddImportOptions, 51Document document, TextSpan span, ImmutableArray<string> diagnosticIds,
AddImport\References\AssemblyReference.cs (1)
27Document document, SyntaxNode node, bool cleanDocument, 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, bool cleanupDocument, 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 (12)
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, bool cleanupDocument, CodeCleanupOptions options, CancellationToken cancellationToken); 104Document document, SyntaxNode node, bool cleanupDocument, CodeCleanupOptions options, CancellationToken cancellationToken) 111var originalDocument = document; 116var newDocument = await provider.AddImportAsync( 119var cleanedDocument = await CleanDocumentAsync(newDocument, cleanupDocument, options, cancellationToken).ConfigureAwait(false); 127protected static async Task<Document> CleanDocumentAsync(Document newDocument, bool cleanupDocument, CodeCleanupOptions options, CancellationToken cancellationToken)
AddImport\References\SymbolReference.cs (10)
28protected abstract bool ShouldAddWithExistingImport(Document document); 30protected abstract ImmutableArray<string> GetTags(Document document); 49Document document, SyntaxNode contextNode, 59(var newContextNode, var newDocument) = await ReplaceNameNodeAsync( 62var updatedDocument = await provider.AddImportAsync( 66var cleanedDocument = await CleanDocumentAsync( 76Document document, SyntaxNode node, bool cleanupDocument, CodeCleanupOptions options, CancellationToken cancellationToken) 118Document document, ImmutableArray<TextChange> textChanges, 121protected abstract CodeActionPriority GetPriority(Document document); 124Document document, CodeCleanupOptions options, SyntaxNode node,
AddImport\SymbolReferenceFinder.cs (2)
30private readonly Document _document; 50Document document,
AddImport\SymbolResult.cs (1)
48public bool DesiredNameMatchesSourceName(Document document)
AddPackage\AbstractAddPackageCodeFixProvider.cs (1)
32var document = context.Document;
AddPackage\InstallPackageDirectlyCodeAction.cs (1)
16Document 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 (5)
25/// <param name="textChanges">Additional text changes to make to the <see cref="Document"/>. Generally, this would be 56Document document, 67Document document, 79Document document, 108Document document,
BraceCompletion\AbstractBraceCompletionService.cs (2)
41public ValueTask<bool> HasBraceCompletionAsync(BraceCompletionContext context, Document document, CancellationToken cancellationToken) 104protected virtual ValueTask<bool> IsValidOpenBraceTokenAtPositionAsync(Document document, SyntaxToken token, int position, CancellationToken cancellationToken)
BraceCompletion\IBraceCompletionService.cs (1)
37ValueTask<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)
24public 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)
CallHierarchy\AbstractCallHierarchyService.cs (10)
42IImmutableSet<Document>? documents, 66IImmutableSet<Document>? documents, 172IImmutableSet<Document>? documents, 182IImmutableSet<Document>? documents, 201IImmutableSet<Document>? documents, 211IImmutableSet<Document>? documents, 221IImmutableSet<Document>? documents, 228var document = project.Solution.GetDocument(syntaxReference.SyntaxTree); 308IImmutableSet<Document>? documents, 319var bestLocation = sourceLocations.FirstOrDefault(d => documents == null || documents.Contains(d));
CallHierarchy\ICallHierarchyService.cs (2)
19IImmutableSet<Document>? documents, 25IImmutableSet<Document>? documents,
ChangeSignature\AbstractChangeSignatureService.cs (14)
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) 162var declarationDocument = solution.GetRequiredDocument(declarationLocation.SourceTree!); 379var doc = currentSolution.GetRequiredDocument(docId); 423var updatedDoc = currentSolution.GetRequiredDocument(docId).WithSyntaxRoot(updatedRoots[docId]); 426var docWithImports = await ImportAdder.AddImportsFromSymbolAnnotationAsync(updatedDoc, cleanupOptions.AddImportOptions, cancellationToken).ConfigureAwait(false); 427var reducedDoc = await Simplifier.ReduceAsync(docWithImports, Simplifier.Annotation, cleanupOptions.SimplifierOptions, cancellationToken: cancellationToken).ConfigureAwait(false); 428var formattedDoc = await Formatter.FormatAsync(reducedDoc, SyntaxAnnotation.ElasticAnnotation, cleanupOptions.FormattingOptions, cancellationToken).ConfigureAwait(false); 460var document = solution.GetDocument(documentId); 1071protected static int GetParameterIndexFromInvocationArgument(SyntaxNode argument, Document document, SemanticModel semanticModel, CancellationToken cancellationToken)
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)
20ImmutableDictionary<Document, ImmutableArray<Diagnostic>> diagnosticsToFix,
CodeFixes\Service\CodeFixService.cs (4)
285Document document, TextSpan? textSpan, string diagnosticId, DiagnosticSeverity minimumSeverity, CancellationToken cancellationToken) 335public async Task<Document> ApplyCodeFixesForSpecificDiagnosticIdAsync( 336Document document, 807if (fixAllProviderInfo != null && textDocument is Document document)
CodeFixes\Service\CodeFixService.FixAllDiagnosticProvider.cs (2)
43public override async Task<IEnumerable<Diagnostic>> GetDocumentDiagnosticsAsync(Document document, CancellationToken cancellationToken) 52public override async Task<IEnumerable<Diagnostic>> GetDocumentSpanDiagnosticsAsync(Document document, TextSpan fixAllSpan, CancellationToken cancellationToken)
CodeFixes\Service\CodeFixService.FixAllPredefinedDiagnosticProvider.cs (1)
25public override Task<IEnumerable<Diagnostic>> GetDocumentDiagnosticsAsync(Document document, CancellationToken cancellationToken)
CodeFixes\Service\ICodeFixService.cs (3)
26Task<CodeFixCollection?> GetDocumentFixAllForIdInSpanAsync(Document document, TextSpan? textSpan, string diagnosticId, DiagnosticSeverity severity, CancellationToken cancellationToken); 27Task<Document> ApplyCodeFixesForSpecificDiagnosticIdAsync(Document document, TextSpan? textSpan, string diagnosticId, DiagnosticSeverity severity, IProgress<CodeAnalysisProgress> progressTracker, CancellationToken cancellationToken);
CodeFixes\Suppression\AbstractSuppressionBatchFixAllProvider.cs (12)
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; 324var oldDocument = oldSolution.GetRequiredDocument(orderedDocuments[0].document.Id); 340private static readonly Func<DocumentId, ConcurrentBag<(CodeAction, Document)>> s_getValue = 345ConcurrentDictionary<DocumentId, ConcurrentBag<(CodeAction, Document)>> documentIdToChangedDocuments, 371var changedDocument = changedSolution.GetRequiredDocument(documentId);
CodeFixes\Suppression\AbstractSuppressionCodeFixProvider.AbstractGlobalSuppressMessageCodeAction.cs (5)
36var changedSuppressionDocument = await GetChangedSuppressionDocumentAsync(cancellationToken).ConfigureAwait(false); 45protected abstract Task<Document> GetChangedSuppressionDocumentAsync(CancellationToken cancellationToken); 66protected async Task<Document> GetOrCreateSuppressionsDocumentAsync(CancellationToken c) 72Document suppressionsDoc = null; 76foreach (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) 157Document document, TextSpan span, IEnumerable<Diagnostic> diagnostics, bool skipSuppressMessage, bool skipUnsuppress, CancellationToken cancellationToken) 186Document? documentOpt, Project project, IEnumerable<Diagnostic> diagnostics, SuppressionTargetInfo suppressionTargetInfo, bool skipSuppressMessage, bool skipUnsuppress, CancellationToken cancellationToken) 261private async Task<SuppressionTargetInfo?> GetSuppressionTargetInfoAsync(Document document, TextSpan span, CancellationToken cancellationToken)
CodeFixes\Suppression\AbstractSuppressionCodeFixProvider.GlobalSuppressMessageCodeAction.cs (2)
24protected override async Task<Document> GetChangedSuppressionDocumentAsync(CancellationToken cancellationToken) 26var suppressionsDoc = await GetOrCreateSuppressionsDocumentAsync(cancellationToken).ConfigureAwait(false);
CodeFixes\Suppression\AbstractSuppressionCodeFixProvider.GlobalSuppressMessageFixAllCodeAction.cs (13)
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, 87var newDocument = await projectCodeAction.GetChangedSuppressionDocumentAsync(cancellationToken).ConfigureAwait(false); 116var newDocument = await projectCodeAction.GetChangedSuppressionDocumentAsync(cancellationToken).ConfigureAwait(false); 128protected override async Task<Document> GetChangedSuppressionDocumentAsync(CancellationToken cancellationToken) 130var suppressionsDoc = await GetOrCreateSuppressionsDocumentAsync(cancellationToken).ConfigureAwait(false); 147var result = suppressionsDoc.WithSyntaxRoot(suppressionsRoot); 148var final = await CleanupDocumentAsync(result, cleanupOptions, cancellationToken).ConfigureAwait(false); 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)
17Task<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)
16private readonly Document _document; 23Document document, 37Document document, 57protected override async Task<Document> GetChangedDocumentAsync(CancellationToken cancellationToken) 60public async Task<Document> GetChangedDocumentAsync(bool includeStartTokenChange, bool includeEndTokenChange, CancellationToken cancellationToken)
CodeFixes\Suppression\AbstractSuppressionCodeFixProvider.RemoveSuppressionCodeAction.BatchFixer.cs (2)
35Document document, ImmutableArray<Diagnostic> diagnostics, 141var document = oldSolution.GetDocument(tree);
CodeFixes\Suppression\AbstractSuppressionCodeFixProvider.RemoveSuppressionCodeAction.cs (1)
25Document 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)
59public void OnFindInDocumentStarted(Document document) 63public void OnFindInDocumentCompleted(Document document)
CodeLens\CodeLensReferencesService.cs (6)
47var document = await solution.GetDocumentAsync(documentId, includeSourceGenerated: true, cancellationToken).ConfigureAwait(false); 104var document = solution.GetDocument(location.SourceTree); 166private static SyntaxNode GetEnclosingCodeElementNode(Document document, SyntaxToken token, ICodeLensDisplayInfoService langServices, CancellationToken cancellationToken) 218var document = await solution.GetDocumentAsync(descriptorAndDocument.DocumentId, includeSourceGenerated: true, cancellationToken).ConfigureAwait(false); 358var document = solution.GetDocument(commonLocation.SourceTree); 389var 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)
34Document document, TextSpan textSpan, bool cleanDocument, CancellationToken cancellationToken) 70public async Task<Document> AddMissingImportsAsync( 71Document document, 118var newDocument = document.WithText(newText); 123var cleanedDocument = await CleanUpNewLinesAsync( 131var organizedDocument = await organizeImportsService.OrganizeImportsAsync( 137private async Task<Document> CleanUpNewLinesAsync(Document document, IEnumerable<TextSpan> insertSpans, SyntaxFormattingOptions formattingOptions, CancellationToken cancellationToken) 139var newDocument = document; 150private async Task<Document> CleanUpNewLinesAsync(Document document, TextSpan insertSpan, SyntaxFormattingOptions options, CancellationToken cancellationToken) 182Document document, 217var newDocument = newSolution.GetRequiredDocument(document.Id);
CodeRefactorings\AddMissingImports\IAddMissingImportsFeatureService.cs (8)
23Task<ImmutableArray<AddImportFixData>> AnalyzeAsync(Document document, TextSpan textSpan, bool cleanupDocument, CancellationToken cancellationToken); 27/// IAddMissingImportsFeatureService, Document, TextSpan, IProgress{CodeAnalysisProgress}, CancellationToken)"/> but 30Task<Document> AddMissingImportsAsync(Document document, ImmutableArray<AddImportFixData> analysisResult, IProgress<CodeAnalysisProgress> progressTracker, CancellationToken cancellationToken); 39public static Task<Document> AddMissingImportsAsync( 40this IAddMissingImportsFeatureService service, Document document, TextSpan textSpan, IProgress<CodeAnalysisProgress> progressTracker, CancellationToken cancellationToken) 45public static async Task<Document> AddMissingImportsAsync( 46this IAddMissingImportsFeatureService service, Document document, TextSpan textSpan, bool cleanupDocument, IProgress<CodeAnalysisProgress> progressTracker, CancellationToken cancellationToken)
CodeRefactorings\ExtractMethod\AbstractExtractMethodCodeRefactoringProvider.cs (5)
54Document document, 70Document document, TextSpan textSpan, ExtractMethodGenerationOptions extractOptions, CancellationToken cancellationToken) 95Document document, TextSpan textSpan, ExtractMethodGenerationOptions extractOptions, CancellationToken cancellationToken) 126private static async Task<Document> AddRenameAnnotationAsync(Document document, SyntaxToken? invocationNameToken, CancellationToken cancellationToken)
CodeRefactorings\MoveType\AbstractMoveTypeService.cs (6)
29public abstract Task<Solution> GetModifiedSolutionAsync(Document document, TextSpan textSpan, MoveTypeOperationKind operationKind, CancellationToken cancellationToken); 30public abstract Task<ImmutableArray<CodeAction>> GetRefactoringAsync(Document document, TextSpan textSpan, CancellationToken cancellationToken); 41protected abstract Task<TTypeDeclarationSyntax?> GetRelevantNodeAsync(Document document, TextSpan textSpan, CancellationToken cancellationToken); 49Document document, TextSpan textSpan, CancellationToken cancellationToken) 56public override async Task<Solution> GetModifiedSolutionAsync(Document document, TextSpan textSpan, MoveTypeOperationKind operationKind, CancellationToken cancellationToken) 70private async Task<TTypeDeclarationSyntax?> GetTypeDeclarationAsync(Document document, TextSpan textSpan, CancellationToken cancellationToken)
CodeRefactorings\MoveType\AbstractMoveTypeService.MoveTypeEditor.cs (11)
64var documentWithMovedType = await AddNewDocumentWithSingleTypeDeclarationAsync(newDocumentId).ConfigureAwait(false); 69var sourceDocument = solutionWithNewDocument.GetRequiredDocument(SemanticDocument.Document.Id); 81var documentWithMovedType = solution.GetRequiredDocument(documentWithMovedTypeId); 98var sourceDocument = solution.GetRequiredDocument(sourceDocumentId); 113private async Task<Document> AddNewDocumentWithSingleTypeDeclarationAsync(DocumentId newDocumentId) 115var document = SemanticDocument.Document; 164var newDocument = solutionWithNewDocument.GetRequiredDocument(newDocumentId); 165var newDocumentWithUpdatedBanner = await AddFileBannerHelpers.CopyBannerAsync( 201private async Task<SyntaxNode> AddFinalNewLineIfDesiredAsync(Document document, SyntaxNode modifiedRoot) 230private async Task<Solution> RemoveTypeFromSourceDocumentAsync(Document sourceDocument) 243var updatedDocument = documentEditor.GetChangedDocument();
CodeRefactorings\MoveType\AbstractMoveTypeService.MoveTypeNamespaceScopeEditor.cs (1)
82var changedDocument = editor.GetChangedDocument();
CodeRefactorings\MoveType\IMoveTypeService.cs (2)
16Task<ImmutableArray<CodeAction>> GetRefactoringAsync(Document document, TextSpan textSpan, CancellationToken cancellationToken); 18Task<Solution> GetModifiedSolutionAsync(Document document, TextSpan textSpan, MoveTypeOperationKind operationKind, CancellationToken cancellationToken);
CodeRefactorings\SyncNamespace\AbstractChangeNamespaceService.cs (40)
40public abstract Task<bool> CanChangeNamespaceAsync(Document document, SyntaxNode container, CancellationToken cancellationToken); 42public abstract Task<Solution> ChangeNamespaceAsync(Document document, SyntaxNode container, string targetNamespace, CancellationToken cancellationToken); 44public abstract Task<Solution?> TryChangeTopLevelNamespacesAsync(Document document, string targetNamespace, CancellationToken cancellationToken); 94protected abstract Task<SyntaxNode?> TryGetApplicableContainerFromSpanAsync(Document document, TextSpan span, CancellationToken cancellationToken); 100/// <see cref="IChangeNamespaceService.CanChangeNamespaceAsync(Document, SyntaxNode, CancellationToken)"/> 107protected abstract Task<ImmutableArray<(DocumentId id, SyntaxNode container)>> GetValidContainersFromAllLinkedDocumentsAsync(Document document, SyntaxNode container, CancellationToken cancellationToken); 115public override async Task<bool> CanChangeNamespaceAsync(Document document, SyntaxNode container, CancellationToken cancellationToken) 127Document document, 171static async Task<ImmutableArray<SyntaxNode>> GetTopLevelNamespacesAsync(Document document, CancellationToken cancellationToken) 183Document document, 284foreach (var document in documents) 325Document document, SyntaxNode container, CancellationToken cancellationToken) 347protected static bool IsSupportedLinkedDocument(Document document, out ImmutableArray<DocumentId> allDocumentIds) 368Document document, 402private static ImmutableArray<SyntaxNode> CreateImports(Document document, ImmutableArray<string> names, bool withFormatterAnnotation) 435var document = solution.GetRequiredDocument(id); 469var documentWithNewNamespace = await FixDeclarationDocumentAsync( 492var result = await FixReferencingDocumentAsync( 507Document document, ISymbol symbol, CancellationToken cancellationToken) 540private static async Task<ImmutableArray<ReferencedSymbol>> FindReferencesAsync(ISymbol symbol, Document document, CancellationToken cancellationToken) 551private async Task<Document> FixDeclarationDocumentAsync( 552Document document, 606var documentWithAddedImports = await AddImportsInContainersAsync( 634var formattedDocument = documentWithAddedImports.WithSyntaxRoot(root); 672private static async Task<Document> FixReferencingDocumentAsync( 673Document document, 692var documentWithAdditionalImports = await AddImportsInContainersAsync( 701var formattedDocument = await Formatter.FormatAsync( 707private static async Task<Document> SimplifyTypeNamesAsync( 708Document document, CodeCleanupOptions documentOptions, CancellationToken cancellationToken) 729private static async Task<(Document, ImmutableArray<SyntaxNode>)> FixReferencesAsync( 730Document document, 792var fixedDocument = editor.GetChangedDocument(); 807using var _2 = ArrayBuilder<Document>.GetInstance(out var documentsToProcess); 814var document = solution.GetRequiredDocument(id); 823var result = await RemoveUnnecessaryImportsWorkerAsync( 834async static Task<Document> RemoveUnnecessaryImportsWorkerAsync( 835Document doc, 854private static async Task<Document> AddImportsInContainersAsync( 855Document document,
CodeRefactorings\SyncNamespace\AbstractSyncNamespaceCodeRefactoringProvider.cs (1)
30protected 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)
CodeRefactorings\SyncNamespace\LocationForAffectedSymbol.cs (1)
17public Document Document => ReferenceLocation.Document;
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)
30public Document Document { get; } 56/// be overwritten during <see cref="CompletionService.GetCompletionsAsync(Document, int, CompletionTrigger, ImmutableHashSet{string}, OptionSet, CancellationToken)"/>. 111Document document, 137Document document, 211internal 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) 77public virtual Task<CompletionChange> GetChangeAsync(Document document, CompletionItem item, char? commitKey, CancellationToken cancellationToken)
Completion\CompletionService.cs (9)
51public static CompletionService? GetService(Document? document) 101var document = text.GetOpenDocumentInCurrentContextWithChanges(); 187Document document, 203internal virtual async Task<CompletionDescription?> GetDescriptionAsync(Document document, CompletionItem item, CompletionOptions options, SymbolDescriptionOptions displayOptions, CancellationToken cancellationToken = default) 232Document document, 277Document document, 300Document document, 374internal virtual Task<bool> IsSpeculativeTypeParameterContextAsync(Document document, int position, CancellationToken cancellationToken) 409Document document,
Completion\CompletionService_GetCompletions.cs (9)
38Document document, 62Document document, 129Document document, ConcatImmutableArray<CompletionProvider> providers, int caretPosition, CompletionOptions options, CompletionTrigger trigger, ImmutableHashSet<string>? roles, SourceText text) 152Document document, ImmutableArray<CompletionProvider> triggeredProviders, int caretPosition, CompletionTrigger trigger, CompletionOptions options, CancellationToken cancellationToken) 180private Document GetDocumentWithFrozenPartialSemantics(Document document, CancellationToken cancellationToken) 189Document document, SourceText text, int caretPosition, in CompletionOptions options) 231Document document, int caretPosition, CompletionTrigger trigger, 332Document document,
Completion\INotifyCommittingItemCompletionProvider.cs (1)
24Task NotifyCommittingItemAsync(Document document, CompletionItem item, char? commitKey, CancellationToken cancellationToken);
Completion\Providers\AbstractAggregateEmbeddedLanguageCompletionProvider.cs (2)
106public override Task<CompletionChange> GetChangeAsync(Document document, CompletionItem item, char? commitKey, CancellationToken cancellationToken) 109internal override Task<CompletionDescription?> GetDescriptionAsync(Document document, CompletionItem item, CompletionOptions options, SymbolDescriptionOptions displayOptions, CancellationToken cancellationToken)
Completion\Providers\AbstractAwaitCompletionProvider.cs (3)
80var document = context.Document; 169public sealed override async Task<CompletionChange> GetChangeAsync(Document document, CompletionItem item, char? commitKey, CancellationToken cancellationToken) 271var document = syntaxContext.Document;
Completion\Providers\AbstractCrefCompletionProvider.cs (2)
15Document document, CompletionItem item, CompletionOptions options, SymbolDescriptionOptions displayOptions, CancellationToken cancellationToken) 33Document document, int position, CompletionOptions options, CancellationToken cancellationToken);
Completion\Providers\AbstractDocCommentCompletionProvider.cs (2)
98protected abstract Task<IEnumerable<CompletionItem>?> GetItemsWorkerAsync(Document document, int position, CompletionTrigger trigger, CancellationToken cancellationToken); 286public 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)
45private async Task<ImmutableArray<CompletionItem>> RecommendCompletionItemsAsync(Document document, CompletionContext context, CancellationToken cancellationToken) 54Document document, 75public sealed override Task<TextChange?> GetTextChangeAsync(Document document, CompletionItem item, char? ch, CancellationToken cancellationToken)
Completion\Providers\AbstractMemberInsertingCompletionProvider.cs (11)
40Document document, CompletionItem item, Compilation compilation, ISymbol member, INamedTypeSymbol containingType, CancellationToken cancellationToken); 48public override async Task<CompletionChange> GetChangeAsync(Document document, CompletionItem item, char? commitKey = null, CancellationToken cancellationToken = default) 60private async Task<(Document, TextSpan? caretPosition)> DetermineNewDocumentAsync( 61Document document, 103var memberContainingDocument = await GenerateMemberAndUsingsAsync(document, completionItem, line, cancellationToken).ConfigureAwait(false); 118private async Task<Document?> GenerateMemberAndUsingsAsync( 119Document document, 171private async Task<(Document Document, TextSpan? Selection)> RemoveDestinationNodeAsync( 172Document memberContainingDocument, CodeCleanupOptions cleanupOptions, CancellationToken cancellationToken) 222var document = memberContainingDocument.WithSyntaxRoot(root); 256internal override Task<CompletionDescription> GetDescriptionWorkerAsync(Document document, CompletionItem item, CompletionOptions options, SymbolDescriptionOptions displayOptions, CancellationToken cancellationToken)
Completion\Providers\AbstractObjectInitializerCompletionProvider.cs (4)
18protected abstract (ITypeSymbol type, Location location, bool isObjectInitializer)? GetInitializedType(Document document, SemanticModel semanticModel, int position, CancellationToken cancellationToken); 24var document = context.Document; 86internal override Task<CompletionDescription> GetDescriptionWorkerAsync(Document document, CompletionItem item, CompletionOptions options, SymbolDescriptionOptions displayOptions, CancellationToken cancellationToken) 89protected 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)
34Document document, CompletionItem completionItem, Compilation compilation, ISymbol overriddenMember, INamedTypeSymbol containingType, CancellationToken cancellationToken)
Completion\Providers\AbstractOverrideCompletionProvider.ItemGetter.cs (2)
18Document document, 35Document document,
Completion\Providers\AbstractPartialMethodCompletionProvider.cs (3)
38var document = context.Document; 59Document document, CompletionItem item, Compilation compilation, ISymbol member, INamedTypeSymbol containingType, CancellationToken cancellationToken) 79Document 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 (2)
20var originatingDocument = context.Document; 34var document = solution.GetRequiredDocument(documentId);
Completion\Providers\AbstractRecommendationServiceBasedCompletionProvider.cs (4)
224Document document, CompletionItem item, CompletionOptions options, SymbolDescriptionOptions displayOptions, CancellationToken cancellationToken) 253var relatedDocument = await document.Project.Solution.GetRequiredDocumentAsync(documentId, includeSourceGenerated: true, cancellationToken).ConfigureAwait(false); 287protected sealed override async Task<bool> IsSemanticTriggerCharacterAsync(Document document, int characterPosition, CancellationToken cancellationToken) 293protected 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 (7)
328internal override Task<CompletionDescription> GetDescriptionWorkerAsync(Document document, CompletionItem item, CompletionOptions options, SymbolDescriptionOptions displayOptions, CancellationToken cancellationToken) 335var document = completionContext.Document; 371Document document, 411protected virtual Task<bool> IsSemanticTriggerCharacterAsync(Document document, int characterPosition, CancellationToken cancellationToken) 440CompletionContext completionContext, Document document, CompletionOptions options, IEnumerable<DocumentId> relatedDocuments, CancellationToken cancellationToken) 449var relatedDocument = solution.GetRequiredDocument(relatedDocumentId); 498public 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)
32protected 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) 212private async Task<bool> IsInImportsDirectiveAsync(Document document, int position, CancellationToken cancellationToken) 221protected static bool IsAddingImportsSupported(Document document, CompletionOptions? completionOptions) 228internal 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\ExtensionMemberImportCompletionHelper.cs (3)
64var document = syntaxContext.Document; 94Document document, 251foreach (var document in project.Documents)
Completion\Providers\ImportCompletionProvider\ExtensionMemberImportCompletionHelper.SymbolComputer.cs (2)
29private readonly Document _originatingDocument; 46Document document,
Completion\Providers\ImportCompletionProvider\ImportCompletionItem.cs (1)
156public static async Task<CompletionDescription> GetCompletionDescriptionAsync(Document document, CompletionItem item, SymbolDescriptionOptions options, CancellationToken cancellationToken)
Completion\Providers\ImportCompletionProvider\ImportCompletionProviderHelpers.cs (3)
22Document document, int completionItemPosition, string namespaceName, CancellationToken cancellationToken) 44var documentWithImport = document.WithSyntaxRoot(rootWithImport); 47var formattedDocumentWithImport = await Formatter.FormatAsync(documentWithImport, Formatter.Annotation, formattingOptions, cancellationToken).ConfigureAwait(false);
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 (8)
139public static async Task<ImmutableArray<ISymbol>> GetSymbolsAsync(CompletionItem item, Document document, CancellationToken cancellationToken) 157var linkedDoc = document.Project.Solution.GetRequiredDocument(id); 192CompletionItem item, Document document, SymbolDescriptionOptions options, CancellationToken cancellationToken) 199CompletionItem item, Document document, ImmutableArray<ISymbol> symbols, SymbolDescriptionOptions options, CancellationToken cancellationToken) 209var contextDocument = FindAppropriateDocumentForDescriptionContext(document, supportedPlatforms); 216private static Document FindAppropriateDocumentForDescriptionContext(Document document, SupportedPlatformData? supportedPlatforms) 417CompletionItem 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 (6)
25protected abstract Task<string> GetFieldNameAsync(Document document, IPropertySymbol propertySymbol, CancellationToken cancellationToken); 32protected abstract Task<Document> ExpandToFieldPropertyAsync(Document document, TPropertyDeclarationNode property, CancellationToken cancellationToken); 85private async Task<Document> ExpandToFullPropertyAsync( 86Document document, 130Document 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)
311private async Task<Document> ConvertForToForEachAsync( 312Document document,
ConvertIfToSwitch\AbstractConvertIfToSwitchCodeRefactoringProvider.cs (1)
182Document document,
ConvertIfToSwitch\AbstractConvertIfToSwitchCodeRefactoringProvider.Rewriting.cs (2)
27private async Task<Document> UpdateDocumentAsync( 28Document document,
ConvertLinq\ConvertForEachToLinqQuery\AbstractConvertForEachToLinqQueryProvider.cs (2)
145private Task<Document> ApplyConversionAsync( 147Document document,
ConvertNumericLiteral\AbstractConvertNumericLiteralCodeRefactoringProvider.cs (2)
122static 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 (4)
53Document document, 268Document document, 309private static async Task<Document> CreateInterpolatedStringAsync( 310Document 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 (24)
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) 254var document = solution.GetRequiredDocument(renamedToken.documentId); 263Document document, TextSpan span, Scope scope, bool isRecord, CancellationToken cancellationToken) 302var documentToEditorMap = new Dictionary<Document, SyntaxEditor>(); 325Dictionary<Document, SyntaxEditor> documentToEditorMap, 364var document = documentToUpdate.Document; 419Document document, SyntaxNode tupleExprOrTypeNode, 491foreach (var document in project.Documents) 518Document startingDocument, SyntaxNode tupleExprOrTypeNode, CancellationToken cancellationToken) 533var document = solution.GetRequiredDocument(group.Key); 543Document document, SyntaxNode tupleExprOrTypeNode) 553Document document, SyntaxNode tupleExprOrTypeNode, INamedTypeSymbol namedTypeSymbol, 554Dictionary<Document, SyntaxEditor> documentToEditorMap, 584Document startingDocument, Dictionary<Document, SyntaxEditor> documentToEditorMap, CancellationToken cancellationToken) 592var updatedDocument = currentSolution.WithDocumentSyntaxRoot(docId, newRoot, PreservationMode.PreserveIdentity) 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)
15Document document, TextSpan span, Scope scope, bool isRecord, CancellationToken cancellationToken);
Copilot\CopilotChangeAnalysisUtilities.cs (1)
40Document document,
Copilot\Extensions.cs (1)
18if (document is not Document sourceDocument)
Copilot\ICopilotChangeAnalysisService.cs (7)
38Document document, ImmutableArray<TextChange> normalizedChanges, CancellationToken cancellationToken); 52Document document, 80Document document, 98var newDocument = document.WithText(newText); 163Document newDocument, 203Document newDocument, 234Document newDocument,
Copilot\ICopilotCodeAnalysisService.cs (6)
36Task<ImmutableArray<string>> GetAvailablePromptTitlesAsync(Document document, CancellationToken cancellationToken); 46Task AnalyzeDocumentAsync(Document document, TextSpan? span, string promptTitle, CancellationToken cancellationToken); 57Task<ImmutableArray<Diagnostic>> GetCachedDocumentDiagnosticsAsync(Document document, TextSpan? span, ImmutableArray<string> promptTitles, CancellationToken cancellationToken); 65Task StartRefinementSessionAsync(Document oldDocument, Document newDocument, Diagnostic? primaryDiagnostic, CancellationToken cancellationToken); 101Document document,
Copilot\IProposalAdjusterService.cs (21)
24using Adjuster = Func<Document, Document, LineFormattingOptions?, CancellationToken, Task<Document>>; 53ImmutableHashSet<string> allowableAdjustments, Document document, 84protected abstract Task<Document> AddMissingTokensIfAppropriateAsync( 85Document originalDocument, Document forkedDocument, CancellationToken cancellationToken); 88ImmutableHashSet<string> allowableAdjustments, Document document, 114ImmutableHashSet<string> allowableAdjustments, Document originalDocument, 136var forkedDocument = originalDocument.WithText(newText); 145var adjustedDocument = await adjuster(originalDocument, forkedDocument, lineFormattingOptions, cancellationToken).ConfigureAwait(false); 381private static async Task<Document> TryGetAddImportTextChangesAsync( 382Document originalDocument, Document forkedDocument, CancellationToken cancellationToken) 393var withImportsDocument = await missingImportsService.AddMissingImportsAsync( 399private static async Task<Document> TryGetFormattingTextChangesAsync( 400Document originalDocument, Document forkedDocument, 419var formattedDocument = forkedDocument.WithSyntaxRoot(formattedRoot); 442private static async Task<TextSpan> GetSpanOfChangesAsync(Document oldDocument, Document newDocument, 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)
14Task<IList<string>> GetProximityExpressionsAsync(Document document, int position, CancellationToken cancellationToken); 15Task<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)
26Task<Document?> AddSourceToAsync(Document document, Compilation symbolCompilation, ISymbol symbol, MetadataReference? metadataReference, string? assemblyLocation, SyntaxFormattingOptions? formattingOptions, CancellationToken cancellationToken);
DesignerAttribute\DesignerAttributeDiscoveryService.cs (5)
132var frozenDocument = solution 198Document? specificDocument, 222Document? specificDocument, 293var document = project.GetRequiredDocument(documentId); 386Document? activeDocument,
Diagnostics\Service\DiagnosticAnalyzerService.IncrementalMemberEditAnalyzer.cs (9)
46private readonly WeakReference<Document?> _lastDocumentWithCachedDiagnostics = new(null); 51public void UpdateDocumentWithCachedDiagnostics(Document document) 68var document = (Document)analysisScope.TextDocument; 190private async Task<(SyntaxNode changedMember, int changedMemberId, ImmutableArray<TextSpan> memberSpans, Document lastDocument)?> TryGetChangedMemberAsync( 191Document document, 195if (!_lastDocumentWithCachedDiagnostics.TryGetTarget(out var lastDocument) 227private async Task<ImmutableArray<TextSpan>> GetOrCreateMemberSpansAsync(Document document, VersionStamp version, CancellationToken cancellationToken) 244static async Task<ImmutableArray<TextSpan>> CreateMemberSpansAsync(Document document, VersionStamp version, CancellationToken cancellationToken)
Diagnostics\Service\DiagnosticAnalyzerService_ComputeDiagnosticAnalysisResults.cs (1)
131var tree = textDocument is Document document
Diagnostics\Service\DiagnosticAnalyzerService_CoreAnalyze.cs (5)
114if (documentAnalysisScope.TextDocument is Document document) 125var model = await ((Document)documentAnalysisScope.TextDocument).GetRequiredSemanticModelAsync(cancellationToken).ConfigureAwait(false); 149if (documentAnalysisScope.TextDocument is not Document document) 177await foreach (var document in project.GetAllRegularAndSourceGeneratedDocumentsAsync(cancellationToken).ConfigureAwait(false)) 193Document document,
Diagnostics\Service\DiagnosticAnalyzerService_GetDiagnosticsForSpan.cs (3)
64var incrementalAnalysis = range is null && document is Document { SupportsSyntaxTree: true }; 114includeSemantic = includeSemantic && analyzer.SupportAnalysisKind(AnalysisKind.Semantic) && document is Document; 331service._incrementalMemberEditAnalyzer.UpdateDocumentWithCachedDiagnostics((Document)document);
Diagnostics\Service\DocumentAnalysisExecutor.cs (8)
85var document = textDocument as Document; 188Contract.ThrowIfFalse(AnalysisScope.TextDocument is Document); 211if (AnalysisScope.TextDocument is not Document) 242var document = (Document)AnalysisScope.TextDocument; 267async ValueTask<TextSpan?> GetAdjustedSpanForCompilerAnalyzerAsync(Document document) 303async ValueTask VerifySpanBasedCompilerDiagnosticsAsync(Document document)
Diagnostics\Service\DocumentAnalysisExecutor_Helpers.cs (2)
168var document = TryGetDocumentWithFilePath(filePath); 193Document? TryGetDocumentWithFilePath(string path)
DocumentHighlighting\AbstractDocumentHighlightsService.cs (16)
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, 188foreach (var currentDocument in documentsToSearch) 206Document document, ISymbol symbol, CancellationToken cancellationToken) 216IImmutableSet<Document> documentToSearch, 220var tagMap = new MultiDictionary<Document, HighlightSpan>(); 246var document = solution.GetDocument(location.SourceTree); 299private static async Task AddLocationSpanAsync(Location location, Solution solution, HashSet<DocumentSpan> spanSet, MultiDictionary<Document, HighlightSpan> tagList, HighlightSpanKind kind, CancellationToken cancellationToken) 318var document = solution.GetRequiredDocument(tree);
DocumentHighlighting\IDocumentHighlightsService.cs (4)
38internal readonly struct DocumentHighlights(Document document, ImmutableArray<HighlightSpan> highlightSpans) 40public Document Document { get; } = document; 51Document document, int position, IImmutableSet<Document> documentsToSearch, HighlightingOptions options, CancellationToken cancellationToken);
DocumentHighlighting\IEmbeddedLanguageDocumentHighlighter.cs (1)
16Document document,
DocumentIdSpan.cs (2)
14/// pointing at a particular location in a <see cref="Document"/> but do not want to root a potentially 30var document = await solution.GetDocumentAsync(this.DocumentId, includeSourceGenerated: true, cancellationToken).ConfigureAwait(false);
DocumentSpan.cs (2)
13Document Document, TextSpan SourceSpan, bool IsGeneratedCode) 15public DocumentSpan(Document document, TextSpan sourceSpan)
DocumentSpanExtensions.cs (1)
32var document = documentSpan.Document;
EditAndContinue\AbstractEditAndContinueAnalyzer.cs (5)
732private static async ValueTask<(Document? document, SourceText text)> GetDocumentContentAsync(Project project, DocumentId documentId, CancellationToken cancellationToken) 736var document = await project.GetDocumentAsync(documentId, includeSourceGenerated: true, cancellationToken).ConfigureAwait(false); 749private async ValueTask<(SyntaxNode oldRoot, SyntaxNode newRoot)> GetSyntaxRootsAsync(Document? oldDocument, Document? newDocument, CancellationToken cancellationToken) 776private static async ValueTask<DocumentSemanticModel> GetDocumentSemanticModelAsync(Project project, Document? document, SyntaxTree tree, CancellationToken cancellationToken)
EditAndContinue\ActiveStatementsMap.cs (1)
166internal async ValueTask<ImmutableArray<UnmappedActiveStatement>> GetOldActiveStatementsAsync(IEditAndContinueAnalyzer analyzer, Document oldDocument, CancellationToken cancellationToken)
EditAndContinue\CommittedSolution.cs (10)
145/// Returns a document snapshot for given <see cref="Document"/> whose content exactly matches 151public async Task<(Document? Document, DocumentState State)> GetDocumentAndStateAsync(Document currentDocument, CancellationToken cancellationToken, bool reloadOutOfSyncDocument = false) 163var committedDocument = solution.GetDocument(documentId); 211var document = committedDocument ?? currentDocument; 249Document? matchingDocument; 325private async ValueTask<(Optional<SourceText?> matchingSourceText, bool? hasDocument)> TryGetMatchingSourceTextAsync(Document document, SourceText sourceText, Document currentDocument, CancellationToken cancellationToken) 369Document? currentDocument, 475private bool? TryReadSourceFileDebugInfo(Document document, Encoding? documentEncoding, out ImmutableArray<byte> checksum, out SourceHashAlgorithm checksumAlgorithm, out Encoding? defaultEncoding)
EditAndContinue\DebuggingSession.cs (3)
454public async ValueTask<ImmutableArray<Diagnostic>> GetDocumentDiagnosticsAsync(Document document, ActiveStatementSpanProvider activeStatementSpanProvider, CancellationToken cancellationToken) 756var newDocument = await solution.GetRequiredDocumentAsync(documentId, includeSourceGenerated: true, cancellationToken).ConfigureAwait(false); 890var newUnmappedDocument = await newSolution.GetRequiredDocumentAsync(unmappedDocumentId, includeSourceGenerated: true, cancellationToken).ConfigureAwait(false);
EditAndContinue\EditAndContinueDocumentAnalysesCache.cs (9)
27private readonly Dictionary<DocumentId, (AsyncLazy<DocumentAnalysisResults> results, Project oldProject, Document? newDocument, ImmutableArray<ActiveStatementLineSpan> activeStatementSpans)> _analyses = []; 35IReadOnlyList<(Document? oldDocument, Document? newDocument)> documents, 66Document? oldDocument, 67Document? newDocument, 105private async Task<ImmutableArray<ActiveStatementLineSpan>> GetLatestUnmappedActiveStatementSpansAsync(Document? oldDocument, Document? newDocument, ActiveStatementSpanProvider newActiveStatementSpanProvider, CancellationToken cancellationToken) 175private AsyncLazy<DocumentAnalysisResults> GetDocumentAnalysisNoLock(Project oldProject, Project newProject, Document? oldDocument, Document? newDocument, ImmutableArray<ActiveStatementLineSpan> activeStatementSpans)
EditAndContinue\EditAndContinueService.cs (1)
202public ValueTask<ImmutableArray<Diagnostic>> GetDocumentDiagnosticsAsync(Document document, ActiveStatementSpanProvider activeStatementSpanProvider, CancellationToken cancellationToken)
EditAndContinue\EditSession.cs (19)
184var oldDocument = await oldProject.GetDocumentAsync(documentAnalysis.DocumentId, includeSourceGenerated: true, cancellationToken).ConfigureAwait(false); 185var newDocument = await newProject.GetDocumentAsync(documentAnalysis.DocumentId, includeSourceGenerated: true, cancellationToken).ConfigureAwait(false); 350var document = newProject.GetRequiredDocument(documentId); 371var document = newProject.GetRequiredDocument(documentId); 387var document = oldProject.GetRequiredDocument(documentId); 569/// Enumerates <see cref="DocumentId"/>s of changed (not added or removed) <see cref="Document"/>s (not additional nor analyzer config). 613private async Task<(ImmutableArray<DocumentAnalysisResults> results, Document? staleDocument)> AnalyzeProjectDifferencesAsync( 621using var _ = ArrayBuilder<(Document? oldDocument, Document? newDocument)>.GetInstance(out var documents); 622Document? staleDocument = null; 624foreach (var newDocument in differences.ChangedOrAddedDocuments) 656foreach (var oldDocument in differences.DeletedDocuments) 676var document = newDocument ?? oldDocument; 835var oldDocument = await oldProject.GetDocumentAsync(analysis.DocumentId, includeSourceGenerated: true, cancellationToken).ConfigureAwait(false); 1057var oldDocument = await oldProject.GetDocumentAsync(documentId, includeSourceGenerated: true, cancellationToken).ConfigureAwait(false); 1113foreach (var changedDocument in projectDifferences.ChangedOrAddedDocuments) 1306var document = await solution.GetDocumentAsync(analysis.DocumentId, includeSourceGenerated: true, cancellationToken).ConfigureAwait(false); 1495var oldDocument = await oldProject.GetDocumentAsync(changedDocumentAnalysis.DocumentId, includeSourceGenerated: true, cancellationToken).ConfigureAwait(false); 1496var newDocument = await newProject.GetDocumentAsync(changedDocumentAnalysis.DocumentId, includeSourceGenerated: true, cancellationToken).ConfigureAwait(false);
EditAndContinue\IEditAndContinueService.cs (1)
21ValueTask<ImmutableArray<Diagnostic>> GetDocumentDiagnosticsAsync(Document document, ActiveStatementSpanProvider activeStatementSpanProvider, CancellationToken cancellationToken);
EditAndContinue\PdbMatchingSourceTextProvider.cs (2)
70var oldDocument = e.OldSolution.GetDocument(e.DocumentId); 77var newDocument = e.NewSolution.GetDocument(e.DocumentId);
EditAndContinue\ProjectDiagnostics.cs (1)
26var document = solution.GetDocument(diagnostic.Location.SourceTree);
EditAndContinue\ProjectDifferences.cs (4)
15public readonly ArrayBuilder<Document> ChangedOrAddedDocuments = ArrayBuilder<Document>.GetInstance(); 16public readonly ArrayBuilder<Document> DeletedDocuments = ArrayBuilder<Document>.GetInstance();
EditAndContinue\Remote\RemoteEditAndContinueServiceProxy.cs (1)
152public async ValueTask<ImmutableArray<DiagnosticData>> GetDocumentDiagnosticsAsync(Document document, ActiveStatementSpanProvider activeStatementSpanProvider, CancellationToken cancellationToken)
EditAndContinue\TraceLog.cs (4)
61private string MakeSourceFileLogPath(Document document, string suffix, UpdateId updateId, int? generation) 107public async ValueTask WriteDocumentAsync(Document document, string fileNameSuffix, UpdateId updateId, int? generation, CancellationToken cancellationToken) 126public async ValueTask WriteDocumentChangeAsync(Document? oldDocument, Document? newDocument, UpdateId updateId, int? generation, CancellationToken cancellationToken)
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)
54Document 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)
41protected abstract Task<SyntaxNode> RewriteFieldNameAndAccessibilityAsync(string originalFieldName, bool makePrivate, Document document, SyntaxAnnotation declarationAnnotation, CancellationToken cancellationToken); 42protected abstract Task<ImmutableArray<IFieldSymbol>> GetFieldsAsync(Document document, TextSpan span, CancellationToken cancellationToken); 45public async Task<EncapsulateFieldResult?> EncapsulateFieldsInSpanAsync(Document document, TextSpan span, bool useDefaultBehavior, CancellationToken cancellationToken) 58public async Task<ImmutableArray<CodeAction>> GetEncapsulateFieldCodeActionsAsync(Document document, TextSpan span, CancellationToken cancellationToken) 82private ImmutableArray<CodeAction> EncapsulateAllFields(Document document, ImmutableArray<IFieldSymbol> fields) 94private ImmutableArray<CodeAction> EncapsulateOneField(Document document, IFieldSymbol field) 111Document document, ImmutableArray<IFieldSymbol> fields, 141private async Task<Solution> EncapsulateFieldsInCurrentProcessAsync(Document document, ImmutableArray<IFieldSymbol> fields, bool updateReferences, CancellationToken cancellationToken) 168Document document, 221var documentWithProperty = await AddPropertyAsync( 231bool updateReferences, Solution solution, Document document, IFieldSymbol field, string finalFieldName, string generatedPropertyName, CancellationToken cancellationToken) 316protected static async Task<Document> AddPropertyAsync( 317Document document, 343Document 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);
Extensions\ExtensionMessageHandlerService_RemoteOrLocal.cs (1)
120public ValueTask<ExtensionMessageResult> HandleExtensionDocumentMessageAsync(Document document, string messageName, string jsonMessage, CancellationToken cancellationToken)
Extensions\IExtensionMessageHandlerFactory.cs (1)
34ImmutableArray<IExtensionMessageHandlerWrapper<Document>> CreateDocumentMessageHandlers(
Extensions\IExtensionMessageHandlerService.cs (1)
83Document documentId, string messageName, string jsonMessage, CancellationToken cancellationToken);
ExternalAccess\Pythia\Api\PythiaCompletionProviderBase.cs (4)
51public static Task<CompletionDescription> GetDescriptionAsync(CompletionItem item, Document document, SymbolDescriptionOptions displayOptions, CancellationToken cancellationToken) 60Document document, CompletionItem item, CompletionOptions options, SymbolDescriptionOptions displayOptions, CancellationToken cancellationToken) 78public override Task<CompletionChange> GetChangeAsync(Document document, CompletionItem item, char? commitKey = null, CancellationToken cancellationToken = default) 81public 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)
16public UnitTestingDocumentDifferenceResult? GetDifference(Document oldDocument, Document newDocument, CancellationToken cancellationToken)
ExternalAccess\UnitTesting\SolutionCrawler\IUnitTestingDocumentDifferenceService.cs (2)
19UnitTestingDocumentDifferenceResult? GetDifference(Document oldDocument, Document newDocument, CancellationToken cancellationToken);
ExternalAccess\UnitTesting\SolutionCrawler\IUnitTestingIncrementalAnalyzer.cs (1)
14Document document,
ExternalAccess\UnitTesting\SolutionCrawler\IUnitTestingWorkCoordinatorPriorityService.cs (1)
18Task<bool> IsLowPriorityAsync(Document document, CancellationToken cancellationToken);
ExternalAccess\UnitTesting\SolutionCrawler\UnitTestingWorkCoordinator.cs (9)
348var sourceDocument = document as Document; 366private static Document GetRequiredDocument(Project project, DocumentId documentId, Document? document) 412IUnitTestingIncrementalAnalyzer analyzer, Project project, DocumentId documentId, Document? document, UnitTestingInvocationReasons invocationReasons) 507private async Task EnqueueChangedDocumentWorkItemAsync(Document oldDocument, Document newDocument) 547foreach (var document in project.Documents) 624var 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 (10)
100var document = data.GetRequiredDocument(); 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 (2)
25public (Document? document, int lineNumber) GetDocumentAndLine(Workspace workspace, UnitTestingParsedFrameWrapper parsedFrame) 28if (textDocument is Document document)
ExternalAccess\VSTypeScript\Api\IVSTypeScriptClassificationService.cs (1)
16Task AddSemanticClassificationsAsync(Document document, ImmutableArray<TextSpan> textSpans, List<ClassifiedSpan> result, CancellationToken cancellationToken);
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\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\IVSTypeScriptTodoCommentDataServiceImplementation.cs (1)
37Document document, ImmutableArray<VSTypeScriptTaskListItemDescriptorWrapper> value, CancellationToken cancellationToken);
ExternalAccess\VSTypeScript\Api\VSTypeScriptCompletionServiceWithProviders.cs (2)
30Document document, 37Document 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)
51Task<SignatureHelpItems?> ISignatureHelpProvider.GetItemsAsync(Document document, int position, SignatureHelpTriggerInfo triggerInfo, MemberDisplayOptions options, CancellationToken cancellationToken) 64protected abstract Task<SignatureHelpItems?> GetItemsAsync(Document document, int position, SignatureHelpTriggerInfo triggerInfo, CancellationToken cancellationToken);
ExternalAccess\VSTypeScript\VSTypeScriptClassificationService.cs (5)
34public Task AddSyntacticClassificationsAsync(Document document, ImmutableArray<TextSpan> textSpans, SegmentedList<ClassifiedSpan> result, CancellationToken cancellationToken) 37public Task AddEmbeddedLanguageClassificationsAsync(Document document, ImmutableArray<TextSpan> textSpans, ClassificationOptions options, SegmentedList<ClassifiedSpan> result, CancellationToken cancellationToken) 43public ValueTask<TextChangeRange?> ComputeSyntacticChangeRangeAsync(Document oldDocument, Document newDocument, TimeSpan timeout, CancellationToken cancellationToken) 49public async Task AddSemanticClassificationsAsync(Document document, ImmutableArray<TextSpan> textSpans, ClassificationOptions options, SegmentedList<ClassifiedSpan> result, 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 (7)
27Document document, 35private readonly Document _document = document; 127var documentWithTypeDeclaration = solutionWithUpdatedOriginalType.GetRequiredDocument(updatedDocument.Id); 165var document = solution.GetRequiredDocument(documentId); 211var updatedOriginalDocument = solution.GetRequiredDocument(_document.Id); 216private static async Task<INamedTypeSymbol> GetNewTypeSymbolAsync(Document document, SyntaxAnnotation typeAnnotation, CancellationToken cancellationToken) 243var document = solution.GetRequiredDocument(documentId);
ExtractClass\IExtractClassOptionsService.cs (1)
15Document document,
ExtractInterface\AbstractExtractInterfaceService.cs (11)
30Document document, 48public async Task<ImmutableArray<ExtractInterfaceCodeAction>> GetExtractInterfaceCodeActionAsync(Document document, TextSpan span, CancellationToken cancellationToken) 58Document documentWithTypeToExtractFrom, 79Document document, 226var document = symbolMapping.AnnotatedSolution.GetDocument(refactoringResult.DocumentToExtractFrom.Id); 255Document document, 277internal static bool IsOptionsServiceAvailable(Document document) 288var document = formattedSolution.GetRequiredDocument(documentId); 292var formattedDocument = await Formatter.FormatAsync( 298var simplifiedDocument = await Simplifier.ReduceAsync( 331var document = solution.GetRequiredDocument(documentId);
ExtractInterface\ExtractInterfaceTypeAnalysisResult.cs (2)
15public readonly Document DocumentToExtractFrom; 23Document documentToExtractFrom,
ExtractInterface\IExtractInterfaceOptionsService.cs (1)
13Document document,
ExtractMethod\AbstractExtractMethodService.cs (1)
30Document 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.cs (11)
42protected abstract AbstractFormattingRule GetCustomFormattingRule(Document document); 44protected abstract Task<(Document document, SyntaxToken invocationNameToken)> InsertNewLineBeforeLocalFunctionIfNecessaryAsync( 45Document document, SyntaxToken invocationNameToken, SyntaxNode methodDefinition, CancellationToken cancellationToken); 86var documentWithoutFinalFormatting = afterTriviaRestored.Document; 106bool CanAddTo(Document document, SyntaxNode insertionPointNode, out OperationStatus status) 138private async Task<(Document document, SyntaxToken? invocationNameToken)> GetFormattedDocumentAsync( 139Document document, 150var annotatedDocument = document.WithSyntaxRoot(root); 151var simplifiedDocument = await Simplifier.ReduceAsync(annotatedDocument, Simplifier.Annotation, this.Options.CodeCleanupOptions.SimplifierOptions, cancellationToken).ConfigureAwait(false); 157var formattedDocument = simplifiedDocument.WithSyntaxRoot( 200private ImmutableArray<AbstractFormattingRule> GetFormattingRules(Document document)
FindUsages\AbstractFindUsagesService.ProgressAdapter.cs (1)
35public 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)
314var document = referenceLocation.Document;
FindUsages\FindUsagesHelpers.cs (2)
23Document document, int position, CancellationToken cancellationToken) 36Document document, int position, bool preferPrimaryConstructor, 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);
FindUsages\IRemoteFindUsagesService.cs (1)
179var document = solution.GetDocument(DocumentId) ??
Formatting\AbstractNewDocumentFormattingService.cs (4)
35public async Task<Document> FormatNewDocumentAsync(Document document, Document? hintDocument, CodeCleanupOptions options, CancellationToken cancellationToken) 49var oldDocument = document;
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)
19Task<Document> FormatNewDocumentAsync(Document document, Document? hintDocument, CodeCleanupOptions options, CancellationToken cancellationToken);
FullyQualify\AbstractFullyQualifyCodeFixProvider.cs (1)
25var document = context.Document;
FullyQualify\AbstractFullyQualifyService.cs (6)
40Document document, TextSpan span, CancellationToken cancellationToken) 60Document document, TextSpan span, CancellationToken cancellationToken) 182Document document, 217private async Task<IEnumerable<TextChange>> ProcessNodeAsync(Document document, TSimpleNameSyntax simpleName, string containerName, INamespaceOrTypeSymbol originalSymbol, CancellationToken cancellationToken) 220var newDocument = document.WithSyntaxRoot(newRoot); 221var cleanedDocument = await CodeAction.CleanupDocumentAsync(
FullyQualify\IFullyQualifyService.cs (1)
35Task<FullyQualifyFixData?> GetFixDataAsync(Document document, TextSpan span, CancellationToken cancellationToken);
GenerateComparisonOperators\GenerateComparisonOperatorsCodeRefactoringProvider.cs (2)
131private static async Task<Document> GenerateComparisonOperatorsAsync( 132Document document,
GenerateConstructors\AbstractGenerateConstructorsCodeRefactoringProvider.ConstructorDelegatingCodeAction.cs (4)
23Document document, 28private readonly Document _document = document; 32protected override async Task<Document> GetChangedDocumentAsync(CancellationToken cancellationToken) 83var result = await codeGenerationService.AddMethodAsync(
GenerateConstructors\AbstractGenerateConstructorsCodeRefactoringProvider.cs (10)
63protected abstract ValueTask<bool> PrefersThrowExpressionAsync(Document document, CancellationToken cancellationToken); 78Document priorDocument, TextSpan priorSelection, Document currentDocument, IntentDataProvider intentDataProvider, CancellationToken cancellationToken) 110Document priorDocument, CodeAction codeAction, IProgress<CodeAnalysisProgress> progressTracker, CancellationToken cancellationToken) 152Document document, 191Document document, 266Document document, TextSpan textSpan, bool addNullChecks, Accessibility? desiredAccessibility, CancellationToken cancellationToken) 282private ImmutableArray<CodeAction> GetCodeActions(Document document, State state, bool addNullChecks) 293private static async Task<Document> AddNavigationAnnotationAsync(Document document, CancellationToken cancellationToken)
GenerateConstructors\AbstractGenerateConstructorsCodeRefactoringProvider.FieldDelegatingCodeAction.cs (4)
23Document document, 28private readonly Document _document = document; 32protected override async Task<Document> GetChangedDocumentAsync(CancellationToken cancellationToken) 72var result = await CodeGenerator.AddMemberDeclarationsAsync(
GenerateConstructors\AbstractGenerateConstructorsCodeRefactoringProvider.GenerateConstructorWithDialogCodeAction.cs (3)
24Document document, 31private readonly Document _document = document; 96var constructorDocument = solution.GetRequiredDocument(constructorTree);
GenerateConstructors\AbstractGenerateConstructorsCodeRefactoringProvider.State.cs (2)
37Document document, 53Document document,
GenerateEqualsAndGetHashCodeFromMembers\AbstractGenerateEqualsAndGetHashCodeService.cs (7)
27public async Task<Document> FormatDocumentAsync(Document document, SyntaxFormattingOptions options, CancellationToken cancellationToken) 30var formattedDocument = await Formatter.FormatAsync( 39Document document, INamedTypeSymbol namedType, ImmutableArray<ISymbol> members, 51Document document, INamedTypeSymbol namedType, 62Document document, INamedTypeSymbol containingType, CancellationToken cancellationToken) 117Document document, INamedTypeSymbol namedType,
GenerateEqualsAndGetHashCodeFromMembers\GenerateEqualsAndGetHashCodeAction.cs (7)
22Document document, 40private readonly Document _document = document; 47protected override async Task<Document> GetChangedDocumentAsync(CancellationToken cancellationToken) 86var newDocument = await UpdateDocumentAndAddImportsAsync( 90var formattedDocument = await service.FormatDocumentAsync( 115private async Task<Document> UpdateDocumentAndAddImportsAsync(SyntaxNode oldType, SyntaxNode newType, CancellationToken cancellationToken) 118var newDocument = _document.WithSyntaxRoot(oldRoot.ReplaceNode(oldType, newType));
GenerateEqualsAndGetHashCodeFromMembers\GenerateEqualsAndGetHashCodeFromMembersCodeRefactoringProvider.cs (5)
169Document document, 200Document document, SyntaxNode typeDeclaration, INamedTypeSymbol containingType, ImmutableArray<ISymbol> selectedMembers, 240Document document, SyntaxNode typeDeclaration, INamedTypeSymbol containingType, ImmutableArray<ISymbol> members, 257Document document, SyntaxNode typeDeclaration, INamedTypeSymbol containingType, ImmutableArray<ISymbol> members, 294Document document, SyntaxNode typeDeclaration, INamedTypeSymbol containingType, ImmutableArray<ISymbol> members,
GenerateEqualsAndGetHashCodeFromMembers\GenerateEqualsAndHashWithDialogCodeAction.cs (2)
22Document document, 34private 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 (3)
25Document document, 31private readonly Document _document = document; 75var newDocument = await CodeGenerator.AddMemberDeclarationsAsync(
GenerateType\AbstractGenerateTypeService.CodeAction.cs (4)
26private readonly Document _document; 32Document document, 85private readonly Document _document; 88internal 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, 274protected static async Task<bool> IsWithinTheImportingNamespaceAsync(Document document, int triggeringPosition, string includeUsingsOrImports, CancellationToken cancellationToken)
GenerateType\AbstractGenerateTypeService.Editor.cs (5)
279var newDocument = newSolution.GetDocument(newDocumentId); 294var codeGenResult = await CodeGenerator.AddNamespaceOrTypeDeclarationAsync( 392var codeGenResult = await CodeGenerator.AddNamedTypeDeclarationAsync( 438var codeGenResult = await CodeGenerator.AddNamespaceOrTypeDeclarationAsync( 551var codeGenResult = await CodeGenerator.AddNamedTypeDeclarationAsync(
GenerateType\AbstractGenerateTypeService.State.cs (2)
315var documentToBeGeneratedIn = namedType.Locations 351private static bool CanGenerateInDocument(Document document)
GenerateType\GenerateTypeOptionsResult.cs (2)
16public Document ExistingDocument { get; } 37Document existingDocument,
GenerateType\IGenerateTypeOptionService.cs (1)
17Document document,
GenerateType\IGenerateTypeService.cs (2)
15Task<ImmutableArray<CodeAction>> GenerateTypeAsync(Document document, SyntaxNode node, CancellationToken cancellationToken); 16Task<(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)
31Document document,
InheritanceMargin\AbstractInheritanceMarginService_Helpers.cs (5)
45Document? document, 84Document document, 133Document document, 165Document document, 254var destinationDocument = document.Project.Solution.GetDocument(groupSyntaxTree);
InheritanceMargin\IInheritanceMarginService.cs (1)
21Document document,
InitializeParameter\AbstractAddParameterCheckCodeRefactoringProvider.cs (18)
69Document document, 100Document document, 173private async Task<Document> UpdateDocumentForRefactoringAsync( 174Document document, 338private bool ParameterValidForNullCheck(Document document, IParameterSymbol parameter, SemanticModel semanticModel, 541private async Task<Document> AddNullCheckAsync( 542Document document, 551var modifiedDocument = await TryAddNullCheckToAssignmentAsync( 564private async Task<Document> AddStringCheckAsync( 565Document document, 580private async Task<Document> AddNumericCheckAsync( 581Document document, 596private static async Task<Document> AddCheckStatementAsync( 597Document document, 630private static async Task<Document> AddEnumIsDefinedCheckStatementAsync( 631Document document, 885private async Task<Document?> TryAddNullCheckToAssignmentAsync( 886Document document,
InitializeParameter\AbstractInitializeMemberFromParameterCodeRefactoringProviderMemberCreation.cs (14)
50Document document, SyntaxNode functionDeclaration, IMethodSymbol method, IBlockOperation? blockStatementOpt, 58Document document, 103Document document, 155Document document, 188Document document, 237Document document, 357Document document, 384var currentDocument = currentSolution.GetRequiredDocument(document.Id); 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)
38Document document, 47Document document,
InlineHints\AbstractInlineHintsService.cs (1)
18Document document, TextSpan textSpan, InlineHintsOptions options, bool displayAllOverride, CancellationToken cancellationToken)
InlineHints\AbstractInlineParameterNameHintsService.cs (1)
36Document 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, ISymbol symbol, SymbolDescriptionOptions options) 24private static async Task<ImmutableArray<TaggedText>> GetDescriptionAsync(Document document, int position, ISymbol originalSymbol, SymbolDescriptionOptions options, CancellationToken cancellationToken)
InlineMethod\AbstractInlineMethodRefactoringProvider.InlineContext.cs (4)
43Document document, 54var calleeDocument = document.Project.Solution.GetRequiredDocument(calleeMethodNode.SyntaxTree); 285Document document, 296.FindReferencesAsync(symbol, document.Project.Solution, ImmutableHashSet<Document>.Empty.Add(document), cancellationToken)
InlineMethod\AbstractInlineMethodRefactoringProvider.MethodParametersInfo.cs (5)
154Document document, 164var calleeDocument = document.Project.Solution.GetRequiredDocument(calleeMethodNode.SyntaxTree); 430Document document, 441.FindReferencesAsync(parameterSymbol, document.Project.Solution, ImmutableHashSet<Document>.Empty.Add(document), cancellationToken).ConfigureAwait(false); 479Document calleeDocument,
InlineTemporary\AbstractInlineTemporaryCodeRefactoringProvider.cs (1)
25Document document,
Intents\IIntentProvider.cs (2)
15Document priorDocument, 17Document currentDocument,
IntroduceParameter\AbstractIntroduceParameterCodeRefactoringProvider.cs (7)
154private async Task<(ImmutableArray<CodeAction> actions, ImmutableArray<CodeAction> actionsAllOccurrences)?> GetActionsAsync(Document document, 212Document document, TExpressionSyntax expression, CancellationToken cancellationToken) 251private async Task<Solution> IntroduceParameterAsync(Document originalDocument, TExpressionSyntax expression, 252IMethodSymbol methodSymbol, SyntaxNode containingMethod, Dictionary<Document, List<TExpressionSyntax>> methodCallSites, bool allOccurrences, IntroduceParameterCodeActionKind selectedCodeAction, 284protected static async Task<Dictionary<Document, List<TExpressionSyntax>>> FindCallSitesAsync( 285Document document, IMethodSymbol methodSymbol, CancellationToken cancellationToken) 287var 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) 227private async Task<SyntaxNode> ModifyDocumentInvocationsTrampolineOverloadAndIntroduceParameterAsync(Compilation compilation, Document currentDocument, 489private 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)
30Document document, INamedTypeSymbol tupleType, TExpressionSyntax expression, CancellationToken cancellationToken); 78private async Task<Document> IntroduceLocalAsync( 79Document document, 127Document document, TExpressionSyntax expression, CancellationToken cancellationToken)
IntroduceVariable\AbstractIntroduceVariableService.cs (5)
52protected abstract Document IntroduceQueryLocal(SemanticDocument document, TExpressionSyntax expression, bool allOccurrences, CancellationToken cancellationToken); 53protected abstract Document IntroduceLocal(SemanticDocument document, CodeCleanupOptions options, 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, 426var newDocument = semanticDocument.Document.WithSyntaxRoot(newRoot);
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)
16Task<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 (5)
152private async Task<Document> InvertIfDirectiveAsync( 153Document document, 187var updatedDocument = document.WithText(newText); 397private async Task<Document> InvertIfAsync( 398Document 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 (13)
21public async Task<Document> AddSourceToAsync( 22Document document, 51var docWithDocComments = await ConvertDocCommentsToRegularCommentsAsync(document, docCommentFormattingService, cancellationToken).ConfigureAwait(false); 53var docWithAssemblyInfo = await AddAssemblyInfoRegionAsync(docWithDocComments, symbolCompilation, symbol.GetOriginalUnreducedDefinition(), cancellationToken).ConfigureAwait(false); 56var formattedDoc = await Formatter.FormatAsync( 67protected abstract Task<Document> AddNullableRegionsAsync(Document document, CancellationToken cancellationToken); 72protected abstract ImmutableArray<AbstractFormattingRule> GetFormattingRules(Document document); 85protected abstract Task<Document> AddAssemblyInfoRegionAsync(Document document, Compilation symbolCompilation, ISymbol symbol, CancellationToken cancellationToken); 87protected abstract Task<Document> ConvertDocCommentsToRegularCommentsAsync(Document document, IDocumentationCommentFormattingService docCommentFormattingService, CancellationToken cancellationToken); 91private static INamespaceOrTypeSymbol CreateCodeGenerationSymbol(Document document, ISymbol symbol)
MetadataAsSource\DecompilationMetadataAsSourceFileProvider.cs (4)
107var temporaryDocument = temporarySolution 124var decompilationDocument = await decompiledSourceService.AddSourceToAsync(temporaryDocument, compilation, symbol, refInfo.metadataReference, refInfo.assemblyLocation, formattingOptions: null, cancellationToken).ConfigureAwait(false); 212var document = metadataWorkspace.CurrentSolution.GetRequiredDocument(generatedDocumentId); 298public Project? MapDocument(Document document)
MetadataAsSource\IMetadataAsSourceFileProvider.cs (1)
44Project? MapDocument(Document document);
MetadataAsSource\IMetadataAsSourceService.cs (2)
25Task<Document> AddSourceToAsync(Document document, Compilation symbolCompilation, ISymbol symbol, SyntaxFormattingOptions? formattingOptions, CancellationToken cancellationToken);
MetadataAsSource\MetadataAsSourceFileService.cs (1)
257internal async Task<SymbolMappingResult?> MapSymbolAsync(Document document, SymbolKey symbolId, CancellationToken cancellationToken)
MetadataAsSource\MetadataAsSourceHelpers.cs (1)
70public 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)
46private static async Task<Document> MoveDeclarationNearReferenceAsync( 47Document document, SyntaxNode statement, CancellationToken cancellationToken)
MoveStaticMembers\IMoveStaticMembersOptionsService.cs (1)
12MoveStaticMembersOptions GetMoveMembersToTypeOptions(Document document, INamedTypeSymbol selectedType, ImmutableArray<ISymbol> selectedNodeSymbols);
MoveStaticMembers\MoveStaticMembersWithDialogCodeAction.cs (8)
26Document document, 31private readonly Document _document = document; 88var sourceDoc = _document.WithSyntaxRoot(root); 181var newTypeDoc = await oldSolution.GetRequiredDocumentAsync(newTypeDocId, cancellationToken: cancellationToken).ConfigureAwait(false); 217var sourceDoc = solutionWithFixedReferences.GetRequiredDocument(sourceDocId); 253var doc = project.GetRequiredDocument(docId); 273Document doc, 407var sourceDoc = solution.GetRequiredDocument(sourceDocId);
MoveToNamespace\AbstractMoveToNamespaceService.cs (16)
25Task<ImmutableArray<MoveToNamespaceCodeAction>> GetCodeActionsAsync(Document document, TextSpan span, CancellationToken cancellationToken); 26Task<MoveToNamespaceAnalysisResult> AnalyzeTypeAtPositionAsync(Document document, int position, CancellationToken cancellationToken); 28MoveToNamespaceOptionsResult GetChangeNamespaceOptions(Document document, string defaultNamespace, ImmutableArray<string> namespaces); 46Document document, 64Document document, 88Document document, SyntaxNode node, int position, CancellationToken cancellationToken) 113Document document, SyntaxNode node, CancellationToken cancellationToken) 186private static async Task<ImmutableArray<ISymbol>> GetMemberSymbolsAsync(Document document, SyntaxNode container, CancellationToken cancellationToken) 215Document document, 238Document document, 254var modifiedDocument = modifiedSolution.GetRequiredDocument(document.Id); 260var mergedDocument = mergedSolution.GetRequiredDocument(document.Id); 275private static async Task<Solution> PropagateChangeToLinkedDocumentsAsync(Document document, SyntaxFormattingOptions formattingOptions, CancellationToken cancellationToken) 278var formattedDocument = await Formatter.FormatAsync(document, SyntaxAnnotation.ElasticAnnotation, formattingOptions, cancellationToken).ConfigureAwait(false); 305private static async Task<IEnumerable<string>> GetNamespacesAsync(Document document, CancellationToken cancellationToken) 315Document 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)
71ImmutableArray<Document> priorityDocuments, 74Document? activeDocument,
NavigateTo\AbstractNavigateToSearchService.cs (1)
37Solution solution, Document? activeDocument, Func<ImmutableArray<INavigateToSearchResult>, Task> onResultsFound)
NavigateTo\AbstractNavigateToSearchService.GeneratedDocumentSearch.cs (1)
25Document? activeDocument,
NavigateTo\AbstractNavigateToSearchService.InProcess.cs (5)
91Document document, 112var linkedDocument = document.Project.Solution.GetRequiredDocument(linkedDocumentId); 137Document? document, 196Document? document, 232Document? document,
NavigateTo\AbstractNavigateToSearchService.NormalSearch.cs (9)
27Document document, 54Document document, 73Task SearchDocumentsInCurrentProcessAsync(ImmutableArray<(Document document, NormalizedTextSpanCollection? spans)> documentAndSpans) 102async Task<ImmutableArray<(Document document, NormalizedTextSpanCollection? spans)>> GetRelatedDocumentsAsync() 120var documentToTextSpans = new MultiDictionary<Document, TextSpan>(); 131var relatedDocument = solution.GetDocument(reference.SyntaxTree); 149ImmutableArray<Document> priorityDocuments, 152Document? activeDocument, 190ImmutableArray<Document> priorityDocuments,
NavigateTo\INavigateToSearchCallback.cs (1)
16Task AddResultsAsync(ImmutableArray<INavigateToSearchResult> results, Document? activeDocument, CancellationToken cancellationToken);
NavigateTo\INavigateToSearchService.cs (6)
19Document document, 38ImmutableArray<Document> priorityDocuments, 41Document? activeDocument, 65ImmutableArray<Document> priorityDocuments, 68Document? activeDocument, 86Document? activeDocument,
NavigateTo\NavigateToSearcher.cs (9)
52private readonly Document? _activeDocument; 53private readonly ImmutableArray<Document> _visibleDocuments; 300foreach (var doc in _visibleDocuments) 327private ImmutableArray<Document> GetPriorityDocuments(ImmutableArray<Project> projects) 332using var _2 = ArrayBuilder<Document>.GetInstance(out var result); 336foreach (var doc in _visibleDocuments) 533public Task SearchDocumentAsync(Document document, string searchPattern, IImmutableSet<string> kinds, Func<ImmutableArray<INavigateToSearchResult>, Task> onResultsFound, CancellationToken cancellationToken) 536public 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 (8)
71Solution solution, Document? activeDocument, CancellationToken cancellationToken) 76var document = solution.GetDocument(DocumentId); 84var document = await solution.GetRequiredDocumentAsync( 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);
OrganizeImports\OrganizeImportsCodeRefactoringProvider.cs (3)
42Document document, CancellationToken cancellationToken) 48var newDocument = await organizeImportsService.OrganizeImportsAsync(document, options, cancellationToken).ConfigureAwait(false); 55Document document, ImmutableArray<TextSpan> fixAllSpans, SyntaxEditor editor, string? equivalenceKey, CancellationToken cancellationToken)
Organizing\AbstractOrganizingService.cs (4)
26protected abstract Task<Document> ProcessAsync(Document document, IEnumerable<ISyntaxOrganizer> organizers, CancellationToken cancellationToken); 28public Task<Document> OrganizeAsync(Document document, IEnumerable<ISyntaxOrganizer> organizers, CancellationToken cancellationToken)
Organizing\IOrganizingService.cs (2)
26Task<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 (3)
279var firstDocument = navigateProject.Documents.First(d => d.FilePath?.Equals(firstDocumentFilePath, StringComparison.OrdinalIgnoreCase) ?? false); 284var navigateDocument = navigateProject.GetDocument(navigateLocation.SourceTree); 377public Project? MapDocument(Document document)
PreferFrameworkType\PreferFrameworkTypeCodeFixProvider.cs (1)
38Document document, ImmutableArray<Diagnostic> diagnostics,
PullMemberUp\Dialog\IPullMemberUpOptionsService.cs (1)
13PullMembersUpOptions GetPullMemberUpOptions(Document document, ImmutableArray<ISymbol> selectedNodeSymbols);
PullMemberUp\Dialog\PullMemberUpWithDialogCodeAction.cs (2)
19Document document, 27private readonly Document _document = document;
PullMemberUp\MembersPuller.cs (5)
39Document document, 60Document document, 92Document document, 267Document document, 381var destinationDocument = await removeImportsService.RemoveUnnecessaryImportsAsync(
QuickInfo\CommonSemanticQuickInfoProvider.cs (3)
46var document = context.Document; 74var document = context.Document; 88var linkedDocument = solution.GetRequiredDocument(linkedDocumentId);
QuickInfo\OnTheFlyDocsRelevantFileInfo.cs (2)
11public Document Document { get; } 14public OnTheFlyDocsRelevantFileInfo(Document document, TextSpan textSpan)
QuickInfo\Presentation\QuickInfoContentBuilder.cs (1)
132var document = context.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)
43internal override async Task<QuickInfoItem?> GetQuickInfoAsync(Document document, int position, SymbolDescriptionOptions options, CancellationToken cancellationToken)
RawStringLiteral\IRawStringLiteralOnAutoInsertService.cs (1)
25TextChange? GetTextChangeForQuote(Document document, SourceText text, int caretPosition, CancellationToken cancellationToken);
RemoveUnusedVariable\AbstractRemoveUnusedVariableCodeFixProvider.cs (2)
43var document = context.Document; 55protected override async Task FixAllAsync(Document document, ImmutableArray<Diagnostic> diagnostics, SyntaxEditor syntaxEditor, CancellationToken cancellationToken)
Rename\SymbolicRenameInfo.cs (6)
32public Document? Document { get; } 45Document document, 115Document document, int position, CancellationToken cancellationToken) 124private static async Task<SyntaxToken> GetTriggerTokenAsync(Document document, int position, CancellationToken cancellationToken) 133Document document, 220var sourceDocument = solution.GetRequiredDocument(location.SourceTree);
ReplaceConditionalWithStatements\AbstractReplaceConditionalWithStatementsCodeRefactoringProvider.cs (5)
112var document = context.Document; 194private static async Task<Document> ReplaceConditionalExpressionInSingleStatementAsync( 195Document document, 218private async Task<Document> ReplaceConditionalExpressionInLocalDeclarationStatementAsync( 219Document document,
ReplaceDocCommentTextWithTag\AbstractReplaceDocCommentTextWithTagCodeRefactoringProvider.cs (2)
157private static async Task<Document> ReplaceTextAsync( 158Document document, TextSpan span, string replacement, CancellationToken cancellationToken)
ReplaceMethodWithProperty\ReplaceMethodWithPropertyCodeRefactoringProvider.cs (8)
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, 349var updatedDocument = await updatedSolution.GetRequiredDocumentAsync( 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)
19Document document, 26Document document,
ReplacePropertyWithMethods\ReplacePropertyWithMethodsCodeRefactoringProvider.cs (6)
72Document document, 193ILookup<Document, (IPropertySymbol property, ReferenceLocation location)> referencesByDocument, 212Document originalDocument, 233Document originalDocument, 331var document = originalSolution.GetDocument(syntax.SyntaxTree); 351var updatedDocument = updatedSolution.GetRequiredDocument(documentId);
SemanticSearch\ISemanticSearchResultsObserver.cs (1)
35ValueTask OnSyntaxNodeFoundAsync(Document document, SyntaxNode node, CancellationToken cancellationToken);
SemanticSearch\SearchCompilationFailureDefinitionItem.cs (1)
13internal sealed class SearchCompilationFailureDefinitionItem(QueryCompilationError error, Document? queryDocument)
SemanticSearch\SemanticSearchDefinitionItemFactory.cs (2)
37public static ValueTask<DefinitionItem> CreateAsync(Document document, SyntaxNode node, CancellationToken cancellationToken) 63private static async ValueTask<DefinitionItem> CreateItemAsync(Document document, TextSpan span, CancellationToken cancellationToken)
SemanticSearch\SemanticSearchDocumentSupportsFeatureService.cs (6)
18private bool IsQueryDocument(Document document) 24public bool SupportsCodeFixes(Document document) 27public bool SupportsRefactorings(Document document) 30public bool SupportsRename(Document document) 33public bool SupportsNavigationToAnyPosition(Document document) 36public bool SupportsSemanticSnippets(Document document)
SemanticSearch\SemanticSearchWorkspace.cs (2)
29public async Task<Document> UpdateQueryDocumentAsync(string? query, string? targetLanguage, CancellationToken cancellationToken) 39var queryDocument = newSolution.GetRequiredDocument(solutionService.GetQueryDocumentId(newSolution));
Shared\Extensions\DocumentExtensions.cs (15)
20public static async Task<Document> ReplaceNodeAsync<TNode>(this Document document, TNode oldNode, TNode newNode, CancellationToken cancellationToken) 27public static Document ReplaceNodeSynchronously<TNode>(this Document document, TNode oldNode, TNode newNode, CancellationToken cancellationToken) 34public static Document ReplaceNode<TNode>(this Document document, SyntaxNode root, TNode oldNode, TNode newNode) 42public static async Task<Document> ReplaceNodesAsync(this Document document, 53this Document document, 55Func<Document, Task<ImmutableArray<T>>> getItemsWorker) 72this Document document, 73Func<Document, CancellationToken, Task<bool>> contextChecker, 84var linkedDocument = solution.GetRequiredDocument(linkedDocumentId); 94public static async Task<NamingRule> GetApplicableNamingRuleAsync(this Document document, ISymbol symbol, CancellationToken cancellationToken) 107this Document document, SymbolKindOrTypeKind kind, Modifiers modifiers, Accessibility? accessibility, CancellationToken cancellationToken)
Shared\IDocumentSupportsFeatureService.cs (10)
14bool SupportsCodeFixes(Document document); 15bool SupportsRefactorings(Document document); 16bool SupportsRename(Document document); 17bool SupportsNavigationToAnyPosition(Document document); 18bool SupportsSemanticSnippets(Document document); 30public bool SupportsCodeFixes(Document document) 33public bool SupportsNavigationToAnyPosition(Document document) 36public bool SupportsRefactorings(Document document) 39public bool SupportsRename(Document document) 42public bool SupportsSemanticSnippets(Document document)
Shared\Utilities\AnnotatedSymbolMapping.cs (1)
100var document = annotatedSolution.GetRequiredDocument(root.Key);
Shared\Utilities\ExtractTypeHelpers.cs (10)
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, 64var newDocument = solutionWithInterfaceDocument.GetRequiredDocument(newDocumentId); 83var newTypeDocument = await CodeGenerator.AddNamespaceOrTypeDeclarationAsync( 109var simplified = await Simplifier.ReduceAsync(newTypeDocument, newCleanupOptions.SimplifierOptions, cancellationToken).ConfigureAwait(false); 110var formattedDocument = await Formatter.FormatAsync(simplified, newCleanupOptions.FormattingOptions, cancellationToken).ConfigureAwait(false); 116Document document, SyntaxFormattingOptions formattingOptions, INamedTypeSymbol type, ImmutableArray<ISymbol> extractableMembers, CancellationToken cancellationToken)
SignatureHelp\AbstractSignatureHelpProvider.cs (7)
34protected abstract Task<SignatureHelpItems?> GetItemsWorkerAsync(Document document, int position, SignatureHelpTriggerInfo triggerInfo, MemberDisplayOptions options, CancellationToken cancellationToken); 241Document document, int position, SignatureHelpTriggerInfo triggerInfo, MemberDisplayOptions options, CancellationToken cancellationToken) 279foreach (var relatedDocument in relatedDocuments) 303private static async Task<ImmutableArray<Document>> FindActiveRelatedDocumentsAsync(int position, Document document, CancellationToken cancellationToken) 305using var _ = ArrayBuilder<Document>.GetInstance(out var builder); 306foreach (var relatedDocument in document.GetLinkedDocuments())
SignatureHelp\CommonSignatureHelpUtilities.cs (2)
104Document document, 164Document document, SyntaxNode initializer, MemberDisplayOptions options, CancellationToken cancellationToken)
SignatureHelp\ISignatureHelpProvider.cs (1)
28Task<SignatureHelpItems?> GetItemsAsync(Document document, int position, SignatureHelpTriggerInfo triggerInfo, MemberDisplayOptions options, CancellationToken cancellationToken);
SignatureHelp\SignatureHelpService.cs (2)
43Document document, 62Document document,
SimplifyThisOrMe\AbstractSimplifyThisOrMeCodeFixProvider.cs (1)
37Document document, ImmutableArray<Diagnostic> diagnostics,
SimplifyTypeNames\AbstractSimplifyTypeNamesCodeFixProvider.cs (2)
72var document = context.Document; 92Document document, ImmutableArray<Diagnostic> diagnostics,
Snippets\RoslynLSPSnippetConverter.cs (2)
22public static async Task<string> GenerateLSPSnippetAsync(Document document, int caretPosition, ImmutableArray<SnippetPlaceholder> placeholders, TextChange textChange, int triggerLocation, CancellationToken cancellationToken) 108private 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 (11)
33public abstract Task<string?> GetContainingClassNameAsync(Document document, int position, CancellationToken cancellationToken); 39public static async Task<string?> GetSimplifiedTypeNameAsync(Document document, TextSpan fieldSpan, string fullyQualifiedTypeName, SimplifierOptions simplifierOptions, CancellationToken cancellationToken) 46var documentWithFullyQualifiedTypeName = document.WithText(text.WithChanges(textChange)); 57public async Task<string?> GetSwitchExpansionAsync(Document document, TextSpan caseGenerationLocation, TextSpan switchExpressionLocation, SimplifierOptions simplifierOptions, CancellationToken cancellationToken) 121protected abstract Task<ITypeSymbol?> GetEnumSymbolAsync(Document document, TextSpan switchExpressionSpan, CancellationToken cancellationToken); 123protected abstract Task<(Document, TextSpan)> GetDocumentWithEnumCaseAsync(Document document, string fullyQualifiedTypeName, string firstEnumMemberName, TextSpan caseGenerationLocation, CancellationToken cancellationToken); 126Document document, 141private static async Task<string?> GetSimplifiedTypeNameAtSpanAsync(Document documentWithFullyQualifiedTypeName, TextSpan fullyQualifiedTypeSpan, SimplifierOptions simplifierOptions, CancellationToken cancellationToken) 154var documentWithAnnotations = documentWithFullyQualifiedTypeName.WithSyntaxRoot(updatedRoot); 156var simplifiedDocument = await Simplifier.ReduceAsync(documentWithAnnotations, simplifierOptions, cancellationToken).ConfigureAwait(false);
Snippets\SnippetProviders\AbstractConditionalBlockSnippetProvider.cs (1)
25Document document, TStatementSyntax node, ISyntaxFacts syntaxFacts, CancellationToken cancellationToken)
Snippets\SnippetProviders\AbstractConsoleSnippetProvider.cs (2)
39protected sealed override async Task<TextChange> GenerateSnippetTextChangeAsync(Document document, int position, CancellationToken cancellationToken) 74Document document, TExpressionSyntax snippetExpressionNode, CancellationToken cancellationToken)
Snippets\SnippetProviders\AbstractInlineStatementSnippetProvider.cs (1)
57protected 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)
22protected 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 (24)
41protected abstract Task<ImmutableArray<TextChange>> GenerateSnippetTextChangesAsync(Document document, int position, CancellationToken cancellationToken); 52Document document, TSnippetSyntax node, ISyntaxFacts syntaxFacts, CancellationToken cancellationToken) 72public async Task<SnippetChange> GetSnippetChangeAsync(Document document, int position, CancellationToken cancellationToken) 80var snippetDocument = await GetDocumentWithSnippetAsync(document, textChanges, cancellationToken).ConfigureAwait(false); 84var snippetWithTriviaDocument = await GetDocumentWithSnippetAndTriviaAsync(snippetDocument, position, syntaxFacts, cancellationToken).ConfigureAwait(false); 87var formatAnnotatedSnippetDocument = await AddFormatAnnotationAsync(snippetWithTriviaDocument, position, cancellationToken).ConfigureAwait(false); 90var reformattedDocument = await CleanupDocumentAsync(formatAnnotatedSnippetDocument, cancellationToken).ConfigureAwait(false); 93var documentWithIndentation = await AddIndentationToDocumentAsync(reformattedDocument, cancellationToken).ConfigureAwait(false); 98var annotatedReformattedDocument = documentWithIndentation.WithSyntaxRoot(reformattedRoot); 142private static async Task<Document> CleanupDocumentAsync( 143Document document, CancellationToken cancellationToken) 170private async Task<Document> GetDocumentWithSnippetAndTriviaAsync(Document snippetDocument, int position, ISyntaxFacts syntaxFacts, CancellationToken cancellationToken) 191private static async Task<Document> GetDocumentWithSnippetAsync(Document document, ImmutableArray<TextChange> snippets, CancellationToken cancellationToken) 196var snippetDocument = document.WithText(originalText); 201private async Task<Document> AddFormatAnnotationAsync(Document document, int position, CancellationToken cancellationToken) 212Document document, int position, CancellationToken cancellationToken) 225protected virtual ValueTask<TSnippetSyntax> AdjustSnippetExpressionAsync(Document document, TSnippetSyntax snippetExpressionNode, CancellationToken cancellationToken) 236private async Task<Document> AddIndentationToDocumentAsync(Document document, CancellationToken cancellationToken) 247protected virtual Task<Document> AddIndentationToDocumentAsync(Document document, TSnippetSyntax snippet, CancellationToken cancellationToken)
Snippets\SnippetProviders\AbstractTypeSnippetProvider.cs (6)
28protected abstract Task<TextChange?> GetAccessibilityModifiersChangeAsync(Document document, int position, CancellationToken cancellationToken); 31Document document, int position, CancellationToken cancellationToken) 47Document document, TTypeDeclarationSyntax node, ISyntaxFacts syntaxFacts, CancellationToken cancellationToken) 58protected static async Task<bool> AreAccessibilityModifiersRequiredAsync(Document document, CancellationToken cancellationToken) 66Document document, int position, CancellationToken cancellationToken) 79Document document, CancellationToken cancellationToken)
Snippets\SnippetProviders\AbstractUsingSnippetProvider.cs (1)
17protected sealed override async Task<TextChange> GenerateSnippetTextChangeAsync(Document document, int position, CancellationToken cancellationToken)
Snippets\SnippetProviders\ISnippetProvider.cs (1)
36Task<SnippetChange> GetSnippetChangeAsync(Document document, int position, CancellationToken cancellationToken);
SolutionCrawler\AbstractDocumentDifferenceService.cs (2)
19public 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)
25Func<CancellationToken, Task<Document>> createChangedDocument, MergeDirection direction, string ifKeywordText); 28Document document, SyntaxNode ifOrElseIf, CancellationToken cancellationToken, out SyntaxNode upperIfOrElseIf); 31Document document, SyntaxNode ifOrElseIf, CancellationToken cancellationToken, out SyntaxNode lowerIfOrElseIf); 33protected abstract SyntaxNode GetChangedRoot(Document document, SyntaxNode root, SyntaxNode upperIfOrElseIf, SyntaxNode lowerIfOrElseIf); 64private async Task<Document> RefactorAsync(Document document, TextSpan upperIfOrElseIfSpan, TextSpan lowerIfOrElseIfSpan, CancellationToken cancellationToken)
SplitOrMergeIfStatements\AbstractSplitIfStatementCodeRefactoringProvider.cs (4)
22protected abstract CodeAction CreateCodeAction(Func<CancellationToken, Task<Document>> createChangedDocument, string ifKeywordText); 25Document document, 59private 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)
47protected sealed override CodeAction CreateCodeAction(Func<CancellationToken, Task<Document>> createChangedDocument, string ifKeywordText) 54Document document, 116Document 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\roslyn\src\Analyzers\Core\CodeFixes\AddAccessibilityModifiers\AbstractAddAccessibilityModifiersCodeFixProvider.cs (1)
40Document document, ImmutableArray<Diagnostic> diagnostics,
src\roslyn\src\Analyzers\Core\CodeFixes\AddAnonymousTypeMemberName\AbstractAddAnonymousTypeMemberNameCodeFixProvider.cs (4)
34var document = context.Document; 53Document document, Diagnostic diagnostic, CancellationToken cancellationToken) 83Document document, ImmutableArray<Diagnostic> diagnostics, 100Document document, SemanticModel semanticModel, Diagnostic diagnostic,
src\roslyn\src\Analyzers\Core\CodeFixes\AddExplicitCast\AbstractAddExplicitCastCodeFixProvider.cs (6)
48Document document, SemanticModel semanticModel, SyntaxNode root, 60Document document, SemanticModel semanticModel, SyntaxNode root, 67var document = context.Document; 115Document document, 170Document document, 211Document document,
src\roslyn\src\Analyzers\Core\CodeFixes\AddExplicitCast\Fixer.cs (2)
39Document document, 109Document document,
src\roslyn\src\Analyzers\Core\CodeFixes\AddObsoleteAttribute\AbstractAddObsoleteAttributeCodeFixProvider.cs (3)
35var document = context.Document; 57private static async Task<INamedTypeSymbol?> GetObsoleteAttributeAsync(Document document, CancellationToken cancellationToken) 71Document document, ImmutableArray<Diagnostic> diagnostics,
src\roslyn\src\Analyzers\Core\CodeFixes\AddParameter\AbstractAddParameterCodeFixProvider.cs (5)
67var document = context.Document; 331Document document, 375Document invocationDocument, 402private async Task<(ITypeSymbol, RefKind)> GetArgumentTypeAndRefKindAsync(Document invocationDocument, TArgumentSyntax argument, CancellationToken cancellationToken) 412Document invocationDocument, TArgumentSyntax argument, INamedTypeSymbol containingType, CancellationToken cancellationToken)
src\roslyn\src\Analyzers\Core\CodeFixes\AddParameter\AddParameterService.cs (4)
78Document invocationDocument, 105var document = documentLookup.Key; 182var rewrittenDocument = rewrittenSolution.GetRequiredDocument(documentId); 215Document invocationDocument, IMethodSymbol method, CancellationToken cancellationToken)
src\roslyn\src\Analyzers\Core\CodeFixes\AddRequiredParentheses\AddRequiredParenthesesCodeFixProvider.cs (2)
26protected override bool IncludeDiagnosticDuringFixAll(Diagnostic diagnostic, Document document, string? equivalenceKey, CancellationToken cancellationToken) 37Document document, ImmutableArray<Diagnostic> diagnostics,
src\roslyn\src\Analyzers\Core\CodeFixes\AliasAmbiguousType\AbstractAliasAmbiguousTypeCodeFixProvider.cs (1)
32var document = context.Document;
src\roslyn\src\Analyzers\Core\CodeFixes\AnalyzerOptionsProviders.cs (1)
14public static async ValueTask<AnalyzerOptionsProvider> GetAnalyzerOptionsProviderAsync(this Document document, CancellationToken cancellationToken)
src\roslyn\src\Analyzers\Core\CodeFixes\ConflictMarkerResolution\AbstractConflictMarkerCodeFixProvider.cs (14)
72var document = context.Document; 268var document = context.Document; 301static CodeAction CreateCodeAction(string title, Func<CancellationToken, Task<Document>> action, string equivalenceKey) 314private static async Task<Document> AddEditsAsync( 315Document document, int startPos, int firstMiddlePos, int secondMiddlePos, int endPos, 380private static Task<Document> TakeTopAsync(Document document, int startPos, int firstMiddlePos, int secondMiddlePos, int endPos, CancellationToken cancellationToken) 383private static Task<Document> TakeBottomAsync(Document document, int startPos, int firstMiddlePos, int secondMiddlePos, int endPos, CancellationToken cancellationToken) 386private static Task<Document> TakeBothAsync(Document document, int startPos, int firstMiddlePos, int secondMiddlePos, int endPos, CancellationToken cancellationToken) 392private async Task<Document> FixAllAsync( 393Document document, ImmutableArray<Diagnostic> diagnostics, 445var finalDoc = document.WithText(finalText);
src\roslyn\src\Analyzers\Core\CodeFixes\ConvertToAsync\AbstractConvertToAsyncCodeFixProvider.cs (2)
52SyntaxNode node, Document document, Diagnostic diagnostic, CancellationToken cancellationToken) 60var otherDocument = document.Project.Solution.GetRequiredDocument(syntaxTree);
src\roslyn\src\Analyzers\Core\CodeFixes\ConvertTypeOfToNameOf\AbstractConvertTypeOfToNameOfCodeFixProvider.cs (1)
34Document document, ImmutableArray<Diagnostic> diagnostics,
src\roslyn\src\Analyzers\Core\CodeFixes\DocumentationComments\AbstractAddDocCommentNodesCodeFixProvider.cs (2)
57protected async Task<Document> AddParamTagAsync( 58Document document, TMemberDeclarationSyntax parentMethod, SyntaxNode docCommentNode, CancellationToken cancellationToken)
src\roslyn\src\Analyzers\Core\CodeFixes\DocumentationComments\AbstractRemoveDocCommentNodeCodeFixProvider.cs (2)
58private async Task<Document> RemoveDuplicateParamTagAsync( 59Document document, TXmlElementSyntax paramNode, CancellationToken cancellationToken)
src\roslyn\src\Analyzers\Core\CodeFixes\FileHeaders\AbstractFileHeaderCodeFixProvider.cs (4)
43private async Task<Document> GetTransformedDocumentAsync(Document document, CancellationToken cancellationToken) 46private async Task<SyntaxNode> GetTransformedSyntaxRootAsync(Document document, CancellationToken cancellationToken) 55internal static async Task<SyntaxNode> GetTransformedSyntaxRootAsync(ISyntaxFacts syntaxFacts, AbstractFileHeaderHelper fileHeaderHelper, SyntaxTrivia newLineTrivia, Document document, string? fileHeaderTemplate, CancellationToken cancellationToken)
src\roslyn\src\Analyzers\Core\CodeFixes\ForEachCast\AbstractForEachCastCodeFixProvider.cs (1)
39Document document, ImmutableArray<Diagnostic> diagnostics,
src\roslyn\src\Analyzers\Core\CodeFixes\Formatting\FormattingCodeFixProvider.cs (2)
68private async Task<Document> FixOneAsync(CodeFixContext context, Diagnostic diagnostic, CancellationToken cancellationToken) 86protected override async Task FixAllAsync(Document document, ImmutableArray<Diagnostic> diagnostics, SyntaxEditor editor, CancellationToken cancellationToken)
src\roslyn\src\Analyzers\Core\CodeFixes\GenerateConstructor\AbstractGenerateConstructorService.cs (1)
80public async Task<ImmutableArray<CodeAction>> GenerateConstructorAsync(Document document, SyntaxNode node, CancellationToken cancellationToken)
src\roslyn\src\Analyzers\Core\CodeFixes\GenerateConstructor\AbstractGenerateConstructorService.State.cs (7)
406public async Task<Document> GetChangedDocumentAsync( 407Document document, bool withFields, bool withProperties, CancellationToken cancellationToken) 422private async Task<Document?> GenerateThisOrBaseDelegatingConstructorAsync( 423Document document, bool withFields, bool withProperties, CancellationToken cancellationToken) 461Document document, bool withFields, bool withProperties, CancellationToken cancellationToken) 482private async Task<Document> GenerateMemberDelegatingConstructorAsync( 483Document document, bool withFields, bool withProperties, CancellationToken cancellationToken)
src\roslyn\src\Analyzers\Core\CodeFixes\GenerateConstructor\IGenerateConstructorService.cs (1)
15Task<ImmutableArray<CodeAction>> GenerateConstructorAsync(Document document, SyntaxNode node, CancellationToken cancellationToken);
src\roslyn\src\Analyzers\Core\CodeFixes\GenerateDefaultConstructors\AbstractGenerateDefaultConstructorCodeFixProvider.cs (1)
23var document = context.Document;
src\roslyn\src\Analyzers\Core\CodeFixes\GenerateDefaultConstructors\AbstractGenerateDefaultConstructorsService.cs (1)
26Document document,
src\roslyn\src\Analyzers\Core\CodeFixes\GenerateDefaultConstructors\GenerateDefaultConstructorsCodeAction.cs (4)
19Document document, 25private readonly Document _document = document; 30protected override async Task<Document> GetChangedDocumentAsync(CancellationToken cancellationToken) 33var result = await CodeGenerator.AddMemberDeclarationsAsync(
src\roslyn\src\Analyzers\Core\CodeFixes\GenerateDefaultConstructors\IGenerateDefaultConstructorsService.cs (1)
17Document document, TextSpan textSpan, bool forRefactoring, CancellationToken cancellationToken);
src\roslyn\src\Analyzers\Core\CodeFixes\GenerateEnumMember\AbstractGenerateEnumMemberService.CodeAction.cs (4)
18private sealed partial class GenerateEnumMemberCodeAction(Document document, State state) : CodeAction 20private readonly Document _document = document; 23protected override async Task<Document> GetChangedDocumentAsync(CancellationToken cancellationToken) 33var result = await codeGenerator.AddFieldAsync(
src\roslyn\src\Analyzers\Core\CodeFixes\GenerateEnumMember\AbstractGenerateEnumMemberService.cs (1)
25public async Task<ImmutableArray<CodeAction>> GenerateEnumMemberAsync(Document document, SyntaxNode node, CancellationToken cancellationToken)
src\roslyn\src\Analyzers\Core\CodeFixes\GenerateEnumMember\IGenerateEnumMemberService.cs (1)
15Task<ImmutableArray<CodeAction>> GenerateEnumMemberAsync(Document document, SyntaxNode node, CancellationToken cancellationToken);
src\roslyn\src\Analyzers\Core\CodeFixes\GenerateMember\AbstractGenerateMemberCodeFixProvider.cs (2)
25protected abstract Task<ImmutableArray<CodeAction>> GetCodeActionsAsync(Document document, SyntaxNode node, CancellationToken cancellationToken); 38var document = context.Document;
src\roslyn\src\Analyzers\Core\CodeFixes\GenerateParameterizedMember\AbstractGenerateConversionService.cs (1)
28Document document,
src\roslyn\src\Analyzers\Core\CodeFixes\GenerateParameterizedMember\AbstractGenerateDeconstructMethodService.cs (1)
24Document document,
src\roslyn\src\Analyzers\Core\CodeFixes\GenerateParameterizedMember\AbstractGenerateMethodService.cs (1)
29Document document,
src\roslyn\src\Analyzers\Core\CodeFixes\GenerateParameterizedMember\AbstractGenerateParameterizedMemberService.CodeAction.cs (5)
19private readonly Document _document; 27Document document, 63protected override async Task<Document> GetChangedDocumentAsync(CancellationToken cancellationToken) 71var result = await CodeGenerator.AddPropertyDeclarationAsync( 87var result = await CodeGenerator.AddMethodDeclarationAsync(
src\roslyn\src\Analyzers\Core\CodeFixes\GenerateParameterizedMember\AbstractGenerateParameterizedMemberService.cs (1)
38protected async ValueTask<ImmutableArray<CodeAction>> GetActionsAsync(Document document, State state, CancellationToken cancellationToken)
src\roslyn\src\Analyzers\Core\CodeFixes\GenerateParameterizedMember\IGenerateConversionService.cs (1)
15Task<ImmutableArray<CodeAction>> GenerateConversionAsync(Document document, SyntaxNode node, CancellationToken cancellationToken);
src\roslyn\src\Analyzers\Core\CodeFixes\GenerateParameterizedMember\IGenerateDeconstructMemberService.cs (1)
16Document document, SyntaxNode targetVariables, INamedTypeSymbol typeToGenerateIn, CancellationToken cancellationToken);
src\roslyn\src\Analyzers\Core\CodeFixes\GenerateParameterizedMember\IGenerateParameterizedMemberService.cs (1)
15Task<ImmutableArray<CodeAction>> GenerateMethodAsync(Document document, SyntaxNode node, CancellationToken cancellationToken);
src\roslyn\src\Analyzers\Core\CodeFixes\GenerateVariable\AbstractGenerateVariableService.CodeAction.cs (1)
47protected override async Task<Document> GetChangedDocumentAsync(CancellationToken cancellationToken)
src\roslyn\src\Analyzers\Core\CodeFixes\GenerateVariable\AbstractGenerateVariableService.cs (4)
33Document document, 119Document document, State state, SymbolKind kind, Accessibility accessibility, CancellationToken cancellationToken) 179ArrayBuilder<CodeAction> result, Document document, State state, CancellationToken cancellationToken) 195ArrayBuilder<CodeAction> result, Document document, State state, CancellationToken cancellationToken)
src\roslyn\src\Analyzers\Core\CodeFixes\GenerateVariable\AbstractGenerateVariableService.GenerateLocalCodeAction.cs (4)
18private sealed class GenerateLocalCodeAction(TService service, Document document, State state) : CodeAction 21private readonly Document _document = document; 36protected override async Task<Document> GetChangedDocumentAsync(CancellationToken cancellationToken) 39var newDocument = _document.WithSyntaxRoot(newRoot);
src\roslyn\src\Analyzers\Core\CodeFixes\GenerateVariable\AbstractGenerateVariableService.GenerateParameterCodeAction.cs (2)
18Document document, 23private readonly Document _document = document;
src\roslyn\src\Analyzers\Core\CodeFixes\GenerateVariable\IGenerateVariableService.cs (1)
15Task<ImmutableArray<CodeAction>> GenerateVariableAsync(Document document, SyntaxNode node, CancellationToken cancellationToken);
src\roslyn\src\Analyzers\Core\CodeFixes\ImplementAbstractClass\AbstractImplementAbstractClassCodeFixProvider.cs (1)
26var document = context.Document;
src\roslyn\src\Analyzers\Core\CodeFixes\ImplementAbstractClass\ImplementAbstractClassData.cs (6)
27Document document, ImplementTypeOptions options, SyntaxNode classNode, SyntaxToken classIdentifier, 31private readonly Document _document = document; 41Document document, SyntaxNode classNode, SyntaxToken classIdentifier, CancellationToken cancellationToken) 76public static async Task<Document?> TryImplementAbstractClassAsync( 77Document document, SyntaxNode classNode, SyntaxToken classIdentifier, CancellationToken cancellationToken) 86public async Task<Document> ImplementAbstractClassAsync(
src\roslyn\src\Analyzers\Core\CodeFixes\ImplementInterface\AbstractImplementInterfaceCodeFixProvider.cs (1)
20var document = context.Document;
src\roslyn\src\Analyzers\Core\CodeFixes\ImplementInterface\AbstractImplementInterfaceService.cs (10)
37protected abstract bool TryInitializeState(Document document, SemanticModel model, SyntaxNode interfaceNode, CancellationToken cancellationToken, 58public async Task<Document> ImplementInterfaceAsync( 59Document document, ImplementTypeOptions options, SyntaxNode node, CancellationToken cancellationToken) 78private async Task<ImplementInterfaceInfo?> AnalyzeAsync(Document document, SyntaxNode interfaceType, CancellationToken cancellationToken) 107private async Task<Document> ImplementInterfaceAsync( 108Document document, 120Document document, 146public async Task<ImmutableArray<CodeAction>> GetCodeActionsAsync(Document document, SyntaxNode? interfaceType, CancellationToken cancellationToken) 174Document document, ImplementInterfaceInfo state, [EnumeratorCancellation] CancellationToken cancellationToken) 300Document document, ImplementInterfaceInfo state, CancellationToken cancellationToken)
src\roslyn\src\Analyzers\Core\CodeFixes\ImplementInterface\AbstractImplementInterfaceService.State.cs (3)
15Document document, 33public readonly Document Document = document; 44Document document,
src\roslyn\src\Analyzers\Core\CodeFixes\ImplementInterface\IImplementInterfaceService.cs (4)
25Task<Document> ImplementInterfaceAsync(Document document, ImplementTypeOptions options, SyntaxNode node, CancellationToken cancellationToken); 33Document document, 41Document document, SyntaxNode? interfaceType, CancellationToken cancellationToken);
src\roslyn\src\Analyzers\Core\CodeFixes\ImplementInterface\ImplementHelpers.cs (1)
20Document document,
src\roslyn\src\Analyzers\Core\CodeFixes\ImplementInterface\ImplementInterfaceGenerator.cs (4)
29private readonly Document Document; 44Document document, 56public Task<Document> ImplementInterfaceAsync(CancellationToken cancellationToken) 69private async Task<Document> ImplementInterfaceAsync(
src\roslyn\src\Analyzers\Core\CodeFixes\ImplementInterface\ImplementInterfaceGenerator_DisposePattern.cs (7)
39private async Task<Document> ImplementDisposePatternAsync( 43var document = this.Document; 53var docWithCoreMembers = await ImplementInterfaceAsync( 79var docWithAllMembers = docWithCoreMembers.WithSyntaxRoot( 89private async Task<Document> AddFinalizerCommentAsync( 90Document document, SyntaxNode finalizer, CancellationToken cancellationToken) 230Document document,
src\roslyn\src\Analyzers\Core\CodeFixes\ImplementType\ImplementTypeOptions.cs (1)
77public static async ValueTask<ImplementTypeOptions> GetImplementTypeOptionsAsync(this Document document, CancellationToken cancellationToken)
src\roslyn\src\Analyzers\Core\CodeFixes\Iterator\AbstractIteratorCodeFixProvider.cs (1)
17protected abstract Task<CodeAction?> GetCodeFixAsync(SyntaxNode root, SyntaxNode node, Document document, Diagnostic diagnostics, CancellationToken cancellationToken);
src\roslyn\src\Analyzers\Core\CodeFixes\MakeFieldReadonly\AbstractMakeFieldReadonlyCodeFixProvider.cs (2)
37Document document, 55Document document, SyntaxEditor editor, List<TSymbolSyntax> declarators, CancellationToken cancellationToken)
src\roslyn\src\Analyzers\Core\CodeFixes\MakeMemberStatic\AbstractMakeMemberStaticCodeFixProvider.cs (1)
28protected sealed override async Task FixAllAsync(Document document, ImmutableArray<Diagnostic> diagnostics, SyntaxEditor editor,
src\roslyn\src\Analyzers\Core\CodeFixes\MakeMethodAsynchronous\AbstractMakeMethodAsynchronousCodeFixProvider.cs (7)
39var document = context.Document; 98private static bool IsLikelyEntryPointName(string name, Document document) 107Document document, 160Document document, 176var newDocument = newSolution.GetRequiredDocument(document.Id); 190Document document, 209var partialDefinitionDocument = solution.GetDocument(partialDefinitionNode.SyntaxTree);
src\roslyn\src\Analyzers\Core\CodeFixes\MakeMethodSynchronous\AbstractMakeMethodSynchronousCodeFixProvider.cs (8)
50Document document, SyntaxNode node, CancellationToken cancellationToken) 71private async Task<Solution> RenameThenRemoveAsyncTokenAsync(Document document, SyntaxNode node, IMethodSymbol methodSymbol, CancellationToken cancellationToken) 82var newDocument = newSolution.GetRequiredDocument(document.Id); 95Document document, IMethodSymbol methodSymbol, SyntaxNode node, CancellationToken cancellationToken) 107var newDocument = document.WithSyntaxRoot(newRoot); 118Document document, SyntaxAnnotation annotation, CancellationToken cancellationToken) 169Solution currentSolution, IGrouping<Document, ReferenceLocation> group, CancellationToken cancellationToken) 171var document = group.Key;
src\roslyn\src\Analyzers\Core\CodeFixes\MakeTypeAbstract\AbstractMakeTypeAbstractCodeFixProvider.cs (1)
28protected sealed override async Task FixAllAsync(Document document, ImmutableArray<Diagnostic> diagnostics, SyntaxEditor editor,
src\roslyn\src\Analyzers\Core\CodeFixes\MakeTypePartial\AbstractMakeTypePartialCodeFixProvider.cs (1)
23protected override async Task FixAllAsync(Document document, ImmutableArray<Diagnostic> diagnostics, SyntaxEditor editor, CancellationToken cancellationToken)
src\roslyn\src\Analyzers\Core\CodeFixes\MatchFolderAndNamespace\AbstractChangeNamespaceToMatchFolderCodeFixProvider.cs (2)
40private static async Task<Solution> FixAllInDocumentAsync(Document document, ImmutableArray<Diagnostic> diagnostics, CancellationToken cancellationToken) 53var documentWithInvalidFolders = document.WithFolders(document.Folders.Concat("Force-Namespace-Change"));
src\roslyn\src\Analyzers\Core\CodeFixes\MatchFolderAndNamespace\AbstractChangeNamespaceToMatchFolderCodeFixProvider.CustomFixAllProvider.cs (1)
89var document = newSolution.GetRequiredDocument(documentId);
src\roslyn\src\Analyzers\Core\CodeFixes\Naming\NamingExtensions.cs (2)
17this Document document, SymbolKind symbolKind, Accessibility accessibility, CancellationToken cancellationToken) 35this Document document, CancellationToken cancellationToken)
src\roslyn\src\Analyzers\Core\CodeFixes\NamingStyle\NamingStyleCodeFixProvider.cs (2)
54var document = context.Document; 104Document document, ISymbol symbol, string fixedName, CancellationToken cancellationToken)
src\roslyn\src\Analyzers\Core\CodeFixes\NewLines\ConsecutiveStatementPlacement\ConsecutiveStatementPlacementCodeFixProvider.cs (5)
31var document = context.Document; 40private static Task<Document> UpdateDocumentAsync(Document document, Diagnostic diagnostic, CancellationToken cancellationToken) 43public static async Task<Document> FixAllAsync(Document document, ImmutableArray<Diagnostic> diagnostics, CancellationToken cancellationToken)
src\roslyn\src\Analyzers\Core\CodeFixes\NewLines\MultipleBlankLines\AbstractMultipleBlankLinesCodeFixProvider.cs (5)
31var document = context.Document; 40private static Task<Document> UpdateDocumentAsync(Document document, Diagnostic diagnostic, CancellationToken cancellationToken) 43private static async Task<Document> FixAllAsync( 44Document document, ImmutableArray<Diagnostic> diagnostics, CancellationToken cancellationToken)
src\roslyn\src\Analyzers\Core\CodeFixes\OrderModifiers\AbstractOrderModifiersCodeFixProvider.cs (1)
44Document document, ImmutableArray<Diagnostic> diagnostics, SyntaxEditor editor, CancellationToken cancellationToken)
src\roslyn\src\Analyzers\Core\CodeFixes\PopulateSwitch\AbstractPopulateSwitchCodeFixProvider.cs (10)
45Document document, SyntaxEditor editor, SemanticModel semanticModel, 59var document = context.Document; 97private Task<Document> FixAsync( 98Document document, Diagnostic diagnostic, 106private Task<Document> FixAllAsync( 107Document document, ImmutableArray<Diagnostic> diagnostics, 117Document document, SyntaxEditor editor, ImmutableArray<Diagnostic> diagnostics, 130Document document, SyntaxEditor editor, Diagnostic diagnostic, 196Document document, 212Document document,
src\roslyn\src\Analyzers\Core\CodeFixes\PopulateSwitch\AbstractPopulateSwitchExpressionCodeFixProvider.cs (1)
24Document document, SyntaxEditor editor, SemanticModel semanticModel,
src\roslyn\src\Analyzers\Core\CodeFixes\PopulateSwitch\AbstractPopulateSwitchStatementCodeFixProvider.cs (1)
31Document document, SyntaxEditor editor, SemanticModel semanticModel,
src\roslyn\src\Analyzers\Core\CodeFixes\QualifyMemberAccess\AbstractQualifyMemberAccessCodeFixProvider.cs (1)
33Document document, ImmutableArray<Diagnostic> diagnostics,
src\roslyn\src\Analyzers\Core\CodeFixes\RemoveAsyncModifier\AbstractRemoveAsyncModifierCodeFixProvider.cs (2)
29var document = context.Document; 53Document document, ImmutableArray<Diagnostic> diagnostics,
src\roslyn\src\Analyzers\Core\CodeFixes\RemoveRedundantEquality\RemoveRedundantEqualityCodeFixProvider.cs (1)
30Document document,
src\roslyn\src\Analyzers\Core\CodeFixes\RemoveUnnecessaryImports\AbstractRemoveUnnecessaryImportsCodeFixProvider.cs (4)
44private static Task<Document> RemoveUnnecessaryImportsAsync( 45Document document, 53Document document, ImmutableArray<Diagnostic> diagnostics, SyntaxEditor editor, CancellationToken cancellationToken) 55var newDocument = await RemoveUnnecessaryImportsAsync(document, cancellationToken).ConfigureAwait(false);
src\roslyn\src\Analyzers\Core\CodeFixes\RemoveUnnecessaryParentheses\AbstractRemoveUnnecessaryParenthesesCodeFixProvider.cs (1)
32Document document, ImmutableArray<Diagnostic> diagnostics,
src\roslyn\src\Analyzers\Core\CodeFixes\RemoveUnnecessarySuppressions\RemoveUnnecessaryAttributeSuppressionsCodeFixProvider.cs (1)
39protected override async Task FixAllAsync(Document document, ImmutableArray<Diagnostic> diagnostics, SyntaxEditor editor, CancellationToken cancellationToken)
src\roslyn\src\Analyzers\Core\CodeFixes\RemoveUnnecessarySuppressions\RemoveUnnecessaryPragmaSuppressionsCodeFixProvider.cs (1)
45protected override async Task FixAllAsync(Document document, ImmutableArray<Diagnostic> diagnostics, SyntaxEditor editor, CancellationToken cancellationToken)
src\roslyn\src\Analyzers\Core\CodeFixes\RemoveUnusedMembers\AbstractRemoveUnusedMembersCodeFixProvider.cs (1)
40Document document,
src\roslyn\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; 915Document document,
src\roslyn\src\Analyzers\Core\CodeFixes\SimplifyBooleanExpression\SimplifyConditionalCodeFixProvider.cs (1)
35Document document,
src\roslyn\src\Analyzers\Core\CodeFixes\SimplifyInterpolation\AbstractSimplifyInterpolationCodeFixProvider.cs (1)
46Document document, ImmutableArray<Diagnostic> diagnostics,
src\roslyn\src\Analyzers\Core\CodeFixes\SimplifyLinqExpression\SimplifyLinqExpressionCodeFixProvider.cs (1)
33Document document,
src\roslyn\src\Analyzers\Core\CodeFixes\UnsealClass\AbstractUnsealClassCodeFixProvider.cs (2)
31var document = context.Document; 63var document = solution.GetRequiredDocument(documentId);
src\roslyn\src\Analyzers\Core\CodeFixes\UpdateLegacySuppressions\UpdateLegacySuppressionsCodeFixProvider.cs (1)
40protected override async Task FixAllAsync(Document document, ImmutableArray<Diagnostic> diagnostics, SyntaxEditor editor, CancellationToken cancellationToken)
src\roslyn\src\Analyzers\Core\CodeFixes\UseAutoProperty\AbstractUseAutoPropertyCodeFixProvider.cs (14)
69Document document, SyntaxNode finalPropertyDeclaration); 72Document propertyDocument, 124var fieldDocument = currentSolution.GetRequiredDocument(field.DeclaringSyntaxReferences[0].GetSyntax(cancellationToken).SyntaxTree); 125var propertyDocument = currentSolution.GetRequiredDocument(property.DeclaringSyntaxReferences[0].GetSyntax(cancellationToken).SyntaxTree); 234var updatedFieldDocument = fieldDocument.WithSyntaxRoot(editor.GetChangedRoot()); 249var updatedFieldDocument = fieldDocument.WithSyntaxRoot(newFieldTreeRoot); 250var updatedPropertyDocument = propertyDocument.WithSyntaxRoot(newPropertyTreeRoot); 326var document = group.Key; 382var document = solution.GetDocument(documentId); 405var fieldDocument = originalSolution.GetRequiredDocument(declarator.SyntaxTree); 410var propertyDocument = originalSolution.GetRequiredDocument(property.SyntaxTree); 455Document document, 469var cleanedDocument = await CodeCleanupHelpers.CleanupSyntaxAsync( 500var document = group.Key;
src\roslyn\src\Analyzers\Core\CodeFixes\UseAutoProperty\UseAutoPropertyFixAllProvider.cs (1)
82var changedDocument = currentSolution.GetRequiredDocument(changedDocumentId);
src\roslyn\src\Analyzers\Core\CodeFixes\UseCoalesceExpression\AbstractUseCoalesceExpressionForIfNullStatementCheckCodeFixProvider.cs (1)
33Document document, ImmutableArray<Diagnostic> diagnostics,
src\roslyn\src\Analyzers\Core\CodeFixes\UseCoalesceExpression\UseCoalesceExpressionForNullableTernaryConditionalCheckCodeFixProvider.cs (1)
36Document document, ImmutableArray<Diagnostic> diagnostics,
src\roslyn\src\Analyzers\Core\CodeFixes\UseCoalesceExpression\UseCoalesceExpressionForTernaryConditionalCheckCodeFixProvider.cs (1)
37Document document, ImmutableArray<Diagnostic> diagnostics,
src\roslyn\src\Analyzers\Core\CodeFixes\UseCollectionExpression\AbstractUseCollectionExpressionCodeFixProvider.cs (1)
27protected override bool IncludeDiagnosticDuringFixAll(Diagnostic diagnostic, Document document, string? equivalenceKey, CancellationToken cancellationToken)
src\roslyn\src\Analyzers\Core\CodeFixes\UseCollectionInitializer\AbstractUseCollectionInitializerCodeFixProvider.cs (2)
56Document document, TObjectCreationExpressionSyntax objectCreation, bool useCollectionExpression, 61Document document,
src\roslyn\src\Analyzers\Core\CodeFixes\UseCompoundAssignment\AbstractUseCompoundAssignmentCodeFixProvider.cs (1)
50Document document, ImmutableArray<Diagnostic> diagnostics,
src\roslyn\src\Analyzers\Core\CodeFixes\UseConditionalExpression\AbstractUseConditionalExpressionCodeFixProvider.cs (4)
43Document document, Diagnostic diagnostic, 47Document document, ImmutableArray<Diagnostic> diagnostics, SyntaxEditor editor, 87Document document, IConditionalOperation ifOperation, 155Document document, SyntaxNode condition, SyntaxNode trueSyntax, SyntaxNode falseSyntax, SyntaxFormattingOptions formattingOptions,
src\roslyn\src\Analyzers\Core\CodeFixes\UseConditionalExpression\ForAssignment\AbstractUseConditionalExpressionForAssignmentCodeFixProvider.cs (1)
57Document document,
src\roslyn\src\Analyzers\Core\CodeFixes\UseConditionalExpression\ForReturn\AbstractUseConditionalExpressionForReturnCodeFixProvider.cs (1)
44Document document,
src\roslyn\src\Analyzers\Core\CodeFixes\UseExplicitTupleName\UseExplicitTupleNameCodeFixProvider.cs (1)
32Document document, ImmutableArray<Diagnostic> diagnostics,
src\roslyn\src\Analyzers\Core\CodeFixes\UseInferredMemberName\AbstractUseInferredMemberNameCodeFixProvider.cs (1)
27Document document, ImmutableArray<Diagnostic> diagnostics,
src\roslyn\src\Analyzers\Core\CodeFixes\UseIsNullCheck\AbstractUseIsNullForReferenceEqualsCodeFixProvider.cs (1)
46Document document, ImmutableArray<Diagnostic> diagnostics,
src\roslyn\src\Analyzers\Core\CodeFixes\UseNullPropagation\AbstractUseNullPropagationCodeFixProvider.cs (3)
80Document document, 99Document document, 157Document document,
src\roslyn\src\Analyzers\Core\CodeFixes\UseObjectInitializer\AbstractUseObjectInitializerCodeFixProvider.cs (1)
64Document document,
src\roslyn\src\Analyzers\Core\CodeFixes\UseSystemHashCode\UseSystemHashCodeCodeFixProvider.cs (1)
34Document document, ImmutableArray<Diagnostic> diagnostics,
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)
21Task<SymbolMappingResult?> MapSymbolAsync(Document document, SymbolKey symbolId, CancellationToken cancellationToken = default); 31Task<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)
107public static async ValueTask<SymbolSearchOptions> GetSymbolSearchOptionsAsync(this Document document, CancellationToken cancellationToken)
SyncNamespaces\AbstractSyncNamespacesService.cs (2)
109var document = solution.GetRequiredDocument(firstDiagnostic.Location.SourceTree); 168public override async Task<IEnumerable<Diagnostic>> GetDocumentDiagnosticsAsync(Document document, CancellationToken cancellationToken)
TaskList\AbstractTaskListService.cs (2)
27Document document, 49Document 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);
UseNamedArguments\AbstractUseNamedArgumentsCodeRefactoringProvider.cs (2)
135private Task<Document> AddNamedArgumentsAsync( 137Document document,
ValueTracking\IValueTrackingService.cs (1)
15Task<ImmutableArray<ValueTrackedItem>> TrackValueSourceAsync(TextSpan selection, Document document, CancellationToken cancellationToken);
ValueTracking\SerializableValueTrackedItem.cs (1)
45var document = solution.GetRequiredDocument(DocumentId);
ValueTracking\ValueTrackedItem.cs (1)
48var document = solution.GetRequiredDocument(location.SourceTree);
ValueTracking\ValueTracker.cs (6)
21Document document, 138private static async Task AddItemsFromAssignmentAsync(Document document, SyntaxNode lhsNode, OperationCollector collector, CancellationToken cancellationToken) 208var sourceDoc = collector.Solution.GetRequiredDocument(location.SourceTree); 255private static async Task<(ISymbol?, SyntaxNode?)> GetSelectedSymbolAsync(TextSpan textSpan, Document document, CancellationToken cancellationToken) 296var document = collector.Solution.GetRequiredDocument(node.SyntaxTree); 328var document = solution.GetRequiredDocument(item.DocumentId);
ValueTracking\ValueTracker.FindReferencesProgress.cs (2)
146var document = referenceLocation.Document; 169var document = referenceLocation.Document;
ValueTracking\ValueTrackingService.cs (1)
29Document document,
Wrapping\AbstractCodeActionComputer.cs (7)
50protected readonly Document OriginalDocument; 66Document document, 93var newDocument = OriginalDocument.WithText(newSourceText); 133var formattedDocument = await FormatDocumentAsync(rewrittenRoot, spanToFormat, cancellationToken).ConfigureAwait(false); 163private async Task<Document> FormatDocumentAsync( 166var newDocument = OriginalDocument.WithSyntaxRoot(rewrittenRoot); 167var formattedDocument = await Formatter.FormatAsync(
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)
27Document 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)
75Document document,
Wrapping\WrapItemsAction.cs (1)
20internal sealed class WrapItemsAction(string title, string parentTitle, Func<IProgress<CodeAnalysisProgress>, CancellationToken, Task<Document>> createChangedDocument)
Microsoft.CodeAnalysis.VisualBasic.CodeStyle.Fixes (32)
src\roslyn\src\Analyzers\VisualBasic\CodeFixes\AddExplicitCast\VisualBasicAddExplicitCastCodeFixProvider.vb (3)
57document As Document, 109document As Document, 167document As Document,
src\roslyn\src\Analyzers\VisualBasic\CodeFixes\GenerateConstructor\GenerateConstructorCodeFixProvider.vb (1)
32Protected Overrides Function GetCodeActionsAsync(document As Document, node As SyntaxNode, cancellationToken As CancellationToken) As Task(Of ImmutableArray(Of CodeAction))
src\roslyn\src\Analyzers\VisualBasic\CodeFixes\GenerateEnumMember\GenerateEnumMemberCodeFixProvider.vb (1)
34Protected Overrides Function GetCodeActionsAsync(document As Document, node As SyntaxNode, cancellationToken As CancellationToken) As Task(Of ImmutableArray(Of CodeAction))
src\roslyn\src\Analyzers\VisualBasic\CodeFixes\GenerateParameterizedMember\GenerateConversionCodeFixProvider.vb (1)
34Protected Overrides Function GetCodeActionsAsync(document As Document, node As SyntaxNode, cancellationToken As CancellationToken) As Task(Of ImmutableArray(Of CodeAction))
src\roslyn\src\Analyzers\VisualBasic\CodeFixes\GenerateParameterizedMember\GenerateParameterizedMemberCodeFixProvider.vb (1)
53Protected Overrides Function GetCodeActionsAsync(document As Document, node As SyntaxNode, cancellationToken As CancellationToken) As Task(Of ImmutableArray(Of CodeAction))
src\roslyn\src\Analyzers\VisualBasic\CodeFixes\GenerateParameterizedMember\VisualBasicGenerateParameterizedMemberService.vb (2)
56Dim typeInference = Document.Document.GetRequiredLanguageService(Of ITypeInferenceService)() 58Document.SemanticModel, Me.InvocationExpression, objectAsDefault:=True,
src\roslyn\src\Analyzers\VisualBasic\CodeFixes\GenerateVariable\VisualBasicGenerateVariableCodeFixProvider.vb (1)
37Protected Overrides Async Function GetCodeActionsAsync(document As Document, node As SyntaxNode, cancellationToken As CancellationToken) As Task(Of ImmutableArray(Of CodeAction))
src\roslyn\src\Analyzers\VisualBasic\CodeFixes\ImplementInterface\VisualBasicImplementInterfaceService.vb (1)
54document As Document, model As SemanticModel, node As SyntaxNode, cancellationToken As CancellationToken,
src\roslyn\src\Analyzers\VisualBasic\CodeFixes\Iterator\VisualBasicChangeToYieldCodeFixProvider.vb (1)
40Protected Overrides Function GetCodeFixAsync(root As SyntaxNode, node As SyntaxNode, document As Document, diagnostics As Diagnostic, cancellationToken As CancellationToken) As Task(Of CodeAction)
src\roslyn\src\Analyzers\VisualBasic\CodeFixes\Iterator\VisualBasicConvertToIteratorCodeFixProvider.vb (1)
42Protected Overrides Async Function GetCodeFixAsync(root As SyntaxNode, node As SyntaxNode, document As Document, diagnostics As Diagnostic, cancellationToken As CancellationToken) As Task(Of CodeAction)
src\roslyn\src\Analyzers\VisualBasic\CodeFixes\RemoveUnnecessaryByVal\VisualBasicRemoveUnnecessaryByValCodeFixProvider.vb (1)
35Protected Overrides Async Function FixAllAsync(document As Document, diagnostics As ImmutableArray(Of Diagnostic), editor As SyntaxEditor, cancellationToken As CancellationToken) As Task
src\roslyn\src\Analyzers\VisualBasic\CodeFixes\RemoveUnnecessaryCast\VisualBasicRemoveUnnecessaryCastCodeFixProvider.vb (3)
52document As Document, 93document As Document, originalCastNodes As ImmutableArray(Of ExpressionSyntax), 115document As Document, originalNodes As ImmutableArray(Of ExpressionSyntax),
src\roslyn\src\Analyzers\VisualBasic\CodeFixes\SimplifyObjectCreation\VisualBasicSimplifyObjectCreationCodeFixProvider.vb (1)
34Protected Overrides Async Function FixAllAsync(document As Document, diagnostics As ImmutableArray(Of Diagnostic), editor As SyntaxEditor, cancellationToken As CancellationToken) As Task
src\roslyn\src\Analyzers\VisualBasic\CodeFixes\UseAutoProperty\VisualBasicUseAutoPropertyCodeFixProvider.vb (2)
42Protected Overrides Function GetFormattingRules(document As Document, finalProperty As SyntaxNode) As ImmutableArray(Of AbstractFormattingRule) 52propertyDocument As Document,
src\roslyn\src\Analyzers\VisualBasic\CodeFixes\UseCollectionInitializer\VisualBasicUseCollectionInitializerCodeFixProvider.vb (1)
42document As Document,
src\roslyn\src\Analyzers\VisualBasic\CodeFixes\UseIsNotExpression\VisualBasicUseIsNotExpressionCodeFixProvider.vb (1)
32document As Document,
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\CodeFixesAndRefactorings\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)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\Extensions\ContextQuery\VisualBasicSyntaxContext.vb (2)
52document As Document, 162Public Shared Function CreateContext(document As Document, semanticModel As SemanticModel, position As Integer, cancellationToken As CancellationToken) As VisualBasicSyntaxContext
src\roslyn\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\roslyn\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\roslyn\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\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\LanguageServices\VisualBasicRemoveUnnecessaryImportsService.vb (2)
27document As Document, 29cancellationToken As CancellationToken) As Task(Of Document)
Microsoft.CodeAnalysis.VisualBasic.Features (181)
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)
96document As Document, 227Public Overrides Function FindNodeToUpdate(document As Document, node As SyntaxNode) As SyntaxNode 607document As Document, 684document As Document, 736Protected 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)
42Protected 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)
79Private 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)
101Private Shared Function CreateActionForImports(document As Document, node As ImportsStatementSyntax, root As CompilationUnitSyntax, cancellationToken As CancellationToken) As IEnumerable(Of CodeAction) 123Private Shared Function CreateActionForOptions(document As Document, node As OptionStatementSyntax, root As CompilationUnitSyntax, cancellationToken As CancellationToken) As IEnumerable(Of CodeAction) 139Private 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)
17Private ReadOnly _document As Document 34Public Sub New(document As Document, node As SyntaxNode, title As String, modifier As SyntaxKind) 41Protected Overrides Async Function GetChangedDocumentAsync(cancellationToken As CancellationToken) As Task(Of Document) 51Private 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)
120Private Shared Async Function InlineTemporaryAsync(document As Document, modifiedIdentifier As ModifiedIdentifierSyntax, cancellationToken As CancellationToken) As Task(Of Document) 224Private Shared Async Function FindDefinitionAsync(document As Document, cancellationToken As CancellationToken) As Task(Of ModifiedIdentifierSyntax) 234Private Shared Async Function FindReferenceAnnotatedNodesAsync(document As Document, cancellationToken As CancellationToken) As Task(Of IEnumerable(Of IdentifierNameSyntax)) 366Private Shared Async Function CreateExpressionToInlineAsync(document As Document, cancellationToken As CancellationToken) As Task(Of ExpressionSyntax) 408inlinedDocument As Document, 413) As Task(Of Document)
CodeRefactorings\MoveType\VisualBasicMoveTypeService.vb (1)
32Protected 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)
70Protected Overrides Function GetValidContainersFromAllLinkedDocumentsAsync(document As Document, container As SyntaxNode, cancellationToken As CancellationToken) As Task(Of ImmutableArray(Of (DocumentId, SyntaxNode))) 85Protected 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)
39Protected 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)
50document As Document, 100Protected Overrides Function IsExclusiveAsync(document As Document, position As Integer, cancellationToken As CancellationToken) As Task(Of Boolean)
Completion\CompletionProviders\PartialTypeCompletionProvider.vb (1)
72Public 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)
69Protected 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 (3)
30Protected Overrides Function GetFieldNameAsync(document As Document, propertySymbol As IPropertySymbol, cancellationToken As CancellationToken) As Task(Of String) 89Protected Overrides Function ExpandToFieldPropertyAsync(document As Document, [property] As PropertyStatementSyntax, cancellationToken As CancellationToken) As Task(Of Document)
Copilot\VisualBasicCopilotProposalAdjusterService.vb (3)
22Protected Overrides Function AddMissingTokensIfAppropriateAsync(originalDocument As Document, forkedDocument As Document, cancellationToken As CancellationToken) As Task(Of Document)
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)
28document As Document, 71Protected 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)
60Protected Overrides Function GetCustomFormattingRule(document As Document) As AbstractFormattingRule 113document As Document, 116cancellationToken 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)
419Public 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)) 614document As Document,
IntroduceVariable\VisualBasicIntroduceLocalForExpressionCodeRefactoringProvider.vb (1)
49Protected 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)
21cancellationToken As CancellationToken) As Document 83cancellationToken As CancellationToken) As Document 125cancellationToken As CancellationToken) As Document 162cancellationToken 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)
27Protected Overrides Async Function AddAssemblyInfoRegionAsync(document As Document, symbolCompilation As Compilation, symbol As ISymbol, cancellationToken As CancellationToken) As Task(Of Document) 53Protected Overrides Function AddNullableRegionsAsync(document As Document, cancellationToken As CancellationToken) As Task(Of Document) 58Protected Overrides Async Function ConvertDocCommentsToRegularCommentsAsync(document As Document, docCommentFormattingService As IDocumentationCommentFormattingService, cancellationToken As CancellationToken) As Task(Of Document) 66Protected Overrides Function GetFormattingRules(document As Document) As ImmutableArray(Of AbstractFormattingRule)
NavigationBar\VisualBasicNavigationBarItemService.vb (1)
39document 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)
57Protected Overrides Function FixAllAsync(document As Document, diagnostics As ImmutableArray(Of Diagnostic), editor As SyntaxEditor, cancellationToken As CancellationToken) As Task 67Private Shared Function GetReplacement(document As Document, node As SyntaxNode) As SyntaxNode
ReplacePropertyWithMethods\VisualBasicReplacePropertyWithMethods.vb (1)
27document As Document,
SignatureHelp\AbstractIntrinsicOperatorSignatureHelpProvider.vb (3)
18Protected MustOverride Function GetIntrinsicOperatorDocumentationAsync(node As TSyntaxNode, document As Document, cancellationToken As CancellationToken) As ValueTask(Of IEnumerable(Of AbstractIntrinsicOperatorDocumentation)) 32Protected Overrides Async Function GetItemsWorkerAsync(document As Document, position As Integer, triggerInfo As SignatureHelpTriggerInfo, options As MemberDisplayOptions, cancellationToken As CancellationToken) As Task(Of SignatureHelpItems) 56Friend 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)
24Protected Overrides Function GetIntrinsicOperatorDocumentationAsync(node As AddRemoveHandlerStatementSyntax, document As Document, cancellationToken As CancellationToken) As ValueTask(Of IEnumerable(Of AbstractIntrinsicOperatorDocumentation))
SignatureHelp\AttributeSignatureHelpProvider.vb (1)
51Protected 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)
24Protected Overrides Function GetIntrinsicOperatorDocumentationAsync(node As CastExpressionSyntax, document As Document, cancellationToken As CancellationToken) As ValueTask(Of IEnumerable(Of AbstractIntrinsicOperatorDocumentation))
SignatureHelp\CollectionInitializerSignatureHelpProvider.vb (1)
45Protected 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)
19Protected Overrides Function GetIntrinsicOperatorDocumentationAsync(node As T, document As Document, cancellationToken As CancellationToken) As ValueTask(Of IEnumerable(Of AbstractIntrinsicOperatorDocumentation))
SignatureHelp\FunctionAggregationSignatureHelpProvider.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\GenericNameSignatureHelpProvider.vb (1)
60Protected 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)
23Protected Overrides Function GetIntrinsicOperatorDocumentationAsync(node As GetTypeExpressionSyntax, document As Document, cancellationToken As CancellationToken) As ValueTask(Of IEnumerable(Of AbstractIntrinsicOperatorDocumentation))
SignatureHelp\GetXmlNamespaceExpressionSignatureHelpProvider.vb (1)
23Protected Overrides Function GetIntrinsicOperatorDocumentationAsync(node As GetXmlNamespaceExpressionSyntax, document As Document, cancellationToken As CancellationToken) As ValueTask(Of IEnumerable(Of AbstractIntrinsicOperatorDocumentation))
SignatureHelp\InvocationExpressionSignatureHelpProvider.MemberGroup.vb (1)
40document As Document,
SignatureHelp\InvocationExpressionSignatureHelpProvider.vb (1)
62Protected 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)
23Protected Overrides Function GetIntrinsicOperatorDocumentationAsync(node As AssignmentStatementSyntax, document As Document, cancellationToken As CancellationToken) As ValueTask(Of IEnumerable(Of AbstractIntrinsicOperatorDocumentation))
SignatureHelp\NameOfExpressionSignatureHelpProvider.vb (1)
27Protected 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)
61Protected 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)
24Protected Overrides Function GetIntrinsicOperatorDocumentationAsync(node As PredefinedCastExpressionSyntax, document As Document, cancellationToken As CancellationToken) As ValueTask(Of IEnumerable(Of AbstractIntrinsicOperatorDocumentation)) 28Private Shared Async Function GetIntrinsicOperatorDocumentationImplAsync(node As PredefinedCastExpressionSyntax, document As Document, cancellationToken As CancellationToken) As Task(Of IEnumerable(Of AbstractIntrinsicOperatorDocumentation))
SignatureHelp\RaiseEventStatementSignatureHelpProvider.vb (1)
61document 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\roslyn\src\Analyzers\VisualBasic\CodeFixes\AddExplicitCast\VisualBasicAddExplicitCastCodeFixProvider.vb (3)
57document As Document, 109document As Document, 167document As Document,
src\roslyn\src\Analyzers\VisualBasic\CodeFixes\GenerateConstructor\GenerateConstructorCodeFixProvider.vb (1)
32Protected Overrides Function GetCodeActionsAsync(document As Document, node As SyntaxNode, cancellationToken As CancellationToken) As Task(Of ImmutableArray(Of CodeAction))
src\roslyn\src\Analyzers\VisualBasic\CodeFixes\GenerateEnumMember\GenerateEnumMemberCodeFixProvider.vb (1)
34Protected Overrides Function GetCodeActionsAsync(document As Document, node As SyntaxNode, cancellationToken As CancellationToken) As Task(Of ImmutableArray(Of CodeAction))
src\roslyn\src\Analyzers\VisualBasic\CodeFixes\GenerateParameterizedMember\GenerateConversionCodeFixProvider.vb (1)
34Protected Overrides Function GetCodeActionsAsync(document As Document, node As SyntaxNode, cancellationToken As CancellationToken) As Task(Of ImmutableArray(Of CodeAction))
src\roslyn\src\Analyzers\VisualBasic\CodeFixes\GenerateParameterizedMember\GenerateParameterizedMemberCodeFixProvider.vb (1)
53Protected Overrides Function GetCodeActionsAsync(document As Document, node As SyntaxNode, cancellationToken As CancellationToken) As Task(Of ImmutableArray(Of CodeAction))
src\roslyn\src\Analyzers\VisualBasic\CodeFixes\GenerateParameterizedMember\VisualBasicGenerateParameterizedMemberService.vb (2)
56Dim typeInference = Document.Document.GetRequiredLanguageService(Of ITypeInferenceService)() 58Document.SemanticModel, Me.InvocationExpression, objectAsDefault:=True,
src\roslyn\src\Analyzers\VisualBasic\CodeFixes\GenerateVariable\VisualBasicGenerateVariableCodeFixProvider.vb (1)
37Protected Overrides Async Function GetCodeActionsAsync(document As Document, node As SyntaxNode, cancellationToken As CancellationToken) As Task(Of ImmutableArray(Of CodeAction))
src\roslyn\src\Analyzers\VisualBasic\CodeFixes\ImplementInterface\VisualBasicImplementInterfaceService.vb (1)
54document As Document, model As SemanticModel, node As SyntaxNode, cancellationToken As CancellationToken,
src\roslyn\src\Analyzers\VisualBasic\CodeFixes\Iterator\VisualBasicChangeToYieldCodeFixProvider.vb (1)
40Protected Overrides Function GetCodeFixAsync(root As SyntaxNode, node As SyntaxNode, document As Document, diagnostics As Diagnostic, cancellationToken As CancellationToken) As Task(Of CodeAction)
src\roslyn\src\Analyzers\VisualBasic\CodeFixes\Iterator\VisualBasicConvertToIteratorCodeFixProvider.vb (1)
42Protected Overrides Async Function GetCodeFixAsync(root As SyntaxNode, node As SyntaxNode, document As Document, diagnostics As Diagnostic, cancellationToken As CancellationToken) As Task(Of CodeAction)
src\roslyn\src\Analyzers\VisualBasic\CodeFixes\RemoveUnnecessaryByVal\VisualBasicRemoveUnnecessaryByValCodeFixProvider.vb (1)
35Protected Overrides Async Function FixAllAsync(document As Document, diagnostics As ImmutableArray(Of Diagnostic), editor As SyntaxEditor, cancellationToken As CancellationToken) As Task
src\roslyn\src\Analyzers\VisualBasic\CodeFixes\RemoveUnnecessaryCast\VisualBasicRemoveUnnecessaryCastCodeFixProvider.vb (3)
52document As Document, 93document As Document, originalCastNodes As ImmutableArray(Of ExpressionSyntax), 115document As Document, originalNodes As ImmutableArray(Of ExpressionSyntax),
src\roslyn\src\Analyzers\VisualBasic\CodeFixes\SimplifyObjectCreation\VisualBasicSimplifyObjectCreationCodeFixProvider.vb (1)
34Protected Overrides Async Function FixAllAsync(document As Document, diagnostics As ImmutableArray(Of Diagnostic), editor As SyntaxEditor, cancellationToken As CancellationToken) As Task
src\roslyn\src\Analyzers\VisualBasic\CodeFixes\UseAutoProperty\VisualBasicUseAutoPropertyCodeFixProvider.vb (2)
42Protected Overrides Function GetFormattingRules(document As Document, finalProperty As SyntaxNode) As ImmutableArray(Of AbstractFormattingRule) 52propertyDocument As Document,
src\roslyn\src\Analyzers\VisualBasic\CodeFixes\UseCollectionInitializer\VisualBasicUseCollectionInitializerCodeFixProvider.vb (1)
42document As Document,
src\roslyn\src\Analyzers\VisualBasic\CodeFixes\UseIsNotExpression\VisualBasicUseIsNotExpressionCodeFixProvider.vb (1)
32document As Document,
Microsoft.CodeAnalysis.VisualBasic.NetAnalyzers (25)
Microsoft.NetCore.Analyzers\InteropServices\BasicSpecifyMarshalingForPInvokeStringArguments.Fixer.vb (2)
33Protected Overrides Async Function FixDeclareStatementAsync(document As Document, node As SyntaxNode, cancellationToken As CancellationToken) As Task(Of Document)
Microsoft.NetCore.Analyzers\Performance\BasicDoNotGuardCall.Fixer.vb (2)
38Protected Overrides Function ReplaceConditionWithChild(document As Document, root As SyntaxNode, conditionalOperationNode As SyntaxNode, childOperationNode As SyntaxNode) As Document
Microsoft.NetCore.Analyzers\Performance\BasicPreferDictionaryTryMethodsOverContainsKeyGuardFixer.vb (4)
43Private Shared Async Function GetTryGetValueActionAsync(root As SyntaxNode, diagnostic As Diagnostic, document As Document, containsKeyAccess As MemberAccessExpressionSyntax, containsKeyInvocation As InvocationExpressionSyntax, cancellationToken As CancellationToken) As Task(Of CodeAction) 113Async Function(ct As CancellationToken) As Task(Of Document) 183Private Shared Function GetTryAddAction(root As SyntaxNode, diagnostic As Diagnostic, document As Document, containsKeyAccess As MemberAccessExpressionSyntax, containsKeyInvocation As InvocationExpressionSyntax) As CodeAction 186Dim replaceFunction = Async Function(ct As CancellationToken) As Task(Of Document)
Microsoft.NetCore.Analyzers\Performance\BasicUseStringMethodCharOverloadWithSingleCharacters.Fixer.vb (2)
42Protected Overrides Function CreateCodeAction(document As Document, argumentListNode As SyntaxNode, sourceCharLiteral As Char) As CodeAction 62Public Sub New(document As Document, argumentListNode As SyntaxNode, sourceCharLiteral As Char)
Microsoft.NetCore.Analyzers\Runtime\BasicPreferDictionaryContainsMethods.Fixer.vb (2)
37Async Function(ct As CancellationToken) As Task(Of Document) 52Async Function(ct As CancellationToken) As Task(Of Document)
Microsoft.NetCore.Analyzers\Runtime\BasicSpecifyCultureForToLowerAndToUpper.Fixer.vb (6)
23Protected Overrides Async Function SpecifyCurrentCultureAsync(document As Document, generator As SyntaxGenerator, root As SyntaxNode, node As SyntaxNode, cancellationToken As CancellationToken) As Task(Of Document) 51Private Shared Async Function SpecifyCurrentCultureWhenTheresNoArgumentListAsync(document As Document, generator As SyntaxGenerator, root As SyntaxNode, memberAccess As MemberAccessExpressionSyntax, nodeToReplace As SyntaxNode, cancellationToken As CancellationToken) As Task(Of Document) 59Protected Overrides Function UseInvariantVersionAsync(document As Document, generator As SyntaxGenerator, root As SyntaxNode, node As SyntaxNode) As Task(Of Document)
Microsoft.NetCore.Analyzers\Runtime\BasicUseOrdinalStringComparison.Fixer.vb (4)
24Protected Overrides Function FixArgumentAsync(document As Document, generator As SyntaxGenerator, root As SyntaxNode, argument As SyntaxNode) As Task(Of Document) 44Protected Overrides Async Function FixIdentifierNameAsync(document As Document, generator As SyntaxGenerator, root As SyntaxNode, identifier As SyntaxNode, cancellationToken As CancellationToken) As Task(Of Document)
Microsoft.NetCore.Analyzers\Usage\BasicDoNotPassNonNullableValueToArgumentNullExceptionThrowIfNullFixer.vb (1)
15Protected Overrides Async Function GetNewRootForNullableStructAsync(document As Document, invocation As InvocationExpressionSyntax, cancellationToken As CancellationToken) As Task(Of SyntaxNode)
Microsoft.NetCore.Analyzers\Usage\BasicPreferGenericOverloads.Fixer.vb (2)
24Protected Overrides Async Function ReplaceWithGenericCallAsync(document As Document, 26cancellationToken As CancellationToken) As Task(Of Document)
Microsoft.CodeAnalysis.VisualBasic.Workspaces (26)
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)
30Protected Overrides Async Function GetRewriterAsync(document As Document, root As SyntaxNode, spans As ImmutableArray(Of TextSpan), cancellationToken As CancellationToken) As Task(Of Rewriter) 45Public 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)
39Protected Overrides Function GetRewriterAsync(document As Document, root As SyntaxNode, spans As ImmutableArray(Of TextSpan), cancellationToken As CancellationToken) As Task(Of Rewriter) 56Public 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
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\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\CodeFixesAndRefactorings\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)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\Extensions\ContextQuery\VisualBasicSyntaxContext.vb (2)
52document As Document, 162Public Shared Function CreateContext(document As Document, semanticModel As SemanticModel, position As Integer, cancellationToken As CancellationToken) As VisualBasicSyntaxContext
src\roslyn\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\roslyn\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\roslyn\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\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\LanguageServices\VisualBasicRemoveUnnecessaryImportsService.vb (2)
27document As Document, 29cancellationToken As CancellationToken) As Task(Of Document)
Microsoft.CodeAnalysis.Workspaces (892)
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)
42Task<bool> CanChangeNamespaceAsync(Document document, SyntaxNode container, CancellationToken cancellationToken); 58Task<Solution> ChangeNamespaceAsync(Document document, SyntaxNode container, string targetNamespace, CancellationToken cancellationToken); 62/// use namespace containers considered valid by <see cref="CanChangeNamespaceAsync(Document, SyntaxNode, CancellationToken)"/> 64Task<Solution?> TryChangeTopLevelNamespacesAsync(Document document, string targetNamespace, CancellationToken cancellationToken);
Classification\AbstractClassificationService.cs (9)
34Document document, ImmutableArray<TextSpan> textSpans, ClassificationOptions options, SegmentedList<ClassifiedSpan> result, CancellationToken cancellationToken) 40Document document, ImmutableArray<TextSpan> textSpans, ClassificationOptions options, SegmentedList<ClassifiedSpan> result, CancellationToken cancellationToken) 46Document document, 107Document document, 137Document document, 186Document document, ISyntaxClassificationService classificationService) 201public async Task AddSyntacticClassificationsAsync(Document document, ImmutableArray<TextSpan> textSpans, SegmentedList<ClassifiedSpan> result, CancellationToken cancellationToken) 228public 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, 58Document 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)
26Document document,
Classification\SyntaxClassification\ISyntaxClassificationService.cs (1)
35Document document,
Classification\SyntaxClassification\SyntaxClassificationExtensions.cs (1)
29Document document,
CodeActions\CodeAction.cs (25)
334var changedDocument = await GetChangedDocumentAsync(cancellationToken).ConfigureAwait(false); 356var changedDocument = await GetChangedDocumentAsync(progress, cancellationToken).ConfigureAwait(false); 380protected virtual Task<Document> GetChangedDocumentAsync(CancellationToken cancellationToken) 396protected virtual Task<Document> GetChangedDocumentAsync(IProgress<CodeAnalysisProgress> progress, CancellationToken cancellationToken) 412internal Task<Document> GetChangedDocumentInternalAsync(CancellationToken cancellation) 465protected virtual async Task<Document> PostProcessChangesAsync(Document document, CancellationToken cancellationToken) 479/// Creates a <see cref="CodeAction"/> for a change to a single <see cref="Document"/>. 483/// <param name="createChangedDocument">Function to create the <see cref="Document"/>.</param> 486public static CodeAction Create(string title, Func<CancellationToken, Task<Document>> createChangedDocument, string? equivalenceKey) 490internal static CodeAction Create(string title, Func<IProgress<CodeAnalysisProgress>, CancellationToken, Task<Document>> createChangedDocument, string? equivalenceKey) 493/// <inheritdoc cref="Create(string, Func{CancellationToken, Task{Document}}, string?)"/> 496public static CodeAction Create(string title, Func<CancellationToken, Task<Document>> createChangedDocument, string? equivalenceKey = null, CodeActionPriority priority = CodeActionPriority.Default) 499/// <inheritdoc cref="Create(string, Func{CancellationToken, Task{Document}}, string?, CodeActionPriority)"/> 501public static CodeAction Create(string title, Func<IProgress<CodeAnalysisProgress>, CancellationToken, Task<Document>> createChangedDocument, string? equivalenceKey = null, CodeActionPriority priority = CodeActionPriority.Default) 513/// Creates a <see cref="CodeAction"/> for a change to more than one <see cref="Document"/> within a <see cref="Solution"/>. 524/// Creates a <see cref="CodeAction"/> for a change to more than one <see cref="Document"/> within a <see cref="Solution"/>. 652private readonly Func<IProgress<CodeAnalysisProgress>, CancellationToken, Task<Document>> _createChangedDocument; 653private readonly Func<IProgress<CodeAnalysisProgress>, CancellationToken, Task<Document>>? _createChangedDocumentPreview; 657Func<IProgress<CodeAnalysisProgress>, CancellationToken, Task<Document>> createChangedDocument, 658Func<IProgress<CodeAnalysisProgress>, CancellationToken, Task<Document>>? createChangedDocumentPreview, 670Func<IProgress<CodeAnalysisProgress>, CancellationToken, Task<Document>> createChangedDocument, 679Func<IProgress<CodeAnalysisProgress>, CancellationToken, Task<Document>> createChangedDocument, 689var newDocument = await _createChangedDocumentPreview(CodeAnalysisProgress.None, cancellationToken).ConfigureAwait(false); 693protected sealed override Task<Document> GetChangedDocumentAsync(IProgress<CodeAnalysisProgress> progress, CancellationToken cancellationToken)
CodeActions\CodeAction_Cleanup.cs (19)
44private static readonly Func<Document, CodeCleanupOptions, CancellationToken, Task<Document>> s_cleanupSyntaxPass = 47private static readonly ImmutableArray<Func<Document, CodeCleanupOptions, CancellationToken, Task<Document>>> s_cleanupSyntaxPasses = [s_cleanupSyntaxPass]; 53private static readonly ImmutableArray<Func<Document, CodeCleanupOptions, CancellationToken, Task<Document>>> s_allCleanupPasses = 71internal static Task<Document> CleanupSyntaxAsync(Document document, CodeCleanupOptions options, CancellationToken cancellationToken) 114ImmutableArray<Func<Document, CodeCleanupOptions, CancellationToken, Task<Document>>> passes, 134var document = await changedSolution.GetRequiredDocumentAsync(documentId, includeSourceGenerated: true, cancellationToken).ConfigureAwait(false); 148internal static async ValueTask<Document> CleanupDocumentAsync(Document document, CodeCleanupOptions options, CancellationToken cancellationToken) 167ImmutableArray<Func<Document, CodeCleanupOptions, CancellationToken, Task<Document>>> passes, 180Solution solution, Func<Document, CodeCleanupOptions, CancellationToken, Task<Document>> cleanupDocumentAsync) 199var document = await solution.GetRequiredDocumentAsync(documentId, includeSourceGenerated: true, cancellationToken).ConfigureAwait(false); 203var 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\CodeFixContext.cs (4)
30public Document Document 34if (TextDocument is not Document document) 86Document document, 145Document document,
CodeFixes\FixAllOccurrences\BatchFixAllProvider.cs (9)
86private static async Task<ImmutableDictionary<Document, ImmutableArray<Diagnostic>>> DetermineDiagnosticsAsync(FixAllContext fixAllContext, IProgress<CodeAnalysisProgress> progressTracker) 110ImmutableDictionary<Document, ImmutableArray<Diagnostic>> documentToDiagnostics) 136private static async Task<ImmutableArray<Document>> GetAllChangedDocumentsInDiagnosticsOrderAsync( 144using var _1 = ArrayBuilder<Task<ImmutableArray<Document>>>.GetInstance(out var tasks); 147var document = solution.GetRequiredDocument(diagnostic.Location.SourceTree!); 162using var _3 = ArrayBuilder<Document>.GetInstance(out var changedDocuments); 184using var _4 = ArrayBuilder<Document>.GetInstance(out var result); 198ImmutableArray<Document> allChangedDocumentsInDiagnosticsOrder, 215var originalDocument = fixAllContext.Solution.GetRequiredDocument(docId);
CodeFixes\FixAllOccurrences\DocumentBasedFixAllProvider.cs (8)
19/// cref="Diagnostic"/> only affect the <see cref="Document"/> the diagnostic was produced in. 25/// cref="FixAllAsync(FixAllContext, Document, ImmutableArray{Diagnostic})"/> for implementors to process. 53/// <para>The new <see cref="Document"/> representing the content fixed document.</para> 57protected abstract Task<Document?> FixAllAsync(FixAllContext fixAllContext, Document document, ImmutableArray<Diagnostic> diagnostics); 75FixAllContext fixAllContext, Func<Document, Document?, ValueTask> onDocumentFixed) 93var newDocument = await this.FixAllAsync(fixAllContext, document, documentDiagnostics).ConfigureAwait(false);
CodeFixes\FixAllOccurrences\FixAllContext.cs (9)
39public Document? Document => State.Document; 53/// Note that <see cref="GetDocumentDiagnosticsAsync(Document)"/>, <see cref="GetProjectDiagnosticsAsync(Project)"/> and <see cref="GetAllDiagnosticsAsync(Project)"/> methods 82Optional<(Document? document, Project project)> documentAndProject, 110Document document, 147Document document, 222public async Task<ImmutableArray<Diagnostic>> GetDocumentDiagnosticsAsync(Document document) 259internal async Task<ImmutableArray<Diagnostic>> GetDocumentSpanDiagnosticsAsync(Document document, TextSpan filterSpan) 331Optional<(Document? document, Project project)> documentAndProject = default, 344internal 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\FixAllProvider.cs (12)
47/// only affect the <see cref="Document"/> the diagnostic was produced in. 55public static FixAllProvider Create(Func<FixAllContext, Document, ImmutableArray<Diagnostic>, Task<Document?>> fixAllAsync) 61/// fixes for a <see cref="Diagnostic"/> only affect the <see cref="Document"/> the diagnostic was produced in. 75Func<FixAllContext, Document, ImmutableArray<Diagnostic>, Task<Document?>> fixAllAsync, 82Func<FixAllContext, Document, ImmutableArray<Diagnostic>, Task<Document?>> fixAllAsync, 104Func<FixAllContext, Document, ImmutableArray<Diagnostic>, Task<Document?>> fixAllAsync, 110protected override Task<Document?> FixAllAsync(FixAllContext context, Document document, ImmutableArray<Diagnostic> diagnostics)
CodeFixes\FixAllOccurrences\FixAllState.cs (4)
29Document? document, 48protected override FixAllState With(Document? document, Project project, FixAllScope scope, string? codeActionEquivalenceKey) 64ImmutableDictionary<Document, ImmutableArray<Diagnostic>> diagnosticsToFix, 68var 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 async Task<IEnumerable<Diagnostic>> GetDocumentDiagnosticsAsync(Document document, CancellationToken cancellationToken)
CodeFixes\FixAllOccurrences\TextChangeMerger.cs (5)
28private readonly Document _oldDocument; 34public TextChangeMerger(Document document) 44public async Task TryMergeChangesAsync(Document newDocument, CancellationToken cancellationToken) 64public async Task TryMergeChangesAsync(ImmutableArray<Document> newDocuments, CancellationToken cancellationToken) 66foreach (var newDocument in newDocuments)
CodeFixesAndRefactorings\CommonFixAllState.cs (5)
21public Document? Document { get; } 29Document? document, 45protected abstract TFixAllState With(Document? document, Project project, FixAllScope scope, string? codeActionEquivalenceKey); 48Optional<(Document? document, Project project)> documentAndProject = default, 73Optional<(Document? document, Project project)> documentAndProject,
CodeFixesAndRefactorings\DocumentBasedFixAllProviderHelpers.cs (2)
28Func<TFixAllContext, Func<Document, Document?, ValueTask>, Task> getFixedDocumentsAsync)
CodeFixesAndRefactorings\FixAllLogger.cs (1)
155public static void LogDiagnosticsStats(int correlationId, ImmutableDictionary<Document, ImmutableArray<Diagnostic>> documentsAndDiagnosticsToFixMap)
CodeFixesAndRefactorings\IRefactorOrFixAllContext.cs (1)
24Optional<(Document? document, Project project)> documentAndProject = default,
CodeFixesAndRefactorings\IRefactorOrFixAllState.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\DocumentBasedRefactorAllProvider.cs (7)
19/// cref="Document"/>s. 55/// <para>The new <see cref="Document"/> representing the content refactored document.</para> 59protected abstract Task<Document?> RefactorAllAsync( 60RefactorAllContext refactorAllContext, Document document, Optional<ImmutableArray<TextSpan>> refactorAllSpans); 84RefactorAllContext refactorAllContext, Func<Document, Document?, ValueTask> onDocumentRefactored) 100var newDocument = await this.RefactorAllAsync(refactorAllContext, document, spans).ConfigureAwait(false);
CodeRefactorings\FixAllOccurences\RefactorAllContext.cs (3)
31public Document Document => State.Document!; 71Optional<(Document? document, Project project)> documentAndProject, 99public Task<ImmutableDictionary<Document, Optional<ImmutableArray<TextSpan>>>> GetRefactorAllSpansAsync(CancellationToken cancellationToken)
CodeRefactorings\FixAllOccurences\RefactorAllProvider.cs (12)
47/// where refactoring(s) registered by this provider only affect a single <see cref="Document"/>. 55public static RefactorAllProvider Create(Func<RefactorAllContext, Document, Optional<ImmutableArray<TextSpan>>, Task<Document?>> refactorAllAsync) 60/// where refactoring(s) registered by this provider only affect a single <see cref="Document"/>. 74Func<RefactorAllContext, Document, Optional<ImmutableArray<TextSpan>>, Task<Document?>> refactorAllAsync, 81Func<RefactorAllContext, Document, Optional<ImmutableArray<TextSpan>>, Task<Document?>> refactorAllAsync, 98Func<RefactorAllContext, Document, Optional<ImmutableArray<TextSpan>>, Task<Document?>> refactorAllAsync, 104protected override Task<Document?> RefactorAllAsync(RefactorAllContext context, Document document, Optional<ImmutableArray<TextSpan>> refactorAllSpans)
CodeRefactorings\FixAllOccurences\RefactorAllState.cs (7)
35Document document, 59Document? document, 72protected override RefactorAllState With(Document? document, Project project, FixAllScope scope, string? codeActionEquivalenceKey) 89internal async Task<ImmutableDictionary<Document, Optional<ImmutableArray<TextSpan>>>> GetRefactorAllSpansAsync(CancellationToken cancellationToken) 91IEnumerable<Document>? documentsToRefactor = null; 98return ImmutableDictionary<Document, Optional<ImmutableArray<TextSpan>>>.Empty; 119return ImmutableDictionary<Document, Optional<ImmutableArray<TextSpan>>>.Empty;
CodeRefactorings\SyntaxEditorBasedCodeRefactoringProvider.cs (7)
36protected Task<Document> RefactorAsync( 37Document document, 47protected Task<Document> RefactorAllAsync( 48Document document, 64internal static async Task<Document> RefactorAllWithEditorAsync( 65Document document, 79Document document,
Diagnostics\DiagnosticData.cs (1)
212var document = project.GetDocument(diagnostic.Location.SourceTree);
Diagnostics\Extensions.cs (2)
54var tree = textDocument is Document { SupportsSyntaxTree: true } document 118if (documentAnalysisScope.TextDocument is Document 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)
18private static async ValueTask<IEnumerable<TextSpan>> GetSpansAsync(Document document, CancellationToken cancellationToken) 24private static async ValueTask<IEnumerable<TextSpan>> GetSpansAsync(Document document, SyntaxAnnotation annotation, CancellationToken cancellationToken) 33public static async Task<Document> AddImportsAsync(Document document, OptionSet? options = null, CancellationToken cancellationToken = default) 39public static Task<Document> AddImportsAsync(Document document, TextSpan span, OptionSet? options = null, CancellationToken cancellationToken = default) 45public static async Task<Document> AddImportsAsync(Document document, SyntaxAnnotation annotation, OptionSet? options = null, CancellationToken cancellationToken = default) 51public static Task<Document> AddImportsAsync(Document document, IEnumerable<TextSpan> spans, OptionSet? options = null, CancellationToken cancellationToken = default) 54private static async Task<Document> AddImportsFromSyntaxesAsync(Document document, IEnumerable<TextSpan> spans, OptionSet? _, CancellationToken cancellationToken) 70internal static async Task<Document> AddImportsFromSyntaxesAsync(Document document, AddImportPlacementOptions options, CancellationToken cancellationToken) 76internal static async Task<Document> AddImportsFromSyntaxesAsync(Document document, SyntaxAnnotation annotation, AddImportPlacementOptions options, CancellationToken cancellationToken) 82internal static Task<Document> AddImportsFromSyntaxesAsync(Document document, IEnumerable<TextSpan> spans, AddImportPlacementOptions options, CancellationToken cancellationToken) 88internal static async Task<Document> AddImportsFromSymbolAnnotationAsync(Document document, AddImportPlacementOptions options, CancellationToken cancellationToken) 94internal static async Task<Document> AddImportsFromSymbolAnnotationAsync(Document document, SyntaxAnnotation annotation, AddImportPlacementOptions options, CancellationToken cancellationToken) 97internal static Task<Document> AddImportsFromSymbolAnnotationAsync(Document document, IEnumerable<TextSpan> spans, AddImportPlacementOptions options, CancellationToken cancellationToken)
Editing\SolutionEditor.cs (2)
48var currentDoc = changedSolution.GetDocument(docEd.OriginalDocument.Id); 49var newDoc = currentDoc.WithSyntaxRoot(docEd.GetChangedRoot());
Editing\SymbolEditor.cs (7)
44public static SymbolEditor Create(Document document) 67public IEnumerable<Document> GetChangedDocuments() 284var doc = ChangedSolution.GetDocument(declaration.SyntaxTree); 290var newDoc = editor.GetChangedDocument(); 326var doc = ChangedSolution.GetDocument(sourceTree) ?? OriginalSolution.GetDocument(sourceTree); 372var doc = ChangedSolution.GetDocument(d.SyntaxTree); 479var doc = ChangedSolution.GetDocument(declGroup.Key);
Editing\SymbolEditorExtensions.cs (1)
40var doc = editor.OriginalSolution.GetDocument(decl.SyntaxTree);
Editing\SyntaxGenerator.cs (1)
72public 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)
17public 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)
ExtractMethod\ExtractMethodOptions.cs (1)
44public static async ValueTask<ExtractMethodGenerationOptions> GetExtractMethodGenerationOptionsAsync(this Document document, CancellationToken cancellationToken)
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\DependentProjectsFinder.cs (1)
101var document = solution.GetDocument(syntaxTree);
FindSymbols\FindReferences\DependentTypeFinder.cs (1)
245var 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 (28)
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).ConfigureAwait(false)) 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) 367protected static Task FindDocumentsWithCollectionExpressionsAsync<TData>(Project project, IImmutableSet<Document>? documents, Action<Document, TData> processResult, TData processResultData, CancellationToken cancellationToken) 698TSymbol symbol, HashSet<string>? globalAliases, Project project, IImmutableSet<Document>? documents, 699Action<Document, TData> processResult, TData processResultData, 723IImmutableSet<Document>? documents, Action<Document, TData> processResult, 768await foreach (var document in project.GetAllRegularAndSourceGeneratedDocumentsAsync(cancellationToken).ConfigureAwait(false))
FindSymbols\FindReferences\Finders\AbstractReferenceFinder_GlobalSuppressions.cs (1)
205Document document,
FindSymbols\FindReferences\Finders\AliasSymbolReferenceFinder.cs (3)
28IImmutableSet<Document>? documents, 29Action<Document, TData> processResult, 36var document = project.Solution.GetDocument(reference.SyntaxTree);
FindSymbols\FindReferences\Finders\ConstructorSymbolReferenceFinder.cs (6)
57IImmutableSet<Document>? documents, 58Action<Document, TData> processResult, 101private static Task FindDocumentsWithImplicitObjectCreationExpressionAsync<TData>(Project project, IImmutableSet<Document>? documents, Action<Document, TData> processResult, TData processResultData, CancellationToken cancellationToken) 106IImmutableSet<Document>? documents, 108Action<Document, TData> processResult,
FindSymbols\FindReferences\Finders\CrefTypeParameterSymbolReferenceFinder.cs (3)
31IImmutableSet<Document>? documents, 32Action<Document, TData> processResult, 39var document = project.Solution.GetDocument(reference.SyntaxTree);
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)
53IImmutableSet<Document>? documents, 54Action<Document, TData> processResult,
FindSymbols\FindReferences\Finders\ExplicitConstructorInitializerSymbolReferenceFinder.cs (1)
27protected override bool CheckIndex(Document document, string name, SyntaxTreeIndex index)
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\ExplicitOrImplicitConstructorInitializerSymbolReferenceFinder.cs (3)
15protected abstract bool CheckIndex(Document document, string name, SyntaxTreeIndex index); 24IImmutableSet<Document>? documents, 25Action<Document, TData> processResult,
FindSymbols\FindReferences\Finders\FieldSymbolReferenceFinder.cs (2)
33IImmutableSet<Document>? documents, 34Action<Document, TData> processResult,
FindSymbols\FindReferences\Finders\ImplicitConstructorInitializerSymbolReferenceFinder.cs (1)
33protected override bool CheckIndex(Document document, string name, SyntaxTreeIndex index)
FindSymbols\FindReferences\Finders\IReferenceFinder.cs (2)
55Project project, IImmutableSet<Document>? documents, 56Action<Document, TData> processResult, TData processResultData,
FindSymbols\FindReferences\Finders\MethodTypeParameterSymbolReferenceFinder.cs (2)
51IImmutableSet<Document>? documents, 52Action<Document, TData> processResult,
FindSymbols\FindReferences\Finders\NamedTypeSymbolReferenceFinder.cs (4)
57IImmutableSet<Document>? documents, 58Action<Document, TData> processResult, 84IImmutableSet<Document>? documents, 85Action<Document, TData> processResult,
FindSymbols\FindReferences\Finders\NamespaceSymbolReferenceFinder.cs (2)
30IImmutableSet<Document>? documents, 31Action<Document, TData> processResult,
FindSymbols\FindReferences\Finders\OperatorSymbolReferenceFinder.cs (4)
25IImmutableSet<Document>? documents, 26Action<Document, TData> processResult, 38IImmutableSet<Document>? documents, 40Action<Document, TData> processResult,
FindSymbols\FindReferences\Finders\OrdinaryMethodReferenceFinder.cs (8)
71IImmutableSet<Document>? documents, 72Action<Document, TData> processResult, 113private static Task FindDocumentsWithDeconstructionAsync<TData>(Project project, IImmutableSet<Document>? documents, Action<Document, TData> processResult, TData processResultData, CancellationToken cancellationToken) 116private static Task FindDocumentsWithAwaitExpressionAsync<TData>(Project project, IImmutableSet<Document>? documents, Action<Document, TData> processResult, TData processResultData, CancellationToken cancellationToken) 119private 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)
23IImmutableSet<Document>? documents, 24Action<Document, TData> processResult,
FindSymbols\FindReferences\Finders\PropertyAccessorSymbolReferenceFinder.cs (2)
43IImmutableSet<Document>? documents, 44Action<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)
28IImmutableSet<Document>? documents, 29Action<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; 75Document 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)
83ValueTask 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, 193var originalDocument = solution.GetDocument(location.SyntaxTree); 206var 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\NavigateToSearchIndex.cs (3)
46public static ValueTask<NavigateToSearchIndex> GetRequiredIndexAsync(Document document, CancellationToken cancellationToken) 52public static ValueTask<NavigateToSearchIndex?> GetIndexAsync(Document document, CancellationToken cancellationToken) 58public static ValueTask<NavigateToSearchIndex?> 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)
17public Task<Document> FormatAsync(Document document, IEnumerable<TextSpan>? spans, LineFormattingOptions lineFormattingOptions, SyntaxFormattingOptions? syntaxFormattingOptions, CancellationToken cancellationToken)
Formatting\Formatter.cs (26)
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) 110private static ISyntaxFormatting GetSyntaxFormatting(Document document) 116internal static Task<Document> FormatAsync(Document document, SyntaxAnnotation annotation, SyntaxFormattingOptions options, CancellationToken cancellationToken) 119internal static Task<Document> FormatAsync(Document document, SyntaxAnnotation annotation, SyntaxFormattingOptions options, ImmutableArray<AbstractFormattingRule> rules, CancellationToken cancellationToken) 122internal static async Task<Document> FormatAsync(Document document, SyntaxAnnotation annotation, OptionSet? optionSet, ImmutableArray<AbstractFormattingRule> rules, CancellationToken cancellationToken) 324internal static async ValueTask<(SyntaxFormattingOptions? Syntax, LineFormattingOptions Line)> GetFormattingOptionsAsync(Document document, OptionSet? optionSet, CancellationToken cancellationToken) 353public static async Task<Document> OrganizeImportsAsync(Document document, CancellationToken cancellationToken = default) 366internal 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);
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)
18using DocumentAndHashBuilder = ArrayBuilder<(Document newDocument, ImmutableArray<byte> newContentHash)>; 30var newDocument = newSolution.GetRequiredDocument(documentId); 59var firstNewDocument = newDocumentsAndHashes[0].newDocument; 101var firstNewDocument = newDocumentsAndHashes[0].newDocument; 102var firstOldDocument = oldSolution.GetRequiredDocument(firstNewDocument.Id); 111var siblingNewDocument = newDocumentsAndHashes[i].newDocument; 112var siblingOldDocument = oldSolution.GetRequiredDocument(siblingNewDocument.Id); 136Document oldDocument, 137Document 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 (2)
52IAliasSymbol? alias, Document document, CancellationToken cancellationToken) 175var document = await solution.GetRequiredDocumentAsync(this.Document, includeSourceGenerated: true, cancellationToken).ConfigureAwait(false);
Remote\RemoteUtilities.cs (3)
36var oldDoc = oldSolution.GetDocument(docId); 37var newDoc = newSolution.GetDocument(docId); 68var document = await oldSolution.GetDocumentAsync(tuple.documentId, includeSourceGenerated: true, cancellationToken).ConfigureAwait(false);
Rename\ConflictEngine\ConflictResolver.cs (2)
131private static SyntaxNode? GetExpansionTargetForLocationPerLanguage(SyntaxToken tokenOrNode, Document document) 138private static bool LocalVariableConflictPerLanguage(SyntaxToken tokenOrNode, Document document, ImmutableArray<ISymbol> newReferencedSymbols)
Rename\ConflictEngine\ConflictResolver.Session.cs (13)
213var declarationDocument = await conflictResolution.CurrentSolution.GetRequiredDocumentAsync( 271var originalDoc = await conflictResolution.OldSolution.GetRequiredDocumentAsync( 294var changeDoc = await conflictResolution.CurrentSolution.GetRequiredDocumentAsync( 327var newDocument = conflictResolution.CurrentSolution.GetRequiredDocument(documentId); 352var newDocument = await conflictResolution.CurrentSolution.GetRequiredDocumentAsync( 355var baseDocument = await conflictResolution.OldSolution.GetRequiredDocumentAsync( 445var newDocument = conflictResolution.CurrentSolution.GetRequiredDocument(unprocessedDocumentIdWithPotentialDeclarationConflicts); 447var baseDocument = conflictResolution.OldSolution.GetRequiredDocument(unprocessedDocumentIdWithPotentialDeclarationConflicts); 631private ImmutableArray<ISymbol> GetSymbolsInNewSolution(Document newDocument, SemanticModel newDocumentSemanticModel, RenameActionAnnotation conflictAnnotation, SyntaxNodeOrToken tokenOrNode) 665var document = await conflictResolution.CurrentSolution.GetRequiredDocumentAsync( 712IEnumerable<Document> documents, 718foreach (var document in documents) 774var document = await originalSolution.GetRequiredDocumentAsync(
Rename\ConflictEngine\MutableConflictResolution.cs (2)
72var document = await CurrentSolution.GetRequiredDocumentAsync( 93internal void RenameDocumentToMatchNewSymbol(Document document)
Rename\ConflictEngine\RenamedSpansTracker.cs (1)
159var document = await solution.GetRequiredDocumentAsync(
Rename\IRemoteRenamerService.cs (1)
90var document = await solution.GetRequiredDocumentAsync(DocumentId, includeSourceGenerated: true, cancellation).ConfigureAwait(false);
Rename\Renamer.cs (2)
69Document document, 98Document 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)
39internal override async Task<Solution> GetModifiedSolutionAsync(Document document, DocumentRenameOptions options, CancellationToken cancellationToken) 50public static SyncNamespaceDocumentAction? TryCreate(Document document, IReadOnlyList<string> newFolders) 62private static AnalysisResult? Analyze(Document document, IReadOnlyCollection<string> newFolders)
Rename\RenameRewriterParameters.cs (2)
15Document document, 49internal readonly Document Document = document;
Rename\RenameUtilities.cs (2)
120internal static IEnumerable<Document> GetDocumentsAffectedByRename(ISymbol symbol, Solution solution, IEnumerable<RenameLocation> renameLocations) 338Document document, int position, CancellationToken cancellationToken)
Rename\SymbolicRenameLocations.ReferenceProcessing.cs (5)
235var document = solution.GetRequiredDocument(location.SourceTree); 357foreach (var document in documentsGroupedByLanguage) 379Document document, string renameText, ISyntaxFactsService syntaxFactsService, 398Document document, string renameText, ArrayBuilder<RenameLocation> renameLocations, CancellationToken cancellationToken) 416Document document,
Shared\Extensions\DocumentExtensions.cs (4)
14public static async ValueTask<SyntaxTreeIndex> GetSyntaxTreeIndexAsync(this Document document, CancellationToken cancellationToken) 21public static ValueTask<SyntaxTreeIndex?> GetSyntaxTreeIndexAsync(this Document document, bool loadOnly, CancellationToken cancellationToken) 24internal 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, 197Document document, 234Document 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\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Services\SemanticFacts\ISemanticFacts.cs (1)
133Task<ISymbol?> GetInterceptorSymbolAsync(Document document, int position, CancellationToken cancellationToken);
src\roslyn\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\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeCleanup\CodeCleanupHelpers.cs (4)
14public static async Task<Document> CleanupSyntaxAsync( 15Document document, CodeCleanupOptions options, CancellationToken cancellationToken) 21var document1 = await syntaxFormatting.FormatAsync(document, Formatter.Annotation, options.FormattingOptions, cancellationToken).ConfigureAwait(false); 24var document2 = await syntaxFormatting.FormatAsync(document1, SyntaxAnnotation.ElasticAnnotation, options.FormattingOptions, cancellationToken).ConfigureAwait(false);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeCleanup\CodeCleanupOptionsProviders.cs (1)
27public static async ValueTask<CodeCleanupOptions> GetCodeCleanupOptionsAsync(this Document document, CancellationToken cancellationToken)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeFixes\FixAllContextHelper.cs (10)
22public static async Task<ImmutableDictionary<Document, ImmutableArray<Diagnostic>>> GetDocumentDiagnosticsToFixAsync( 29var document = fixAllContext.Document; 41return ImmutableDictionary<Document, ImmutableArray<Diagnostic>>.Empty.SetItem(document, documentDiagnostics); 106return ImmutableDictionary<Document, ImmutableArray<Diagnostic>>.Empty; 113static async Task<ImmutableDictionary<Document, ImmutableArray<Diagnostic>>> GetSpanDiagnosticsAsync( 115IEnumerable<KeyValuePair<Document, ImmutableArray<TextSpan>>> documentsAndSpans) 117var builder = PooledDictionary<Document, ArrayBuilder<Diagnostic>>.GetInstance(); 132private static async Task<ImmutableDictionary<Document, ImmutableArray<Diagnostic>>> GetDocumentDiagnosticsToFixAsync( 137var builder = ImmutableDictionary.CreateBuilder<Document, ImmutableArray<Diagnostic>>(); 142if (textDocument is not Document document)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeFixes\ForkingSyntaxEditorBasedCodeFixProvider.cs (2)
38Document document, 55Document document,
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeFixes\MultiProjectSafeFixAllProvider.cs (2)
78var document = fixAllContext.Solution.GetRequiredDocument(documentId); 91var linkedDocument = fixAllContext.Solution.GetRequiredDocument(linkedDocumentId);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeFixes\SyntaxEditorBasedCodeFixProvider.cs (8)
63protected Func<CancellationToken, Task<Document>> GetDocumentUpdater(CodeFixContext context, Diagnostic? diagnostic = null) 69private Task<Document> FixAllAsync( 70Document document, ImmutableArray<Diagnostic> diagnostics, CancellationToken cancellationToken) 78internal static async Task<Document> FixAllWithEditorAsync( 79Document document, 98Document document, ImmutableArray<Diagnostic> diagnostics, SyntaxEditor editor, CancellationToken cancellationToken); 111protected virtual bool IncludeDiagnosticDuringFixAll(Diagnostic diagnostic, Document document, string? equivalenceKey, CancellationToken cancellationToken) 122/// cref="IncludeDiagnosticDuringFixAll(Diagnostic, Document, string, CancellationToken)"/> should be overridden
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeFixesAndRefactorings\AbstractFixAllSpanMappingService.cs (9)
20protected abstract Task<ImmutableDictionary<Document, ImmutableArray<TextSpan>>> GetFixAllSpansIfWithinGlobalStatementAsync( 21Document document, TextSpan span, CancellationToken cancellationToken); 23public Task<ImmutableDictionary<Document, ImmutableArray<TextSpan>>> GetFixAllSpansAsync( 24Document document, TextSpan triggerSpan, FixAllScope fixAllScope, CancellationToken cancellationToken) 32private async Task<ImmutableDictionary<Document, ImmutableArray<TextSpan>>> GetFixAllSpansAsync( 33Document document, TextSpan span, bool fixAllInContainingMember, CancellationToken cancellationToken) 50var builder = PooledDictionary<Document, ArrayBuilder<TextSpan>>.GetInstance(); 53var documentForLocation = document.Project.GetDocument(syntaxRef.SyntaxTree); 73Document document,
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeFixesAndRefactorings\FixAllHelper.cs (1)
14Document triggerDocument,
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeFixesAndRefactorings\IFixAllSpanMappingService.cs (2)
30Task<ImmutableDictionary<Document, ImmutableArray<TextSpan>>> GetFixAllSpansAsync( 31Document document, TextSpan triggerSpan, FixAllScope fixAllScope, CancellationToken cancellationToken);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\AbstractCodeGenerationService.cs (12)
229private async Task<Document> GetEditAsync( 242var oldDocument = context.Solution.GetRequiredDocument(destinationTree); 252var newDocument = oldDocument.WithSyntaxRoot(currentRoot); 391public virtual Task<Document> AddEventAsync( 401public Task<Document> AddFieldAsync(CodeGenerationSolutionContext context, INamedTypeSymbol destination, IFieldSymbol field, CancellationToken cancellationToken) 410public Task<Document> AddPropertyAsync(CodeGenerationSolutionContext context, INamedTypeSymbol destination, IPropertySymbol property, CancellationToken cancellationToken) 419public Task<Document> AddNamedTypeAsync(CodeGenerationSolutionContext context, INamedTypeSymbol destination, INamedTypeSymbol namedType, CancellationToken cancellationToken) 428public Task<Document> AddNamedTypeAsync(CodeGenerationSolutionContext context, INamespaceSymbol destination, INamedTypeSymbol namedType, CancellationToken cancellationToken) 437public Task<Document> AddNamespaceAsync(CodeGenerationSolutionContext context, INamespaceSymbol destination, INamespaceSymbol @namespace, CancellationToken cancellationToken) 446public Task<Document> AddMethodAsync(CodeGenerationSolutionContext context, INamedTypeSymbol destination, IMethodSymbol method, CancellationToken cancellationToken) 455public Task<Document> AddMembersAsync(CodeGenerationSolutionContext context, INamedTypeSymbol destination, IEnumerable<ISymbol> members, CancellationToken cancellationToken) 464public Task<Document> AddNamespaceOrTypeAsync(CodeGenerationSolutionContext context, INamespaceSymbol destination, INamespaceOrTypeSymbol namespaceOrType, CancellationToken cancellationToken)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\AbstractCodeGenerationService_FindDeclaration.cs (1)
79var document = solution.GetDocument(syntaxTree);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\CleanCodeGenerationOptions.cs (1)
39public static async ValueTask<CleanCodeGenerationOptions> GetCleanCodeGenerationOptionsAsync(this Document document, CancellationToken cancellationToken)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\CodeGenerationContext.cs (3)
136public Func<Document, bool>? AllowGenerationIntoHiddenCode { get; } 153Func<Document, bool>? allowGenerationIntoHiddenCode = null) 201Optional<Func<Document, bool>?> allowGenerationIntoHiddenCode = default)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\CodeGenerationOptionsProviders.cs (2)
34public static async ValueTask<CodeGenerationOptions> GetCodeGenerationOptionsAsync(this Document document, CancellationToken cancellationToken) 40public static async ValueTask<CodeGenerationContextInfo> GetCodeGenerationInfoAsync(this Document document, CodeGenerationContext context, CancellationToken cancellationToken)
src\roslyn\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\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\ICodeGenerationService.cs (9)
133Task<Document> AddEventAsync(CodeGenerationSolutionContext context, INamedTypeSymbol destination, IEventSymbol @event, CancellationToken cancellationToken); 138Task<Document> AddFieldAsync(CodeGenerationSolutionContext context, INamedTypeSymbol destination, IFieldSymbol field, CancellationToken cancellationToken); 143Task<Document> AddMethodAsync(CodeGenerationSolutionContext context, INamedTypeSymbol destination, IMethodSymbol method, CancellationToken cancellationToken); 148Task<Document> AddPropertyAsync(CodeGenerationSolutionContext context, INamedTypeSymbol destination, IPropertySymbol property, CancellationToken cancellationToken); 153Task<Document> AddNamedTypeAsync(CodeGenerationSolutionContext context, INamedTypeSymbol destination, INamedTypeSymbol namedType, CancellationToken cancellationToken); 158Task<Document> AddNamedTypeAsync(CodeGenerationSolutionContext context, INamespaceSymbol destination, INamedTypeSymbol namedType, CancellationToken cancellationToken); 163Task<Document> AddNamespaceAsync(CodeGenerationSolutionContext context, INamespaceSymbol destination, INamespaceSymbol @namespace, CancellationToken cancellationToken); 168Task<Document> AddNamespaceOrTypeAsync(CodeGenerationSolutionContext context, INamespaceSymbol destination, INamespaceOrTypeSymbol namespaceOrType, CancellationToken cancellationToken); 173Task<Document> AddMembersAsync(CodeGenerationSolutionContext context, INamedTypeSymbol destination, IEnumerable<ISymbol> members, CancellationToken cancellationToken);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeRefactorings\CodeRefactoringContextExtensions.cs (3)
59public static async Task<TSyntaxNode?> TryGetRelevantNodeAsync<TSyntaxNode>(this Document document, TextSpan span, CancellationToken cancellationToken) where TSyntaxNode : SyntaxNode 76this Document document, TextSpan span, CancellationToken cancellationToken) where TSyntaxNode : SyntaxNode 82this Document document, TextSpan span, bool allowEmptyNodes, CancellationToken cancellationToken) where TSyntaxNode : SyntaxNode
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Editing\ImportAdderService.cs (6)
30public async Task<Document> AddImportsAsync( 31Document document, 109private async Task<Document> AddImportDirectivesFromSyntaxesAsync( 110Document document, 170private async Task<Document> AddImportDirectivesFromSymbolAnnotationsAsync( 171Document document,
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\ContextQuery\ISyntaxContextService.cs (1)
12SyntaxContext CreateContext(Document document, SemanticModel semanticModel, int position, CancellationToken cancellationToken);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\ContextQuery\SyntaxContext.cs (2)
14Document document, 48public Document Document { get; } = document;
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\DocumentExtensions.cs (19)
27public static TLanguageService? GetLanguageService<TLanguageService>(this Document? document) where TLanguageService : class, ILanguageService 30public static TLanguageService GetRequiredLanguageService<TLanguageService>(this Document document) where TLanguageService : class, ILanguageService 33public static async ValueTask<SemanticModel> GetRequiredSemanticModelAsync(this Document document, CancellationToken cancellationToken) 44public static async ValueTask<SemanticModel> GetRequiredNullableDisabledSemanticModelAsync(this Document document, CancellationToken cancellationToken) 57public static async ValueTask<SyntaxTree> GetRequiredSyntaxTreeAsync(this Document document, CancellationToken cancellationToken) 67public static SyntaxTree GetRequiredSyntaxTreeSynchronously(this Document document, CancellationToken cancellationToken) 74public static async ValueTask<SyntaxNode> GetRequiredSyntaxRootAsync(this Document document, CancellationToken cancellationToken) 84public static SyntaxNode GetRequiredSyntaxRootSynchronously(this Document document, CancellationToken cancellationToken) 97public static bool IsRazorSourceGeneratedDocument(this Document? document) 125public static ValueTask<SemanticModel> ReuseExistingSpeculativeModelAsync(this Document document, int position, CancellationToken cancellationToken) 142public static async ValueTask<SemanticModel> ReuseExistingSpeculativeModelAsync(this Document document, TextSpan span, CancellationToken cancellationToken) 167public static ValueTask<SemanticModel> ReuseExistingSpeculativeModelAsync(this Document document, SyntaxNode? node, CancellationToken cancellationToken) 178public static async Task<bool> HasAnyErrorsAsync(this Document document, CancellationToken cancellationToken, List<string>? ignoreErrorCode = null) 184public static async Task<ImmutableArray<Diagnostic>> GetErrorsAsync(this Document document, CancellationToken cancellationToken, IList<string>? ignoreErrorCode = null) 200public static async Task VerifyNoErrorsAsync(this Document newDocument, string message, CancellationToken cancellationToken, List<string>? ignoreErrorCodes = null) 212public static bool IsGeneratedCode(this Document document, CancellationToken cancellationToken) 219public static async Task<bool> IsGeneratedCodeAsync(this Document document, CancellationToken cancellationToken) 226public static IEnumerable<Document> GetLinkedDocuments(this Document document)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\ISolutionExtensions.cs (4)
36public static Document GetRequiredDocument(this Solution solution, SyntaxTree syntaxTree) 50public static Document GetRequiredDocument(this Solution solution, DocumentId documentId) 90public static ValueTask<Document> GetRequiredDocumentAsync(this Solution solution, DocumentId documentId, CancellationToken cancellationToken) 93public static async ValueTask<Document> GetRequiredDocumentAsync(this Solution solution, DocumentId documentId, bool includeSourceGenerated, CancellationToken cancellationToken)
src\roslyn\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\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\TextDocumentExtensions.cs (1)
31case Document document:
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Formatting\DocumentFormattingOptionsProviders.cs (1)
22public static async ValueTask<DocumentFormattingOptions> GetDocumentFormattingOptionsAsync(this Document document, CancellationToken cancellationToken)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Formatting\FormatterShared.cs (4)
21public Task<Document> FormatAsync(Document document, SyntaxAnnotation annotation, SyntaxFormattingOptions options, CancellationToken cancellationToken) 24public async Task<Document> FormatAsync(Document document, SyntaxAnnotation annotation, SyntaxFormattingOptions options, ImmutableArray<AbstractFormattingRule> rules, CancellationToken cancellationToken)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Formatting\LineFormattingOptionsProviders.cs (1)
17public static async ValueTask<LineFormattingOptions> GetLineFormattingOptionsAsync(this Document document, CancellationToken cancellationToken)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Formatting\SyntaxFormattingOptionsProviders.cs (1)
17public static async ValueTask<SyntaxFormattingOptions> GetSyntaxFormattingOptionsAsync(this Document document, CancellationToken cancellationToken)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\LanguageServices\GeneratedCodeRecognition\AbstractGeneratedCodeRecognitionService.cs (3)
17public bool IsGeneratedCode(Document document, CancellationToken cancellationToken) 24public async Task<bool> IsGeneratedCodeAsync(Document document, CancellationToken cancellationToken) 30private static bool IsGeneratedCode(SyntaxTree syntaxTree, Document document, CancellationToken cancellationToken)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\LanguageServices\GeneratedCodeRecognition\IGeneratedCodeRecognitionService.cs (2)
14bool IsGeneratedCode(Document document, CancellationToken cancellationToken); 17Task<bool> IsGeneratedCodeAsync(Document document, CancellationToken cancellationToken);
src\roslyn\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\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\LanguageServices\InitializeParameter\IInitializeParameterService.cs (1)
22Document document, IParameterSymbol parameter, ISymbol fieldOrProperty, CancellationToken cancellationToken);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\LanguageServices\MoveDeclarationNearReference\AbstractMoveDeclarationNearReferenceService.cs (9)
36protected abstract Task<bool> TypesAreCompatibleAsync(Document document, ILocalSymbol localSymbol, TLocalDeclarationStatementSyntax declarationStatement, SyntaxNode right, CancellationToken cancellationToken); 38public async Task<(bool canMove, bool mayChangeSemantics)> CanMoveDeclarationNearReferenceAsync(Document document, SyntaxNode node, CancellationToken cancellationToken) 47private async Task<State> ComputeStateAsync(Document document, SyntaxNode node, CancellationToken cancellationToken) 77public async Task<Document> MoveDeclarationNearReferenceAsync( 78Document document, SyntaxNode localDeclarationStatement, CancellationToken cancellationToken) 119Document document, State state, SyntaxEditor editor, SyntaxAnnotation warningAnnotation, CancellationToken cancellationToken) 160Document document, State state, SyntaxEditor editor, SyntaxAnnotation warningAnnotation) 205Document document, 236Document document, State state)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\LanguageServices\MoveDeclarationNearReference\AbstractMoveDeclarationNearReferenceService.State.cs (2)
40Document document, 55Document document,
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\LanguageServices\MoveDeclarationNearReference\IMoveDeclarationNearReferenceService.cs (3)
17Task<(bool canMove, bool mayChangeSemantics)> CanMoveDeclarationNearReferenceAsync(Document document, SyntaxNode localDeclarationStatement, CancellationToken cancellationToken); 24Task<Document> MoveDeclarationNearReferenceAsync(Document document, SyntaxNode localDeclarationStatement, CancellationToken cancellationToken);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\LanguageServices\RemoveUnnecessaryImports\AbstractRemoveUnnecessaryImportsService.cs (6)
19public Task<Document> RemoveUnnecessaryImportsAsync(Document document, CancellationToken cancellationToken) 22public abstract Task<Document> RemoveUnnecessaryImportsAsync(Document fromDocument, Func<SyntaxNode, bool>? predicate, CancellationToken cancellationToken); 25Document document, Func<SyntaxNode, bool> predicate, CancellationToken cancellationToken) 32foreach (var current in document.GetLinkedDocuments())
src\roslyn\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\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\LanguageServices\ReplaceDiscardDeclarationsWithAssignments\IReplaceDiscardDeclarationsWithAssignmentsService.cs (1)
30Task<SyntaxNode> ReplaceAsync(Document document, SyntaxNode memberDeclaration, CancellationToken cancellationToken);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\LanguageServices\SemanticsFactsService\AbstractSemanticFactsService.cs (1)
269public Task<ISymbol?> GetInterceptorSymbolAsync(Document document, int position, CancellationToken cancellationToken)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\NamingStyles\NamingStylePreferencesProviders.cs (1)
15public static async ValueTask<NamingStylePreferences> GetNamingStylePreferencesAsync(this Document document, CancellationToken cancellationToken)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Options\MemberDisplayOptions.cs (1)
50public static async ValueTask<MemberDisplayOptions> GetMemberDisplayOptionsAsync(this Document document, CancellationToken cancellationToken)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\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);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\SemanticModelReuse\SemanticModelWorkspaceServiceFactory.SemanticModelWorkspaceService.cs (3)
94public async ValueTask<SemanticModel> ReuseExistingSpeculativeModelAsync(Document document, SyntaxNode node, CancellationToken cancellationToken) 138ImmutableDictionary<DocumentId, SemanticModelReuseInfo?> map, Document document, SyntaxNode bodyNode, CancellationToken cancellationToken) 176Document document,
src\roslyn\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, 238var newDocument = document.WithSyntaxRoot(newRoot); 294private async Task<Document> RemoveUnusedNamespaceImportsAsync( 295Document document,
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Simplification\ISimplificationService.cs (2)
30Task<Document> ReduceAsync( 31Document document,
src\roslyn\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\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Utilities\ParsedDocument.cs (6)
15/// Represents a <see cref="Document"/> content that has been parsed. 20/// In general, any feature API that accepts <see cref="ParsedDocument"/> should be synchronous and not access <see cref="Document"/> or <see cref="Solution"/> snapshots. 31public static async ValueTask<ParsedDocument> CreateAsync(Document document, CancellationToken cancellationToken) 39public static ParsedDocument CreateSynchronously(Document document, CancellationToken cancellationToken) 66/// Equivalent semantics to <see cref="Document.GetTextChangesAsync(Document, CancellationToken)"/>
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Utilities\SemanticDocument.cs (3)
13internal sealed class SemanticDocument(Document document, SourceText text, SyntaxNode root, SemanticModel semanticModel) 18public static new async Task<SemanticDocument> CreateAsync(Document document, CancellationToken cancellationToken) 28var newDocument = this.Document.WithSyntaxRoot(root);
src\roslyn\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);
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 (4)
108public Document AddDocument(ProjectId projectId, string name, SourceText text) 134public Document AddDocument(DocumentInfo documentInfo) 151var doc = this.CurrentSolution.GetDocument(documentId); 164var doc = this.CurrentSolution.GetDocument(documentId);
Workspace\DocumentEventArgs.cs (2)
11public Document Document { get; } 13public 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)
19Document oldDocument, 20Document newDocument, 24Document document,
Workspace\Host\DocumentService\DocumentExcerptHelper.cs (2)
15public static bool CanExcerpt(Document document) 26public static async Task<ExcerptResult?> TryExcerptAsync(Document document, TextSpan span, ExcerptMode mode, ClassificationOptions classificationOptions, CancellationToken cancellationToken)
Workspace\Host\DocumentService\IDocumentExcerptService.cs (7)
14/// excerpt some part of <see cref="Document"/> 19/// return <see cref="ExcerptResult"/> of given <see cref="Document"/> and <see cref="TextSpan"/> 23Task<ExcerptResult?> TryExcerptAsync(Document document, TextSpan span, ExcerptMode mode, ClassificationOptions classificationOptions, CancellationToken cancellationToken); 38internal readonly struct ExcerptResult(SourceText content, TextSpan mappedSpan, ImmutableArray<ClassifiedSpan> classifiedSpans, Document document, TextSpan span) 58/// should be same document in <see cref="IDocumentExcerptService.TryExcerptAsync(Document, TextSpan, ExcerptMode, ClassificationOptions, CancellationToken)" /> 60public readonly Document Document = document; 65/// should be same text span in <see cref="IDocumentExcerptService.TryExcerptAsync(Document, TextSpan, ExcerptMode, ClassificationOptions, CancellationToken)" />
Workspace\Host\DocumentService\ISpanMappingService.cs (3)
30Document oldDocument, 31Document newDocument, 47Task<ImmutableArray<MappedSpanResult>> MapSpansAsync(Document document, IEnumerable<TextSpan> spans, CancellationToken cancellationToken);
Workspace\Host\DocumentService\SpanMappingHelper.cs (2)
14public static bool CanMapSpans(Document document) 25public static async Task<ImmutableArray<MappedSpanResult>?> TryGetMappedSpanResultAsync(Document document, ImmutableArray<TextSpan> textSpans, 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 async Task<bool> ChecksumMatchesAsync(Document document, string name, Checksum checksum, CancellationToken cancellationToken) 38public async Task<Stream?> ReadStreamAsync(Document document, string name, CancellationToken cancellationToken) 53public async Task<Stream?> ReadStreamAsync(Document document, string name, Checksum? checksum, CancellationToken cancellationToken) 62public async Task<bool> WriteStreamAsync(Document document, string name, Stream stream, CancellationToken cancellationToken) 77public async Task<bool> WriteStreamAsync(Document document, string name, Stream stream, Checksum? checksum, CancellationToken cancellationToken)
Workspace\IWorkspaceConfigurationService.cs (1)
27/// cref="Document"/>, <see cref="SyntaxTree"/>, etc.) to which it would be impractical to flow these options
Workspace\ProjectSystem\ProjectSystemProject.BatchingDocumentCollection.cs (1)
506var documentToReload = w.CurrentSolution.GetDocument(documentId);
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)
62var otherDocument = otherTextDocument as Document ?? 70internal bool HasTextChanged(Document otherDocument) 384public Document WithSourceCodeKind(SourceCodeKind kind) 390public Document WithText(SourceText text) 406public Document WithSyntaxRoot(SyntaxNode root) 422public Document WithName(string name) 428public Document WithFolders(IEnumerable<string> folders) 434public Document WithFilePath(string? filePath) 441public async Task<IEnumerable<TextChange>> GetTextChangesAsync(Document oldDocument, CancellationToken cancellationToken = default) 447/// Similar to <see cref="GetTextChangesAsync(Document, CancellationToken)"/>, but should be used when in a forced 451Document oldDocument, CancellationToken cancellationToken) 459bool useAsync, Document oldDocument, CancellationToken cancellationToken) 518/// <see cref="Document" />. <see cref="Document"/>s are considered to be linked if they 529internal Document WithFrozenPartialSemantics(CancellationToken cancellationToken) 538/// <para/> Note: this will give back a solution where this <see cref="Document"/>'s project will not run generators 552internal 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)
22Task<ImmutableArray<TextChange>> GetTextChangesAsync(Document oldDocument, Document newDocument, CancellationToken cancellationToken); 32Task<ImmutableArray<TextChange>> GetTextChangesAsync(Document oldDocument, Document newDocument, TextDifferenceTypes preferredDifferenceType, CancellationToken cancellationToken);
Workspace\Solution\Project.cs (14)
31private Dictionary<DocumentId, Document?>? _idToDocumentMap; 198public IEnumerable<Document> Documents => DocumentIds.Select(GetDocument)!; 237public Document? GetDocument(SyntaxTree? syntaxTree) 243public Document? GetDocument(DocumentId documentId) 290internal async ValueTask<Document?> GetDocumentAsync(DocumentId documentId, bool includeSourceGenerated = false, CancellationToken cancellationToken = default) 292var document = GetDocument(documentId); 325internal async IAsyncEnumerable<Document> GetAllRegularAndSourceGeneratedDocumentsAsync([EnumeratorCancellation] CancellationToken cancellationToken) 327foreach (var document in this.Documents) 488private async Task<bool> ContainsAsync(Func<Document, Task<bool>> predicateAsync) 497private static readonly Func<DocumentId, Project, Document?> s_tryCreateDocumentFunction = 703public Document AddDocument(string name, SyntaxNode syntaxRoot, IEnumerable<string>? folders = null, string? filePath = null) 715public Document AddDocument(string name, SourceText text, IEnumerable<string>? folders = null, string? filePath = null) 724public Document AddDocument(string name, string text, IEnumerable<string>? folders = null, string? filePath = null) 837internal async ValueTask<Document?> GetDocumentAsync(ImmutableArray<byte> contentHash, CancellationToken cancellationToken)
Workspace\Solution\Solution.cs (5)
247public Document? GetDocument(DocumentId? documentId) 253internal async ValueTask<Document?> GetDocumentAsync(DocumentId? documentId, bool includeSourceGenerated = false, CancellationToken cancellationToken = default) 323public Document? GetDocument(SyntaxTree? syntaxTree) 326internal Document? GetDocument(SyntaxTree? syntaxTree, ProjectId? projectId) 1670internal Document WithFrozenSourceGeneratedDocument(
Workspace\Solution\SourceGeneratedDocument.cs (2)
12/// A <see cref="Document"/> that was generated by an <see cref="ISourceGenerator" />. 36internal override Document WithFrozenPartialSemantics(bool forceFreeze, CancellationToken cancellationToken)
Workspace\Solution\TextDocument.cs (2)
84/// <remarks>This is internal for the same reason <see cref="Document.GetSyntaxTreeSynchronously(CancellationToken)"/> is internal: 98/// <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)
18public static ImmutableArray<Document> GetRelatedDocumentsWithChanges(this SourceText text) 45/// Gets the <see cref="Document"/> from the corresponding workspace's current solution that is associated with the source text's container 48public static Document? GetOpenDocumentInCurrentContextWithChanges(this SourceText text) 49=> (Document?)text.GetOpenTextDocumentInCurrentContextWithChanges(sourceDocumentOnly: true); 105public static ImmutableArray<Document> GetRelatedDocuments(this SourceTextContainer container) 125public static Document? GetOpenDocumentInCurrentContext(this SourceTextContainer container) 143internal static Document? GetDocumentWithFrozenPartialSemantics(this SourceText text, CancellationToken cancellationToken) 145var document = text.GetOpenDocumentInCurrentContextWithChanges();
Workspace\Workspace.cs (13)
351var relatedDocument = solution.GetRequiredDocument(relatedDocumentId); 602protected virtual void OnDocumentTextChanged(Document document) 1235/// When a <see cref="Document"/>s text is changed, we need to make sure all of the linked files also have their 1304var newDocument = newSolution.GetRequiredDocument(documentId); 1324var newDocument = newSolution.GetDocument(updatedDocumentId); 1618using var _2 = PooledHashSet<Document>.GetInstance(out var infoChangedNewDocuments); 1625var oldDoc = projectChange.OldProject.GetRequiredDocument(docId); 1626var newDoc = projectChange.NewProject.GetRequiredDocument(docId); 1640foreach (var newDoc in infoChangedNewDocuments) 1935var document = projectChanges.NewProject.GetDocument(documentId)!; 1989var oldDoc = projectChanges.OldProject.GetDocument(documentId)!; 1990var newDoc = projectChanges.NewProject.GetDocument(documentId)!; 2045doc is Document sourceDoc ? sourceDoc.SourceCodeKind : SourceCodeKind.Regular,
Workspace\Workspace_Editor.cs (4)
369var oldDocument = oldSolution.GetDocument(documentId); 420var newDoc = newSolution.GetRequiredDocument(documentId); 657var document = oldSolution.GetDocument(documentId); 697var newDoc = newSolution.GetRequiredDocument(documentId);
Workspace\Workspace_Events.cs (5)
56/// Registers a handler that is fired when a <see cref="Document"/> is opened in the editor. 62/// Registers a handler that is fired when a <see cref="Document"/> is closed in the editor. 136protected Task RaiseDocumentOpenedEventAsync(Document document) 156protected Task RaiseDocumentClosedEventAsync(Document document) 163protected Task RaiseDocumentActiveContextChangedEventAsync(Document document)
Workspace\Workspace_EventsLegacy.cs (2)
44/// An event that is fired when a <see cref="Document"/> is opened in the editor. 66/// An event that is fired when a <see cref="Document"/> is closed in the editor.
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)
396var document = this.CurrentSolution.GetDocument(documentId); 522var document = this.CurrentSolution.GetDocument(documentId);
Microsoft.DotNet.HotReload.Utils.Generator (5)
BaselineProject.cs (1)
68foreach (var doc in project.Documents) {
DeltaProject.cs (2)
72Document oldDocument = oldProject.GetDocument(baseDocumentId)!; 74Document updatedDocument;
DocResolver.cs (2)
26private static ImmutableDictionary<string, DocumentId> BuildDocMap (IEnumerable<Document> docs) 29foreach (var doc in docs) {
Microsoft.DotNet.HotReload.Watch (1)
HotReload\CompilationHandler.cs (1)
1046foreach (var document in project.Documents)
Microsoft.Gen.BuildMetadata.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.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.MetadataExtractor.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\runtime\src\libraries\System.Runtime.InteropServices\gen\Common\ConvertToSourceGeneratedInteropFixer.cs (1)
119Document doc = context.Document;
Microsoft.Interop.LibraryImportGenerator (8)
Analyzers\AddDisableRuntimeMarshallingAttributeFixer.cs (2)
54Document? assemblyInfo = 70static bool IsPropertiesAssemblyInfo(Document document)
Analyzers\ConvertToLibraryImportFixer.cs (2)
285Document? document = editor.OriginalDocument; 641private 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\runtime\src\libraries\System.Runtime.InteropServices\gen\Common\ConvertToSourceGeneratedInteropFixer.cs (1)
119Document 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,
Roslyn.Diagnostics.Analyzers (215)
AbstractApplyTraitToClass`1.cs (2)
27Document Document, 67private async Task<Document> ApplyTraitToClassAsync(State state, CancellationToken cancellationToken)
AbstractCreateTestAccessor`1.cs (2)
58private async Task<Document> CreateTestAccessorAsync(Document document, TextSpan sourceSpan, CancellationToken cancellationToken)
AbstractExposeMemberForTesting`1.cs (1)
100private async Task<Solution> AddMemberToTestAccessorAsync(Document document, TextSpan sourceSpan, string memberName, string memberDocumentationCommentId, CancellationToken cancellationToken)
AbstractRunIterations`1.cs (2)
81private static async Task<Document> RunIterationsAsync(Document document, TMethodDeclarationSyntax method, bool convertToTheory, CancellationToken cancellationToken)
ExportedPartsShouldHaveImportingConstructorCodeFixProvider.cs (7)
45Func<CancellationToken, Task<Document>> createChangedDocument; 79private static async Task<Document> AddExplicitImportingConstructorAsync(Document document, TextSpan sourceSpan, CancellationToken cancellationToken) 141private static async Task<Document> MakeConstructorPublicAsync(Document document, TextSpan sourceSpan, CancellationToken cancellationToken) 158private static async Task<Document> AddImportingConstructorAttributeAsync(Document document, TextSpan sourceSpan, CancellationToken cancellationToken)
ImportingConstructorShouldBeObsoleteCodeFixProvider.cs (11)
42Func<CancellationToken, Task<Document>> createChangedDocument; 85private async Task<Document> AddObsoleteAttributeAsync(Document document, TextSpan sourceSpan, CancellationToken cancellationToken) 117private static async Task<Document> AddDescriptionAndErrorAsync(Document document, TextSpan sourceSpan, CancellationToken cancellationToken) 138private static async Task<Document> UpdateDescriptionAsync(Document document, TextSpan sourceSpan, CancellationToken cancellationToken) 163private static async Task<Document> AddErrorAsync(Document document, TextSpan sourceSpan, CancellationToken cancellationToken) 182private static async Task<Document> SetErrorToTrueAsync(Document document, TextSpan sourceSpan, CancellationToken cancellationToken)
PartsExportedWithMEFv2MustBeMarkedAsShared.Fixer.cs (3)
32var document = context.Document; 61private static Task<Document> AddSharedAttributeAsync(Document document, SyntaxNode root, SyntaxNode declaration)
src\roslyn\src\RoslynAnalyzers\Utilities\Refactoring\CodeRefactoringContextExtensions.cs (2)
28this Document document, 39this Document document,
src\roslyn\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\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeCleanup\CodeCleanupHelpers.cs (4)
14public static async Task<Document> CleanupSyntaxAsync( 15Document document, CodeCleanupOptions options, CancellationToken cancellationToken) 21var document1 = await syntaxFormatting.FormatAsync(document, Formatter.Annotation, options.FormattingOptions, cancellationToken).ConfigureAwait(false); 24var document2 = await syntaxFormatting.FormatAsync(document1, SyntaxAnnotation.ElasticAnnotation, options.FormattingOptions, cancellationToken).ConfigureAwait(false);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeCleanup\CodeCleanupOptionsProviders.cs (1)
27public static async ValueTask<CodeCleanupOptions> GetCodeCleanupOptionsAsync(this Document document, CancellationToken cancellationToken)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeFixes\FixAllContextHelper.cs (7)
22public static async Task<ImmutableDictionary<Document, ImmutableArray<Diagnostic>>> GetDocumentDiagnosticsToFixAsync( 29var document = fixAllContext.Document; 41return ImmutableDictionary<Document, ImmutableArray<Diagnostic>>.Empty.SetItem(document, documentDiagnostics); 106return ImmutableDictionary<Document, ImmutableArray<Diagnostic>>.Empty; 132private static async Task<ImmutableDictionary<Document, ImmutableArray<Diagnostic>>> GetDocumentDiagnosticsToFixAsync( 137var builder = ImmutableDictionary.CreateBuilder<Document, ImmutableArray<Diagnostic>>(); 142if (textDocument is not Document document)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeFixes\ForkingSyntaxEditorBasedCodeFixProvider.cs (2)
38Document document, 55Document document,
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeFixes\MultiProjectSafeFixAllProvider.cs (2)
78var document = fixAllContext.Solution.GetRequiredDocument(documentId); 91var linkedDocument = fixAllContext.Solution.GetRequiredDocument(linkedDocumentId);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeFixes\SyntaxEditorBasedCodeFixProvider.cs (8)
63protected Func<CancellationToken, Task<Document>> GetDocumentUpdater(CodeFixContext context, Diagnostic? diagnostic = null) 69private Task<Document> FixAllAsync( 70Document document, ImmutableArray<Diagnostic> diagnostics, CancellationToken cancellationToken) 78internal static async Task<Document> FixAllWithEditorAsync( 79Document document, 98Document document, ImmutableArray<Diagnostic> diagnostics, SyntaxEditor editor, CancellationToken cancellationToken); 111protected virtual bool IncludeDiagnosticDuringFixAll(Diagnostic diagnostic, Document document, string? equivalenceKey, CancellationToken cancellationToken) 122/// cref="IncludeDiagnosticDuringFixAll(Diagnostic, Document, string, CancellationToken)"/> should be overridden
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeFixesAndRefactorings\AbstractFixAllSpanMappingService.cs (9)
20protected abstract Task<ImmutableDictionary<Document, ImmutableArray<TextSpan>>> GetFixAllSpansIfWithinGlobalStatementAsync( 21Document document, TextSpan span, CancellationToken cancellationToken); 23public Task<ImmutableDictionary<Document, ImmutableArray<TextSpan>>> GetFixAllSpansAsync( 24Document document, TextSpan triggerSpan, FixAllScope fixAllScope, CancellationToken cancellationToken) 32private async Task<ImmutableDictionary<Document, ImmutableArray<TextSpan>>> GetFixAllSpansAsync( 33Document document, TextSpan span, bool fixAllInContainingMember, CancellationToken cancellationToken) 50var builder = PooledDictionary<Document, ArrayBuilder<TextSpan>>.GetInstance(); 53var documentForLocation = document.Project.GetDocument(syntaxRef.SyntaxTree); 73Document document,
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeFixesAndRefactorings\FixAllHelper.cs (1)
14Document triggerDocument,
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeFixesAndRefactorings\IFixAllSpanMappingService.cs (2)
30Task<ImmutableDictionary<Document, ImmutableArray<TextSpan>>> GetFixAllSpansAsync( 31Document document, TextSpan triggerSpan, FixAllScope fixAllScope, CancellationToken cancellationToken);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\AbstractCodeGenerationService.cs (12)
229private async Task<Document> GetEditAsync( 242var oldDocument = context.Solution.GetRequiredDocument(destinationTree); 252var newDocument = oldDocument.WithSyntaxRoot(currentRoot); 391public virtual Task<Document> AddEventAsync( 401public Task<Document> AddFieldAsync(CodeGenerationSolutionContext context, INamedTypeSymbol destination, IFieldSymbol field, CancellationToken cancellationToken) 410public Task<Document> AddPropertyAsync(CodeGenerationSolutionContext context, INamedTypeSymbol destination, IPropertySymbol property, CancellationToken cancellationToken) 419public Task<Document> AddNamedTypeAsync(CodeGenerationSolutionContext context, INamedTypeSymbol destination, INamedTypeSymbol namedType, CancellationToken cancellationToken) 428public Task<Document> AddNamedTypeAsync(CodeGenerationSolutionContext context, INamespaceSymbol destination, INamedTypeSymbol namedType, CancellationToken cancellationToken) 437public Task<Document> AddNamespaceAsync(CodeGenerationSolutionContext context, INamespaceSymbol destination, INamespaceSymbol @namespace, CancellationToken cancellationToken) 446public Task<Document> AddMethodAsync(CodeGenerationSolutionContext context, INamedTypeSymbol destination, IMethodSymbol method, CancellationToken cancellationToken) 455public Task<Document> AddMembersAsync(CodeGenerationSolutionContext context, INamedTypeSymbol destination, IEnumerable<ISymbol> members, CancellationToken cancellationToken) 464public Task<Document> AddNamespaceOrTypeAsync(CodeGenerationSolutionContext context, INamespaceSymbol destination, INamespaceOrTypeSymbol namespaceOrType, CancellationToken cancellationToken)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\AbstractCodeGenerationService_FindDeclaration.cs (1)
79var document = solution.GetDocument(syntaxTree);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\CleanCodeGenerationOptions.cs (1)
39public static async ValueTask<CleanCodeGenerationOptions> GetCleanCodeGenerationOptionsAsync(this Document document, CancellationToken cancellationToken)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\CodeGenerationContext.cs (3)
136public Func<Document, bool>? AllowGenerationIntoHiddenCode { get; } 153Func<Document, bool>? allowGenerationIntoHiddenCode = null) 201Optional<Func<Document, bool>?> allowGenerationIntoHiddenCode = default)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\CodeGenerationOptionsProviders.cs (2)
34public static async ValueTask<CodeGenerationOptions> GetCodeGenerationOptionsAsync(this Document document, CancellationToken cancellationToken) 40public static async ValueTask<CodeGenerationContextInfo> GetCodeGenerationInfoAsync(this Document document, CodeGenerationContext context, CancellationToken cancellationToken)
src\roslyn\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\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\ICodeGenerationService.cs (9)
133Task<Document> AddEventAsync(CodeGenerationSolutionContext context, INamedTypeSymbol destination, IEventSymbol @event, CancellationToken cancellationToken); 138Task<Document> AddFieldAsync(CodeGenerationSolutionContext context, INamedTypeSymbol destination, IFieldSymbol field, CancellationToken cancellationToken); 143Task<Document> AddMethodAsync(CodeGenerationSolutionContext context, INamedTypeSymbol destination, IMethodSymbol method, CancellationToken cancellationToken); 148Task<Document> AddPropertyAsync(CodeGenerationSolutionContext context, INamedTypeSymbol destination, IPropertySymbol property, CancellationToken cancellationToken); 153Task<Document> AddNamedTypeAsync(CodeGenerationSolutionContext context, INamedTypeSymbol destination, INamedTypeSymbol namedType, CancellationToken cancellationToken); 158Task<Document> AddNamedTypeAsync(CodeGenerationSolutionContext context, INamespaceSymbol destination, INamedTypeSymbol namedType, CancellationToken cancellationToken); 163Task<Document> AddNamespaceAsync(CodeGenerationSolutionContext context, INamespaceSymbol destination, INamespaceSymbol @namespace, CancellationToken cancellationToken); 168Task<Document> AddNamespaceOrTypeAsync(CodeGenerationSolutionContext context, INamespaceSymbol destination, INamespaceOrTypeSymbol namespaceOrType, CancellationToken cancellationToken); 173Task<Document> AddMembersAsync(CodeGenerationSolutionContext context, INamedTypeSymbol destination, IEnumerable<ISymbol> members, CancellationToken cancellationToken);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeRefactorings\CodeRefactoringContextExtensions.cs (3)
59public static async Task<TSyntaxNode?> TryGetRelevantNodeAsync<TSyntaxNode>(this Document document, TextSpan span, CancellationToken cancellationToken) where TSyntaxNode : SyntaxNode 76this Document document, TextSpan span, CancellationToken cancellationToken) where TSyntaxNode : SyntaxNode 82this Document document, TextSpan span, bool allowEmptyNodes, CancellationToken cancellationToken) where TSyntaxNode : SyntaxNode
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Editing\ImportAdderService.cs (6)
30public async Task<Document> AddImportsAsync( 31Document document, 109private async Task<Document> AddImportDirectivesFromSyntaxesAsync( 110Document document, 170private async Task<Document> AddImportDirectivesFromSymbolAnnotationsAsync( 171Document document,
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\ContextQuery\ISyntaxContextService.cs (1)
12SyntaxContext CreateContext(Document document, SemanticModel semanticModel, int position, CancellationToken cancellationToken);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\ContextQuery\SyntaxContext.cs (2)
14Document document, 48public Document Document { get; } = document;
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\DocumentExtensions.cs (16)
27public static TLanguageService? GetLanguageService<TLanguageService>(this Document? document) where TLanguageService : class, ILanguageService 30public static TLanguageService GetRequiredLanguageService<TLanguageService>(this Document document) where TLanguageService : class, ILanguageService 33public static async ValueTask<SemanticModel> GetRequiredSemanticModelAsync(this Document document, CancellationToken cancellationToken) 57public static async ValueTask<SyntaxTree> GetRequiredSyntaxTreeAsync(this Document document, CancellationToken cancellationToken) 74public static async ValueTask<SyntaxNode> GetRequiredSyntaxRootAsync(this Document document, CancellationToken cancellationToken) 97public static bool IsRazorSourceGeneratedDocument(this Document? document) 125public static ValueTask<SemanticModel> ReuseExistingSpeculativeModelAsync(this Document document, int position, CancellationToken cancellationToken) 142public static async ValueTask<SemanticModel> ReuseExistingSpeculativeModelAsync(this Document document, TextSpan span, CancellationToken cancellationToken) 167public static ValueTask<SemanticModel> ReuseExistingSpeculativeModelAsync(this Document document, SyntaxNode? node, CancellationToken cancellationToken) 178public static async Task<bool> HasAnyErrorsAsync(this Document document, CancellationToken cancellationToken, List<string>? ignoreErrorCode = null) 184public static async Task<ImmutableArray<Diagnostic>> GetErrorsAsync(this Document document, CancellationToken cancellationToken, IList<string>? ignoreErrorCode = null) 200public static async Task VerifyNoErrorsAsync(this Document newDocument, string message, CancellationToken cancellationToken, List<string>? ignoreErrorCodes = null) 219public static async Task<bool> IsGeneratedCodeAsync(this Document document, CancellationToken cancellationToken) 226public static IEnumerable<Document> GetLinkedDocuments(this Document document) 237public static async ValueTask<IOptionsReader> GetHostAnalyzerConfigOptionsAsync(this Document document, CancellationToken cancellationToken)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\ISolutionExtensions.cs (2)
36public static Document GetRequiredDocument(this Solution solution, SyntaxTree syntaxTree) 50public static Document GetRequiredDocument(this Solution solution, DocumentId documentId)
src\roslyn\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\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\TextDocumentExtensions.cs (1)
31case Document document:
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Formatting\DocumentFormattingOptionsProviders.cs (1)
22public static async ValueTask<DocumentFormattingOptions> GetDocumentFormattingOptionsAsync(this Document document, CancellationToken cancellationToken)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Formatting\FormatterShared.cs (4)
21public Task<Document> FormatAsync(Document document, SyntaxAnnotation annotation, SyntaxFormattingOptions options, CancellationToken cancellationToken) 24public async Task<Document> FormatAsync(Document document, SyntaxAnnotation annotation, SyntaxFormattingOptions options, ImmutableArray<AbstractFormattingRule> rules, CancellationToken cancellationToken)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Formatting\LineFormattingOptionsProviders.cs (1)
17public static async ValueTask<LineFormattingOptions> GetLineFormattingOptionsAsync(this Document document, CancellationToken cancellationToken)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Formatting\SyntaxFormattingOptionsProviders.cs (1)
17public static async ValueTask<SyntaxFormattingOptions> GetSyntaxFormattingOptionsAsync(this Document document, CancellationToken cancellationToken)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\LanguageServices\GeneratedCodeRecognition\AbstractGeneratedCodeRecognitionService.cs (2)
24public async Task<bool> IsGeneratedCodeAsync(Document document, CancellationToken cancellationToken) 30private static bool IsGeneratedCode(SyntaxTree syntaxTree, Document document, CancellationToken cancellationToken)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\LanguageServices\GeneratedCodeRecognition\IGeneratedCodeRecognitionService.cs (1)
17Task<bool> IsGeneratedCodeAsync(Document document, CancellationToken cancellationToken);
src\roslyn\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\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\LanguageServices\InitializeParameter\IInitializeParameterService.cs (1)
22Document document, IParameterSymbol parameter, ISymbol fieldOrProperty, CancellationToken cancellationToken);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\LanguageServices\MoveDeclarationNearReference\AbstractMoveDeclarationNearReferenceService.cs (9)
36protected abstract Task<bool> TypesAreCompatibleAsync(Document document, ILocalSymbol localSymbol, TLocalDeclarationStatementSyntax declarationStatement, SyntaxNode right, CancellationToken cancellationToken); 38public async Task<(bool canMove, bool mayChangeSemantics)> CanMoveDeclarationNearReferenceAsync(Document document, SyntaxNode node, CancellationToken cancellationToken) 47private async Task<State> ComputeStateAsync(Document document, SyntaxNode node, CancellationToken cancellationToken) 77public async Task<Document> MoveDeclarationNearReferenceAsync( 78Document document, SyntaxNode localDeclarationStatement, CancellationToken cancellationToken) 119Document document, State state, SyntaxEditor editor, SyntaxAnnotation warningAnnotation, CancellationToken cancellationToken) 160Document document, State state, SyntaxEditor editor, SyntaxAnnotation warningAnnotation) 205Document document, 236Document document, State state)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\LanguageServices\MoveDeclarationNearReference\AbstractMoveDeclarationNearReferenceService.State.cs (2)
40Document document, 55Document document,
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\LanguageServices\MoveDeclarationNearReference\IMoveDeclarationNearReferenceService.cs (3)
17Task<(bool canMove, bool mayChangeSemantics)> CanMoveDeclarationNearReferenceAsync(Document document, SyntaxNode localDeclarationStatement, CancellationToken cancellationToken); 24Task<Document> MoveDeclarationNearReferenceAsync(Document document, SyntaxNode localDeclarationStatement, CancellationToken cancellationToken);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\LanguageServices\RemoveUnnecessaryImports\AbstractRemoveUnnecessaryImportsService.cs (6)
19public Task<Document> RemoveUnnecessaryImportsAsync(Document document, CancellationToken cancellationToken) 22public abstract Task<Document> RemoveUnnecessaryImportsAsync(Document fromDocument, Func<SyntaxNode, bool>? predicate, CancellationToken cancellationToken); 25Document document, Func<SyntaxNode, bool> predicate, CancellationToken cancellationToken) 32foreach (var current in document.GetLinkedDocuments())
src\roslyn\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\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\LanguageServices\ReplaceDiscardDeclarationsWithAssignments\IReplaceDiscardDeclarationsWithAssignmentsService.cs (1)
30Task<SyntaxNode> ReplaceAsync(Document document, SyntaxNode memberDeclaration, CancellationToken cancellationToken);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\NamingStyles\NamingStylePreferencesProviders.cs (1)
15public static async ValueTask<NamingStylePreferences> GetNamingStylePreferencesAsync(this Document document, CancellationToken cancellationToken)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Options\MemberDisplayOptions.cs (1)
50public static async ValueTask<MemberDisplayOptions> GetMemberDisplayOptionsAsync(this Document document, CancellationToken cancellationToken)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\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);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\SemanticModelReuse\SemanticModelWorkspaceServiceFactory.SemanticModelWorkspaceService.cs (3)
94public async ValueTask<SemanticModel> ReuseExistingSpeculativeModelAsync(Document document, SyntaxNode node, CancellationToken cancellationToken) 138ImmutableDictionary<DocumentId, SemanticModelReuseInfo?> map, Document document, SyntaxNode bodyNode, CancellationToken cancellationToken) 176Document document,
src\roslyn\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, 238var newDocument = document.WithSyntaxRoot(newRoot); 294private async Task<Document> RemoveUnusedNamespaceImportsAsync( 295Document document,
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Simplification\ISimplificationService.cs (2)
30Task<Document> ReduceAsync( 31Document document,
src\roslyn\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\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Utilities\ParsedDocument.cs (5)
15/// Represents a <see cref="Document"/> content that has been parsed. 20/// In general, any feature API that accepts <see cref="ParsedDocument"/> should be synchronous and not access <see cref="Document"/> or <see cref="Solution"/> snapshots. 31public static async ValueTask<ParsedDocument> CreateAsync(Document document, CancellationToken cancellationToken) 66/// Equivalent semantics to <see cref="Document.GetTextChangesAsync(Document, CancellationToken)"/>
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Utilities\SemanticDocument.cs (3)
13internal sealed class SemanticDocument(Document document, SourceText text, SyntaxNode root, SemanticModel semanticModel) 18public static new async Task<SemanticDocument> CreateAsync(Document document, CancellationToken cancellationToken) 28var newDocument = this.Document.WithSyntaxRoot(root);
src\roslyn\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);
TestExportsShouldNotBeDiscoverableCodeFixProvider.cs (2)
50private static async Task<Document> AddPartNotDiscoverableAttributeAsync(Document document, TextSpan sourceSpan, CancellationToken cancellationToken)
Roslyn.Diagnostics.CSharp.Analyzers (28)
CSharpAvoidOptSuffixForNullableEnableCodeCodeFixProvider.cs (1)
67private static async Task<Solution> RemoveOptSuffixOnVariableAsync(Document document, ISymbol variableSymbol, string newName, CancellationToken cancellationToken)
CSharpDoNotUseDebugAssertForInterpolatedStringsFixer.cs (2)
56private static async Task<Document> ReplaceWithDebugAssertAsync(Document document, Location location, INamedTypeSymbol roslynDebugSymbol, CancellationToken cancellationToken)
NumberCommentsRefactoring.cs (2)
51private static async Task<Document> FixCommentsAsync(Document document, LiteralExpressionSyntax stringLiteral, CancellationToken c)
PreferNullLiteralCodeFixProvider.cs (2)
48private static async Task<Document> ReplaceWithNullLiteralAsync(Document document, Location location, CancellationToken cancellationToken)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\CodeFixesAndRefactorings\CSharpFixAllSpanMappingService.cs (5)
24protected override async Task<ImmutableDictionary<Document, ImmutableArray<TextSpan>>> GetFixAllSpansIfWithinGlobalStatementAsync( 25Document document, TextSpan span, CancellationToken cancellationToken) 30return ImmutableDictionary<Document, ImmutableArray<TextSpan>>.Empty; 43return ImmutableDictionary<Document, ImmutableArray<TextSpan>>.Empty; 48return ImmutableDictionary<Document, ImmutableArray<TextSpan>>.Empty
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\CodeGeneration\CSharpCodeGenerationService.cs (2)
62public override async Task<Document> AddEventAsync( 65var newDocument = await base.AddEventAsync(
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\ContextQuery\CSharpSyntaxContext.cs (3)
51Document document, 181public static CSharpSyntaxContext CreateContext(Document document, SemanticModel semanticModel, int position, CancellationToken cancellationToken) 185Document document, SemanticModel semanticModel, int position, CancellationToken cancellationToken)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\ContextQuery\CSharpSyntaxContextService.cs (1)
18public SyntaxContext CreateContext(Document document, SemanticModel semanticModel, int position, CancellationToken cancellationToken)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Formatting\CSharpSyntaxFormattingOptionsProviders.cs (1)
13public static async ValueTask<CSharpSyntaxFormattingOptions> GetCSharpSyntaxFormattingOptionsAsync(this Document document, CancellationToken cancellationToken)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\LanguageServices\CSharpMoveDeclarationNearReferenceService.cs (1)
53Document document, ILocalSymbol localSymbol,
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\LanguageServices\CSharpRemoveUnnecessaryImportsService.cs (2)
37public override async Task<Document> RemoveUnnecessaryImportsAsync( 38Document document,
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\LanguageServices\CSharpReplaceDiscardDeclarationsWithAssignmentsService.cs (1)
37Document document,
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\LanguageServices\InitializeParameter\CSharpInitializeParameterService.cs (1)
109protected override Task<Solution> TryAddAssignmentForPrimaryConstructorAsync(Document document, IParameterSymbol parameter, ISymbol fieldOrProperty, CancellationToken cancellationToken)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\LanguageServices\InitializeParameter\InitializeParameterHelpers.cs (3)
34Document document, 62var editingDocument = solution.GetRequiredDocument(propertyDeclaration.SyntaxTree); 82var editingDocument = solution.GetRequiredDocument(variableDeclarator.SyntaxTree);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Simplification\CSharpSimplifierOptionsProviders.cs (1)
13public static async ValueTask<CSharpSimplifierOptions> GetCSharpSimplifierOptionsAsync(this Document document, CancellationToken cancellationToken)
Roslyn.Diagnostics.VisualBasic.Analyzers (2)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\LanguageServices\VisualBasicRemoveUnnecessaryImportsService.vb (2)
27document As Document, 29cancellationToken As CancellationToken) As Task(Of Document)
System.Text.RegularExpressions.Generator (8)
UpgradeToGeneratedRegexCodeFixer.cs (8)
93private static async Task<Document> CreateGeneratedRegexProperty( 94Document document, SyntaxNode root, SyntaxNode nodeToFix, CancellationToken cancellationToken) 191private static async Task<Document> ConvertFieldToGeneratedRegexProperty(Document document, SyntaxNode root, SyntaxNode nodeToFix, FieldDeclarationSyntax fieldDeclaration, CancellationToken cancellationToken) 242private static async Task<Document> ConvertPropertyToGeneratedRegexProperty( 243Document document, SyntaxNode root, SyntaxNode nodeToFix, PropertyDeclarationSyntax propertyDeclaration, CancellationToken cancellationToken) 287private static Document TryAddNewMember( 288SyntaxGenerator generator, Document document,
System.Windows.Forms.Analyzers.CodeFixes.CSharp (2)
System\Windows\Forms\CSharp\CodeFixes\AddDesignerSerializationVisibility\AddDesignerSerializationVisibilityCodeFixProvider.cs (2)
57private static async Task<Document> AddDesignerSerializationAttribute( 58Document document,