1 instantiation of DocumentEditor
Microsoft.CodeAnalysis.Workspaces (1)
Editing\DocumentEditor.cs (1)
37
return new
DocumentEditor
(document, model, root);
339 references to DocumentEditor
ILLink.CodeFixProvider (22)
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);
RequiresUnsafeCodeFixProvider.cs (10)
138
var
editor = await
DocumentEditor
.CreateAsync(document, cancellationToken).ConfigureAwait(false);
190
var
editor = await
DocumentEditor
.CreateAsync(document, cancellationToken).ConfigureAwait(false);
369
var
editor = await
DocumentEditor
.CreateAsync(document, cancellationToken).ConfigureAwait(false);
392
var
editor = await
DocumentEditor
.CreateAsync(document, cancellationToken).ConfigureAwait(false);
418
var
editor = await
DocumentEditor
.CreateAsync(document, cancellationToken).ConfigureAwait(false);
SynchronizeUnsafeContractCodeFixProvider.cs (2)
181
var
editor = await
DocumentEditor
.CreateAsync(document, cancellationToken).ConfigureAwait(false);
UnsafeModifierCodeFixHelpers.cs (6)
107
var
editor = await
DocumentEditor
.CreateAsync(document, cancellationToken).ConfigureAwait(false);
124
var
editor = await
DocumentEditor
.CreateAsync(document, cancellationToken).ConfigureAwait(false);
184
var
editor = await
DocumentEditor
.CreateAsync(document, cancellationToken).ConfigureAwait(false);
Microsoft.Analyzers.Extra (6)
CallAnalysis\Fixers\LegacyLoggingFixer.cs (4)
143
var
docEditor = await
DocumentEditor
.CreateAsync(targetDoc, cancellationToken).ConfigureAwait(false);
471
var
docEditor = await solEditor.GetDocumentEditorAsync(doc.Id, cancellationToken).ConfigureAwait(false);
581
var
docEditor = await solEditor.GetDocumentEditorAsync(targetDoc.Id, cancellationToken).ConfigureAwait(false);
MakeExeTypesInternalFixer.cs (2)
39
var
editor = await
DocumentEditor
.CreateAsync(document, cancellationToken).ConfigureAwait(false);
Microsoft.AspNetCore.App.CodeFixes (4)
Kestrel\ListenOnIPv6AnyFixer.cs (2)
33
var
editor = await
DocumentEditor
.CreateAsync(context.Document, cancellationToken).ConfigureAwait(false);
PublicPartialProgramClassFixer.cs (2)
31
var
editor = await
DocumentEditor
.CreateAsync(context.Document, cancellationToken).ConfigureAwait(false);
Microsoft.CodeAnalysis.Analyzers (13)
FixAnalyzers\FixerWithFixAllAnalyzer.Fixer.cs (2)
59
var
editor = await
DocumentEditor
.CreateAsync(document, cancellationToken).ConfigureAwait(false);
MetaAnalyzers\Fixers\CompareSymbolsCorrectlyFix.cs (6)
125
var
editor = await
DocumentEditor
.CreateAsync(document, cancellationToken).ConfigureAwait(false);
194
var
editor = await
DocumentEditor
.CreateAsync(document, cancellationToken).ConfigureAwait(false);
260
var
editor = await
DocumentEditor
.CreateAsync(document, cancellationToken).ConfigureAwait(false);
MetaAnalyzers\Fixers\PreferIsKindFix.cs (5)
39
var
editor = await
DocumentEditor
.CreateAsync(document, cancellationToken).ConfigureAwait(false);
50
protected abstract void FixDiagnostic(
DocumentEditor
editor, SyntaxNode nodeToFix);
65
var
editor = await
DocumentEditor
.CreateAsync(document, fixAllContext.CancellationToken).ConfigureAwait(false);
Microsoft.CodeAnalysis.CodeStyle.Fixes (3)
src\roslyn\src\Analyzers\Core\CodeFixes\MakeMethodAsynchronous\AbstractMakeMethodAsynchronousCodeFixProvider.cs (2)
302
var
mainDocumentEditor = await solutionEditor.GetDocumentEditorAsync(document.Id, cancellationToken).ConfigureAwait(false);
314
var
partialDefinitionDocumentEditor = await solutionEditor.GetDocumentEditorAsync(partialDefinitionDocument.Id, cancellationToken).ConfigureAwait(false);
src\roslyn\src\Analyzers\Core\CodeFixes\UseAutoProperty\AbstractUseAutoPropertyCodeFixProvider.cs (1)
332
var
editor = await solutionEditor.GetDocumentEditorAsync(document.Id, cancellationToken).ConfigureAwait(false);
Microsoft.CodeAnalysis.CSharp.Analyzers (1)
MetaAnalyzers\Fixers\CSharpPreferIsKindFix.cs (1)
37
protected override void FixDiagnostic(
DocumentEditor
editor, SyntaxNode nodeToFix)
Microsoft.CodeAnalysis.CSharp.CodeStyle.Fixes (13)
src\roslyn\src\Analyzers\CSharp\CodeFixes\ConvertToRecord\ConvertToRecordEngine.cs (2)
97
var
documentEditor = await solutionEditor
490
var
documentEditor = await solutionEditor
src\roslyn\src\Analyzers\CSharp\CodeFixes\UsePrimaryConstructor\CSharpUsePrimaryConstructorCodeFixProvider.cs (6)
137
var
constructorDocumentEditor = await solutionEditor.GetDocumentEditorAsync(document.Id, cancellationToken).ConfigureAwait(false);
383
var
documentEditor = await solutionEditor.GetDocumentEditorAsync(document.Id, cancellationToken).ConfigureAwait(false);
476
var
declarationDocumentEditor = await solutionEditor.GetDocumentEditorAsync(declarationDocument.Id, cancellationToken).ConfigureAwait(false);
535
var
documentEditor = await solutionEditor.GetDocumentEditorAsync(memberDocument.Id, cancellationToken).ConfigureAwait(false);
610
var
documentEditor = await solutionEditor.GetDocumentEditorAsync(document.Id, cancellationToken).ConfigureAwait(false);
626
var
documentEditor = await solutionEditor.GetDocumentEditorAsync(document.Id, cancellationToken).ConfigureAwait(false);
src\roslyn\src\Analyzers\CSharp\CodeFixes\UseSystemThreadingLock\CSharpUseSystemThreadingLockCodeFixProvider.cs (2)
94
var
editor = await solutionEditor.GetDocumentEditorAsync(document.Id, cancellationToken).ConfigureAwait(false);
126
var
groupDocumentEditor = await solutionEditor.GetDocumentEditorAsync(groupDocument.Id, cancellationToken).ConfigureAwait(false);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\LanguageServices\InitializeParameter\InitializeParameterHelpers.cs (3)
63
var
editor = await solutionEditor.GetDocumentEditorAsync(editingDocument.Id, cancellationToken).ConfigureAwait(false);
83
var
editor = await solutionEditor.GetDocumentEditorAsync(editingDocument.Id, cancellationToken).ConfigureAwait(false);
112
var
editor = await solutionEditor.GetDocumentEditorAsync(group.Key.Id, cancellationToken).ConfigureAwait(false);
Microsoft.CodeAnalysis.CSharp.Features (18)
ConvertPrimaryToRegularConstructor\ConvertPrimaryToRegularConstructorCodeRefactoringProvider.cs (3)
100
var
mainDocumentEditor = await solutionEditor.GetDocumentEditorAsync(document.Id, cancellationToken).ConfigureAwait(false);
274
var
editor = await solutionEditor.GetDocumentEditorAsync(solution.GetDocumentId(initializer.SyntaxTree), cancellationToken).ConfigureAwait(false);
369
var
editor = await solutionEditor.GetDocumentEditorAsync(solution.GetDocumentId(syntaxTree), cancellationToken).ConfigureAwait(false);
Copilot\CSharpCopilotCodeFixProvider.cs (2)
123
var
editor = await
DocumentEditor
.CreateAsync(document, cancellationToken).ConfigureAwait(false);
ImplementInterface\AbstractChangeImplementationCodeRefactoringProvider.cs (1)
251
var
editor = await solutionEditor.GetDocumentEditorAsync(
ImplementInterface\CSharpImplementExplicitlyCodeRefactoringProvider.cs (1)
68
var
editor = await solutionEditor.GetDocumentEditorAsync(
InitializeParameter\CSharpInitializeMemberFromPrimaryConstructorParameterCodeRefactoringProvider_Update.cs (1)
107
var
editor = await solutionEditor.GetDocumentEditorAsync(editingDocument.Id, cancellationToken).ConfigureAwait(false);
src\roslyn\src\Analyzers\CSharp\CodeFixes\ConvertToRecord\ConvertToRecordEngine.cs (2)
97
var
documentEditor = await solutionEditor
490
var
documentEditor = await solutionEditor
src\roslyn\src\Analyzers\CSharp\CodeFixes\UsePrimaryConstructor\CSharpUsePrimaryConstructorCodeFixProvider.cs (6)
137
var
constructorDocumentEditor = await solutionEditor.GetDocumentEditorAsync(document.Id, cancellationToken).ConfigureAwait(false);
383
var
documentEditor = await solutionEditor.GetDocumentEditorAsync(document.Id, cancellationToken).ConfigureAwait(false);
476
var
declarationDocumentEditor = await solutionEditor.GetDocumentEditorAsync(declarationDocument.Id, cancellationToken).ConfigureAwait(false);
535
var
documentEditor = await solutionEditor.GetDocumentEditorAsync(memberDocument.Id, cancellationToken).ConfigureAwait(false);
610
var
documentEditor = await solutionEditor.GetDocumentEditorAsync(document.Id, cancellationToken).ConfigureAwait(false);
626
var
documentEditor = await solutionEditor.GetDocumentEditorAsync(document.Id, cancellationToken).ConfigureAwait(false);
src\roslyn\src\Analyzers\CSharp\CodeFixes\UseSystemThreadingLock\CSharpUseSystemThreadingLockCodeFixProvider.cs (2)
94
var
editor = await solutionEditor.GetDocumentEditorAsync(document.Id, cancellationToken).ConfigureAwait(false);
126
var
groupDocumentEditor = await solutionEditor.GetDocumentEditorAsync(groupDocument.Id, cancellationToken).ConfigureAwait(false);
Microsoft.CodeAnalysis.CSharp.NetAnalyzers (27)
Microsoft.CodeQuality.Analyzers\ApiDesignGuidelines\CSharpStaticHolderTypes.Fixer.cs (2)
51
DocumentEditor
editor = await
DocumentEditor
.CreateAsync(document, ct).ConfigureAwait(false);
Microsoft.CodeQuality.Analyzers\QualityGuidelines\CSharpDoNotInitializeUnnecessarily.Fixer.cs (2)
43
DocumentEditor
editor = await
DocumentEditor
.CreateAsync(doc, ct).ConfigureAwait(false);
Microsoft.NetCore.Analyzers\InteropServices\CSharpDisableRuntimeMarshalling.FixAllProvider.cs (2)
34
var
editor = await
DocumentEditor
.CreateAsync(document, fixAllContext.CancellationToken).ConfigureAwait(false);
Microsoft.NetCore.Analyzers\InteropServices\CSharpDisableRuntimeMarshalling.Fixer.cs (4)
76
var
editor = await
DocumentEditor
.CreateAsync(document, ct).ConfigureAwait(false);
88
private static bool TryRewriteMethodCall(SyntaxNode node,
DocumentEditor
editor, IdentifierGenerator pointerIdentifierGenerator, bool addRenameAnnotation, CancellationToken ct)
201
private static void AddUnsafeModifierToEnclosingMethod(
DocumentEditor
editor, SyntaxNode syntax)
Microsoft.NetCore.Analyzers\InteropServices\CSharpDynamicInterfaceCastableImplementation.Fixer.cs (2)
184
var
editor = await
DocumentEditor
.CreateAsync(document, cancellationToken).ConfigureAwait(false);
Microsoft.NetCore.Analyzers\Performance\CSharpPreferDictionaryTryMethodsOverContainsKeyGuardFixer.cs (4)
125
var
editor = await
DocumentEditor
.CreateAsync(document, ct).ConfigureAwait(false);
218
var
editor = await
DocumentEditor
.CreateAsync(document, ct).ConfigureAwait(false);
Microsoft.NetCore.Analyzers\Performance\CSharpUseStringMethodCharOverloadWithSingleCharacters.Fixer.cs (1)
71
DocumentEditor
editor,
Microsoft.NetCore.Analyzers\Runtime\CSharpAvoidRedundantRegexIsMatchBeforeMatch.Fixer.cs (4)
440
var
editor = await
DocumentEditor
.CreateAsync(document, cancellationToken).ConfigureAwait(false);
460
var
editor = await
DocumentEditor
.CreateAsync(document, cancellationToken).ConfigureAwait(false);
Microsoft.NetCore.Analyzers\Runtime\CSharpPreferDictionaryContainsMethods.Fixer.cs (2)
52
var
editor = await
DocumentEditor
.CreateAsync(doc, ct).ConfigureAwait(false);
Microsoft.NetCore.Analyzers\Usage\CSharpDoNotPassNonNullableValueToArgumentNullExceptionThrowIfNullFixer.cs (2)
20
var
editor = await
DocumentEditor
.CreateAsync(document, cancellationToken).ConfigureAwait(false);
Microsoft.NetCore.Analyzers\Usage\CSharpPreferGenericOverloads.Fixer.cs (2)
43
var
editor = await
DocumentEditor
.CreateAsync(document, cancellationToken).ConfigureAwait(false);
Microsoft.CodeAnalysis.CSharp.Workspaces (3)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\LanguageServices\InitializeParameter\InitializeParameterHelpers.cs (3)
63
var
editor = await solutionEditor.GetDocumentEditorAsync(editingDocument.Id, cancellationToken).ConfigureAwait(false);
83
var
editor = await solutionEditor.GetDocumentEditorAsync(editingDocument.Id, cancellationToken).ConfigureAwait(false);
112
var
editor = await solutionEditor.GetDocumentEditorAsync(group.Key.Id, cancellationToken).ConfigureAwait(false);
Microsoft.CodeAnalysis.Features (32)
AddConstructorParametersFromMembers\AddConstructorParametersFromMembersCodeRefactoringProvider.AddConstructorParametersCodeAction.cs (2)
117
var
editor = await solutionEditor.GetDocumentEditorAsync(documentToUpdate.Id, cancellationToken).ConfigureAwait(false);
144
var
memberEditor = await solutionEditor.GetDocumentEditorAsync(memberDocument.Id, cancellationToken).ConfigureAwait(false);
CodeFixes\Suppression\AbstractSuppressionCodeFixProvider.RemoveSuppressionCodeAction_Attribute.cs (2)
70
var
editor = await
DocumentEditor
.CreateAsync(documentWithAttribute, cancellationToken).ConfigureAwait(false);
CodeRefactorings\MoveType\AbstractMoveTypeService.MoveTypeEditor.cs (6)
120
var
documentEditor = await
DocumentEditor
.CreateAsync(document, CancellationToken).ConfigureAwait(false);
184
private void RemoveLeadingBlankLinesFromMovedType(
DocumentEditor
documentEditor)
232
var
documentEditor = await
DocumentEditor
.CreateAsync(sourceDocument, CancellationToken).ConfigureAwait(false);
300
DocumentEditor
documentEditor,
CodeRefactorings\MoveType\AbstractMoveTypeService.MoveTypeNamespaceScopeEditor.cs (2)
46
var
editor = await
DocumentEditor
.CreateAsync(SemanticDocument.Document, this.CancellationToken).ConfigureAwait(false);
CodeRefactorings\SyncNamespace\AbstractChangeNamespaceService.cs (5)
317
var
documentEditor = await solutionEditor.GetDocumentEditorAsync(id, cancellationToken).ConfigureAwait(false);
443
var
editor = await
DocumentEditor
.CreateAsync(document, cancellationToken).ConfigureAwait(false);
737
var
editor = await
DocumentEditor
.CreateAsync(document, cancellationToken).ConfigureAwait(false);
InlineMethod\AbstractInlineMethodRefactoringProvider.cs (2)
277
var
calleeDocumentEditor = await solutionEditor.GetDocumentEditorAsync(calleeDocumentId, cancellationToken).ConfigureAwait(false);
285
var
callerDocumentEditor = await solutionEditor.GetDocumentEditorAsync(document.Id, cancellationToken).ConfigureAwait(false);
MoveStaticMembers\MoveStaticMembersWithDialogCodeAction.cs (2)
286
var
docEditor = await
DocumentEditor
.CreateAsync(doc, cancellationToken).ConfigureAwait(false);
PullMemberUp\MembersPuller.cs (6)
104
var
destinationEditor = await solutionEditor.GetDocumentEditorAsync(
123
var
originalMemberEditor = await solutionEditor.GetDocumentEditorAsync(
197
DocumentEditor
editor,
225
DocumentEditor
editor,
278
var
destinationEditor = await solutionEditor.GetDocumentEditorAsync(
330
var
originalMemberEditor = await solutionEditor.GetDocumentEditorAsync(
RemoveUnusedVariable\AbstractRemoveUnusedVariableCodeFixProvider.cs (2)
63
var
documentEditor = await
DocumentEditor
.CreateAsync(document, cancellationToken).ConfigureAwait(false);
src\roslyn\src\Analyzers\Core\CodeFixes\MakeMethodAsynchronous\AbstractMakeMethodAsynchronousCodeFixProvider.cs (2)
302
var
mainDocumentEditor = await solutionEditor.GetDocumentEditorAsync(document.Id, cancellationToken).ConfigureAwait(false);
314
var
partialDefinitionDocumentEditor = await solutionEditor.GetDocumentEditorAsync(partialDefinitionDocument.Id, cancellationToken).ConfigureAwait(false);
src\roslyn\src\Analyzers\Core\CodeFixes\UseAutoProperty\AbstractUseAutoPropertyCodeFixProvider.cs (1)
332
var
editor = await solutionEditor.GetDocumentEditorAsync(document.Id, cancellationToken).ConfigureAwait(false);
Microsoft.CodeAnalysis.NetAnalyzers (140)
Microsoft.CodeQuality.Analyzers\ApiDesignGuidelines\DefineAccessorsForAttributeArguments.Fixer.cs (4)
125
DocumentEditor
editor = await
DocumentEditor
.CreateAsync(document, cancellationToken).ConfigureAwait(false);
152
DocumentEditor
editor = await
DocumentEditor
.CreateAsync(document, cancellationToken).ConfigureAwait(false);
Microsoft.CodeQuality.Analyzers\ApiDesignGuidelines\DoNotDirectlyAwaitATask.Fixer.cs (5)
55
DocumentEditor
editor = await
DocumentEditor
.CreateAsync(document, cancellationToken).ConfigureAwait(false);
60
private static void FixDiagnostic(
DocumentEditor
editor, SyntaxNode expression, bool argument)
88
var
editor = await
DocumentEditor
.CreateAsync(document, fixAllContext.CancellationToken).ConfigureAwait(false);
Microsoft.CodeQuality.Analyzers\ApiDesignGuidelines\EnumStorageShouldBeInt32.Fixer.cs (2)
48
var
editor = await
DocumentEditor
.CreateAsync(document, cancellationToken).ConfigureAwait(false);
Microsoft.CodeQuality.Analyzers\ApiDesignGuidelines\EnumWithFlagsAttribute.Fixer.cs (2)
52
DocumentEditor
editor = await
DocumentEditor
.CreateAsync(document, cancellationToken).ConfigureAwait(false);
Microsoft.CodeQuality.Analyzers\ApiDesignGuidelines\EquatableAnalyzer.Fixer.cs (4)
95
var
editor = await
DocumentEditor
.CreateAsync(document, cancellationToken).ConfigureAwait(false);
119
var
editor = await
DocumentEditor
.CreateAsync(document, cancellationToken).ConfigureAwait(false);
Microsoft.CodeQuality.Analyzers\ApiDesignGuidelines\ExceptionsShouldBePublic.Fixer.cs (2)
49
DocumentEditor
editor = await
DocumentEditor
.CreateAsync(document, cancellationToken).ConfigureAwait(false);
Microsoft.CodeQuality.Analyzers\ApiDesignGuidelines\ImplementStandardExceptionConstructors.Fixer.cs (2)
57
DocumentEditor
editor = await
DocumentEditor
.CreateAsync(document, cancellationToken).ConfigureAwait(false);
Microsoft.CodeQuality.Analyzers\ApiDesignGuidelines\MarkAttributesWithAttributeUsage.Fixer.cs (2)
67
var
editor = await
DocumentEditor
.CreateAsync(document, cancellationToken).ConfigureAwait(false);
Microsoft.CodeQuality.Analyzers\ApiDesignGuidelines\OperatorsShouldHaveSymmetricalOverloads.Fixer.cs (2)
51
var
editor = await
DocumentEditor
.CreateAsync(document, cancellationToken).ConfigureAwait(false);
Microsoft.CodeQuality.Analyzers\ApiDesignGuidelines\OverloadOperatorEqualsOnOverridingValueTypeEquals.Fixer.cs (2)
52
var
editor = await
DocumentEditor
.CreateAsync(document, cancellationToken).ConfigureAwait(false);
Microsoft.CodeQuality.Analyzers\ApiDesignGuidelines\OverrideEqualsAndOperatorEqualsOnValueTypes.Fixer.cs (2)
64
var
editor = await
DocumentEditor
.CreateAsync(document, ct).ConfigureAwait(false);
Microsoft.CodeQuality.Analyzers\ApiDesignGuidelines\OverrideEqualsOnOverloadingOperatorEquals.Fixer.cs (2)
57
var
editor = await
DocumentEditor
.CreateAsync(document, cancellationToken).ConfigureAwait(false);
Microsoft.CodeQuality.Analyzers\ApiDesignGuidelines\OverrideGetHashCodeOnOverridingEquals.Fixer.cs (2)
49
var
editor = await
DocumentEditor
.CreateAsync(document, cancellationToken).ConfigureAwait(false);
Microsoft.CodeQuality.Analyzers\ApiDesignGuidelines\OverrideMethodsOnComparableTypes.Fixer.cs (2)
52
var
editor = await
DocumentEditor
.CreateAsync(document, cancellationToken).ConfigureAwait(false);
Microsoft.CodeQuality.Analyzers\ApiDesignGuidelines\TypesThatOwnDisposableFieldsShouldBeDisposable.Fixer.cs (2)
48
DocumentEditor
editor = await
DocumentEditor
.CreateAsync(document, cancellationToken).ConfigureAwait(false);
Microsoft.CodeQuality.Analyzers\ApiDesignGuidelines\UriParametersShouldNotBeStrings.Fixer.cs (2)
78
var
editor = await
DocumentEditor
.CreateAsync(document, cancellationToken).ConfigureAwait(false);
Microsoft.CodeQuality.Analyzers\Maintainability\AvoidLengthCalculationWhenSlicingToEnd.Fixer.cs (2)
70
var
editor = await
DocumentEditor
.CreateAsync(document, cancellationToken).ConfigureAwait(false);
Microsoft.CodeQuality.Analyzers\Maintainability\AvoidUnusedPrivateFields.Fixer.cs (2)
53
DocumentEditor
editor = await
DocumentEditor
.CreateAsync(document, cancellationToken).ConfigureAwait(false);
Microsoft.CodeQuality.Analyzers\Maintainability\UseNameofInPlaceOfString.Fixer.cs (2)
54
var
editor = await
DocumentEditor
.CreateAsync(document, cancellationToken).ConfigureAwait(false);
Microsoft.CodeQuality.Analyzers\QualityGuidelines\RemoveEmptyFinalizers.Fixer.cs (2)
44
DocumentEditor
editor = await
DocumentEditor
.CreateAsync(document, cancellationToken).ConfigureAwait(false);
Microsoft.CodeQuality.Analyzers\QualityGuidelines\UseLiteralsWhereAppropriate.Fixer.cs (2)
57
var
editor = await
DocumentEditor
.CreateAsync(document, cancellationToken).ConfigureAwait(false);
Microsoft.NetCore.Analyzers\InteropServices\ProvidePublicParameterlessSafeHandleConstructor.Fixer.cs (2)
52
var
editor = await
DocumentEditor
.CreateAsync(document, ct).ConfigureAwait(false);
Microsoft.NetCore.Analyzers\InteropServices\SpecifyMarshalingForPInvokeStringArguments.Fixer.cs (2)
70
DocumentEditor
editor = await
DocumentEditor
.CreateAsync(document, cancellationToken).ConfigureAwait(false);
Microsoft.NetCore.Analyzers\Performance\DoNotUseCountWhenAnyCanBeUsed.Fixer.cs (2)
127
var
editor = await
DocumentEditor
.CreateAsync(this._document, cancellationToken).ConfigureAwait(false);
Microsoft.NetCore.Analyzers\Performance\PreferConvertToHexStringOverBitConverter.Fixer.cs (2)
87
var
editor = await
DocumentEditor
.CreateAsync(context.Document, cancellationToken).ConfigureAwait(false);
Microsoft.NetCore.Analyzers\Performance\PreferIsEmptyOverCount.Fixer.cs (2)
49
DocumentEditor
editor = await
DocumentEditor
.CreateAsync(context.Document, cancellationToken).ConfigureAwait(false);
Microsoft.NetCore.Analyzers\Performance\PreferReadOnlySpanOverSpan.Fixer.cs (2)
57
var
editor = await
DocumentEditor
.CreateAsync(document, cancellationToken).ConfigureAwait(false);
Microsoft.NetCore.Analyzers\Performance\UseAsSpanInsteadOfRangeIndexer.Fixer.cs (2)
108
var
editor = await
DocumentEditor
.CreateAsync(_document, cancellationToken).ConfigureAwait(false);
Microsoft.NetCore.Analyzers\Performance\UsePropertyInsteadOfCountMethodWhenAvailable.Fixer.cs (2)
116
var
editor = await
DocumentEditor
.CreateAsync(this._document, cancellationToken).ConfigureAwait(false);
Microsoft.NetCore.Analyzers\Performance\UseSearchValues.Fixer.cs (3)
67
DocumentEditor
editor = await
DocumentEditor
.CreateAsync(document, cancellationToken).ConfigureAwait(false);
168
private static void ImportSystemNamespaceIfNeeded(
DocumentEditor
editor, INamedTypeSymbol memoryExtensions, SyntaxNode node)
Microsoft.NetCore.Analyzers\Performance\UseSpanClearInsteadOfFIll.Fixer.cs (2)
44
DocumentEditor
editor = await
DocumentEditor
.CreateAsync(context.Document, cancellationToken).ConfigureAwait(false);
Microsoft.NetCore.Analyzers\Performance\UseStringContainsCharOverloadWithSingleCharacters.Fixer.cs (2)
70
var
editor = await
DocumentEditor
.CreateAsync(_document, cancellationToken).ConfigureAwait(false);
Microsoft.NetCore.Analyzers\Performance\UseStringMethodCharOverloadWithSingleCharacters.Fixer.cs (3)
59
protected abstract void ApplyFix(
DocumentEditor
editor, SemanticModel model, SyntaxNode oldArgumentListNode, char c);
72
var
editor = await
DocumentEditor
.CreateAsync(_document, cancellationToken).ConfigureAwait(false);
Microsoft.NetCore.Analyzers\Runtime\AvoidConstArrays.Fixer.cs (2)
53
DocumentEditor
editor = await
DocumentEditor
.CreateAsync(document, cancellationToken).ConfigureAwait(false);
Microsoft.NetCore.Analyzers\Runtime\AvoidUnreliableStreamRead.Fixer.cs (2)
85
var
editor = await
DocumentEditor
.CreateAsync(document, cancellationToken).ConfigureAwait(false);
Microsoft.NetCore.Analyzers\Runtime\AvoidUnsealedAttributes.Fixer.cs (3)
25
DocumentEditor
editor = await
DocumentEditor
.CreateAsync(context.Document, context.CancellationToken).ConfigureAwait(false);
40
private static Task<Document> MakeSealedAsync(
DocumentEditor
editor, SyntaxNode declaration)
Microsoft.NetCore.Analyzers\Runtime\AvoidZeroLengthArrayAllocations.Fixer.cs (2)
49
DocumentEditor
editor = await
DocumentEditor
.CreateAsync(document, cancellationToken).ConfigureAwait(false);
Microsoft.NetCore.Analyzers\Runtime\InstantiateArgumentExceptionsCorrectly.Fixer.cs (4)
82
DocumentEditor
editor = await
DocumentEditor
.CreateAsync(document, token).ConfigureAwait(false);
120
DocumentEditor
editor = await
DocumentEditor
.CreateAsync(document, token).ConfigureAwait(false);
Microsoft.NetCore.Analyzers\Runtime\MarkAllNonSerializableFields.Fixer.cs (2)
57
DocumentEditor
editor = await
DocumentEditor
.CreateAsync(document, cancellationToken).ConfigureAwait(false);
Microsoft.NetCore.Analyzers\Runtime\MarkISerializableTypesWithSerializable.Fixer.cs (2)
45
DocumentEditor
editor = await
DocumentEditor
.CreateAsync(document, cancellationToken).ConfigureAwait(false);
Microsoft.NetCore.Analyzers\Runtime\PreferAsSpanOverSubstring.Fixer.cs (2)
60
var
editor = await
DocumentEditor
.CreateAsync(document, token).ConfigureAwait(false);
Microsoft.NetCore.Analyzers\Runtime\PreferConstCharOverConstUnitString.Fixer.cs (4)
106
DocumentEditor
editor = await
DocumentEditor
.CreateAsync(doc, cancellationToken).ConfigureAwait(false);
119
DocumentEditor
editor = await
DocumentEditor
.CreateAsync(doc, cancellationToken).ConfigureAwait(false);
Microsoft.NetCore.Analyzers\Runtime\PreferJsonElementParse.Fixer.cs (2)
50
DocumentEditor
editor = await
DocumentEditor
.CreateAsync(doc, ct).ConfigureAwait(false);
Microsoft.NetCore.Analyzers\Runtime\PreferStringContainsOverIndexOf.Fixer.cs (2)
78
DocumentEditor
editor = await
DocumentEditor
.CreateAsync(document, cancellationToken).ConfigureAwait(false);
Microsoft.NetCore.Analyzers\Runtime\PreferTypedStringBuilderAppendOverloads.Fixer.cs (4)
46
DocumentEditor
editor = await
DocumentEditor
.CreateAsync(doc, ct).ConfigureAwait(false);
65
DocumentEditor
editor = await
DocumentEditor
.CreateAsync(doc, ct).ConfigureAwait(false);
Microsoft.NetCore.Analyzers\Runtime\SealInternalTypes.Fixer.cs (1)
49
var
documentEditor = await solutionEditor.GetDocumentEditorAsync(document.Id, token).ConfigureAwait(false);
Microsoft.NetCore.Analyzers\Runtime\TestForEmptyStringsUsingStringLength.Fixer.cs (4)
109
DocumentEditor
editor = await
DocumentEditor
.CreateAsync(context.Document, context.CancellationToken).ConfigureAwait(false);
125
DocumentEditor
editor = await
DocumentEditor
.CreateAsync(context.Document, context.CancellationToken).ConfigureAwait(false);
Microsoft.NetCore.Analyzers\Runtime\TestForNaNCorrectly.Fixer.cs (2)
88
DocumentEditor
editor = await
DocumentEditor
.CreateAsync(context.Document, context.CancellationToken).ConfigureAwait(false);
Microsoft.NetCore.Analyzers\Runtime\UseCancellationTokenThrowIfCancellationRequested.Fixer.cs (5)
60
var
editor = await
DocumentEditor
.CreateAsync(context.Document, token).ConfigureAwait(false);
87
var
editor = await
DocumentEditor
.CreateAsync(context.Document, token).ConfigureAwait(false);
120
DocumentEditor
editor,
Microsoft.NetCore.Analyzers\Runtime\UseEnvironmentMembersFixer.cs (2)
62
DocumentEditor
editor = await
DocumentEditor
.CreateAsync(doc, cancellationToken).ConfigureAwait(false);
Microsoft.NetCore.Analyzers\Runtime\UseExceptionThrowHelpersFixer.cs (4)
41
DocumentEditor
editor = await
DocumentEditor
.CreateAsync(doc, cancellationToken).ConfigureAwait(false);
134
DocumentEditor
editor = await
DocumentEditor
.CreateAsync(document, fixAllContext.CancellationToken).ConfigureAwait(false);
Microsoft.NetCore.Analyzers\Runtime\UseRegexMembersFixer.cs (2)
66
DocumentEditor
editor = await
DocumentEditor
.CreateAsync(doc, cancellationToken).ConfigureAwait(false);
Microsoft.NetCore.Analyzers\Runtime\UseSpanBasedStringConcat.Fixer.cs (2)
88
var
editor = await
DocumentEditor
.CreateAsync(document, cancellationToken).ConfigureAwait(false);
Microsoft.NetCore.Analyzers\Runtime\UseStringEqualsOverStringCompare.Fixer.cs (2)
57
var
editor = await
DocumentEditor
.CreateAsync(document, cancellationToken).ConfigureAwait(false);
Microsoft.NetCore.Analyzers\Tasks\DoNotCreateTaskCompletionSourceWithWrongArguments.Fixer.cs (2)
45
DocumentEditor
editor = await
DocumentEditor
.CreateAsync(doc, ct).ConfigureAwait(false);
Microsoft.NetCore.Analyzers\Tasks\DoNotUseWhenAllOrWaitAllWithSingleArgumentFixer.cs (4)
45
var
editor = await
DocumentEditor
.CreateAsync(context.Document, ct).ConfigureAwait(false);
65
var
editor = await
DocumentEditor
.CreateAsync(context.Document, ct).ConfigureAwait(false);
Microsoft.NetCore.Analyzers\Usage\UseVolatileReadWrite.Fixer.cs (2)
67
var
editor = await
DocumentEditor
.CreateAsync(context.Document, cancellationToken).ConfigureAwait(false);
SyntaxEditorFixAllProvider.cs (2)
36
/// <see cref="
DocumentEditor
"/>, because <see cref="
DocumentEditor
.CreateAsync"/> binds a
Microsoft.CodeAnalysis.VisualBasic.Analyzers (1)
MetaAnalyzers\Fixers\BasicPreferIsKindFix.vb (1)
34
Protected Overrides Sub FixDiagnostic(editor As
DocumentEditor
, nodeToFix As SyntaxNode)
Microsoft.CodeAnalysis.VisualBasic.NetAnalyzers (8)
Microsoft.NetCore.Analyzers\InteropServices\BasicSpecifyMarshalingForPInvokeStringArguments.Fixer.vb (1)
34
Dim editor = Await
DocumentEditor
.CreateAsync(document, cancellationToken).ConfigureAwait(False)
Microsoft.NetCore.Analyzers\Performance\BasicPreferDictionaryTryMethodsOverContainsKeyGuardFixer.vb (2)
114
Dim editor = Await
DocumentEditor
.CreateAsync(document, ct).ConfigureAwait(False)
187
Dim editor = Await
DocumentEditor
.CreateAsync(document, ct).ConfigureAwait(False)
Microsoft.NetCore.Analyzers\Performance\BasicUseStringMethodCharOverloadWithSingleCharacters.Fixer.vb (1)
66
Protected Overrides Sub ApplyFix(editor As
DocumentEditor
, model As SemanticModel, oldArgumentListNode As SyntaxNode, c As Char)
Microsoft.NetCore.Analyzers\Runtime\BasicPreferDictionaryContainsMethods.Fixer.vb (2)
38
Dim editor = Await
DocumentEditor
.CreateAsync(doc, ct).ConfigureAwait(False)
53
Dim editor = Await
DocumentEditor
.CreateAsync(doc, ct).ConfigureAwait(False)
Microsoft.NetCore.Analyzers\Usage\BasicDoNotPassNonNullableValueToArgumentNullExceptionThrowIfNullFixer.vb (1)
16
Dim editor = Await
DocumentEditor
.CreateAsync(document, cancellationToken).ConfigureAwait(False)
Microsoft.NetCore.Analyzers\Usage\BasicPreferGenericOverloads.Fixer.vb (1)
43
Dim editor = Await
DocumentEditor
.CreateAsync(document, cancellationToken).ConfigureAwait(False)
Microsoft.CodeAnalysis.Workspaces (15)
Editing\DocumentEditor.cs (2)
26
/// Creates a new <see cref="
DocumentEditor
"/> instance.
28
public static async Task<
DocumentEditor
> CreateAsync(Document document, CancellationToken cancellationToken = default)
Editing\SolutionEditor.cs (6)
18
private readonly Dictionary<DocumentId,
DocumentEditor
> _documentEditors = [];
26
/// Gets the <see cref="
DocumentEditor
"/> for the corresponding <see cref="DocumentId"/>.
28
public async Task<
DocumentEditor
> GetDocumentEditorAsync(DocumentId id, CancellationToken cancellationToken = default)
30
if (!_documentEditors.TryGetValue(id, out
var
editor))
32
editor = await
DocumentEditor
.CreateAsync(solution.GetDocument(id), cancellationToken).ConfigureAwait(false);
46
foreach (
var
docEd in _documentEditors.Values)
Editing\SymbolEditor.cs (7)
212
/// <param name="editor">The <see cref="
DocumentEditor
"/> to apply edits to.</param>
214
public delegate void DeclarationEditAction(
DocumentEditor
editor, SyntaxNode declaration);
219
/// <param name="editor">The <see cref="
DocumentEditor
"/> to apply edits to.</param>
222
public delegate Task AsyncDeclarationEditAction(
DocumentEditor
editor, SyntaxNode declaration, CancellationToken cancellationToken);
285
var
editor = await
DocumentEditor
.CreateAsync(doc, cancellationToken).ConfigureAwait(false);
465
var
editor = await solutionEditor.GetDocumentEditorAsync(docId, cancellationToken).ConfigureAwait(false);
Microsoft.Interop.ComInterfaceGenerator (7)
Analyzers\AddGeneratedComClassFixer.cs (2)
27
var
editor = await solutionEditor.GetDocumentEditorAsync(documentId, ct).ConfigureAwait(false);
63
var
attrEditor = await solutionEditor.GetDocumentEditorAsync(attrDocumentId, ct).ConfigureAwait(false);
Analyzers\AddMarshalAsToElementFixer.cs (2)
47
DocumentEditor
editor = await
DocumentEditor
.CreateAsync(doc, ct).ConfigureAwait(false);
Analyzers\ConvertComImportToGeneratedComInterfaceFixer.cs (2)
42
var
editor = await solutionEditor.GetDocumentEditorAsync(documentId, ct).ConfigureAwait(false);
76
private static async Task ConvertComImportToGeneratedComInterfaceAsync(
DocumentEditor
editor, SyntaxNode node, bool mayRequireAdditionalWork, bool addStringMarshalling, CancellationToken ct)
src\runtime\src\libraries\System.Runtime.InteropServices\gen\Common\ConvertToSourceGeneratedInteropFixer.cs (1)
228
protected static void MakeNodeParentsPartial(
DocumentEditor
editor, SyntaxNode syntax)
Microsoft.Interop.LibraryImportGenerator (15)
Analyzers\AddDisableRuntimeMarshallingAttributeFixer.cs (2)
58
DocumentEditor
editor = await
DocumentEditor
.CreateAsync(assemblyInfo, cancellationToken).ConfigureAwait(false);
Analyzers\ConvertToLibraryImportFixer.cs (9)
88
var
editor = await solutionEditor.GetDocumentEditorAsync(documentId, ct).ConfigureAwait(false);
110
var
editor = await solutionEditor.GetDocumentEditorAsync(documentId, ct).ConfigureAwait(false);
125
var
editor = await solutionEditor.GetDocumentEditorAsync(documentId, ct).ConfigureAwait(false);
144
var
editor = await solutionEditor.GetDocumentEditorAsync(documentId, ct).ConfigureAwait(false);
173
DocumentEditor
editor,
210
DocumentEditor
editor,
292
private static async Task<bool> TransformCallersOfNoPreserveSigMethod(
DocumentEditor
editor, IMethodSymbol methodSymbol, CancellationToken cancellationToken)
433
DocumentEditor
editor,
592
DocumentEditor
editor,
Analyzers\CustomMarshallerAttributeFixer.cs (3)
187
DocumentEditor
editor,
204
private static void AddMissingMembersToStatelessMarshaller(
DocumentEditor
editor, SyntaxNode declaringSyntax, INamedTypeSymbol marshallerType, ITypeSymbol managedType, HashSet<string> missingMemberNames, bool isLinearCollectionMarshaller)
400
private static void AddMissingMembersToStatefulMarshaller(
DocumentEditor
editor, SyntaxNode declaringSyntax, INamedTypeSymbol marshallerType, ITypeSymbol managedType, HashSet<string> missingMemberNames, bool isLinearCollectionMarshaller)
src\runtime\src\libraries\System.Runtime.InteropServices\gen\Common\ConvertToSourceGeneratedInteropFixer.cs (1)
228
protected static void MakeNodeParentsPartial(
DocumentEditor
editor, SyntaxNode syntax)
Roslyn.Diagnostics.CSharp.Analyzers (5)
NumberCommentsRefactoring.cs (2)
61
var
editor = await
DocumentEditor
.CreateAsync(document, c).ConfigureAwait(false);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\LanguageServices\InitializeParameter\InitializeParameterHelpers.cs (3)
63
var
editor = await solutionEditor.GetDocumentEditorAsync(editingDocument.Id, cancellationToken).ConfigureAwait(false);
83
var
editor = await solutionEditor.GetDocumentEditorAsync(editingDocument.Id, cancellationToken).ConfigureAwait(false);
112
var
editor = await solutionEditor.GetDocumentEditorAsync(group.Key.Id, cancellationToken).ConfigureAwait(false);
System.Text.RegularExpressions.Generator (6)
UpgradeToGeneratedRegexCodeFixer.cs (6)
148
DocumentEditor
editor = await
DocumentEditor
.CreateAsync(document, cancellationToken).ConfigureAwait(false);
212
DocumentEditor
editor = await
DocumentEditor
.CreateAsync(document, cancellationToken).ConfigureAwait(false);
262
DocumentEditor
editor = await
DocumentEditor
.CreateAsync(document, cancellationToken).ConfigureAwait(false);