-
Notifications
You must be signed in to change notification settings - Fork 4.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #22314 from MaStr11/AddParameterCodeFixForMethod
AddParameterCodeFixProvider: Add support for method invocations.
- Loading branch information
Showing
28 changed files
with
3,196 additions
and
101 deletions.
There are no files selected for viewing
1,822 changes: 1,822 additions & 0 deletions
1,822
src/EditorFeatures/CSharpTest/AddParameter/AddParameterTests.cs
Large diffs are not rendered by default.
Oops, something went wrong.
623 changes: 623 additions & 0 deletions
623
src/EditorFeatures/VisualBasicTest/AddParameter/AddParameterTests.vb
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
437 changes: 359 additions & 78 deletions
437
src/Features/Core/Portable/AddParameter/AbstractAddParameterCodeFixProvider.cs
Large diffs are not rendered by default.
Oops, something went wrong.
22 changes: 22 additions & 0 deletions
22
src/Features/Core/Portable/AddParameter/ArgumentInsertPositionData.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. | ||
|
||
using System; | ||
using System.Collections.Generic; | ||
using System.Text; | ||
|
||
namespace Microsoft.CodeAnalysis.AddParameter | ||
{ | ||
internal struct ArgumentInsertPositionData<TArgumentSyntax> where TArgumentSyntax : SyntaxNode | ||
{ | ||
public ArgumentInsertPositionData(IMethodSymbol methodToUpdate, TArgumentSyntax argumentToInsert, int argumentInsertionIndex) | ||
{ | ||
MethodToUpdate = methodToUpdate; | ||
ArgumentToInsert = argumentToInsert; | ||
ArgumentInsertionIndex = argumentInsertionIndex; | ||
} | ||
|
||
public IMethodSymbol MethodToUpdate { get; } | ||
public TArgumentSyntax ArgumentToInsert { get; } | ||
public int ArgumentInsertionIndex { get; } | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. | ||
|
||
using System; | ||
using System.Collections.Generic; | ||
using System.Text; | ||
using System.Threading; | ||
using System.Threading.Tasks; | ||
|
||
namespace Microsoft.CodeAnalysis.AddParameter | ||
{ | ||
internal struct CodeFixData | ||
{ | ||
public CodeFixData( | ||
IMethodSymbol method, | ||
Func<CancellationToken, Task<Solution>> createChangedSolutionNonCascading, | ||
Func<CancellationToken, Task<Solution>> createChangedSolutionCascading) | ||
{ | ||
Method = method ?? throw new ArgumentNullException(nameof(method)); | ||
CreateChangedSolutionNonCascading = createChangedSolutionNonCascading ?? throw new ArgumentNullException(nameof(createChangedSolutionNonCascading)); | ||
CreateChangedSolutionCascading = createChangedSolutionCascading; | ||
} | ||
|
||
/// <summary> | ||
/// The overload to fix. | ||
/// </summary> | ||
public IMethodSymbol Method { get; } | ||
|
||
/// <summary> | ||
/// A mandatory fix for the overload without cascading. | ||
/// </summary> | ||
public Func<CancellationToken, Task<Solution>> CreateChangedSolutionNonCascading { get; } | ||
|
||
/// <summary> | ||
/// An optional fix for the overload with cascading. | ||
/// </summary> | ||
public Func<CancellationToken, Task<Solution>> CreateChangedSolutionCascading { get; } | ||
} | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.