1 instantiation of DocumentEditor
Microsoft.CodeAnalysis.Workspaces (1)
Editing\DocumentEditor.cs (1)
37return new DocumentEditor(document, model, root);
103 references to DocumentEditor
ILLink.CodeFixProvider (4)
BaseAttributeCodeFixProvider.cs (2)
72 var editor = await DocumentEditor.CreateAsync (document, cancellationToken).ConfigureAwait (false);
DynamicallyAccessedMembersCodeFixProvider.cs (2)
133 var editor = await DocumentEditor.CreateAsync (document, cancellationToken).ConfigureAwait (false);
Microsoft.Analyzers.Extra (6)
CallAnalysis\Fixers\LegacyLoggingFixer.cs (4)
143var docEditor = await DocumentEditor.CreateAsync(targetDoc, cancellationToken).ConfigureAwait(false); 471var docEditor = await solEditor.GetDocumentEditorAsync(doc.Id, cancellationToken).ConfigureAwait(false); 581var docEditor = await solEditor.GetDocumentEditorAsync(targetDoc.Id, cancellationToken).ConfigureAwait(false);
MakeExeTypesInternalFixer.cs (2)
39var editor = await DocumentEditor.CreateAsync(document, cancellationToken).ConfigureAwait(false);
Microsoft.AspNetCore.App.CodeFixes (4)
Kestrel\ListenOnIPv6AnyFixer.cs (2)
33var editor = await DocumentEditor.CreateAsync(context.Document, cancellationToken).ConfigureAwait(false);
PublicPartialProgramClassFixer.cs (2)
31var editor = await DocumentEditor.CreateAsync(context.Document, cancellationToken).ConfigureAwait(false);
Microsoft.AspNetCore.Mvc.Api.Analyzers (4)
AddResponseTypeAttributeCodeFixAction.cs (2)
64var documentEditor = await DocumentEditor.CreateAsync(_document, cancellationToken).ConfigureAwait(false);
ApiActionsDoNotRequireExplicitModelValidationCodeFixProvider.cs (2)
55var editor = await DocumentEditor.CreateAsync(_document, cancellationToken).ConfigureAwait(false);
Microsoft.CodeAnalysis.CSharp.CodeStyle.Fixes (4)
src\Analyzers\CSharp\CodeFixes\ConvertToRecord\ConvertToRecordEngine.cs (1)
97var documentEditor = await solutionEditor
src\Analyzers\CSharp\CodeFixes\UsePrimaryConstructor\CSharpUsePrimaryConstructorCodeFixProvider.cs (2)
139var constructorDocumentEditor = await solutionEditor.GetDocumentEditorAsync(document.Id, cancellationToken).ConfigureAwait(false); 385var documentEditor = await solutionEditor.GetDocumentEditorAsync(document.Id, cancellationToken).ConfigureAwait(false);
src\Analyzers\CSharp\CodeFixes\UseSystemThreadingLock\CSharpUseSystemThreadingLockCodeFixProvider.cs (1)
96var editor = await solutionEditor.GetDocumentEditorAsync(document.Id, cancellationToken).ConfigureAwait(false);
Microsoft.CodeAnalysis.CSharp.Features (7)
ConvertPrimaryToRegularConstructor\ConvertPrimaryToRegularConstructorCodeRefactoringProvider.cs (1)
94var mainDocumentEditor = await solutionEditor.GetDocumentEditorAsync(document.Id, cancellationToken).ConfigureAwait(false);
Copilot\CSharpCopilotCodeFixProvider.cs (2)
125var editor = await DocumentEditor.CreateAsync(document, cancellationToken).ConfigureAwait(false);
src\Analyzers\CSharp\CodeFixes\ConvertToRecord\ConvertToRecordEngine.cs (1)
97var documentEditor = await solutionEditor
src\Analyzers\CSharp\CodeFixes\UsePrimaryConstructor\CSharpUsePrimaryConstructorCodeFixProvider.cs (2)
139var constructorDocumentEditor = await solutionEditor.GetDocumentEditorAsync(document.Id, cancellationToken).ConfigureAwait(false); 385var documentEditor = await solutionEditor.GetDocumentEditorAsync(document.Id, cancellationToken).ConfigureAwait(false);
src\Analyzers\CSharp\CodeFixes\UseSystemThreadingLock\CSharpUseSystemThreadingLockCodeFixProvider.cs (1)
96var editor = await solutionEditor.GetDocumentEditorAsync(document.Id, cancellationToken).ConfigureAwait(false);
Microsoft.CodeAnalysis.CSharp.Workspaces.UnitTests (3)
CodeGeneration\AddAttributesTests.cs (2)
52var editor = await DocumentEditor.CreateAsync(doc);
CodeGeneration\AddImportsTests.cs (1)
803var editor = await DocumentEditor.CreateAsync(document, CancellationToken.None).ConfigureAwait(false);
Microsoft.CodeAnalysis.Features (24)
CodeFixes\Suppression\AbstractSuppressionCodeFixProvider.RemoveSuppressionCodeAction_Attribute.cs (2)
70var editor = await DocumentEditor.CreateAsync(documentWithAttribute, cancellationToken).ConfigureAwait(false);
CodeRefactorings\MoveType\AbstractMoveTypeService.MoveTypeEditor.cs (6)
119var documentEditor = await DocumentEditor.CreateAsync(document, CancellationToken).ConfigureAwait(false); 186private void RemoveLeadingBlankLinesFromMovedType(DocumentEditor documentEditor) 234var documentEditor = await DocumentEditor.CreateAsync(sourceDocument, CancellationToken).ConfigureAwait(false); 302DocumentEditor documentEditor,
CodeRefactorings\MoveType\AbstractMoveTypeService.MoveTypeNamespaceScopeEditor.cs (2)
49var editor = await DocumentEditor.CreateAsync(documentToEdit, cancellationToken).ConfigureAwait(false);
CodeRefactorings\SyncNamespace\AbstractChangeNamespaceService.cs (4)
315var documentEditor = await solutionEditor.GetDocumentEditorAsync(id, cancellationToken).ConfigureAwait(false); 441var editor = await DocumentEditor.CreateAsync(document, cancellationToken).ConfigureAwait(false); 692var editor = await DocumentEditor.CreateAsync(document, cancellationToken).ConfigureAwait(false);
InlineMethod\AbstractInlineMethodRefactoringProvider.cs (2)
344var calleeDocumentEditor = await solutionEditor.GetDocumentEditorAsync(calleeDocumentId, cancellationToken).ConfigureAwait(false); 359var callerDocumentEditor = await solutionEditor.GetDocumentEditorAsync(document.Id, cancellationToken).ConfigureAwait(false);
MoveStaticMembers\MoveStaticMembersWithDialogCodeAction.cs (2)
266var docEditor = await DocumentEditor.CreateAsync(doc, cancellationToken).ConfigureAwait(false);
PullMemberUp\MembersPuller.cs (4)
122var originalMemberEditor = await solutionEditor.GetDocumentEditorAsync( 196DocumentEditor editor, 224DocumentEditor editor, 329var originalMemberEditor = await solutionEditor.GetDocumentEditorAsync(
RemoveUnusedVariable\AbstractRemoveUnusedVariableCodeFixProvider.cs (2)
68var documentEditor = await DocumentEditor.CreateAsync(document, cancellationToken).ConfigureAwait(false);
Microsoft.CodeAnalysis.Workspaces (12)
Editing\DocumentEditor.cs (2)
26/// Creates a new <see cref="DocumentEditor"/> instance. 28public static async Task<DocumentEditor> CreateAsync(Document document, CancellationToken cancellationToken = default)
Editing\SolutionEditor.cs (4)
18private readonly Dictionary<DocumentId, DocumentEditor> _documentEditors = []; 26/// Gets the <see cref="DocumentEditor"/> for the corresponding <see cref="DocumentId"/>. 28public async Task<DocumentEditor> GetDocumentEditorAsync(DocumentId id, CancellationToken cancellationToken = default) 32editor = await DocumentEditor.CreateAsync(solution.GetDocument(id), cancellationToken).ConfigureAwait(false);
Editing\SymbolEditor.cs (6)
212/// <param name="editor">The <see cref="DocumentEditor"/> to apply edits to.</param> 215public delegate void DeclarationEditAction(DocumentEditor editor, SyntaxNode declaration); 220/// <param name="editor">The <see cref="DocumentEditor"/> to apply edits to.</param> 224public delegate Task AsyncDeclarationEditAction(DocumentEditor editor, SyntaxNode declaration, CancellationToken cancellationToken); 288var editor = await DocumentEditor.CreateAsync(doc, cancellationToken).ConfigureAwait(false);
Microsoft.Interop.ComInterfaceGenerator (14)
Analyzers\AddGeneratedComClassFixer.cs (2)
24private static Task AddGeneratedComClassAsync(DocumentEditor editor, SyntaxNode node) 43protected override Func<DocumentEditor, CancellationToken, Task> CreateFixForSelectedOptions(SyntaxNode node, ImmutableDictionary<string, Option> selectedOptions)
Analyzers\AddMarshalAsToElementFixer.cs (2)
47DocumentEditor editor = await DocumentEditor.CreateAsync(doc, ct).ConfigureAwait(false);
Analyzers\ConvertComImportToGeneratedComInterfaceFixer.cs (2)
35protected override Func<DocumentEditor, CancellationToken, Task> CreateFixForSelectedOptions(SyntaxNode node, ImmutableDictionary<string, Option> selectedOptions) 72private static async Task ConvertComImportToGeneratedComInterfaceAsync(DocumentEditor editor, SyntaxNode node, bool mayRequireAdditionalWork, bool addStringMarshalling, CancellationToken ct)
src\libraries\System.Runtime.InteropServices\gen\Common\ConvertToSourceGeneratedInteropFixer.cs (8)
33protected abstract Func<DocumentEditor, CancellationToken, Task> CreateFixForSelectedOptions(SyntaxNode node, ImmutableDictionary<string, Option> selectedOptions); 106private static async Task<Solution> ApplyActionAndEnableUnsafe(Solution solution, DocumentId documentId, Func<DocumentEditor, CancellationToken, Task> documentBasedFix, CancellationToken ct) 109var docEditor = await editor.GetDocumentEditorAsync(documentId, ct).ConfigureAwait(false); 151DocumentEditor editor = await DocumentEditor.CreateAsync(doc, ct).ConfigureAwait(false); 164protected record struct ConvertToSourceGeneratedInteropFix(Func<DocumentEditor, CancellationToken, Task> ApplyFix, ImmutableDictionary<string, Option> SelectedOptions); 199DocumentEditor editor = await solutionEditor.GetDocumentEditorAsync(documentId, ct).ConfigureAwait(false); 232protected static void MakeNodeParentsPartial(DocumentEditor editor, SyntaxNode syntax)
Microsoft.Interop.LibraryImportGenerator (19)
Analyzers\AddDisableRuntimeMarshallingAttributeFixer.cs (2)
58DocumentEditor editor = await DocumentEditor.CreateAsync(assemblyInfo, cancellationToken).ConfigureAwait(false);
Analyzers\ConvertToLibraryImportFixer.cs (6)
129protected override Func<DocumentEditor, CancellationToken, Task> CreateFixForSelectedOptions(SyntaxNode node, ImmutableDictionary<string, Option> selectedOptions) 161DocumentEditor editor, 198DocumentEditor editor, 271private static async Task<bool> TransformCallersOfNoPreserveSigMethod(DocumentEditor editor, IMethodSymbol methodSymbol, CancellationToken cancellationToken) 412DocumentEditor editor, 571DocumentEditor editor,
Analyzers\CustomMarshallerAttributeFixer.cs (3)
187DocumentEditor editor, 204private static void AddMissingMembersToStatelessMarshaller(DocumentEditor editor, SyntaxNode declaringSyntax, INamedTypeSymbol marshallerType, ITypeSymbol managedType, HashSet<string> missingMemberNames, bool isLinearCollectionMarshaller) 400private static void AddMissingMembersToStatefulMarshaller(DocumentEditor editor, SyntaxNode declaringSyntax, INamedTypeSymbol marshallerType, ITypeSymbol managedType, HashSet<string> missingMemberNames, bool isLinearCollectionMarshaller)
src\libraries\System.Runtime.InteropServices\gen\Common\ConvertToSourceGeneratedInteropFixer.cs (8)
33protected abstract Func<DocumentEditor, CancellationToken, Task> CreateFixForSelectedOptions(SyntaxNode node, ImmutableDictionary<string, Option> selectedOptions); 106private static async Task<Solution> ApplyActionAndEnableUnsafe(Solution solution, DocumentId documentId, Func<DocumentEditor, CancellationToken, Task> documentBasedFix, CancellationToken ct) 109var docEditor = await editor.GetDocumentEditorAsync(documentId, ct).ConfigureAwait(false); 151DocumentEditor editor = await DocumentEditor.CreateAsync(doc, ct).ConfigureAwait(false); 164protected record struct ConvertToSourceGeneratedInteropFix(Func<DocumentEditor, CancellationToken, Task> ApplyFix, ImmutableDictionary<string, Option> SelectedOptions); 199DocumentEditor editor = await solutionEditor.GetDocumentEditorAsync(documentId, ct).ConfigureAwait(false); 232protected static void MakeNodeParentsPartial(DocumentEditor editor, SyntaxNode syntax)
System.Text.RegularExpressions.Generator (2)
UpgradeToGeneratedRegexCodeFixer.cs (2)
155DocumentEditor editor = await DocumentEditor.CreateAsync(document, cancellationToken).ConfigureAwait(false);