211 references to Document
Microsoft.CodeAnalysis.CodeStyle.Fixes (41)
AbstractAddAnonymousTypeMemberNameCodeFixProvider.cs (1)
35
var document = context.
Document
;
AbstractAddDocCommentNodesCodeFixProvider.cs (2)
32
var root = await context.
Document
.GetRequiredSyntaxRootAsync(context.CancellationToken).ConfigureAwait(false);
44
cancellationToken => AddParamTagAsync(context.
Document
, parentMethod, docCommentNode, cancellationToken),
AbstractAddExplicitCastCodeFixProvider.cs (1)
58
var document = context.
Document
;
AbstractAddObsoleteAttributeCodeFixProvider.cs (1)
36
var document = context.
Document
;
AbstractAddParameterCodeFixProvider.cs (2)
56
var document = context.
Document
;
233
var codeFixData = PrepareCreationOfCodeActions(context.
Document
, arguments, methodsAndArgumentsToAdd);
AbstractAliasAmbiguousTypeCodeFixProvider.cs (1)
33
var document = context.
Document
;
AbstractChangeNamespaceToMatchFolderCodeFixProvider.cs (2)
27
var service = context.
Document
.Project.Solution.Services.GetRequiredService<ISupportedChangesService>();
33
cancellationToken => FixAllInDocumentAsync(context.
Document
, context.Diagnostics,
AbstractConflictMarkerCodeFixProvider.cs (2)
70
var document = context.
Document
;
266
var document = context.
Document
;
AbstractConvertToAsyncCodeFixProvider.cs (2)
32
var root = await context.
Document
.GetSyntaxRootAsync(context.CancellationToken).ConfigureAwait(false);
41
node, context.
Document
, diagnostic, context.CancellationToken).ConfigureAwait(false);
AbstractFileHeaderCodeFixProvider.cs (1)
38
cancellationToken => GetTransformedDocumentAsync(context.
Document
, context.GetOptionsProvider(), cancellationToken),
AbstractIteratorCodeFixProvider.cs (2)
28
var root = await context.
Document
.GetSyntaxRootAsync(context.CancellationToken).ConfigureAwait(false);
36
var codeAction = await GetCodeFixAsync(root, node, context.
Document
, diagnostic, context.CancellationToken).ConfigureAwait(false);
AbstractMakeMethodAsynchronousCodeFixProvider.cs (1)
35
var document = context.
Document
;
AbstractMakeMethodSynchronousCodeFixProvider.cs (1)
41
cancellationToken => FixNodeAsync(context.
Document
, node, cancellationToken),
AbstractMultipleBlankLinesCodeFixProvider.cs (1)
35
var document = context.
Document
;
AbstractOrderModifiersCodeFixProvider.cs (1)
43
var syntaxTree = await context.
Document
.GetRequiredSyntaxTreeAsync(context.CancellationToken).ConfigureAwait(false);
AbstractPopulateSwitchCodeFixProvider.cs (1)
64
var document = context.
Document
;
AbstractRemoveAsyncModifierCodeFixProvider.cs (1)
31
var document = context.
Document
;
AbstractRemoveDocCommentNodeCodeFixProvider.cs (2)
36
var root = await context.
Document
.GetRequiredSyntaxRootAsync(context.CancellationToken).ConfigureAwait(false);
43
cancellationToken => RemoveDuplicateParamTagAsync(context.
Document
, paramNode, cancellationToken),
AbstractRemoveUnnecessaryImportsCodeFixProvider.cs (1)
33
c => RemoveUnnecessaryImportsAsync(context.
Document
, context.GetOptionsProvider(), c),
AbstractRemoveUnusedValuesCodeFixProvider.cs (3)
147
if (IsForEachIterationVariableDiagnostic(diagnostic, context.
Document
, context.CancellationToken))
156
var syntaxFacts = context.
Document
.GetRequiredLanguageService<ISyntaxFactsService>();
157
var root = await context.
Document
.GetRequiredSyntaxRootAsync(context.CancellationToken).ConfigureAwait(false);
AbstractUnsealClassCodeFixProvider.cs (1)
31
var document = context.
Document
;
AbstractUpgradeProjectCodeFixProvider.cs (1)
43
var project = context.
Document
.Project;
ConsecutiveStatementPlacementCodeFixProvider.cs (1)
35
var document = context.
Document
;
FormattingCodeFixProvider.cs (3)
65
var options = await context.
Document
.GetCodeFixOptionsAsync(context.GetOptionsProvider(), cancellationToken).ConfigureAwait(false);
67
var tree = await context.
Document
.GetRequiredSyntaxTreeAsync(cancellationToken).ConfigureAwait(false);
69
return context.
Document
.WithText(await updatedTree.GetTextAsync(cancellationToken).ConfigureAwait(false));
NamingStyleCodeFixProvider.cs (1)
57
var document = context.
Document
;
RemoveUnnecessaryAttributeSuppressionsCodeFixProvider.cs (1)
33
var root = await context.
Document
.GetRequiredSyntaxRootAsync(context.CancellationToken).ConfigureAwait(false);
RemoveUnnecessaryPragmaSuppressionsCodeFixProvider.cs (2)
38
var root = await context.
Document
.GetRequiredSyntaxRootAsync(context.CancellationToken).ConfigureAwait(false);
39
var syntaxFacts = context.
Document
.GetRequiredLanguageService<ISyntaxFactsService>();
SyntaxEditorBasedCodeFixProvider.cs (1)
64
return cancellationToken => FixAllAsync(context.
Document
, diagnostics, context.GetOptionsProvider(), cancellationToken);
UpdateLegacySuppressionsCodeFixProvider.cs (1)
34
var root = await context.
Document
.GetRequiredSyntaxRootAsync(context.CancellationToken).ConfigureAwait(false);
Microsoft.CodeAnalysis.CSharp.CodeStyle.Fixes (34)
AbstractAssignOutParametersCodeFixProvider.cs (1)
32
var document = context.
Document
;
AddInheritdocCodeFixProvider.cs (2)
48
var document = context.
Document
;
70
semanticModel ??= await context.
Document
.GetRequiredSemanticModelAsync(cancellationToken).ConfigureAwait(false);
ArrowExpressionClausePlacementCodeFixProvider.cs (1)
38
var document = context.
Document
;
ConditionalExpressionPlacementCodeFixProvider.cs (1)
38
var document = context.
Document
;
ConsecutiveBracePlacementCodeFixProvider.cs (1)
37
var document = context.
Document
;
ConstructorInitializerPlacementCodeFixProvider.cs (1)
36
var document = context.
Document
;
CSharpAddParenthesesAroundConditionalExpressionInInterpolatedStringCodeFixProvider.cs (2)
39
var root = await context.
Document
.GetRequiredSyntaxRootAsync(context.CancellationToken).ConfigureAwait(false);
48
c => GetChangedDocumentAsync(context.
Document
, conditionalExpression.SpanStart, c),
CSharpConvertToRecordCodeFixProvider.cs (1)
36
var document = context.
Document
;
CSharpDeclareAsNullableCodeFixProvider.cs (1)
51
var model = await context.
Document
.GetRequiredSemanticModelAsync(cancellationToken).ConfigureAwait(false);
CSharpDisambiguateSameVariableCodeFixProvider.cs (1)
45
var document = context.
Document
;
CSharpFixReturnTypeCodeFixProvider.cs (1)
43
var document = context.
Document
;
CSharpMakeMemberRequiredCodeFixProvider.cs (1)
40
var document = context.
Document
;
CSharpMakeStatementAsynchronousCodeFixProvider.cs (1)
38
var root = await context.
Document
.GetRequiredSyntaxRootAsync(context.CancellationToken).ConfigureAwait(false);
CSharpRemoveConfusingSuppressionCodeFixProvider.cs (1)
40
var document = context.
Document
;
CSharpReplaceDefaultLiteralCodeFixProvider.cs (4)
45
var syntaxRoot = await context.
Document
.GetRequiredSyntaxRootAsync(context.CancellationToken).ConfigureAwait(false);
52
var semanticModel = await context.
Document
.GetRequiredSemanticModelAsync(context.CancellationToken).ConfigureAwait(false);
55
context.
Document
, semanticModel, defaultLiteral, context.CancellationToken);
62
c => ReplaceAsync(context.
Document
, context.Span, newExpression, c),
CSharpUpdateProjectToAllowUnsafeCodeFixProvider.cs (1)
39
_ => Task.FromResult(AllowUnsafeOnProject(context.
Document
.Project))), context.Diagnostics);
EmbeddedStatementPlacementCodeFixProvider.cs (1)
37
var document = context.
Document
;
HideBaseCodeFixProvider.cs (2)
35
var root = await context.
Document
.GetRequiredSyntaxRootAsync(context.CancellationToken).ConfigureAwait(false);
49
context.RegisterCodeFix(new AddNewKeywordAction(context.
Document
, originalNode, context.GetOptionsProvider()), context.Diagnostics);
MakeRefStructCodeFixProvider.cs (1)
43
var document = context.
Document
;
MisplacedUsingDirectivesCodeFixProvider.cs (1)
59
var document = context.
Document
;
PassInCapturedVariablesAsArgumentsCodeFixProvider.cs (1)
40
context.
Document
,
RemoveInKeywordCodeFixProvider.cs (2)
40
var root = await context.
Document
.GetRequiredSyntaxRootAsync(context.CancellationToken).ConfigureAwait(false);
54
cancellationToken => FixAsync(context.
Document
, argumentSyntax, cancellationToken),
RemoveNewModifierCodeFixProvider.cs (3)
38
var root = await context.
Document
.GetRequiredSyntaxRootAsync(context.CancellationToken).ConfigureAwait(false);
49
var generator = context.
Document
.GetRequiredLanguageService<SyntaxGenerator>();
56
ct => FixAsync(context.
Document
, generator, memberDeclarationSyntax, ct),
UseExplicitTypeForConstCodeFixProvider.cs (1)
41
var document = context.
Document
;
UseExpressionBodyForLambdaCodeFixProvider.cs (1)
37
var document = context.
Document
;
Microsoft.CodeAnalysis.CSharp.EditorFeatures.UnitTests (4)
Diagnostics\FixAllProvider\BatchFixerTests.cs (2)
73
var root = await context.
Document
.GetSyntaxRootAsync(context.CancellationToken).ConfigureAwait(false);
84
var newDocument = context.
Document
.WithSyntaxRoot(newRoot);
Formatting\CodeCleanupTests.TestFixers.cs (2)
32
var root = await context.
Document
.GetSyntaxRootAsync(cancellationToken);
40
return context.
Document
.WithSyntaxRoot(newRoot);
Microsoft.CodeAnalysis.CSharp.Features (39)
AbstractAssignOutParametersCodeFixProvider.cs (1)
32
var document = context.
Document
;
AddInheritdocCodeFixProvider.cs (2)
48
var document = context.
Document
;
70
semanticModel ??= await context.
Document
.GetRequiredSemanticModelAsync(cancellationToken).ConfigureAwait(false);
ArrowExpressionClausePlacementCodeFixProvider.cs (1)
38
var document = context.
Document
;
CodeFixes\GenerateMethod\GenerateDeconstructMethodCodeFixProvider.cs (2)
44
if (context.
Document
.Project.IsSubmission)
49
var document = context.
Document
;
ConditionalExpressionPlacementCodeFixProvider.cs (1)
38
var document = context.
Document
;
ConsecutiveBracePlacementCodeFixProvider.cs (1)
37
var document = context.
Document
;
ConstructorInitializerPlacementCodeFixProvider.cs (1)
36
var document = context.
Document
;
ConvertProgram\ConvertToProgramMainCodeFixProvider.cs (1)
36
var document = context.
Document
;
ConvertProgram\ConvertToTopLevelStatementsCodeFixProvider.cs (1)
38
var document = context.
Document
;
CSharpAddParenthesesAroundConditionalExpressionInInterpolatedStringCodeFixProvider.cs (2)
39
var root = await context.
Document
.GetRequiredSyntaxRootAsync(context.CancellationToken).ConfigureAwait(false);
48
c => GetChangedDocumentAsync(context.
Document
, conditionalExpression.SpanStart, c),
CSharpConvertToRecordCodeFixProvider.cs (1)
36
var document = context.
Document
;
CSharpDeclareAsNullableCodeFixProvider.cs (1)
51
var model = await context.
Document
.GetRequiredSemanticModelAsync(cancellationToken).ConfigureAwait(false);
CSharpDisambiguateSameVariableCodeFixProvider.cs (1)
45
var document = context.
Document
;
CSharpFixReturnTypeCodeFixProvider.cs (1)
43
var document = context.
Document
;
CSharpMakeMemberRequiredCodeFixProvider.cs (1)
40
var document = context.
Document
;
CSharpMakeStatementAsynchronousCodeFixProvider.cs (1)
38
var root = await context.
Document
.GetRequiredSyntaxRootAsync(context.CancellationToken).ConfigureAwait(false);
CSharpRemoveConfusingSuppressionCodeFixProvider.cs (1)
40
var document = context.
Document
;
CSharpReplaceDefaultLiteralCodeFixProvider.cs (4)
45
var syntaxRoot = await context.
Document
.GetRequiredSyntaxRootAsync(context.CancellationToken).ConfigureAwait(false);
52
var semanticModel = await context.
Document
.GetRequiredSemanticModelAsync(context.CancellationToken).ConfigureAwait(false);
55
context.
Document
, semanticModel, defaultLiteral, context.CancellationToken);
62
c => ReplaceAsync(context.
Document
, context.Span, newExpression, c),
CSharpUpdateProjectToAllowUnsafeCodeFixProvider.cs (1)
39
_ => Task.FromResult(AllowUnsafeOnProject(context.
Document
.Project))), context.Diagnostics);
EmbeddedStatementPlacementCodeFixProvider.cs (1)
37
var document = context.
Document
;
HideBaseCodeFixProvider.cs (2)
35
var root = await context.
Document
.GetRequiredSyntaxRootAsync(context.CancellationToken).ConfigureAwait(false);
49
context.RegisterCodeFix(new AddNewKeywordAction(context.
Document
, originalNode, context.GetOptionsProvider()), context.Diagnostics);
ImplementInterface\CSharpImplementInterfaceCodeFixProvider.cs (1)
41
var document = context.
Document
;
MakeRefStructCodeFixProvider.cs (1)
43
var document = context.
Document
;
MisplacedUsingDirectivesCodeFixProvider.cs (1)
59
var document = context.
Document
;
PassInCapturedVariablesAsArgumentsCodeFixProvider.cs (1)
40
context.
Document
,
RemoveInKeywordCodeFixProvider.cs (2)
40
var root = await context.
Document
.GetRequiredSyntaxRootAsync(context.CancellationToken).ConfigureAwait(false);
54
cancellationToken => FixAsync(context.
Document
, argumentSyntax, cancellationToken),
RemoveNewModifierCodeFixProvider.cs (3)
38
var root = await context.
Document
.GetRequiredSyntaxRootAsync(context.CancellationToken).ConfigureAwait(false);
49
var generator = context.
Document
.GetRequiredLanguageService<SyntaxGenerator>();
56
ct => FixAsync(context.
Document
, generator, memberDeclarationSyntax, ct),
UseExplicitTypeForConstCodeFixProvider.cs (1)
41
var document = context.
Document
;
UseExpressionBodyForLambdaCodeFixProvider.cs (1)
37
var document = context.
Document
;
Microsoft.CodeAnalysis.EditorFeatures.UnitTests (4)
CodeFixes\CodeFixServiceTests.cs (2)
749
context.RegisterCodeFix(CodeAction.Create(_name, ct => Task.FromResult(context.
Document
)), fixableDiagnostics);
795
ct => Task.FromResult(context.
Document
),
CodeFixes\ErrorCases\CodeFixExceptionInGetFixAllProvider.cs (1)
30
context.RegisterCodeFix(CodeAction.Create("Do Nothing", token => Task.FromResult(context.
Document
)), context.Diagnostics[0]);
CodeFixes\ErrorCases\CodeFixExceptionInRegisterMethodAsync.cs (1)
25
var root = await context.
Document
.GetSyntaxRootAsync(context.CancellationToken).ConfigureAwait(false);
Microsoft.CodeAnalysis.EditorFeatures2.UnitTests (7)
CodeFixes\CodeFixServiceTests.vb (6)
238
Contract.ThrowIfFalse(context.
Document
.Project.Language = LanguageNames.CSharp)
239
Dim root = Await context.
Document
.GetSyntaxRootAsync(context.CancellationToken).ConfigureAwait(False)
242
context.RegisterCodeFix(CodeAction.Create("FIX_TEST0000", Function(ct) Task.FromResult(context.
Document
.WithSyntaxRoot(root))), context.Diagnostics)
263
Contract.ThrowIfFalse(context.
Document
.Project.Language = LanguageNames.CSharp)
264
Dim root = Await context.
Document
.GetSyntaxRootAsync(context.CancellationToken).ConfigureAwait(False)
267
context.RegisterCodeFix(CodeAction.Create("FIX_TEST1111", Function(ct) Task.FromResult(context.
Document
.WithSyntaxRoot(root))), context.Diagnostics)
Diagnostics\AdditionalFileDiagnosticsTests.vb (1)
115
Dim project = context.
Document
.Project
Microsoft.CodeAnalysis.Features (58)
AbstractAddAnonymousTypeMemberNameCodeFixProvider.cs (1)
35
var document = context.
Document
;
AbstractAddDocCommentNodesCodeFixProvider.cs (2)
32
var root = await context.
Document
.GetRequiredSyntaxRootAsync(context.CancellationToken).ConfigureAwait(false);
44
cancellationToken => AddParamTagAsync(context.
Document
, parentMethod, docCommentNode, cancellationToken),
AbstractAddExplicitCastCodeFixProvider.cs (1)
58
var document = context.
Document
;
AbstractAddObsoleteAttributeCodeFixProvider.cs (1)
36
var document = context.
Document
;
AbstractAddParameterCodeFixProvider.cs (2)
56
var document = context.
Document
;
233
var codeFixData = PrepareCreationOfCodeActions(context.
Document
, arguments, methodsAndArgumentsToAdd);
AbstractAliasAmbiguousTypeCodeFixProvider.cs (1)
33
var document = context.
Document
;
AbstractChangeNamespaceToMatchFolderCodeFixProvider.cs (2)
27
var service = context.
Document
.Project.Solution.Services.GetRequiredService<ISupportedChangesService>();
33
cancellationToken => FixAllInDocumentAsync(context.
Document
, context.Diagnostics,
AbstractConflictMarkerCodeFixProvider.cs (2)
70
var document = context.
Document
;
266
var document = context.
Document
;
AbstractConvertToAsyncCodeFixProvider.cs (2)
32
var root = await context.
Document
.GetSyntaxRootAsync(context.CancellationToken).ConfigureAwait(false);
41
node, context.
Document
, diagnostic, context.CancellationToken).ConfigureAwait(false);
AbstractFileHeaderCodeFixProvider.cs (1)
38
cancellationToken => GetTransformedDocumentAsync(context.
Document
, context.GetOptionsProvider(), cancellationToken),
AbstractIteratorCodeFixProvider.cs (2)
28
var root = await context.
Document
.GetSyntaxRootAsync(context.CancellationToken).ConfigureAwait(false);
36
var codeAction = await GetCodeFixAsync(root, node, context.
Document
, diagnostic, context.CancellationToken).ConfigureAwait(false);
AbstractMakeMethodAsynchronousCodeFixProvider.cs (1)
35
var document = context.
Document
;
AbstractMakeMethodSynchronousCodeFixProvider.cs (1)
41
cancellationToken => FixNodeAsync(context.
Document
, node, cancellationToken),
AbstractMultipleBlankLinesCodeFixProvider.cs (1)
35
var document = context.
Document
;
AbstractOrderModifiersCodeFixProvider.cs (1)
43
var syntaxTree = await context.
Document
.GetRequiredSyntaxTreeAsync(context.CancellationToken).ConfigureAwait(false);
AbstractPopulateSwitchCodeFixProvider.cs (1)
64
var document = context.
Document
;
AbstractRemoveAsyncModifierCodeFixProvider.cs (1)
31
var document = context.
Document
;
AbstractRemoveDocCommentNodeCodeFixProvider.cs (2)
36
var root = await context.
Document
.GetRequiredSyntaxRootAsync(context.CancellationToken).ConfigureAwait(false);
43
cancellationToken => RemoveDuplicateParamTagAsync(context.
Document
, paramNode, cancellationToken),
AbstractRemoveUnnecessaryImportsCodeFixProvider.cs (1)
33
c => RemoveUnnecessaryImportsAsync(context.
Document
, context.GetOptionsProvider(), c),
AbstractRemoveUnusedValuesCodeFixProvider.cs (3)
147
if (IsForEachIterationVariableDiagnostic(diagnostic, context.
Document
, context.CancellationToken))
156
var syntaxFacts = context.
Document
.GetRequiredLanguageService<ISyntaxFactsService>();
157
var root = await context.
Document
.GetRequiredSyntaxRootAsync(context.CancellationToken).ConfigureAwait(false);
AbstractUnsealClassCodeFixProvider.cs (1)
31
var document = context.
Document
;
AbstractUpgradeProjectCodeFixProvider.cs (1)
43
var project = context.
Document
.Project;
AddImport\AbstractAddImportCodeFixProvider.cs (1)
51
var document = context.
Document
;
AddMissingReference\AbstractAddMissingReferenceCodeFixProvider.cs (2)
61
context.
Document
.Project, identity, context.CancellationToken).ConfigureAwait(false);
71
var compilation = await context.
Document
.Project.GetRequiredCompilationAsync(cancellationToken).ConfigureAwait(false);
AddPackage\AbstractAddPackageCodeFixProvider.cs (1)
44
var document = context.
Document
;
CodeFixes\GenerateMember\AbstractGenerateMemberCodeFixProvider.cs (3)
34
if (context.
Document
.Project.IsSubmission)
40
var document = context.
Document
;
47
var codeActions = await GetCodeActionsAsync(context.
Document
, name, context.Options, context.CancellationToken).ConfigureAwait(false);
CodeFixes\Suppression\WrapperCodeFixProvider.cs (2)
35
var suppressionFixes = await _suppressionFixProvider.GetFixesAsync(context.
Document
, context.Span, documentDiagnostics, context.Options, context.CancellationToken).ConfigureAwait(false);
42
var suppressionFixes = await _suppressionFixProvider.GetFixesAsync(context.
Document
.Project, projectDiagnostics, context.Options, context.CancellationToken).ConfigureAwait(false);
ConsecutiveStatementPlacementCodeFixProvider.cs (1)
35
var document = context.
Document
;
FormattingCodeFixProvider.cs (3)
65
var options = await context.
Document
.GetCodeFixOptionsAsync(context.GetOptionsProvider(), cancellationToken).ConfigureAwait(false);
67
var tree = await context.
Document
.GetRequiredSyntaxTreeAsync(cancellationToken).ConfigureAwait(false);
69
return context.
Document
.WithText(await updatedTree.GetTextAsync(cancellationToken).ConfigureAwait(false));
FullyQualify\AbstractFullyQualifyCodeFixProvider.cs (1)
24
var document = context.
Document
;
GenerateDefaultConstructors\AbstractGenerateDefaultConstructorCodeFixProvider.cs (1)
24
var document = context.
Document
;
ImplementAbstractClass\AbstractImplementAbstractClassCodeFixProvider.cs (1)
29
var document = context.
Document
;
NamingStyleCodeFixProvider.cs (1)
57
var document = context.
Document
;
RemoveUnnecessaryAttributeSuppressionsCodeFixProvider.cs (1)
33
var root = await context.
Document
.GetRequiredSyntaxRootAsync(context.CancellationToken).ConfigureAwait(false);
RemoveUnnecessaryPragmaSuppressionsCodeFixProvider.cs (2)
38
var root = await context.
Document
.GetRequiredSyntaxRootAsync(context.CancellationToken).ConfigureAwait(false);
39
var syntaxFacts = context.
Document
.GetRequiredLanguageService<ISyntaxFactsService>();
RemoveUnusedVariable\AbstractRemoveUnusedVariableCodeFixProvider.cs (1)
43
var document = context.
Document
;
SimplifyTypeNames\AbstractSimplifyTypeNamesCodeFixProvider.cs (1)
77
var document = context.
Document
;
SpellCheck\AbstractSpellCheckCodeFixProvider.cs (3)
41
var document = context.
Document
;
112
var document = context.
Document
;
155
var document = context.
Document
;
UpdateLegacySuppressionsCodeFixProvider.cs (1)
34
var root = await context.
Document
.GetRequiredSyntaxRootAsync(context.CancellationToken).ConfigureAwait(false);
UseAutoProperty\AbstractUseAutoPropertyCodeFixProvider.cs (1)
75
var solution = context.
Document
.Project.Solution;
Microsoft.CodeAnalysis.VisualBasic.EditorFeatures.UnitTests (2)
Formatting\CodeCleanUpTests.vb (2)
729
Dim root = Await context.
Document
.GetSyntaxRootAsync(cancellationToken)
731
Return context.
Document
.WithSyntaxRoot(root.RemoveNode(node.Parent, SyntaxRemoveOptions.KeepNoTrivia))
Microsoft.CodeAnalysis.VisualBasic.Features (17)
CodeFixes\CorrectNextControlVariable\CorrectNextControlVariableCodeFixProvider.vb (2)
37
Dim root = Await context.
Document
.GetSyntaxRootAsync(context.CancellationToken).ConfigureAwait(False)
66
context.RegisterCodeFix(New CorrectNextControlVariableCodeAction(context.
Document
, nodeToReplace, newNode), context.Diagnostics)
CodeFixes\GenerateEndConstruct\GenerateEndConstructCodeFixProvider.vb (4)
65
Dim root = Await context.
Document
.GetSyntaxRootAsync(context.CancellationToken).ConfigureAwait(False)
87
Function(c) GeneratePropertyEndConstructAsync(context.
Document
, DirectCast(endStatement.Parent, PropertyBlockSyntax), c),
98
Function(c) GeneratePropertyEndConstructAsync(context.
Document
, DirectCast(endStatement.Parent.Parent, PropertyBlockSyntax), c),
109
Function(c) GenerateEndConstructAsync(context.
Document
, endStatement, c),
CodeFixes\GenerateEvent\GenerateEventCodeFixProvider.vb (4)
45
Dim root = Await context.
Document
.GetSyntaxRootAsync(context.CancellationToken).ConfigureAwait(False)
56
result = Await GenerateEventFromImplementsAsync(context.
Document
, qualifiedName, context.Options, context.CancellationToken).ConfigureAwait(False)
61
result = Await GenerateEventFromHandlesAsync(context.
Document
, handlesClauseItem, context.Options, context.CancellationToken).ConfigureAwait(False)
66
result = Await GenerateEventFromAddRemoveHandlerAsync(context.
Document
, handlerStatement, context.Options, context.CancellationToken).ConfigureAwait(False)
CodeFixes\IncorrectExitContinue\IncorrectExitContinueCodeFixProvider.vb (1)
59
Dim document = context.
Document
CodeFixes\IncorrectFunctionReturnType\IncorrectFunctionReturnTypeCodeFixProvider.vb (1)
41
Dim document = context.
Document
CodeFixes\MoveToTopOfFile\MoveToTopOfFileCodeFixProvider.vb (1)
44
Dim document = context.
Document
CodeFixes\OverloadBase\OverloadBaseCodeFixProvider.vb (3)
37
Dim root = Await context.
Document
.GetSyntaxRootAsync(context.CancellationToken).ConfigureAwait(False)
49
context.RegisterCodeFix(New AddKeywordAction(context.
Document
, token.Parent, VBFeaturesResources.Add_Overloads, SyntaxKind.OverloadsKeyword, context.Options), context.Diagnostics)
51
context.RegisterCodeFix(New AddKeywordAction(context.
Document
, token.Parent, VBFeaturesResources.Add_Shadows, SyntaxKind.ShadowsKeyword, context.Options), context.Diagnostics)
ImplementInterface\VisualBasicImplementInterfaceCodeFixProvider.vb (1)
39
Dim document = context.
Document
Microsoft.CodeAnalysis.Workspaces (3)
CodeFixes\CodeFixContext.cs (2)
52
/// This property should be used instead of <see cref="
Document
"/> property by
59
/// Text span within the <see cref="
Document
"/> or <see cref="TextDocument"/> to fix.
SyntaxEditorBasedCodeFixProvider.cs (1)
64
return cancellationToken => FixAllAsync(context.
Document
, diagnostics, context.GetOptionsProvider(), cancellationToken);
Microsoft.CodeAnalysis.Workspaces.UnitTests (1)
BatchFixAllProviderTests.cs (1)
104
cancellationToken => CreateChangedDocument(context.
Document
, diagnostic.Location.SourceSpan, replacement, cancellationToken),
Microsoft.VisualStudio.LanguageServices.Xaml (1)
CodeFixes\RemoveUnnecessaryUsings\XamlRemoveUnnecessaryUsingsCodeFixProvider.cs (1)
50
c => RemoveUnnecessaryImportsAsync(context.
Document
, c),