Skip to content

Commit 3461628

Browse files
author
MPCoreDeveloper
committed
added assets
1 parent 64c8fc7 commit 3461628

File tree

6 files changed

+61
-23
lines changed

6 files changed

+61
-23
lines changed

.gitattributes

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,12 @@
22
# Set default behavior to automatically normalize line endings.
33
###############################################################################
44
* text=auto
5+
# Ignore PowerShell scripts for language statistics
6+
*.ps1 linguist-language=PowerShell
7+
*.ps1 linguist-vendored
58

9+
# Force C# as the primary language
10+
*.cs linguist-language=C#
611
###############################################################################
712
# Set default behavior for command prompt diff.
813
#

Assets/logo.jpeg

114 KB
Loading

Posseth.NamedArguments.AnalyzerAndFixer.CodeFixes/PossethNamedArgumentsAnalyzerAndFixerCodeFixProvider.cs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
namespace Posseth.NamedArguments.AnalyzerAndFixer
1616
{
1717
[ExportCodeFixProvider(LanguageNames.CSharp, Name = nameof(NamedArgumentsCodeFixProvider)), Shared]
18-
public class NamedArgumentsCodeFixProvider : CodeFixProvider
18+
public class NamedArgumentsCodeFixProvider : CodeFixProvider
1919
{
2020
private const string Title = "Use named argument";
2121

@@ -39,6 +39,7 @@ public sealed override async Task RegisterCodeFixesAsync(CodeFixContext context)
3939
equivalenceKey: Title),
4040
diagnostic);
4141
}
42+
4243
private async Task<Document> UseNamedArgumentAsync(Document document, ArgumentSyntax argument, CancellationToken cancellationToken)
4344
{
4445
var semanticModel = await document.GetSemanticModelAsync(cancellationToken).ConfigureAwait(false);
@@ -47,29 +48,29 @@ private async Task<Document> UseNamedArgumentAsync(Document document, ArgumentSy
4748

4849
if (invocation == null)
4950
{
50-
// Als de parent geen InvocationExpressionSyntax is, kunnen we de fix niet toepassen
51+
// If the parent is not an InvocationExpressionSyntax, we cannot apply the fix
5152
return document;
5253
}
5354

5455
var methodSymbol = semanticModel.GetSymbolInfo(invocation).Symbol as IMethodSymbol;
5556

5657
if (methodSymbol == null)
5758
{
58-
// Als methodSymbol null is, kunnen we de fix niet toepassen
59+
// If methodSymbol is null, we cannot apply the fix
5960
return document;
6061
}
6162

6263
var parameter = methodSymbol.Parameters[argumentList.Arguments.IndexOf(argument)];
6364

6465
if (parameter == null)
6566
{
66-
// Als parameter null is, kunnen we de fix niet toepassen
67+
// If parameter is null, we cannot apply the fix
6768
return document;
6869
}
6970

70-
// Maak een nieuwe argument node met een NameColon
71+
// Create a new argument node with a NameColon
7172
var namedArgument = SyntaxFactory.Argument(
72-
SyntaxFactory.NameColon(parameter.Name), // Hier voeg je de naam van de parameter toe
73+
SyntaxFactory.NameColon(parameter.Name), // Here you add the name of the parameter
7374
argument.RefOrOutKeyword,
7475
argument.Expression);
7576

@@ -78,6 +79,5 @@ private async Task<Document> UseNamedArgumentAsync(Document document, ArgumentSy
7879

7980
return document.WithSyntaxRoot(newRoot);
8081
}
81-
8282
}
8383
}

Posseth.NamedArguments.AnalyzerAndFixer.Package/Posseth.NamedArguments.AnalyzerAndFixer.Package.csproj

Lines changed: 27 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -10,22 +10,39 @@
1010
<PropertyGroup>
1111
<PackageId>Posseth.NamedArguments.AnalyzerAndFixer</PackageId>
1212
<PackageVersion>1.0.0.0</PackageVersion>
13-
<Authors>Posse</Authors>
14-
<PackageLicenseUrl>http://LICENSE_URL_HERE_OR_DELETE_THIS_LINE</PackageLicenseUrl>
15-
<PackageProjectUrl>http://PROJECT_URL_HERE_OR_DELETE_THIS_LINE</PackageProjectUrl>
16-
<PackageIconUrl>http://ICON_URL_HERE_OR_DELETE_THIS_LINE</PackageIconUrl>
17-
<RepositoryUrl>http://REPOSITORY_URL_HERE_OR_DELETE_THIS_LINE</RepositoryUrl>
13+
<Authors>MPCoreDeveloper</Authors>
14+
<PackageLicenseUrl>https://github.com/MPCoreDeveloper/Posseth.NamedArguments.AnalyzerAndFixer</PackageLicenseUrl>
15+
<PackageProjectUrl>https://github.com/MPCoreDeveloper/Posseth.NamedArguments.AnalyzerAndFixer</PackageProjectUrl>
16+
<RepositoryUrl>https://github.com/MPCoreDeveloper/Posseth.NamedArguments.AnalyzerAndFixer</RepositoryUrl>
1817
<PackageRequireLicenseAcceptance>false</PackageRequireLicenseAcceptance>
19-
<Description>Posseth.NamedArguments.AnalyzerAndFixer</Description>
20-
<PackageReleaseNotes>Summary of changes made in this release of the package.</PackageReleaseNotes>
21-
<Copyright>Copyright</Copyright>
22-
<PackageTags>Posseth.NamedArguments.AnalyzerAndFixer, analyzers</PackageTags>
18+
<Description>This tool analyzes method calls to ensure they use named arguments and provides an option to automatically convert positional arguments to named arguments. For example, it can transform `TestMethod(1, 2)` into `TestMethod(x: 1, y: 2)`.
19+
</Description>
20+
<PackageReleaseNotes>initial release</PackageReleaseNotes>
21+
<Copyright>Free to use , distribute and modify </Copyright>
22+
<PackageTags>NamedArguments;AnalyzerAndFixer;analyzers;</PackageTags>
2323
<DevelopmentDependency>true</DevelopmentDependency>
2424
<NoPackageAnalysis>true</NoPackageAnalysis>
25-
2625
<TargetsForTfmSpecificContentInPackage>$(TargetsForTfmSpecificContentInPackage);_AddAnalyzersToOutput</TargetsForTfmSpecificContentInPackage>
26+
<Title>Named Arguments Analyzer and Fixer</Title>
27+
<Version>1.0.0</Version>
28+
<Company>Posseth Software</Company>
29+
<Product>Posseth.NamedArguments.AnalyzerAndFixer</Product>
30+
<PackageIcon>logo.jpeg</PackageIcon>
31+
<RepositoryType>git</RepositoryType>
32+
<PackageReadmeFile>README.md</PackageReadmeFile>
2733
</PropertyGroup>
2834

35+
<ItemGroup>
36+
<None Include="..\Assets\logo.jpeg">
37+
<Pack>True</Pack>
38+
<PackagePath>\</PackagePath>
39+
</None>
40+
<None Include="..\README.md">
41+
<Pack>True</Pack>
42+
<PackagePath>\</PackagePath>
43+
</None>
44+
</ItemGroup>
45+
2946
<ItemGroup>
3047
<ProjectReference Include="..\Posseth.NamedArguments.AnalyzerAndFixer.CodeFixes\Posseth.NamedArguments.AnalyzerAndFixer.CodeFixes.csproj" />
3148
<ProjectReference Include="..\Posseth.NamedArguments.AnalyzerAndFixer\Posseth.NamedArguments.AnalyzerAndFixer.csproj" />

Posseth.NamedArguments.AnalyzerAndFixer.sln

Lines changed: 18 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,25 @@ Microsoft Visual Studio Solution File, Format Version 12.00
33
# Visual Studio Version 17
44
VisualStudioVersion = 17.11.35219.272
55
MinimumVisualStudioVersion = 10.0.40219.1
6-
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Posseth.NamedArguments.AnalyzerAndFixer", "Posseth.NamedArguments.AnalyzerAndFixer\Posseth.NamedArguments.AnalyzerAndFixer.csproj", "{CCEAA914-108C-4F08-B42F-510877ED1223}"
6+
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Posseth.NamedArguments.AnalyzerAndFixer", "Posseth.NamedArguments.AnalyzerAndFixer\Posseth.NamedArguments.AnalyzerAndFixer.csproj", "{CCEAA914-108C-4F08-B42F-510877ED1223}"
77
EndProject
8-
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Posseth.NamedArguments.AnalyzerAndFixer.CodeFixes", "Posseth.NamedArguments.AnalyzerAndFixer.CodeFixes\Posseth.NamedArguments.AnalyzerAndFixer.CodeFixes.csproj", "{42C7B52D-05E8-4357-B450-AC9285EBD889}"
8+
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Posseth.NamedArguments.AnalyzerAndFixer.CodeFixes", "Posseth.NamedArguments.AnalyzerAndFixer.CodeFixes\Posseth.NamedArguments.AnalyzerAndFixer.CodeFixes.csproj", "{42C7B52D-05E8-4357-B450-AC9285EBD889}"
99
EndProject
10-
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Posseth.NamedArguments.AnalyzerAndFixer.Package", "Posseth.NamedArguments.AnalyzerAndFixer.Package\Posseth.NamedArguments.AnalyzerAndFixer.Package.csproj", "{E04D2391-C29D-4C60-9A9E-8400B437D66A}"
10+
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Posseth.NamedArguments.AnalyzerAndFixer.Package", "Posseth.NamedArguments.AnalyzerAndFixer.Package\Posseth.NamedArguments.AnalyzerAndFixer.Package.csproj", "{E04D2391-C29D-4C60-9A9E-8400B437D66A}"
1111
EndProject
12-
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Posseth.NamedArguments.AnalyzerAndFixer.Test", "Posseth.NamedArguments.AnalyzerAndFixer.Test\Posseth.NamedArguments.AnalyzerAndFixer.Test.csproj", "{8B96F85D-AF6D-4B8A-9814-112F09929F73}"
12+
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Posseth.NamedArguments.AnalyzerAndFixer.Test", "Posseth.NamedArguments.AnalyzerAndFixer.Test\Posseth.NamedArguments.AnalyzerAndFixer.Test.csproj", "{8B96F85D-AF6D-4B8A-9814-112F09929F73}"
1313
EndProject
14-
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Posseth.NamedArguments.AnalyzerAndFixer.Vsix", "Posseth.NamedArguments.AnalyzerAndFixer.Vsix\Posseth.NamedArguments.AnalyzerAndFixer.Vsix.csproj", "{DF3F84BA-98C9-4FBA-9B42-10C1EBF0C447}"
14+
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Posseth.NamedArguments.AnalyzerAndFixer.Vsix", "Posseth.NamedArguments.AnalyzerAndFixer.Vsix\Posseth.NamedArguments.AnalyzerAndFixer.Vsix.csproj", "{DF3F84BA-98C9-4FBA-9B42-10C1EBF0C447}"
15+
EndProject
16+
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{D511EA3B-C7FB-4AC4-8F64-3B9AA538F2AE}"
17+
ProjectSection(SolutionItems) = preProject
18+
.gitattributes = .gitattributes
19+
.gitignore = .gitignore
20+
LICENSE.txt = LICENSE.txt
21+
README.md = README.md
22+
EndProjectSection
23+
EndProject
24+
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Assets", "Assets", "{6CFEB8BE-45D4-46C1-A4A6-B407570CBF48}"
1525
EndProject
1626
Global
1727
GlobalSection(SolutionConfigurationPlatforms) = preSolution
@@ -43,6 +53,9 @@ Global
4353
GlobalSection(SolutionProperties) = preSolution
4454
HideSolutionNode = FALSE
4555
EndGlobalSection
56+
GlobalSection(NestedProjects) = preSolution
57+
{6CFEB8BE-45D4-46C1-A4A6-B407570CBF48} = {D511EA3B-C7FB-4AC4-8F64-3B9AA538F2AE}
58+
EndGlobalSection
4659
GlobalSection(ExtensibilityGlobals) = postSolution
4760
SolutionGuid = {BF18F192-ED7A-42AA-B965-EB35F304F75F}
4861
EndGlobalSection

README.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,4 @@
1-
# Posseth.NamedArguments.AnalyzerAndFixer
1+
# Posseth NamedArguments AnalyzerAndFixer
2+
3+
This is a simple tool that can be used to analyze and fix named arguments in codebase.
4+
It is implemented as a Analyzer and CodeFix provider for Roslyn.

0 commit comments

Comments
 (0)