From f23a674f0e17b10c25e7e5734b3b31c399e37d6a Mon Sep 17 00:00:00 2001 From: Josef Pihrt Date: Sun, 16 Jul 2023 12:25:39 +0200 Subject: [PATCH] Add workflow (#1112) --- .editorconfig | 1 - .github/workflows/build.yml | 279 ++++++++++++++++++ .vscode/settings.json | 3 + CONTRIBUTING.md | 2 +- ChangeLog.md | 4 + GitVersion.yml | 9 + .../Analyzers.CodeFixes.csproj | 8 +- .../OptimizeLinqMethodCallCodeFixProvider.cs | 2 +- .../SimplifyNullCheckRefactoring.cs | 8 +- .../Properties/AssemblyInfo.cs | 5 - src/Analyzers/Analyzers.csproj | 9 + ...nnecessaryBracesInSwitchSectionAnalyzer.cs | 1 - .../Analysis/SimplifyNullCheckAnalyzer.cs | 2 +- .../Analysis/UseConditionalAccessAnalyzer.cs | 6 +- src/Analyzers/Properties/AssemblyInfo.cs | 6 - .../CSharp.Workspaces.csproj | 48 +++ .../CSharp/SyntaxLogicalInverter.cs | 4 +- .../Properties/AssemblyInfo.cs | 20 -- src/CSharp/CSharp.csproj | 57 ++++ .../SyntaxRewriters/WhitespaceRemover.cs | 10 +- src/CSharp/Properties/AssemblyInfo.cs | 23 -- .../CodeAnalysis.Analyzers.CodeFixes.csproj | 10 +- .../Properties/AssemblyInfo.cs | 5 - .../CodeAnalysis.Analyzers.csproj | 11 +- .../Properties/AssemblyInfo.cs | 6 - src/CodeFixes/CodeFixes.csproj | 11 +- src/CodeFixes/Properties/AssemblyInfo.cs | 6 - .../Program.cs | 33 ++- .../Properties/launchSettings.json | 8 + src/CommandLine/AnalyzerAssemblyInfo.cs | 2 +- src/CommandLine/CommandLine.csproj | 6 + src/CommandLine/Commands/HelpCommand.cs | 1 + src/CommandLine/Commands/MigrateCommand.cs | 112 ------- src/CommandLine/DelegateFactory.cs | 2 +- src/CommandLine/Program.cs | 11 + src/CommandLine/Properties/AssemblyInfo.cs | 5 - .../Analysis/RemoveAsyncAwaitAnalysis.cs | 2 +- src/Common/Common.csproj | 48 +++ src/Common/Properties/AssemblyInfo.cs | 20 -- src/Core/Core.csproj | 66 +++++ src/Core/Properties/AssemblyInfo.cs | 26 -- src/Directory.Build.props | 45 ++- src/Documentation/Documentation.csproj | 7 +- src/Documentation/DocumentationWriter.cs | 2 +- .../Extensions/SymbolExtensions.cs | 5 +- src/Documentation/Properties/AssemblyInfo.cs | 5 - src/Documentation/SymbolDefinitionDisplay.cs | 8 - src/Documentation/SymbolDefinitionWriter.cs | 9 +- .../SymbolDefinitionWriterHelpers.cs | 3 +- .../UrlProviders/DefaultUrlSegmentProvider.cs | 2 +- .../CSharp/CodeFixHelpers.cs | 2 +- .../Formatting.Analyzers.CodeFixes.csproj | 10 +- .../Properties/AssemblyInfo.cs | 5 - .../Formatting.Analyzers.csproj | 11 +- .../Properties/AssemblyInfo.cs | 6 - .../AddUsingStaticDirectiveRefactoring.cs | 8 - .../RoslynatorCodeRefactoringProvider.cs | 7 +- src/Refactorings/Properties/AssemblyInfo.cs | 5 - src/Refactorings/Refactorings.csproj | 6 + src/Roslynator.CoreAndTesting.slnf | 23 ++ src/Roslynator.sln | 9 +- src/Roslynator.slnf | 28 -- ...056AvoidUsageOfUsingAliasDirectiveTests.cs | 4 +- ...sionInsteadOfConditionalExpressionTests.cs | 6 +- .../RCS1169MakeFieldReadOnlyTests.cs | 2 +- .../SyntaxLogicalInverterTests.cs | 83 +++--- .../Core.Tests/GeneratedCodeUtilityTests.cs | 57 ++-- .../RR0078JoinStringExpressionsTests.cs | 15 +- src/Tests/TestLibrary/Foo.cs | 2 +- .../Properties/AssemblyInfo.cs | 5 - .../Testing.CSharp.Xunit.csproj | 6 + src/Tests/Testing.CSharp.sln | 53 ---- .../Testing.CSharp/Properties/AssemblyInfo.cs | 14 - .../Testing.CSharp/Testing.CSharp.csproj | 33 +++ .../Testing.Common/Properties/AssemblyInfo.cs | 18 -- .../Testing.Common/Testing.Common.csproj | 45 +++ .../Testing.Common/Testing/CodeVerifier.cs | 5 +- .../Properties/AssemblyInfo.cs | 10 - .../Testing.VisualBasic.csproj | 21 ++ src/Tests/Tests.Common/Tests.Common.csproj | 4 - .../Properties/AssemblyInfo.cs | 3 - src/Tools/Cleaner/Properties/AssemblyInfo.cs | 3 - .../CSharpSyntaxWalkerGenerator.cs | 48 --- .../CodeGeneration/Properties/AssemblyInfo.cs | 3 - src/Tools/CodeGenerator/Configuration.md | 16 +- src/Tools/CodeGenerator/Program.cs | 4 - .../CodeGenerator/Properties/AssemblyInfo.cs | 3 - .../Properties/launchSettings.json | 8 + src/Tools/Metadata/Properties/AssemblyInfo.cs | 3 - src/Tools/MetadataGenerator/Program.cs | 4 - .../Properties/AssemblyInfo.cs | 3 - .../Properties/launchSettings.json | 8 + .../Utilities/Properties/AssemblyInfo.cs | 3 - .../Properties/AssemblyInfo.cs | 18 -- .../VisualBasic.Workspaces.csproj | 42 +++ .../VisualBasicSyntaxFactsService.cs | 1 + src/VisualBasic/Properties/AssemblyInfo.cs | 5 - src/VisualBasic/VisualBasic.csproj | 3 + src/VisualStudio/manifest.json | 13 + .../source.extension.vsixmanifest | 4 +- .../Properties/AssemblyInfo.cs | 4 - src/VisualStudioCode/package/package.json | 2 +- .../Properties/AssemblyInfo.cs | 17 -- .../Workspaces.Common.csproj | 42 +++ .../CodeFixes/DiagnosticFix.cs | 2 +- src/Workspaces.Core/Extensions/Extensions.cs | 3 + .../Formatting/CodeFormatter.cs | 1 + src/Workspaces.Core/Logging/LogHelpers.cs | 2 +- src/Workspaces.Core/Logging/Logger.cs | 9 - .../Properties/AssemblyInfo.cs | 15 - .../Rename/LocalSymbolComparer.cs | 8 +- src/Workspaces.Core/Rename/SymbolRenamer.cs | 6 +- src/Workspaces.Core/Workspaces.Core.csproj | 33 +++ text/ReleaseCheckList.md | 33 --- tools/build.cmd | 149 ---------- tools/build_cli.cmd | 37 --- tools/build_cli.ps1 | 31 -- tools/build_cli_debug.cmd | 14 - tools/build_cli_debug.ps1 | 5 + tools/build_debug.cmd | 20 -- tools/build_testing.cmd | 16 - tools/build_vscode.cmd | 56 ---- tools/clean_debug.cmd | 9 - tools/clean_release.cmd | 9 - tools/clean_vscode.cmd | 12 - tools/cli_add_file_banner.ps1 | 4 +- tools/cli_analyze.ps1 | 10 +- tools/cli_fix.ps1 | 24 +- tools/cli_format.ps1 | 4 +- tools/cli_lloc.ps1 | 4 +- tools/cli_loc.ps1 | 4 +- tools/copy_spelling_from_orang.cmd | 29 -- tools/copy_spelling_from_orang.ps1 | 27 ++ tools/generate_all.ps1 | 4 + tools/generate_cli_docs.ps1 | 11 + tools/generate_cli_documentation.cmd | 22 -- tools/generate_cli_documentation_debug.cmd | 27 -- tools/generate_code.cmd | 13 - tools/generate_code.ps1 | 8 + tools/generate_documentation.cmd | 64 ---- tools/generate_metadata.cmd | 13 - tools/generate_metadata.ps1 | 8 + tools/generate_ref_docs.ps1 | 58 ++++ src/Core.sln => tools/generate_ref_docs.sln | 29 +- tools/generate_test_files.cmd | 7 - tools/list_syntax_node_hierarchy.cmd | 22 -- tools/list_syntax_node_hierarchy.ps1 | 13 + tools/nuget_push.cmd | 24 -- tools/nuget_push.ps1 | 21 ++ tools/patterns/assembly_info_version.txt | 4 - .../assembly_names_to_be_prefixed.txt | 30 -- tools/patterns/vscode_version.txt | 4 - tools/patterns/vsix_manifest_version.txt | 4 - tools/reinstall_cli_debug.ps1 | 11 + tools/reinstall_dotnet_cli.cmd | 7 - tools/reinstall_dotnet_cli_debug.cmd | 15 - tools/report_analyzers_execution_time.cmd | 26 -- tools/report_analyzers_execution_time.ps1 | 13 + tools/restore.cmd | 9 - tools/sn.cmd | 6 - tools/sn.ps1 | 3 + tools/test.cmd | 73 ----- tools/vsix_build_reinstall_debug.cmd | 32 -- tools/vsix_install_debug.cmd | 9 - tools/vsix_publish.cmd | 19 -- tools/vsix_publish.ps1 | 11 + tools/vsix_uninstall_debug.cmd | 9 - tools/vsix_uninstall_debug.ps1 | 3 + 168 files changed, 1331 insertions(+), 1624 deletions(-) create mode 100644 .github/workflows/build.yml create mode 100644 .vscode/settings.json create mode 100644 GitVersion.yml delete mode 100644 src/Analyzers.CodeFixes/Properties/AssemblyInfo.cs delete mode 100644 src/Analyzers/Properties/AssemblyInfo.cs delete mode 100644 src/CSharp.Workspaces/Properties/AssemblyInfo.cs delete mode 100644 src/CSharp/Properties/AssemblyInfo.cs delete mode 100644 src/CodeAnalysis.Analyzers.CodeFixes/Properties/AssemblyInfo.cs delete mode 100644 src/CodeAnalysis.Analyzers/Properties/AssemblyInfo.cs delete mode 100644 src/CodeFixes/Properties/AssemblyInfo.cs create mode 100644 src/CommandLine.DocumentationGenerator/Properties/launchSettings.json delete mode 100644 src/CommandLine/Properties/AssemblyInfo.cs delete mode 100644 src/Common/Properties/AssemblyInfo.cs delete mode 100644 src/Core/Properties/AssemblyInfo.cs delete mode 100644 src/Documentation/Properties/AssemblyInfo.cs delete mode 100644 src/Formatting.Analyzers.CodeFixes/Properties/AssemblyInfo.cs delete mode 100644 src/Formatting.Analyzers/Properties/AssemblyInfo.cs delete mode 100644 src/Refactorings/Properties/AssemblyInfo.cs create mode 100644 src/Roslynator.CoreAndTesting.slnf delete mode 100644 src/Roslynator.slnf delete mode 100644 src/Tests/Testing.CSharp.Xunit/Properties/AssemblyInfo.cs delete mode 100644 src/Tests/Testing.CSharp.sln delete mode 100644 src/Tests/Testing.CSharp/Properties/AssemblyInfo.cs delete mode 100644 src/Tests/Testing.Common/Properties/AssemblyInfo.cs delete mode 100644 src/Tests/Testing.VisualBasic/Properties/AssemblyInfo.cs delete mode 100644 src/Tools/AddCodeFileHeader/Properties/AssemblyInfo.cs delete mode 100644 src/Tools/Cleaner/Properties/AssemblyInfo.cs delete mode 100644 src/Tools/CodeGeneration/Properties/AssemblyInfo.cs delete mode 100644 src/Tools/CodeGenerator/Properties/AssemblyInfo.cs create mode 100644 src/Tools/CodeGenerator/Properties/launchSettings.json delete mode 100644 src/Tools/Metadata/Properties/AssemblyInfo.cs delete mode 100644 src/Tools/MetadataGenerator/Properties/AssemblyInfo.cs create mode 100644 src/Tools/MetadataGenerator/Properties/launchSettings.json delete mode 100644 src/Tools/Utilities/Properties/AssemblyInfo.cs delete mode 100644 src/VisualBasic.Workspaces/Properties/AssemblyInfo.cs delete mode 100644 src/VisualBasic/Properties/AssemblyInfo.cs create mode 100644 src/VisualStudio/manifest.json delete mode 100644 src/VisualStudioCode/Properties/AssemblyInfo.cs delete mode 100644 src/Workspaces.Common/Properties/AssemblyInfo.cs delete mode 100644 src/Workspaces.Core/Properties/AssemblyInfo.cs delete mode 100644 text/ReleaseCheckList.md delete mode 100644 tools/build.cmd delete mode 100644 tools/build_cli.cmd delete mode 100644 tools/build_cli.ps1 delete mode 100644 tools/build_cli_debug.cmd create mode 100644 tools/build_cli_debug.ps1 delete mode 100644 tools/build_debug.cmd delete mode 100644 tools/build_testing.cmd delete mode 100644 tools/build_vscode.cmd delete mode 100644 tools/clean_debug.cmd delete mode 100644 tools/clean_release.cmd delete mode 100644 tools/clean_vscode.cmd delete mode 100644 tools/copy_spelling_from_orang.cmd create mode 100644 tools/copy_spelling_from_orang.ps1 create mode 100644 tools/generate_all.ps1 create mode 100644 tools/generate_cli_docs.ps1 delete mode 100644 tools/generate_cli_documentation.cmd delete mode 100644 tools/generate_cli_documentation_debug.cmd delete mode 100644 tools/generate_code.cmd create mode 100644 tools/generate_code.ps1 delete mode 100644 tools/generate_documentation.cmd delete mode 100644 tools/generate_metadata.cmd create mode 100644 tools/generate_metadata.ps1 create mode 100644 tools/generate_ref_docs.ps1 rename src/Core.sln => tools/generate_ref_docs.sln (69%) delete mode 100644 tools/generate_test_files.cmd delete mode 100644 tools/list_syntax_node_hierarchy.cmd create mode 100644 tools/list_syntax_node_hierarchy.ps1 delete mode 100644 tools/nuget_push.cmd create mode 100644 tools/nuget_push.ps1 delete mode 100644 tools/patterns/assembly_info_version.txt delete mode 100644 tools/patterns/assembly_names_to_be_prefixed.txt delete mode 100644 tools/patterns/vscode_version.txt delete mode 100644 tools/patterns/vsix_manifest_version.txt create mode 100644 tools/reinstall_cli_debug.ps1 delete mode 100644 tools/reinstall_dotnet_cli.cmd delete mode 100644 tools/reinstall_dotnet_cli_debug.cmd delete mode 100644 tools/report_analyzers_execution_time.cmd create mode 100644 tools/report_analyzers_execution_time.ps1 delete mode 100644 tools/restore.cmd delete mode 100644 tools/sn.cmd create mode 100644 tools/sn.ps1 delete mode 100644 tools/test.cmd delete mode 100644 tools/vsix_build_reinstall_debug.cmd delete mode 100644 tools/vsix_install_debug.cmd delete mode 100644 tools/vsix_publish.cmd create mode 100644 tools/vsix_publish.ps1 delete mode 100644 tools/vsix_uninstall_debug.cmd create mode 100644 tools/vsix_uninstall_debug.ps1 diff --git a/.editorconfig b/.editorconfig index 7b104cf9f8..a574687ad4 100644 --- a/.editorconfig +++ b/.editorconfig @@ -70,7 +70,6 @@ dotnet_diagnostic.RCS0039.severity = suggestion dotnet_diagnostic.RCS0041.severity = suggestion dotnet_diagnostic.RCS0042.severity = suggestion dotnet_diagnostic.RCS0043.severity = suggestion -dotnet_diagnostic.RCS0044.severity = suggestion dotnet_diagnostic.RCS0046.severity = suggestion dotnet_diagnostic.RCS0048.severity = silent dotnet_diagnostic.RCS0049.severity = suggestion diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000000..6f912d5127 --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,279 @@ +on: + push: + branches: + - main + tags: + - v* + - cli-v* + pull_request: + +env: + Configuration: Release + TreatWarningsAsErrors: true + WarningsNotAsErrors: 1591,NU5128 + Deterministic: true + RunCodeAnalysis: false + +jobs: + pre_build: + runs-on: ubuntu-20.04 + outputs: + version: ${{ steps.version.outputs.version }} + version3: ${{ steps.version.outputs.version3 }} + cliVersion: ${{ steps.cliVersion.outputs.version }} + defaults: + run: + working-directory: src + steps: + - uses: actions/checkout@v3 + with: + fetch-depth: 0 + - run: dotnet tool install -g GitVersion.Tool --version 5.12.0 + - name: Resolve version + id: version + run: | + dotnet-gitversion > version.json + version="$(jq -r '.SemVer' version.json)" + version3="$(jq -r '.MajorMinorPatch' version.json)" + pr_version="$(jq -r '.MajorMinorPatch' version.json)-$(jq -r '.PreReleaseLabel' version.json).${{ github.run_number }}.${{ github.run_attempt }}" + if [ "${{ github.event_name }}" = "pull_request" ]; then version=$pr_version; fi + echo "Resolved version: $version" + echo "version=${version}" >> $GITHUB_OUTPUT + echo "Resolved version3: $version3" + echo "version3=${version3}" >> $GITHUB_OUTPUT + - name: Resolve CLI version + id: cliVersion + run: | + dotnet-gitversion /overrideconfig tag-prefix=cli-v > version.json + version="$(jq -r '.SemVer' version.json)" + pr_version="$(jq -r '.MajorMinorPatch' version.json)-$(jq -r '.PreReleaseLabel' version.json).${{ github.run_number }}.${{ github.run_attempt }}" + if [ "${{ github.event_name }}" = "pull_request" ]; then version=$pr_version; fi + echo "Resolved CLI version: $version" + echo "version=${version}" >> $GITHUB_OUTPUT + - run: dotnet restore Roslynator.sln + - run: dotnet build Roslynator.sln --no-restore + - run: | + dotnet format Roslynator.sln --no-restore --verify-no-changes --severity info --exclude-diagnostics \ + IDE0220 `# 'foreach' statement implicitly converts type. Add an explicit cast to make intent clearer.` \ + IDE0251 `# Property can be made read-only.` \ + IDE0270 `# Null check can be simplified.` + - run: dotnet test Roslynator.sln --no-build + + build_core_and_testing: + if: github.ref_type != 'tag' || startsWith(github.ref_name, 'v') + needs: pre_build + runs-on: ubuntu-20.04 + env: + Version: ${{ needs.pre_build.outputs.version }} + defaults: + run: + working-directory: src + steps: + - uses: actions/checkout@v3 + - run: dotnet restore Roslynator.CoreAndTesting.slnf + - run: dotnet build Roslynator.CoreAndTesting.slnf --no-restore + - run: dotnet pack Roslynator.CoreAndTesting.slnf --no-build -o _nupkg + - uses: actions/upload-artifact@v3 + with: + name: nuget_packages + path: src/_nupkg/*nupkg + + build_analyzers: + if: github.ref_type != 'tag' || startsWith(github.ref_name, 'v') + needs: pre_build + runs-on: ubuntu-20.04 + env: + Version: ${{ needs.pre_build.outputs.version }} + strategy: + matrix: + component: + - name: Analyzers + propertyName: Analyzers + - name: Formatting.Analyzers + propertyName: FormattingAnalyzers + - name: CodeAnalysis.Analyzers + propertyName: CodeAnalysisAnalyzers + defaults: + run: + working-directory: src/${{ matrix.component.name }}.CodeFixes + steps: + - uses: actions/checkout@v3 + - run: dotnet restore + - run: dotnet build --no-restore /p:Roslynator${{ matrix.component.propertyName }}NuGet=true + - run: dotnet pack --no-build + - uses: actions/upload-artifact@v3 + with: + name: nuget_packages + path: src/${{ matrix.component.name }}.CodeFixes/bin/Release/*.nupkg + + build_vs_extension: + if: github.ref_type != 'tag' || startsWith(github.ref_name, 'v') + needs: pre_build + runs-on: windows-latest + env: + Version: ${{ needs.pre_build.outputs.version }} + DeployExtension: false + defaults: + run: + working-directory: src/VisualStudio + steps: + - uses: actions/checkout@v3 + - run: (Get-Content source.extension.vsixmanifest) -replace 'Version="1.0.0"', 'Version="${{ needs.pre_build.outputs.version3 }}"' | Set-Content source.extension.vsixmanifest + - run: dotnet restore + - uses: microsoft/setup-msbuild@v1.1 + - run: msbuild + - uses: actions/upload-artifact@v3 + with: + name: vs_extension + path: src/VisualStudio/bin/Release/net472/*.vsix + - uses: actions/upload-artifact@v3 + with: + name: vs_extension + path: src/VisualStudio/manifest.json + + build_vs_code_extension: + if: github.ref_type != 'tag' || startsWith(github.ref_name, 'v') + needs: [ pre_build, build_analyzers ] + runs-on: ubuntu-20.04 + env: + Version: ${{ needs.pre_build.outputs.version }} + defaults: + run: + working-directory: src/VisualStudioCode + steps: + - uses: actions/checkout@v3 + - run: dotnet restore + - run: dotnet build --no-restore /p:DefineConstants=VSCODE + - run: | + mkdir package/roslyn/analyzers + mkdir package/roslyn/refactorings + mkdir package/roslyn/fixes + cp bin/Release/netstandard2.0/Roslynator.Core.dll package/roslyn/common + cp bin/Release/netstandard2.0/Roslynator.Common.dll package/roslyn/common + cp bin/Release/netstandard2.0/Roslynator.CSharp.dll package/roslyn/common + cp bin/Release/netstandard2.0/Roslynator.Workspaces.Core.dll package/roslyn/common + cp bin/Release/netstandard2.0/Roslynator.Workspaces.Common.dll package/roslyn/common + cp bin/Release/netstandard2.0/Roslynator.CSharp.Workspaces.dll package/roslyn/common + cp bin/Release/netstandard2.0/Roslynator.CSharp.Analyzers.dll package/roslyn/analyzers + cp bin/Release/netstandard2.0/Roslynator.CSharp.Analyzers.CodeFixes.dll package/roslyn/analyzers + cp bin/Release/netstandard2.0/Roslynator.Formatting.Analyzers.dll package/roslyn/analyzers + cp bin/Release/netstandard2.0/Roslynator.Formatting.Analyzers.CodeFixes.dll package/roslyn/analyzers + cp bin/Release/netstandard2.0/Roslynator.CSharp.Refactorings.dll package/roslyn/refactorings + cp bin/Release/netstandard2.0/Roslynator.CSharp.CodeFixes.dll package/roslyn/fixes + name: Copy DLLs to package + - run: > + sed -i 's/"version": "1.0.0"/"version": "${{ needs.pre_build.outputs.version3 }}"/' package/package.json + - run: npm install + working-directory: src/VisualStudioCode/package + - run: npm install -g @vscode/vsce + - run: vsce package + working-directory: src/VisualStudioCode/package + - uses: actions/upload-artifact@v3 + with: + name: vs_code_extension + path: src/VisualStudioCode/package/*.vsix + - run: rm package/*.vsix + - run: sed -i s/ms-dotnettools.csharp/muhammad-sammy.csharp/ package/package.json + - run: vsce package + working-directory: src/VisualStudioCode/package + - uses: actions/upload-artifact@v3 + with: + name: ovsx_extension + path: src/VisualStudioCode/package/*.vsix + + build_core_cli: + if: github.ref_type != 'tag' || startsWith(github.ref_name, 'cli-v') + needs: pre_build + runs-on: ubuntu-20.04 + env: + RoslynatorDotNetCli: true + RoslynatorCliVersion: ${{ needs.pre_build.outputs.cliVersion }} + Version: ${{ needs.pre_build.outputs.version }} + defaults: + run: + working-directory: src/CommandLine + steps: + - uses: actions/checkout@v3 + - run: dotnet restore + - run: dotnet build --no-restore + - run: dotnet pack --no-build + - uses: actions/upload-artifact@v3 + with: + name: nuget_packages + path: src/CommandLine/bin/Release/*.nupkg + + build_framework_cli: + if: github.ref_type != 'tag' || startsWith(github.ref_name, 'cli-v') + needs: pre_build + runs-on: windows-latest + env: + RoslynatorCommandLine: true + RoslynatorCliVersion: ${{ needs.pre_build.outputs.cliVersion }} + Version: ${{ needs.pre_build.outputs.version }} + defaults: + run: + working-directory: src/CommandLine + steps: + - uses: actions/checkout@v3 + - run: dotnet restore + - run: dotnet build --no-restore + - run: dotnet publish --no-build + - run: dotnet pack --no-build + - uses: actions/upload-artifact@v3 + with: + name: nuget_packages + path: src/CommandLine/bin/Release/*.nupkg + + publish_nuget_packages: + needs: [ build_core_and_testing, build_analyzers, build_core_cli, build_framework_cli ] + runs-on: ubuntu-20.04 + if: github.ref_type == 'tag' + steps: + - uses: actions/download-artifact@v3 + with: + name: nuget_packages + path: nuget_packages + - run: dotnet nuget push "*.nupkg" -k ${{ secrets.NUGET_API_KEY }} -s "https://api.nuget.org/v3/index.json" + working-directory: nuget_packages + + publish_vs_code_extension: + needs: build_vs_code_extension + runs-on: ubuntu-20.04 + if: github.ref_type == 'tag' && startsWith(github.ref_name, 'v') + steps: + - uses: actions/download-artifact@v3 + with: + name: vs_code_extension + path: vs_code_extension + - run: npm install -g @vscode/vsce + - run: vsce publish -p ${{ secrets.VS_MARKETPLACE_TOKEN }} + working-directory: vs_code_extension + + publish_ovsx_extension: + needs: build_vs_code_extension + runs-on: ubuntu-20.04 + if: github.ref_type == 'tag' && startsWith(github.ref_name, 'v') + steps: + - uses: actions/download-artifact@v3 + with: + name: ovsx_extension + path: ovsx_extension + - run: npm install -g ovsx + - run: ovsx publish -p ${{ secrets.OPEN_VSX_TOKEN }} + working-directory: ovsx_extension + + publish_vs_extension: + needs: build_vs_extension + runs-on: windows-latest + if: github.ref_type == 'tag' && startsWith(github.ref_name, 'v') + steps: + - uses: actions/download-artifact@v3 + with: + name: vs_extension + path: vs_extension + - run: | + $visualStudioPath = vswhere -latest -products * -requires Microsoft.VisualStudio.Component.VSSDK -property installationPath + $vsixPublisher = Join-Path "$visualStudioPath" "VSSDK\VisualStudioIntegration\Tools\Bin\VsixPublisher.exe" + & "$vsixPublisher" publish -payload Roslynator.VisualStudio.vsix -publishManifest manifest.json -personalAccessToken ${{ secrets.VS_MARKETPLACE_TOKEN }} + working-directory: vs_extension + name: Publish VS extension to Marketplace diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 0000000000..3dadb1965b --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,3 @@ +{ + "dotnet.defaultSolution": "src/Roslynator.sln" +} \ No newline at end of file diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index d4a038ed7e..f7d55f7341 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -25,4 +25,4 @@ Guidelines for contributing to the Roslynator repo. ## Coding Style * **DO** follow [.NET Runtime Coding Style](https://github.com/dotnet/runtime/blob/main/docs/coding-guidelines/coding-style.md) (except using `s_` and `t_` prefix for field names). -* **DO** install [Roslynator for Visual Studio](https://marketplace.visualstudio.com/items?itemName=josefpihrt.Roslynator2019) and follow suggestions. +* **DO** install extension for VS/VS Code and follow suggestions. diff --git a/ChangeLog.md b/ChangeLog.md index 5d9c68c07b..b9956b3af5 100644 --- a/ChangeLog.md +++ b/ChangeLog.md @@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +### Added + +- Add GitHub workflow ([#1112](https://github.com/josefpihrt/roslynator/pull/1112)) + ### Changed - [CLI] Bump Roslyn to 4.6.0 ([#1106](https://github.com/josefpihrt/roslynator/pull/1106)). diff --git a/GitVersion.yml b/GitVersion.yml new file mode 100644 index 0000000000..f52bf60c50 --- /dev/null +++ b/GitVersion.yml @@ -0,0 +1,9 @@ +build-metadata-padding: 4 +mode: ContinuousDeployment + +branches: + main: + tag: beta + pull-request: + tag: alpha + tag-number-pattern: '[/-](?\d+)[-/]' diff --git a/src/Analyzers.CodeFixes/Analyzers.CodeFixes.csproj b/src/Analyzers.CodeFixes/Analyzers.CodeFixes.csproj index ebfeb53dfa..ea36b045b0 100644 --- a/src/Analyzers.CodeFixes/Analyzers.CodeFixes.csproj +++ b/src/Analyzers.CodeFixes/Analyzers.CodeFixes.csproj @@ -5,7 +5,7 @@ - $(RoslynatorVersion) + $(RoslynatorAnalyzersVersion) Roslynator.CSharp.Analyzers.CodeFixes Roslynator.CSharp Roslynator.Analyzers.nuspec @@ -34,4 +34,10 @@ + + + <_Parameter1>Roslynator.Analyzers.Tests, PublicKey=$(RoslynatorPublicKey) + + + \ No newline at end of file diff --git a/src/Analyzers.CodeFixes/CSharp/CodeFixes/OptimizeLinqMethodCallCodeFixProvider.cs b/src/Analyzers.CodeFixes/CSharp/CodeFixes/OptimizeLinqMethodCallCodeFixProvider.cs index 7ef99c2ba1..aad0fe3874 100644 --- a/src/Analyzers.CodeFixes/CSharp/CodeFixes/OptimizeLinqMethodCallCodeFixProvider.cs +++ b/src/Analyzers.CodeFixes/CSharp/CodeFixes/OptimizeLinqMethodCallCodeFixProvider.cs @@ -424,7 +424,7 @@ private static Task CallFindInsteadOfFirstOrDefaultAsync( { ITypeSymbol typeSymbol = semanticModel.GetTypeSymbol(invocationInfo.Expression, cancellationToken); - if ((typeSymbol as IArrayTypeSymbol)?.Rank == 1) + if (typeSymbol is IArrayTypeSymbol { Rank: 1 }) { NameSyntax arrayName = ParseName("global::System.Array") .WithLeadingTrivia(invocationInfo.InvocationExpression.GetLeadingTrivia()) diff --git a/src/Analyzers.CodeFixes/CSharp/Refactorings/SimplifyNullCheckRefactoring.cs b/src/Analyzers.CodeFixes/CSharp/Refactorings/SimplifyNullCheckRefactoring.cs index ad50b4d023..858a7afb91 100644 --- a/src/Analyzers.CodeFixes/CSharp/Refactorings/SimplifyNullCheckRefactoring.cs +++ b/src/Analyzers.CodeFixes/CSharp/Refactorings/SimplifyNullCheckRefactoring.cs @@ -44,7 +44,7 @@ public static async Task RefactorAsync( //RCS1084 UseCoalesceExpressionInsteadOfConditionalExpression newNode = nullCheck.Expression; coalesce = true; - + // If the types are polymorphic then the LHS of the null coalesce must be cast to the base type. ITypeSymbol newNodeType = semanticModel.GetTypeSymbol(newNode); ITypeSymbol whenNullType = semanticModel.GetTypeSymbol(whenNull); @@ -59,8 +59,8 @@ public static async Task RefactorAsync( castType = NullableType(castType); newNode = CastExpression( - castType, - newNode.WithoutTrivia()) + castType, + newNode.WithoutTrivia()) .WithTriviaFrom(newNode); } } @@ -73,7 +73,7 @@ public static async Task RefactorAsync( var memberAccessExpression = (MemberAccessExpressionSyntax)expression.Parent; if (!memberAccessExpression.IsParentKind(SyntaxKind.InvocationExpression) - && (memberAccessExpression.Name as IdentifierNameSyntax)?.Identifier.ValueText == "Value") + && memberAccessExpression.Name is IdentifierNameSyntax { Identifier.ValueText: "Value" }) { if (memberAccessExpression == whenNotNull) { diff --git a/src/Analyzers.CodeFixes/Properties/AssemblyInfo.cs b/src/Analyzers.CodeFixes/Properties/AssemblyInfo.cs deleted file mode 100644 index 5a36f459a4..0000000000 --- a/src/Analyzers.CodeFixes/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,5 +0,0 @@ -// Copyright (c) Josef Pihrt and Contributors. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. - -using System.Runtime.CompilerServices; - -[assembly: InternalsVisibleTo("Roslynator.Analyzers.Tests, PublicKey=0024000004800000940000000602000000240000525341310004000001000100d348e1a51bc190259aed17cfe132736241fef462de45a5de6c881c7f9d705073c7a2a08ba5ae493c7e878fe5f3cf7909e89045cca696422f03b284b147daf6b93c47bc53dd61ceeae60f73149d183032f029761d0d59aab49a26be4f6af71cd8194ace937642bdcb515f07530096122e97cfe6c8549a843530f71c24c7e3dab8")] diff --git a/src/Analyzers/Analyzers.csproj b/src/Analyzers/Analyzers.csproj index 19a3cb8d39..efed7ba1df 100644 --- a/src/Analyzers/Analyzers.csproj +++ b/src/Analyzers/Analyzers.csproj @@ -24,4 +24,13 @@ + + + <_Parameter1>Roslynator.Analyzers.Tests, PublicKey=$(RoslynatorPublicKey) + + + <_Parameter1>Roslynator.CSharp.Analyzers.CodeFixes, PublicKey=$(RoslynatorPublicKey) + + + \ No newline at end of file diff --git a/src/Analyzers/CSharp/Analysis/RemoveUnnecessaryBracesInSwitchSectionAnalyzer.cs b/src/Analyzers/CSharp/Analysis/RemoveUnnecessaryBracesInSwitchSectionAnalyzer.cs index 024aeb9822..52f28f4e52 100644 --- a/src/Analyzers/CSharp/Analysis/RemoveUnnecessaryBracesInSwitchSectionAnalyzer.cs +++ b/src/Analyzers/CSharp/Analysis/RemoveUnnecessaryBracesInSwitchSectionAnalyzer.cs @@ -106,5 +106,4 @@ static bool AnalyzeTrivia(SyntaxTriviaList trivia) return trivia.All(f => f.IsKind(SyntaxKind.WhitespaceTrivia, SyntaxKind.EndOfLineTrivia, SyntaxKind.SingleLineCommentTrivia)); } } - } diff --git a/src/Analyzers/CSharp/Analysis/SimplifyNullCheckAnalyzer.cs b/src/Analyzers/CSharp/Analysis/SimplifyNullCheckAnalyzer.cs index 9409042bf3..3b23124452 100644 --- a/src/Analyzers/CSharp/Analysis/SimplifyNullCheckAnalyzer.cs +++ b/src/Analyzers/CSharp/Analysis/SimplifyNullCheckAnalyzer.cs @@ -106,7 +106,7 @@ private static void AnalyzeConditionalExpression(SyntaxNodeAnalysisContext conte var memberAccessExpression = (MemberAccessExpressionSyntax)expression.Parent; if (!memberAccessExpression.IsParentKind(SyntaxKind.InvocationExpression) - && (memberAccessExpression.Name as IdentifierNameSyntax)?.Identifier.ValueText == "Value") + && memberAccessExpression.Name is IdentifierNameSyntax { Identifier.ValueText: "Value" }) { if (memberAccessExpression == whenNotNull) { diff --git a/src/Analyzers/CSharp/Analysis/UseConditionalAccessAnalyzer.cs b/src/Analyzers/CSharp/Analysis/UseConditionalAccessAnalyzer.cs index 5bd49667fe..d3593bc7d2 100644 --- a/src/Analyzers/CSharp/Analysis/UseConditionalAccessAnalyzer.cs +++ b/src/Analyzers/CSharp/Analysis/UseConditionalAccessAnalyzer.cs @@ -274,18 +274,18 @@ private static bool ValidateRightExpression( case SyntaxKind.GreaterThanOrEqualExpression: case SyntaxKind.EqualsExpression: { - var leftTypeSymbol = semanticModel.GetTypeSymbol(((BinaryExpressionSyntax)expression).Left); + ITypeSymbol leftTypeSymbol = semanticModel.GetTypeSymbol(((BinaryExpressionSyntax)expression).Left); if (leftTypeSymbol.IsErrorType()) return false; if (leftTypeSymbol.IsValueType && !CSharpFacts.IsPredefinedType(leftTypeSymbol.SpecialType)) - { + { // If the LHS is a ValueTypes then making the expression conditional would change the type of the expression // and hence we would call a different overload (a valid overload may not exists) return false; } - + expression = ((BinaryExpressionSyntax)expression) .Right? .WalkDownParentheses(); diff --git a/src/Analyzers/Properties/AssemblyInfo.cs b/src/Analyzers/Properties/AssemblyInfo.cs deleted file mode 100644 index 6cc7162758..0000000000 --- a/src/Analyzers/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,6 +0,0 @@ -// Copyright (c) Josef Pihrt and Contributors. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. - -using System.Runtime.CompilerServices; - -[assembly: InternalsVisibleTo("Roslynator.Analyzers.Tests, PublicKey=0024000004800000940000000602000000240000525341310004000001000100d348e1a51bc190259aed17cfe132736241fef462de45a5de6c881c7f9d705073c7a2a08ba5ae493c7e878fe5f3cf7909e89045cca696422f03b284b147daf6b93c47bc53dd61ceeae60f73149d183032f029761d0d59aab49a26be4f6af71cd8194ace937642bdcb515f07530096122e97cfe6c8549a843530f71c24c7e3dab8")] -[assembly: InternalsVisibleTo("Roslynator.CSharp.Analyzers.CodeFixes, PublicKey=0024000004800000940000000602000000240000525341310004000001000100d348e1a51bc190259aed17cfe132736241fef462de45a5de6c881c7f9d705073c7a2a08ba5ae493c7e878fe5f3cf7909e89045cca696422f03b284b147daf6b93c47bc53dd61ceeae60f73149d183032f029761d0d59aab49a26be4f6af71cd8194ace937642bdcb515f07530096122e97cfe6c8549a843530f71c24c7e3dab8")] diff --git a/src/CSharp.Workspaces/CSharp.Workspaces.csproj b/src/CSharp.Workspaces/CSharp.Workspaces.csproj index e7dba15847..baaf1dc028 100644 --- a/src/CSharp.Workspaces/CSharp.Workspaces.csproj +++ b/src/CSharp.Workspaces/CSharp.Workspaces.csproj @@ -54,6 +54,54 @@ Roslynator.NameGenerator <_Parameter1>$(RoslynatorDllPrefix)Roslynator.Workspaces.Common, PublicKey=$(RoslynatorPublicKey) + + <_Parameter1>Roslynator, PublicKey=$(RoslynatorPublicKey) + + + <_Parameter1>Roslynator.CodeGeneration, PublicKey=$(RoslynatorPublicKey) + + + <_Parameter1>Roslynator.CSharp.Analyzers, PublicKey=$(RoslynatorPublicKey) + + + <_Parameter1>Roslynator.CSharp.Analyzers.CodeFixes, PublicKey=$(RoslynatorPublicKey) + + + <_Parameter1>Roslynator.CSharp.Refactorings, PublicKey=$(RoslynatorPublicKey) + + + <_Parameter1>Roslynator.CSharp.CodeFixes, PublicKey=$(RoslynatorPublicKey) + + + <_Parameter1>Roslynator.VisualStudio, PublicKey=$(RoslynatorPublicKey) + + + <_Parameter1>Roslynator.Analyzers.Tests, PublicKey=$(RoslynatorPublicKey) + + + <_Parameter1>Roslynator.CodeFixes.Tests, PublicKey=$(RoslynatorPublicKey) + + + <_Parameter1>Roslynator.Refactorings.Tests, PublicKey=$(RoslynatorPublicKey) + + + <_Parameter1>Roslynator.CodeAnalysis.Analyzers, PublicKey=$(RoslynatorPublicKey) + + + <_Parameter1>Roslynator.CodeAnalysis.Analyzers.CodeFixes, PublicKey=$(RoslynatorPublicKey) + + + <_Parameter1>Roslynator.CodeAnalysis.Analyzers.Tests, PublicKey=$(RoslynatorPublicKey) + + + <_Parameter1>Roslynator.Formatting.Analyzers, PublicKey=$(RoslynatorPublicKey) + + + <_Parameter1>Roslynator.Formatting.Analyzers.CodeFixes, PublicKey=$(RoslynatorPublicKey) + + + <_Parameter1>Roslynator.Formatting.Analyzers.Tests, PublicKey=$(RoslynatorPublicKey) + diff --git a/src/CSharp.Workspaces/CSharp/SyntaxLogicalInverter.cs b/src/CSharp.Workspaces/CSharp/SyntaxLogicalInverter.cs index 515508274e..78a1ff0d14 100644 --- a/src/CSharp.Workspaces/CSharp/SyntaxLogicalInverter.cs +++ b/src/CSharp.Workspaces/CSharp/SyntaxLogicalInverter.cs @@ -75,8 +75,8 @@ private ExpressionSyntax LogicallyInvertAndParenthesize( if (expression is null) return null; - var inverted = LogicallyInvertImpl(expression, semanticModel, cancellationToken); - return inverted.IsKind(SyntaxKind.LogicalNotExpression, SyntaxKind.ParenthesizedExpression) ? inverted : inverted.Parenthesize(); + ExpressionSyntax inverted = LogicallyInvertImpl(expression, semanticModel, cancellationToken); + return (inverted.IsKind(SyntaxKind.LogicalNotExpression, SyntaxKind.ParenthesizedExpression)) ? inverted : inverted.Parenthesize(); } private ExpressionSyntax LogicallyInvertImpl( diff --git a/src/CSharp.Workspaces/Properties/AssemblyInfo.cs b/src/CSharp.Workspaces/Properties/AssemblyInfo.cs deleted file mode 100644 index b023145bdc..0000000000 --- a/src/CSharp.Workspaces/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,20 +0,0 @@ -// Copyright (c) Josef Pihrt and Contributors. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. - -using System.Runtime.CompilerServices; - -[assembly: InternalsVisibleTo("Roslynator, PublicKey=0024000004800000940000000602000000240000525341310004000001000100d348e1a51bc190259aed17cfe132736241fef462de45a5de6c881c7f9d705073c7a2a08ba5ae493c7e878fe5f3cf7909e89045cca696422f03b284b147daf6b93c47bc53dd61ceeae60f73149d183032f029761d0d59aab49a26be4f6af71cd8194ace937642bdcb515f07530096122e97cfe6c8549a843530f71c24c7e3dab8")] -[assembly: InternalsVisibleTo("Roslynator.CodeGeneration, PublicKey=0024000004800000940000000602000000240000525341310004000001000100d348e1a51bc190259aed17cfe132736241fef462de45a5de6c881c7f9d705073c7a2a08ba5ae493c7e878fe5f3cf7909e89045cca696422f03b284b147daf6b93c47bc53dd61ceeae60f73149d183032f029761d0d59aab49a26be4f6af71cd8194ace937642bdcb515f07530096122e97cfe6c8549a843530f71c24c7e3dab8")] -[assembly: InternalsVisibleTo("Roslynator.CSharp.Analyzers, PublicKey=0024000004800000940000000602000000240000525341310004000001000100d348e1a51bc190259aed17cfe132736241fef462de45a5de6c881c7f9d705073c7a2a08ba5ae493c7e878fe5f3cf7909e89045cca696422f03b284b147daf6b93c47bc53dd61ceeae60f73149d183032f029761d0d59aab49a26be4f6af71cd8194ace937642bdcb515f07530096122e97cfe6c8549a843530f71c24c7e3dab8")] -[assembly: InternalsVisibleTo("Roslynator.CSharp.Analyzers.CodeFixes, PublicKey=0024000004800000940000000602000000240000525341310004000001000100d348e1a51bc190259aed17cfe132736241fef462de45a5de6c881c7f9d705073c7a2a08ba5ae493c7e878fe5f3cf7909e89045cca696422f03b284b147daf6b93c47bc53dd61ceeae60f73149d183032f029761d0d59aab49a26be4f6af71cd8194ace937642bdcb515f07530096122e97cfe6c8549a843530f71c24c7e3dab8")] -[assembly: InternalsVisibleTo("Roslynator.CSharp.Refactorings, PublicKey=0024000004800000940000000602000000240000525341310004000001000100d348e1a51bc190259aed17cfe132736241fef462de45a5de6c881c7f9d705073c7a2a08ba5ae493c7e878fe5f3cf7909e89045cca696422f03b284b147daf6b93c47bc53dd61ceeae60f73149d183032f029761d0d59aab49a26be4f6af71cd8194ace937642bdcb515f07530096122e97cfe6c8549a843530f71c24c7e3dab8")] -[assembly: InternalsVisibleTo("Roslynator.CSharp.CodeFixes, PublicKey=0024000004800000940000000602000000240000525341310004000001000100d348e1a51bc190259aed17cfe132736241fef462de45a5de6c881c7f9d705073c7a2a08ba5ae493c7e878fe5f3cf7909e89045cca696422f03b284b147daf6b93c47bc53dd61ceeae60f73149d183032f029761d0d59aab49a26be4f6af71cd8194ace937642bdcb515f07530096122e97cfe6c8549a843530f71c24c7e3dab8")] -[assembly: InternalsVisibleTo("Roslynator.VisualStudio, PublicKey=0024000004800000940000000602000000240000525341310004000001000100d348e1a51bc190259aed17cfe132736241fef462de45a5de6c881c7f9d705073c7a2a08ba5ae493c7e878fe5f3cf7909e89045cca696422f03b284b147daf6b93c47bc53dd61ceeae60f73149d183032f029761d0d59aab49a26be4f6af71cd8194ace937642bdcb515f07530096122e97cfe6c8549a843530f71c24c7e3dab8")] -[assembly: InternalsVisibleTo("Roslynator.Analyzers.Tests, PublicKey=0024000004800000940000000602000000240000525341310004000001000100d348e1a51bc190259aed17cfe132736241fef462de45a5de6c881c7f9d705073c7a2a08ba5ae493c7e878fe5f3cf7909e89045cca696422f03b284b147daf6b93c47bc53dd61ceeae60f73149d183032f029761d0d59aab49a26be4f6af71cd8194ace937642bdcb515f07530096122e97cfe6c8549a843530f71c24c7e3dab8")] -[assembly: InternalsVisibleTo("Roslynator.CodeFixes.Tests, PublicKey=0024000004800000940000000602000000240000525341310004000001000100d348e1a51bc190259aed17cfe132736241fef462de45a5de6c881c7f9d705073c7a2a08ba5ae493c7e878fe5f3cf7909e89045cca696422f03b284b147daf6b93c47bc53dd61ceeae60f73149d183032f029761d0d59aab49a26be4f6af71cd8194ace937642bdcb515f07530096122e97cfe6c8549a843530f71c24c7e3dab8")] -[assembly: InternalsVisibleTo("Roslynator.Refactorings.Tests, PublicKey=0024000004800000940000000602000000240000525341310004000001000100d348e1a51bc190259aed17cfe132736241fef462de45a5de6c881c7f9d705073c7a2a08ba5ae493c7e878fe5f3cf7909e89045cca696422f03b284b147daf6b93c47bc53dd61ceeae60f73149d183032f029761d0d59aab49a26be4f6af71cd8194ace937642bdcb515f07530096122e97cfe6c8549a843530f71c24c7e3dab8")] -[assembly: InternalsVisibleTo("Roslynator.CodeAnalysis.Analyzers, PublicKey=0024000004800000940000000602000000240000525341310004000001000100d348e1a51bc190259aed17cfe132736241fef462de45a5de6c881c7f9d705073c7a2a08ba5ae493c7e878fe5f3cf7909e89045cca696422f03b284b147daf6b93c47bc53dd61ceeae60f73149d183032f029761d0d59aab49a26be4f6af71cd8194ace937642bdcb515f07530096122e97cfe6c8549a843530f71c24c7e3dab8")] -[assembly: InternalsVisibleTo("Roslynator.CodeAnalysis.Analyzers.CodeFixes, PublicKey=0024000004800000940000000602000000240000525341310004000001000100d348e1a51bc190259aed17cfe132736241fef462de45a5de6c881c7f9d705073c7a2a08ba5ae493c7e878fe5f3cf7909e89045cca696422f03b284b147daf6b93c47bc53dd61ceeae60f73149d183032f029761d0d59aab49a26be4f6af71cd8194ace937642bdcb515f07530096122e97cfe6c8549a843530f71c24c7e3dab8")] -[assembly: InternalsVisibleTo("Roslynator.CodeAnalysis.Analyzers.Tests, PublicKey=0024000004800000940000000602000000240000525341310004000001000100d348e1a51bc190259aed17cfe132736241fef462de45a5de6c881c7f9d705073c7a2a08ba5ae493c7e878fe5f3cf7909e89045cca696422f03b284b147daf6b93c47bc53dd61ceeae60f73149d183032f029761d0d59aab49a26be4f6af71cd8194ace937642bdcb515f07530096122e97cfe6c8549a843530f71c24c7e3dab8")] -[assembly: InternalsVisibleTo("Roslynator.Formatting.Analyzers, PublicKey=0024000004800000940000000602000000240000525341310004000001000100d348e1a51bc190259aed17cfe132736241fef462de45a5de6c881c7f9d705073c7a2a08ba5ae493c7e878fe5f3cf7909e89045cca696422f03b284b147daf6b93c47bc53dd61ceeae60f73149d183032f029761d0d59aab49a26be4f6af71cd8194ace937642bdcb515f07530096122e97cfe6c8549a843530f71c24c7e3dab8")] -[assembly: InternalsVisibleTo("Roslynator.Formatting.Analyzers.CodeFixes, PublicKey=0024000004800000940000000602000000240000525341310004000001000100d348e1a51bc190259aed17cfe132736241fef462de45a5de6c881c7f9d705073c7a2a08ba5ae493c7e878fe5f3cf7909e89045cca696422f03b284b147daf6b93c47bc53dd61ceeae60f73149d183032f029761d0d59aab49a26be4f6af71cd8194ace937642bdcb515f07530096122e97cfe6c8549a843530f71c24c7e3dab8")] -[assembly: InternalsVisibleTo("Roslynator.Formatting.Analyzers.Tests, PublicKey=0024000004800000940000000602000000240000525341310004000001000100d348e1a51bc190259aed17cfe132736241fef462de45a5de6c881c7f9d705073c7a2a08ba5ae493c7e878fe5f3cf7909e89045cca696422f03b284b147daf6b93c47bc53dd61ceeae60f73149d183032f029761d0d59aab49a26be4f6af71cd8194ace937642bdcb515f07530096122e97cfe6c8549a843530f71c24c7e3dab8")] diff --git a/src/CSharp/CSharp.csproj b/src/CSharp/CSharp.csproj index a2a47178d6..2cf9767793 100644 --- a/src/CSharp/CSharp.csproj +++ b/src/CSharp/CSharp.csproj @@ -59,6 +59,63 @@ Roslynator.NameGenerator <_Parameter1>$(RoslynatorDllPrefix)Roslynator.Documentation, PublicKey=$(RoslynatorPublicKey) + + <_Parameter1>Roslynator, PublicKey=$(RoslynatorPublicKey) + + + <_Parameter1>Roslynator.Workspaces, PublicKey=$(RoslynatorPublicKey) + + + <_Parameter1>Roslynator.CodeGeneration, PublicKey=$(RoslynatorPublicKey) + + + <_Parameter1>Roslynator.MetadataGenerator, PublicKey=$(RoslynatorPublicKey) + + + <_Parameter1>Roslynator.CSharp.Analyzers, PublicKey=$(RoslynatorPublicKey) + + + <_Parameter1>Roslynator.CSharp.Analyzers.CodeFixes, PublicKey=$(RoslynatorPublicKey) + + + <_Parameter1>Roslynator.CSharp.CodeFixes, PublicKey=$(RoslynatorPublicKey) + + + <_Parameter1>Roslynator.CSharp.Refactorings, PublicKey=$(RoslynatorPublicKey) + + + <_Parameter1>Roslynator.CSharp.Tests, PublicKey=$(RoslynatorPublicKey) + + + <_Parameter1>Roslynator.CSharp.Workspaces.Tests, PublicKey=$(RoslynatorPublicKey) + + + <_Parameter1>Roslynator.Analyzers.Tests, PublicKey=$(RoslynatorPublicKey) + + + <_Parameter1>Roslynator.CodeFixes.Tests, PublicKey=$(RoslynatorPublicKey) + + + <_Parameter1>Roslynator.Refactorings.Tests, PublicKey=$(RoslynatorPublicKey) + + + <_Parameter1>Roslynator.CodeAnalysis.Analyzers, PublicKey=$(RoslynatorPublicKey) + + + <_Parameter1>Roslynator.CodeAnalysis.Analyzers.CodeFixes, PublicKey=$(RoslynatorPublicKey) + + + <_Parameter1>Roslynator.CodeAnalysis.Analyzers.Tests, PublicKey=$(RoslynatorPublicKey) + + + <_Parameter1>Roslynator.Formatting.Analyzers, PublicKey=$(RoslynatorPublicKey) + + + <_Parameter1>Roslynator.Formatting.Analyzers.CodeFixes, PublicKey=$(RoslynatorPublicKey) + + + <_Parameter1>Roslynator.Formatting.Analyzers.Tests, PublicKey=$(RoslynatorPublicKey) + diff --git a/src/CSharp/CSharp/SyntaxRewriters/WhitespaceRemover.cs b/src/CSharp/CSharp/SyntaxRewriters/WhitespaceRemover.cs index 6383b50029..a9ccbca20d 100644 --- a/src/CSharp/CSharp/SyntaxRewriters/WhitespaceRemover.cs +++ b/src/CSharp/CSharp/SyntaxRewriters/WhitespaceRemover.cs @@ -38,13 +38,15 @@ public override SyntaxTrivia VisitTrivia(SyntaxTrivia trivia) if (trivia.IsKind(SyntaxKind.WhitespaceTrivia)) return Replacement; - - if (trivia.IsKind(SyntaxKind.EndOfLineTrivia)){ + + if (trivia.IsKind(SyntaxKind.EndOfLineTrivia)) + { // We can only safely remove EndOfLineTrivia if it is not proceeded by a SingleLineComment - var triviaIndex = trivia.Token.TrailingTrivia.IndexOf(trivia); + int triviaIndex = trivia.Token.TrailingTrivia.IndexOf(trivia); if (triviaIndex == 0) return Replacement; - var prevTrivia = trivia.Token.TrailingTrivia[triviaIndex - 1]; + + SyntaxTrivia prevTrivia = trivia.Token.TrailingTrivia[triviaIndex - 1]; if (!prevTrivia.IsKind(SyntaxKind.SingleLineCommentTrivia)) return Replacement; } diff --git a/src/CSharp/Properties/AssemblyInfo.cs b/src/CSharp/Properties/AssemblyInfo.cs deleted file mode 100644 index 0575769c65..0000000000 --- a/src/CSharp/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,23 +0,0 @@ -// Copyright (c) Josef Pihrt and Contributors. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. - -using System.Runtime.CompilerServices; - -[assembly: InternalsVisibleTo("Roslynator, PublicKey=0024000004800000940000000602000000240000525341310004000001000100d348e1a51bc190259aed17cfe132736241fef462de45a5de6c881c7f9d705073c7a2a08ba5ae493c7e878fe5f3cf7909e89045cca696422f03b284b147daf6b93c47bc53dd61ceeae60f73149d183032f029761d0d59aab49a26be4f6af71cd8194ace937642bdcb515f07530096122e97cfe6c8549a843530f71c24c7e3dab8")] -[assembly: InternalsVisibleTo("Roslynator.Workspaces, PublicKey=0024000004800000940000000602000000240000525341310004000001000100d348e1a51bc190259aed17cfe132736241fef462de45a5de6c881c7f9d705073c7a2a08ba5ae493c7e878fe5f3cf7909e89045cca696422f03b284b147daf6b93c47bc53dd61ceeae60f73149d183032f029761d0d59aab49a26be4f6af71cd8194ace937642bdcb515f07530096122e97cfe6c8549a843530f71c24c7e3dab8")] -[assembly: InternalsVisibleTo("Roslynator.CodeGeneration, PublicKey=0024000004800000940000000602000000240000525341310004000001000100d348e1a51bc190259aed17cfe132736241fef462de45a5de6c881c7f9d705073c7a2a08ba5ae493c7e878fe5f3cf7909e89045cca696422f03b284b147daf6b93c47bc53dd61ceeae60f73149d183032f029761d0d59aab49a26be4f6af71cd8194ace937642bdcb515f07530096122e97cfe6c8549a843530f71c24c7e3dab8")] -[assembly: InternalsVisibleTo("Roslynator.MetadataGenerator, PublicKey=0024000004800000940000000602000000240000525341310004000001000100d348e1a51bc190259aed17cfe132736241fef462de45a5de6c881c7f9d705073c7a2a08ba5ae493c7e878fe5f3cf7909e89045cca696422f03b284b147daf6b93c47bc53dd61ceeae60f73149d183032f029761d0d59aab49a26be4f6af71cd8194ace937642bdcb515f07530096122e97cfe6c8549a843530f71c24c7e3dab8")] -[assembly: InternalsVisibleTo("Roslynator.CSharp.Analyzers, PublicKey=0024000004800000940000000602000000240000525341310004000001000100d348e1a51bc190259aed17cfe132736241fef462de45a5de6c881c7f9d705073c7a2a08ba5ae493c7e878fe5f3cf7909e89045cca696422f03b284b147daf6b93c47bc53dd61ceeae60f73149d183032f029761d0d59aab49a26be4f6af71cd8194ace937642bdcb515f07530096122e97cfe6c8549a843530f71c24c7e3dab8")] -[assembly: InternalsVisibleTo("Roslynator.CSharp.Analyzers.CodeFixes, PublicKey=0024000004800000940000000602000000240000525341310004000001000100d348e1a51bc190259aed17cfe132736241fef462de45a5de6c881c7f9d705073c7a2a08ba5ae493c7e878fe5f3cf7909e89045cca696422f03b284b147daf6b93c47bc53dd61ceeae60f73149d183032f029761d0d59aab49a26be4f6af71cd8194ace937642bdcb515f07530096122e97cfe6c8549a843530f71c24c7e3dab8")] -[assembly: InternalsVisibleTo("Roslynator.CSharp.CodeFixes, PublicKey=0024000004800000940000000602000000240000525341310004000001000100d348e1a51bc190259aed17cfe132736241fef462de45a5de6c881c7f9d705073c7a2a08ba5ae493c7e878fe5f3cf7909e89045cca696422f03b284b147daf6b93c47bc53dd61ceeae60f73149d183032f029761d0d59aab49a26be4f6af71cd8194ace937642bdcb515f07530096122e97cfe6c8549a843530f71c24c7e3dab8")] -[assembly: InternalsVisibleTo("Roslynator.CSharp.Refactorings, PublicKey=0024000004800000940000000602000000240000525341310004000001000100d348e1a51bc190259aed17cfe132736241fef462de45a5de6c881c7f9d705073c7a2a08ba5ae493c7e878fe5f3cf7909e89045cca696422f03b284b147daf6b93c47bc53dd61ceeae60f73149d183032f029761d0d59aab49a26be4f6af71cd8194ace937642bdcb515f07530096122e97cfe6c8549a843530f71c24c7e3dab8")] -[assembly: InternalsVisibleTo("Roslynator.CSharp.Tests, PublicKey=0024000004800000940000000602000000240000525341310004000001000100d348e1a51bc190259aed17cfe132736241fef462de45a5de6c881c7f9d705073c7a2a08ba5ae493c7e878fe5f3cf7909e89045cca696422f03b284b147daf6b93c47bc53dd61ceeae60f73149d183032f029761d0d59aab49a26be4f6af71cd8194ace937642bdcb515f07530096122e97cfe6c8549a843530f71c24c7e3dab8")] -[assembly: InternalsVisibleTo("Roslynator.CSharp.Workspaces.Tests, PublicKey=0024000004800000940000000602000000240000525341310004000001000100d348e1a51bc190259aed17cfe132736241fef462de45a5de6c881c7f9d705073c7a2a08ba5ae493c7e878fe5f3cf7909e89045cca696422f03b284b147daf6b93c47bc53dd61ceeae60f73149d183032f029761d0d59aab49a26be4f6af71cd8194ace937642bdcb515f07530096122e97cfe6c8549a843530f71c24c7e3dab8")] -[assembly: InternalsVisibleTo("Roslynator.Analyzers.Tests, PublicKey=0024000004800000940000000602000000240000525341310004000001000100d348e1a51bc190259aed17cfe132736241fef462de45a5de6c881c7f9d705073c7a2a08ba5ae493c7e878fe5f3cf7909e89045cca696422f03b284b147daf6b93c47bc53dd61ceeae60f73149d183032f029761d0d59aab49a26be4f6af71cd8194ace937642bdcb515f07530096122e97cfe6c8549a843530f71c24c7e3dab8")] -[assembly: InternalsVisibleTo("Roslynator.CodeFixes.Tests, PublicKey=0024000004800000940000000602000000240000525341310004000001000100d348e1a51bc190259aed17cfe132736241fef462de45a5de6c881c7f9d705073c7a2a08ba5ae493c7e878fe5f3cf7909e89045cca696422f03b284b147daf6b93c47bc53dd61ceeae60f73149d183032f029761d0d59aab49a26be4f6af71cd8194ace937642bdcb515f07530096122e97cfe6c8549a843530f71c24c7e3dab8")] -[assembly: InternalsVisibleTo("Roslynator.Refactorings.Tests, PublicKey=0024000004800000940000000602000000240000525341310004000001000100d348e1a51bc190259aed17cfe132736241fef462de45a5de6c881c7f9d705073c7a2a08ba5ae493c7e878fe5f3cf7909e89045cca696422f03b284b147daf6b93c47bc53dd61ceeae60f73149d183032f029761d0d59aab49a26be4f6af71cd8194ace937642bdcb515f07530096122e97cfe6c8549a843530f71c24c7e3dab8")] -[assembly: InternalsVisibleTo("Roslynator.CodeAnalysis.Analyzers, PublicKey=0024000004800000940000000602000000240000525341310004000001000100d348e1a51bc190259aed17cfe132736241fef462de45a5de6c881c7f9d705073c7a2a08ba5ae493c7e878fe5f3cf7909e89045cca696422f03b284b147daf6b93c47bc53dd61ceeae60f73149d183032f029761d0d59aab49a26be4f6af71cd8194ace937642bdcb515f07530096122e97cfe6c8549a843530f71c24c7e3dab8")] -[assembly: InternalsVisibleTo("Roslynator.CodeAnalysis.Analyzers.CodeFixes, PublicKey=0024000004800000940000000602000000240000525341310004000001000100d348e1a51bc190259aed17cfe132736241fef462de45a5de6c881c7f9d705073c7a2a08ba5ae493c7e878fe5f3cf7909e89045cca696422f03b284b147daf6b93c47bc53dd61ceeae60f73149d183032f029761d0d59aab49a26be4f6af71cd8194ace937642bdcb515f07530096122e97cfe6c8549a843530f71c24c7e3dab8")] -[assembly: InternalsVisibleTo("Roslynator.CodeAnalysis.Analyzers.Tests, PublicKey=0024000004800000940000000602000000240000525341310004000001000100d348e1a51bc190259aed17cfe132736241fef462de45a5de6c881c7f9d705073c7a2a08ba5ae493c7e878fe5f3cf7909e89045cca696422f03b284b147daf6b93c47bc53dd61ceeae60f73149d183032f029761d0d59aab49a26be4f6af71cd8194ace937642bdcb515f07530096122e97cfe6c8549a843530f71c24c7e3dab8")] -[assembly: InternalsVisibleTo("Roslynator.Formatting.Analyzers, PublicKey=0024000004800000940000000602000000240000525341310004000001000100d348e1a51bc190259aed17cfe132736241fef462de45a5de6c881c7f9d705073c7a2a08ba5ae493c7e878fe5f3cf7909e89045cca696422f03b284b147daf6b93c47bc53dd61ceeae60f73149d183032f029761d0d59aab49a26be4f6af71cd8194ace937642bdcb515f07530096122e97cfe6c8549a843530f71c24c7e3dab8")] -[assembly: InternalsVisibleTo("Roslynator.Formatting.Analyzers.CodeFixes, PublicKey=0024000004800000940000000602000000240000525341310004000001000100d348e1a51bc190259aed17cfe132736241fef462de45a5de6c881c7f9d705073c7a2a08ba5ae493c7e878fe5f3cf7909e89045cca696422f03b284b147daf6b93c47bc53dd61ceeae60f73149d183032f029761d0d59aab49a26be4f6af71cd8194ace937642bdcb515f07530096122e97cfe6c8549a843530f71c24c7e3dab8")] -[assembly: InternalsVisibleTo("Roslynator.Formatting.Analyzers.Tests, PublicKey=0024000004800000940000000602000000240000525341310004000001000100d348e1a51bc190259aed17cfe132736241fef462de45a5de6c881c7f9d705073c7a2a08ba5ae493c7e878fe5f3cf7909e89045cca696422f03b284b147daf6b93c47bc53dd61ceeae60f73149d183032f029761d0d59aab49a26be4f6af71cd8194ace937642bdcb515f07530096122e97cfe6c8549a843530f71c24c7e3dab8")] diff --git a/src/CodeAnalysis.Analyzers.CodeFixes/CodeAnalysis.Analyzers.CodeFixes.csproj b/src/CodeAnalysis.Analyzers.CodeFixes/CodeAnalysis.Analyzers.CodeFixes.csproj index 2e8bca4542..e5497bfca6 100644 --- a/src/CodeAnalysis.Analyzers.CodeFixes/CodeAnalysis.Analyzers.CodeFixes.csproj +++ b/src/CodeAnalysis.Analyzers.CodeFixes/CodeAnalysis.Analyzers.CodeFixes.csproj @@ -5,11 +5,11 @@ - $(RoslynatorCodeAnalysisAnalyzersVersion) + $(RoslynatorAnalyzersVersion) Roslynator.CodeAnalysis.Analyzers.CodeFixes Roslynator.CodeAnalysis Roslynator.CodeAnalysis.Analyzers.nuspec - configuration=$(Configuration);version=$(RoslynatorCodeAnalysisAnalyzersPackageVersion) + configuration=$(Configuration);version=$(RoslynatorAnalyzersPackageVersion) @@ -34,4 +34,10 @@ + + + <_Parameter1>Roslynator.CodeAnalysis.Analyzers.Tests, PublicKey=$(RoslynatorPublicKey) + + + \ No newline at end of file diff --git a/src/CodeAnalysis.Analyzers.CodeFixes/Properties/AssemblyInfo.cs b/src/CodeAnalysis.Analyzers.CodeFixes/Properties/AssemblyInfo.cs deleted file mode 100644 index c9640a32fb..0000000000 --- a/src/CodeAnalysis.Analyzers.CodeFixes/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,5 +0,0 @@ -// Copyright (c) Josef Pihrt and Contributors. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. - -using System.Runtime.CompilerServices; - -[assembly: InternalsVisibleTo("Roslynator.CodeAnalysis.Analyzers.Tests, PublicKey=0024000004800000940000000602000000240000525341310004000001000100d348e1a51bc190259aed17cfe132736241fef462de45a5de6c881c7f9d705073c7a2a08ba5ae493c7e878fe5f3cf7909e89045cca696422f03b284b147daf6b93c47bc53dd61ceeae60f73149d183032f029761d0d59aab49a26be4f6af71cd8194ace937642bdcb515f07530096122e97cfe6c8549a843530f71c24c7e3dab8")] diff --git a/src/CodeAnalysis.Analyzers/CodeAnalysis.Analyzers.csproj b/src/CodeAnalysis.Analyzers/CodeAnalysis.Analyzers.csproj index e9855bf9e8..43d16eb345 100644 --- a/src/CodeAnalysis.Analyzers/CodeAnalysis.Analyzers.csproj +++ b/src/CodeAnalysis.Analyzers/CodeAnalysis.Analyzers.csproj @@ -5,7 +5,7 @@ - $(RoslynatorCodeAnalysisAnalyzersVersion) + $(RoslynatorAnalyzersVersion) Roslynator.CodeAnalysis.Analyzers Roslynator.CodeAnalysis false @@ -24,4 +24,13 @@ + + + <_Parameter1>Roslynator.CodeAnalysis.Analyzers.Tests, PublicKey=$(RoslynatorPublicKey) + + + <_Parameter1>Roslynator.CodeAnalysis.Analyzers.CodeFixes, PublicKey=$(RoslynatorPublicKey) + + + \ No newline at end of file diff --git a/src/CodeAnalysis.Analyzers/Properties/AssemblyInfo.cs b/src/CodeAnalysis.Analyzers/Properties/AssemblyInfo.cs deleted file mode 100644 index 9fb2493cb4..0000000000 --- a/src/CodeAnalysis.Analyzers/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,6 +0,0 @@ -// Copyright (c) Josef Pihrt and Contributors. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. - -using System.Runtime.CompilerServices; - -[assembly: InternalsVisibleTo("Roslynator.CodeAnalysis.Analyzers.Tests, PublicKey=0024000004800000940000000602000000240000525341310004000001000100d348e1a51bc190259aed17cfe132736241fef462de45a5de6c881c7f9d705073c7a2a08ba5ae493c7e878fe5f3cf7909e89045cca696422f03b284b147daf6b93c47bc53dd61ceeae60f73149d183032f029761d0d59aab49a26be4f6af71cd8194ace937642bdcb515f07530096122e97cfe6c8549a843530f71c24c7e3dab8")] -[assembly: InternalsVisibleTo("Roslynator.CodeAnalysis.Analyzers.CodeFixes, PublicKey=0024000004800000940000000602000000240000525341310004000001000100d348e1a51bc190259aed17cfe132736241fef462de45a5de6c881c7f9d705073c7a2a08ba5ae493c7e878fe5f3cf7909e89045cca696422f03b284b147daf6b93c47bc53dd61ceeae60f73149d183032f029761d0d59aab49a26be4f6af71cd8194ace937642bdcb515f07530096122e97cfe6c8549a843530f71c24c7e3dab8")] diff --git a/src/CodeFixes/CodeFixes.csproj b/src/CodeFixes/CodeFixes.csproj index e4b9100706..0fd0bb486b 100644 --- a/src/CodeFixes/CodeFixes.csproj +++ b/src/CodeFixes/CodeFixes.csproj @@ -9,7 +9,7 @@ Roslynator.CSharp.CodeFixes Roslynator.CSharp.CodeFixes Roslynator.CodeFixes.nuspec - configuration=$(Configuration);version=$(RoslynatorCodeFixesPackageVersion) + configuration=$(Configuration) false @@ -34,4 +34,13 @@ + + + <_Parameter1>Roslynator.VisualStudio, PublicKey=$(RoslynatorPublicKey) + + + <_Parameter1>Roslynator.MetadataGenerator, PublicKey=$(RoslynatorPublicKey) + + + \ No newline at end of file diff --git a/src/CodeFixes/Properties/AssemblyInfo.cs b/src/CodeFixes/Properties/AssemblyInfo.cs deleted file mode 100644 index 36413d61b5..0000000000 --- a/src/CodeFixes/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,6 +0,0 @@ -// Copyright (c) Josef Pihrt and Contributors. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. - -using System.Runtime.CompilerServices; - -[assembly: InternalsVisibleTo("Roslynator.VisualStudio, PublicKey=0024000004800000940000000602000000240000525341310004000001000100d348e1a51bc190259aed17cfe132736241fef462de45a5de6c881c7f9d705073c7a2a08ba5ae493c7e878fe5f3cf7909e89045cca696422f03b284b147daf6b93c47bc53dd61ceeae60f73149d183032f029761d0d59aab49a26be4f6af71cd8194ace937642bdcb515f07530096122e97cfe6c8549a843530f71c24c7e3dab8")] -[assembly: InternalsVisibleTo("Roslynator.MetadataGenerator, PublicKey=0024000004800000940000000602000000240000525341310004000001000100d348e1a51bc190259aed17cfe132736241fef462de45a5de6c881c7f9d705073c7a2a08ba5ae493c7e878fe5f3cf7909e89045cca696422f03b284b147daf6b93c47bc53dd61ceeae60f73149d183032f029761d0d59aab49a26be4f6af71cd8194ace937642bdcb515f07530096122e97cfe6c8549a843530f71c24c7e3dab8")] diff --git a/src/CommandLine.DocumentationGenerator/Program.cs b/src/CommandLine.DocumentationGenerator/Program.cs index e521bcd634..6395b02e94 100644 --- a/src/CommandLine.DocumentationGenerator/Program.cs +++ b/src/CommandLine.DocumentationGenerator/Program.cs @@ -24,22 +24,33 @@ private static void Main(params string[] args) "Roslynator Command-line Tool", commands.OrderBy(f => f.Name, StringComparer.InvariantCulture)); - string destinationDirectoryPath = null; - string dataDirectoryPath = null; - - if (Debugger.IsAttached) - { - destinationDirectoryPath = (args.Length > 0) ? args[0] : @"..\..\..\..\..\docs\cli"; - dataDirectoryPath = @"..\..\..\data"; - } - else + if (args.Length < 2) { - destinationDirectoryPath = args[0]; - dataDirectoryPath = @"..\src\CommandLine.DocumentationGenerator\data"; + Console.WriteLine("Invalid number of arguments"); + return; } + string destinationDirectoryPath = args[0]; + string dataDirectoryPath = args[1]; + + string[] ignoredCommandNames = (args.Length > 2) + ? Regex.Split(args[2], ",") + : Array.Empty(); + + destinationDirectoryPath = Path.GetFullPath(destinationDirectoryPath); + dataDirectoryPath = Path.GetFullPath(dataDirectoryPath); + + Console.WriteLine($"Destination directory: {destinationDirectoryPath}"); + Console.WriteLine($"Data directory: {dataDirectoryPath}"); + foreach (Command command in application.Commands) { + if (ignoredCommandNames.Contains(command.Name)) + { + Console.WriteLine($"Skip command '{command.Name}'"); + continue; + } + string commandFilePath = Path.GetFullPath(Path.Combine(destinationDirectoryPath, $"{command.Name}-command.md")); using (var sw = new StreamWriter(commandFilePath, append: false, Encoding.UTF8)) diff --git a/src/CommandLine.DocumentationGenerator/Properties/launchSettings.json b/src/CommandLine.DocumentationGenerator/Properties/launchSettings.json new file mode 100644 index 0000000000..202c23d65e --- /dev/null +++ b/src/CommandLine.DocumentationGenerator/Properties/launchSettings.json @@ -0,0 +1,8 @@ +{ + "profiles": { + "CommandLine.DocumentationGenerator": { + "commandName": "Project", + "commandLineArgs": "\"../../../../../docs/cli\" \"../../../data\"" + } + } +} \ No newline at end of file diff --git a/src/CommandLine/AnalyzerAssemblyInfo.cs b/src/CommandLine/AnalyzerAssemblyInfo.cs index 684a96a23d..8ae54c6e9c 100644 --- a/src/CommandLine/AnalyzerAssemblyInfo.cs +++ b/src/CommandLine/AnalyzerAssemblyInfo.cs @@ -2,7 +2,7 @@ namespace Roslynator.CommandLine; -internal struct AnalyzerAssemblyInfo +internal readonly struct AnalyzerAssemblyInfo { public AnalyzerAssemblyInfo(AnalyzerAssembly analyzerAssembly, string filePath) { diff --git a/src/CommandLine/CommandLine.csproj b/src/CommandLine/CommandLine.csproj index 50dd740459..39a3ed75d6 100644 --- a/src/CommandLine/CommandLine.csproj +++ b/src/CommandLine/CommandLine.csproj @@ -69,4 +69,10 @@ + + + <_Parameter1>Roslynator.CommandLine.DocumentationGenerator, PublicKey=$(RoslynatorPublicKey) + + + diff --git a/src/CommandLine/Commands/HelpCommand.cs b/src/CommandLine/Commands/HelpCommand.cs index 93f596b8dd..4c3639e124 100644 --- a/src/CommandLine/Commands/HelpCommand.cs +++ b/src/CommandLine/Commands/HelpCommand.cs @@ -72,6 +72,7 @@ private static void WriteHelp( } } + [System.Diagnostics.CodeAnalysis.SuppressMessage("Style", "IDE0060:Remove unused parameter")] private static void OpenHelpInBrowser(string commandName) { throw new NotSupportedException(); diff --git a/src/CommandLine/Commands/MigrateCommand.cs b/src/CommandLine/Commands/MigrateCommand.cs index 19467f2b7b..40fb6c6998 100644 --- a/src/CommandLine/Commands/MigrateCommand.cs +++ b/src/CommandLine/Commands/MigrateCommand.cs @@ -17,8 +17,6 @@ namespace Roslynator.CommandLine; internal class MigrateCommand { - private static readonly Regex _versionRegex = new(@"\A(?\d+\.\d+\.\d+)(?-.*)?\z"); - private static readonly Regex _editorConfigRegex = new( @" dotnet_diagnostic\. @@ -178,111 +176,6 @@ private CommandStatus ExecuteFile(string path) return CommandStatus.NotSuccess; } - private CommandStatus ExecuteProject(string path, XDocument document) - { - List messages = null; - - foreach (XElement itemGroup in document.Root.Descendants("ItemGroup")) - { - XElement analyzers = null; - XElement formattingAnalyzers = null; - - foreach (XElement e in itemGroup.Elements("PackageReference")) - { - string packageId = e.Attribute("Include")?.Value; - - if (packageId is null) - continue; - - if (packageId == "Roslynator.Formatting.Analyzers") - formattingAnalyzers = e; - - if (packageId == "Roslynator.Analyzers") - analyzers = e; - } - - if (analyzers is null) - continue; - - if (formattingAnalyzers is not null) - { - string versionText = formattingAnalyzers.Attribute("Version")?.Value; - - if (versionText is null) - { - WriteXmlError(formattingAnalyzers, "Version attribute not found"); - continue; - } - - if (versionText is not null) - { - Match match = _versionRegex.Match(versionText); - - if (!match.Success) - { - WriteXmlError(formattingAnalyzers, $"Invalid version '{versionText}'"); - continue; - } - - versionText = match.Groups["version"].Value; - - if (!Version.TryParse(versionText, out Version version)) - { - WriteXmlError(formattingAnalyzers, $"Invalid version '{versionText}'"); - continue; - } - - if (version > Versions.Version_1_0_0 - || !match.Groups["suffix"].Success) - { - continue; - } - } - } - - if (formattingAnalyzers is not null) - { - var message = new LogMessage("Update package 'Roslynator.Formatting.Analyzers' to '1.0.0'", Colors.Message_OK, Verbosity.Normal); - - (messages ??= new List()).Add(message); - - formattingAnalyzers.SetAttributeValue("Version", "1.0.0"); - } - else - { - var message = new LogMessage("Add package 'Roslynator.Formatting.Analyzers 1.0.0'", Colors.Message_OK, Verbosity.Normal); - - (messages ??= new List()).Add(message); - - XText whitespace = null; - - if (analyzers.NodesBeforeSelf().LastOrDefault() is XText xtext - && xtext is not null - && string.IsNullOrWhiteSpace(xtext.Value)) - { - whitespace = xtext; - } - - analyzers.AddAfterSelf(whitespace, new XElement("PackageReference", new XAttribute("Include", "Roslynator.Formatting.Analyzers"), new XAttribute("Version", "1.0.0"))); - } - } - - if (messages is not null) - { - WriteUpdateMessages(path, messages); - - if (!DryRun) - { - var settings = new XmlWriterSettings() { OmitXmlDeclaration = true }; - - using (XmlWriter xmlWriter = XmlWriter.Create(path, settings)) - document.Save(xmlWriter); - } - } - - return CommandStatus.Success; - } - private CommandStatus ExecuteRuleSet(string path) { XDocument document; @@ -471,11 +364,6 @@ private CommandStatus ExecuteEditorConfig(string path) return CommandStatus.Success; } - private static void WriteXmlError(XElement element, string message) - { - WriteLine($"{message}, line: {((IXmlLineInfo)element).LineNumber}, file: '{element}'", Colors.Message_Warning, Verbosity.Detailed); - } - private static void WriteUpdateMessages(string path, List messages) { WriteLine($"Update '{path}'", Colors.Message_OK, Verbosity.Minimal); diff --git a/src/CommandLine/DelegateFactory.cs b/src/CommandLine/DelegateFactory.cs index 276267116c..4d143ef0f9 100644 --- a/src/CommandLine/DelegateFactory.cs +++ b/src/CommandLine/DelegateFactory.cs @@ -174,7 +174,7 @@ private static TDelegate CreateDelegateAndCatchIfThrows( || ex is MissingMemberException || ex is TypeLoadException) { - Logger.WriteError(ex, $"Cannot create delegate: {ex.Message}"); + Logger.WriteError(ex); return null; } } diff --git a/src/CommandLine/Program.cs b/src/CommandLine/Program.cs index 8c929eb740..92c5dd0ef2 100644 --- a/src/CommandLine/Program.cs +++ b/src/CommandLine/Program.cs @@ -4,6 +4,7 @@ using System.Collections.Generic; using System.Collections.Immutable; using System.Diagnostics; +using System.Diagnostics.CodeAnalysis; using System.IO; using System.Linq; using System.Reflection; @@ -365,6 +366,7 @@ private static async Task AnalyzeAsync(AnalyzeCommandLineOptions options) return GetExitCode(status); } +#if DEBUG private static int AnalyzeAssembly(AnalyzeAssemblyCommandLineOptions options) { string language = null; @@ -438,6 +440,7 @@ private static async Task FindSymbolsAsync(FindSymbolsCommandLineOptions op return GetExitCode(status); } +#endif private static async Task RenameSymbolAsync(RenameSymbolCommandLineOptions options) { @@ -450,7 +453,9 @@ private static async Task RenameSymbolAsync(RenameSymbolCommandLineOptions if (!TryParseOptionValueAsEnum(options.OnError, OptionNames.OnError, out RenameErrorResolution errorResolution, defaultValue: RenameErrorResolution.None)) return ExitCodes.Error; +#pragma warning disable RCS1118 var visibility = Visibility.Public; +#pragma warning restore RCS1118 var scopeFilter = RenameScopeFilter.All; #if DEBUG if (!TryParseOptionValueAsEnum(options.Visibility, OptionNames.Visibility, out visibility)) @@ -679,6 +684,7 @@ private static async Task SpellcheckAsync(SpellcheckCommandLineOptions opti return GetExitCode(status); } +#if DEBUG private static async Task SlnListAsync(SlnListCommandLineOptions options) { if (!options.TryGetProjectFilter(out ProjectFilter projectFilter)) @@ -702,6 +708,7 @@ private static int ListVisualStudio(ListVisualStudioCommandLineOptions options) return GetExitCode(status); } +#endif private static async Task PhysicalLinesOfCodeAsync(PhysicalLinesOfCodeCommandLineOptions options) { @@ -846,6 +853,7 @@ private static async Task GenerateDocRootAsync(GenerateDocRootCommandLineOp return GetExitCode(status); } +#if DEBUG private static async Task GenerateSourceReferencesAsync(GenerateSourceReferencesCommandLineOptions options) { if (!TryParseOptionValueAsEnum(options.Depth, OptionNames.Depth, out DocumentationDepth depth, DocumentationOptions.DefaultValues.Depth)) @@ -870,6 +878,7 @@ private static async Task GenerateSourceReferencesAsync(GenerateSourceRefer return GetExitCode(status); } +#endif private static int Migrate(MigrateCommandLineOptions options) { @@ -907,6 +916,7 @@ private static int Migrate(MigrateCommandLineOptions options) return GetExitCode(status); } +#if DEBUG private static async Task ListReferencesAsync(ListReferencesCommandLineOptions options) { if (!TryParseOptionValueAsEnum(options.Display, OptionNames.Display, out MetadataReferenceDisplay display, MetadataReferenceDisplay.Path)) @@ -931,6 +941,7 @@ private static async Task ListReferencesAsync(ListReferencesCommandLineOpti return GetExitCode(status); } +#endif private static bool TryParsePaths(string value, out ImmutableArray paths) { diff --git a/src/CommandLine/Properties/AssemblyInfo.cs b/src/CommandLine/Properties/AssemblyInfo.cs deleted file mode 100644 index 691c3a5862..0000000000 --- a/src/CommandLine/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,5 +0,0 @@ -// Copyright (c) Josef Pihrt and Contributors. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. - -using System.Runtime.CompilerServices; - -[assembly: InternalsVisibleTo("Roslynator.CommandLine.DocumentationGenerator, PublicKey=0024000004800000940000000602000000240000525341310004000001000100d348e1a51bc190259aed17cfe132736241fef462de45a5de6c881c7f9d705073c7a2a08ba5ae493c7e878fe5f3cf7909e89045cca696422f03b284b147daf6b93c47bc53dd61ceeae60f73149d183032f029761d0d59aab49a26be4f6af71cd8194ace937642bdcb515f07530096122e97cfe6c8549a843530f71c24c7e3dab8")] diff --git a/src/Common/CSharp/Analysis/RemoveAsyncAwaitAnalysis.cs b/src/Common/CSharp/Analysis/RemoveAsyncAwaitAnalysis.cs index f6da8369a2..e9a63019c5 100644 --- a/src/Common/CSharp/Analysis/RemoveAsyncAwaitAnalysis.cs +++ b/src/Common/CSharp/Analysis/RemoveAsyncAwaitAnalysis.cs @@ -13,7 +13,7 @@ namespace Roslynator.CSharp.Analysis; -internal struct RemoveAsyncAwaitAnalysis : IDisposable +internal readonly struct RemoveAsyncAwaitAnalysis : IDisposable { private RemoveAsyncAwaitAnalysis(AwaitExpressionWalker walker) { diff --git a/src/Common/Common.csproj b/src/Common/Common.csproj index 0065c4c791..de6f44aacb 100644 --- a/src/Common/Common.csproj +++ b/src/Common/Common.csproj @@ -28,9 +28,57 @@ <_Parameter1>$(RoslynatorDllPrefix)Roslynator.Workspaces.Common, PublicKey=$(RoslynatorPublicKey) + + <_Parameter1>Roslynator.CSharp.Analyzers, PublicKey=$(RoslynatorPublicKey) + + + <_Parameter1>Roslynator.CSharp.Analyzers.CodeFixes, PublicKey=$(RoslynatorPublicKey) + + + <_Parameter1>Roslynator.CSharp.CodeFixes, PublicKey=$(RoslynatorPublicKey) + + + <_Parameter1>Roslynator.CSharp.Refactorings, PublicKey=$(RoslynatorPublicKey) + + + <_Parameter1>Roslynator.Analyzers.Tests, PublicKey=$(RoslynatorPublicKey) + + + <_Parameter1>Roslynator.CodeFixes.Tests, PublicKey=$(RoslynatorPublicKey) + + + <_Parameter1>Roslynator.Refactorings.Tests, PublicKey=$(RoslynatorPublicKey) + + + <_Parameter1>Roslynator.CodeAnalysis.Analyzers, PublicKey=$(RoslynatorPublicKey) + + + <_Parameter1>Roslynator.CodeAnalysis.Analyzers.CodeFixes, PublicKey=$(RoslynatorPublicKey) + + + <_Parameter1>Roslynator.CodeAnalysis.Analyzers.Tests, PublicKey=$(RoslynatorPublicKey) + + + <_Parameter1>Roslynator.Formatting.Analyzers, PublicKey=$(RoslynatorPublicKey) + + + <_Parameter1>Roslynator.Formatting.Analyzers.CodeFixes, PublicKey=$(RoslynatorPublicKey) + + + <_Parameter1>Roslynator.Formatting.Analyzers.Tests, PublicKey=$(RoslynatorPublicKey) + + + <_Parameter1>Roslynator.CodeGeneration, PublicKey=$(RoslynatorPublicKey) + + + <_Parameter1>Roslynator.CodeGenerator, PublicKey=$(RoslynatorPublicKey) + + + <_Parameter1>Roslynator.VisualStudio, PublicKey=$(RoslynatorPublicKey) + diff --git a/src/Common/Properties/AssemblyInfo.cs b/src/Common/Properties/AssemblyInfo.cs deleted file mode 100644 index 59850ff874..0000000000 --- a/src/Common/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,20 +0,0 @@ -// Copyright (c) Josef Pihrt and Contributors. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. - -using System.Runtime.CompilerServices; - -[assembly: InternalsVisibleTo("Roslynator.CSharp.Analyzers, PublicKey=0024000004800000940000000602000000240000525341310004000001000100d348e1a51bc190259aed17cfe132736241fef462de45a5de6c881c7f9d705073c7a2a08ba5ae493c7e878fe5f3cf7909e89045cca696422f03b284b147daf6b93c47bc53dd61ceeae60f73149d183032f029761d0d59aab49a26be4f6af71cd8194ace937642bdcb515f07530096122e97cfe6c8549a843530f71c24c7e3dab8")] -[assembly: InternalsVisibleTo("Roslynator.CSharp.Analyzers.CodeFixes, PublicKey=0024000004800000940000000602000000240000525341310004000001000100d348e1a51bc190259aed17cfe132736241fef462de45a5de6c881c7f9d705073c7a2a08ba5ae493c7e878fe5f3cf7909e89045cca696422f03b284b147daf6b93c47bc53dd61ceeae60f73149d183032f029761d0d59aab49a26be4f6af71cd8194ace937642bdcb515f07530096122e97cfe6c8549a843530f71c24c7e3dab8")] -[assembly: InternalsVisibleTo("Roslynator.CSharp.CodeFixes, PublicKey=0024000004800000940000000602000000240000525341310004000001000100d348e1a51bc190259aed17cfe132736241fef462de45a5de6c881c7f9d705073c7a2a08ba5ae493c7e878fe5f3cf7909e89045cca696422f03b284b147daf6b93c47bc53dd61ceeae60f73149d183032f029761d0d59aab49a26be4f6af71cd8194ace937642bdcb515f07530096122e97cfe6c8549a843530f71c24c7e3dab8")] -[assembly: InternalsVisibleTo("Roslynator.CSharp.Refactorings, PublicKey=0024000004800000940000000602000000240000525341310004000001000100d348e1a51bc190259aed17cfe132736241fef462de45a5de6c881c7f9d705073c7a2a08ba5ae493c7e878fe5f3cf7909e89045cca696422f03b284b147daf6b93c47bc53dd61ceeae60f73149d183032f029761d0d59aab49a26be4f6af71cd8194ace937642bdcb515f07530096122e97cfe6c8549a843530f71c24c7e3dab8")] -[assembly: InternalsVisibleTo("Roslynator.Analyzers.Tests, PublicKey=0024000004800000940000000602000000240000525341310004000001000100d348e1a51bc190259aed17cfe132736241fef462de45a5de6c881c7f9d705073c7a2a08ba5ae493c7e878fe5f3cf7909e89045cca696422f03b284b147daf6b93c47bc53dd61ceeae60f73149d183032f029761d0d59aab49a26be4f6af71cd8194ace937642bdcb515f07530096122e97cfe6c8549a843530f71c24c7e3dab8")] -[assembly: InternalsVisibleTo("Roslynator.CodeFixes.Tests, PublicKey=0024000004800000940000000602000000240000525341310004000001000100d348e1a51bc190259aed17cfe132736241fef462de45a5de6c881c7f9d705073c7a2a08ba5ae493c7e878fe5f3cf7909e89045cca696422f03b284b147daf6b93c47bc53dd61ceeae60f73149d183032f029761d0d59aab49a26be4f6af71cd8194ace937642bdcb515f07530096122e97cfe6c8549a843530f71c24c7e3dab8")] -[assembly: InternalsVisibleTo("Roslynator.Refactorings.Tests, PublicKey=0024000004800000940000000602000000240000525341310004000001000100d348e1a51bc190259aed17cfe132736241fef462de45a5de6c881c7f9d705073c7a2a08ba5ae493c7e878fe5f3cf7909e89045cca696422f03b284b147daf6b93c47bc53dd61ceeae60f73149d183032f029761d0d59aab49a26be4f6af71cd8194ace937642bdcb515f07530096122e97cfe6c8549a843530f71c24c7e3dab8")] -[assembly: InternalsVisibleTo("Roslynator.CodeAnalysis.Analyzers, PublicKey=0024000004800000940000000602000000240000525341310004000001000100d348e1a51bc190259aed17cfe132736241fef462de45a5de6c881c7f9d705073c7a2a08ba5ae493c7e878fe5f3cf7909e89045cca696422f03b284b147daf6b93c47bc53dd61ceeae60f73149d183032f029761d0d59aab49a26be4f6af71cd8194ace937642bdcb515f07530096122e97cfe6c8549a843530f71c24c7e3dab8")] -[assembly: InternalsVisibleTo("Roslynator.CodeAnalysis.Analyzers.CodeFixes, PublicKey=0024000004800000940000000602000000240000525341310004000001000100d348e1a51bc190259aed17cfe132736241fef462de45a5de6c881c7f9d705073c7a2a08ba5ae493c7e878fe5f3cf7909e89045cca696422f03b284b147daf6b93c47bc53dd61ceeae60f73149d183032f029761d0d59aab49a26be4f6af71cd8194ace937642bdcb515f07530096122e97cfe6c8549a843530f71c24c7e3dab8")] -[assembly: InternalsVisibleTo("Roslynator.CodeAnalysis.Analyzers.Tests, PublicKey=0024000004800000940000000602000000240000525341310004000001000100d348e1a51bc190259aed17cfe132736241fef462de45a5de6c881c7f9d705073c7a2a08ba5ae493c7e878fe5f3cf7909e89045cca696422f03b284b147daf6b93c47bc53dd61ceeae60f73149d183032f029761d0d59aab49a26be4f6af71cd8194ace937642bdcb515f07530096122e97cfe6c8549a843530f71c24c7e3dab8")] -[assembly: InternalsVisibleTo("Roslynator.Formatting.Analyzers, PublicKey=0024000004800000940000000602000000240000525341310004000001000100d348e1a51bc190259aed17cfe132736241fef462de45a5de6c881c7f9d705073c7a2a08ba5ae493c7e878fe5f3cf7909e89045cca696422f03b284b147daf6b93c47bc53dd61ceeae60f73149d183032f029761d0d59aab49a26be4f6af71cd8194ace937642bdcb515f07530096122e97cfe6c8549a843530f71c24c7e3dab8")] -[assembly: InternalsVisibleTo("Roslynator.Formatting.Analyzers.CodeFixes, PublicKey=0024000004800000940000000602000000240000525341310004000001000100d348e1a51bc190259aed17cfe132736241fef462de45a5de6c881c7f9d705073c7a2a08ba5ae493c7e878fe5f3cf7909e89045cca696422f03b284b147daf6b93c47bc53dd61ceeae60f73149d183032f029761d0d59aab49a26be4f6af71cd8194ace937642bdcb515f07530096122e97cfe6c8549a843530f71c24c7e3dab8")] -[assembly: InternalsVisibleTo("Roslynator.Formatting.Analyzers.Tests, PublicKey=0024000004800000940000000602000000240000525341310004000001000100d348e1a51bc190259aed17cfe132736241fef462de45a5de6c881c7f9d705073c7a2a08ba5ae493c7e878fe5f3cf7909e89045cca696422f03b284b147daf6b93c47bc53dd61ceeae60f73149d183032f029761d0d59aab49a26be4f6af71cd8194ace937642bdcb515f07530096122e97cfe6c8549a843530f71c24c7e3dab8")] -[assembly: InternalsVisibleTo("Roslynator.CodeGeneration, PublicKey=0024000004800000940000000602000000240000525341310004000001000100d348e1a51bc190259aed17cfe132736241fef462de45a5de6c881c7f9d705073c7a2a08ba5ae493c7e878fe5f3cf7909e89045cca696422f03b284b147daf6b93c47bc53dd61ceeae60f73149d183032f029761d0d59aab49a26be4f6af71cd8194ace937642bdcb515f07530096122e97cfe6c8549a843530f71c24c7e3dab8")] -[assembly: InternalsVisibleTo("Roslynator.CodeGenerator, PublicKey=0024000004800000940000000602000000240000525341310004000001000100d348e1a51bc190259aed17cfe132736241fef462de45a5de6c881c7f9d705073c7a2a08ba5ae493c7e878fe5f3cf7909e89045cca696422f03b284b147daf6b93c47bc53dd61ceeae60f73149d183032f029761d0d59aab49a26be4f6af71cd8194ace937642bdcb515f07530096122e97cfe6c8549a843530f71c24c7e3dab8")] -[assembly: InternalsVisibleTo("Roslynator.VisualStudio, PublicKey=0024000004800000940000000602000000240000525341310004000001000100d348e1a51bc190259aed17cfe132736241fef462de45a5de6c881c7f9d705073c7a2a08ba5ae493c7e878fe5f3cf7909e89045cca696422f03b284b147daf6b93c47bc53dd61ceeae60f73149d183032f029761d0d59aab49a26be4f6af71cd8194ace937642bdcb515f07530096122e97cfe6c8549a843530f71c24c7e3dab8")] diff --git a/src/Core/Core.csproj b/src/Core/Core.csproj index 7d5dcbab15..da3b6381c2 100644 --- a/src/Core/Core.csproj +++ b/src/Core/Core.csproj @@ -60,6 +60,72 @@ <_Parameter1>$(RoslynatorDllPrefix)Roslynator.Documentation, PublicKey=$(RoslynatorPublicKey) + + <_Parameter1>Roslynator, PublicKey=$(RoslynatorPublicKey) + + + <_Parameter1>Roslynator.CodeGeneration, PublicKey=$(RoslynatorPublicKey) + + + <_Parameter1>Roslynator.MetadataGenerator, PublicKey=$(RoslynatorPublicKey) + + + <_Parameter1>Roslynator.CSharp.Analyzers, PublicKey=$(RoslynatorPublicKey) + + + <_Parameter1>Roslynator.CSharp.Analyzers.CodeFixes, PublicKey=$(RoslynatorPublicKey) + + + <_Parameter1>Roslynator.CSharp.CodeFixes, PublicKey=$(RoslynatorPublicKey) + + + <_Parameter1>Roslynator.CSharp.Refactorings, PublicKey=$(RoslynatorPublicKey) + + + <_Parameter1>Roslynator.Testing.Common, PublicKey=$(RoslynatorPublicKey) + + + <_Parameter1>Roslynator.Testing.CSharp, PublicKey=$(RoslynatorPublicKey) + + + <_Parameter1>Roslynator.Testing.VisualBasic, PublicKey=$(RoslynatorPublicKey) + + + <_Parameter1>Roslynator.Core.Tests, PublicKey=$(RoslynatorPublicKey) + + + <_Parameter1>Roslynator.CSharp.Tests, PublicKey=$(RoslynatorPublicKey) + + + <_Parameter1>Roslynator.CSharp.Workspaces.Tests, PublicKey=$(RoslynatorPublicKey) + + + <_Parameter1>Roslynator.Analyzers.Tests, PublicKey=$(RoslynatorPublicKey) + + + <_Parameter1>Roslynator.CodeFixes.Tests, PublicKey=$(RoslynatorPublicKey) + + + <_Parameter1>Roslynator.Refactorings.Tests, PublicKey=$(RoslynatorPublicKey) + + + <_Parameter1>Roslynator.CodeAnalysis.Analyzers, PublicKey=$(RoslynatorPublicKey) + + + <_Parameter1>Roslynator.CodeAnalysis.Analyzers.CodeFixes, PublicKey=$(RoslynatorPublicKey) + + + <_Parameter1>Roslynator.CodeAnalysis.Analyzers.Tests, PublicKey=$(RoslynatorPublicKey) + + + <_Parameter1>Roslynator.Formatting.Analyzers, PublicKey=$(RoslynatorPublicKey) + + + <_Parameter1>Roslynator.Formatting.Analyzers.CodeFixes, PublicKey=$(RoslynatorPublicKey) + + + <_Parameter1>Roslynator.Formatting.Analyzers.Tests, PublicKey=$(RoslynatorPublicKey) + diff --git a/src/Core/Properties/AssemblyInfo.cs b/src/Core/Properties/AssemblyInfo.cs deleted file mode 100644 index 35c8c6f641..0000000000 --- a/src/Core/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,26 +0,0 @@ -// Copyright (c) Josef Pihrt and Contributors. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. - -using System.Runtime.CompilerServices; - -[assembly: InternalsVisibleTo("Roslynator, PublicKey=0024000004800000940000000602000000240000525341310004000001000100d348e1a51bc190259aed17cfe132736241fef462de45a5de6c881c7f9d705073c7a2a08ba5ae493c7e878fe5f3cf7909e89045cca696422f03b284b147daf6b93c47bc53dd61ceeae60f73149d183032f029761d0d59aab49a26be4f6af71cd8194ace937642bdcb515f07530096122e97cfe6c8549a843530f71c24c7e3dab8")] -[assembly: InternalsVisibleTo("Roslynator.CodeGeneration, PublicKey=0024000004800000940000000602000000240000525341310004000001000100d348e1a51bc190259aed17cfe132736241fef462de45a5de6c881c7f9d705073c7a2a08ba5ae493c7e878fe5f3cf7909e89045cca696422f03b284b147daf6b93c47bc53dd61ceeae60f73149d183032f029761d0d59aab49a26be4f6af71cd8194ace937642bdcb515f07530096122e97cfe6c8549a843530f71c24c7e3dab8")] -[assembly: InternalsVisibleTo("Roslynator.MetadataGenerator, PublicKey=0024000004800000940000000602000000240000525341310004000001000100d348e1a51bc190259aed17cfe132736241fef462de45a5de6c881c7f9d705073c7a2a08ba5ae493c7e878fe5f3cf7909e89045cca696422f03b284b147daf6b93c47bc53dd61ceeae60f73149d183032f029761d0d59aab49a26be4f6af71cd8194ace937642bdcb515f07530096122e97cfe6c8549a843530f71c24c7e3dab8")] -[assembly: InternalsVisibleTo("Roslynator.CSharp.Analyzers, PublicKey=0024000004800000940000000602000000240000525341310004000001000100d348e1a51bc190259aed17cfe132736241fef462de45a5de6c881c7f9d705073c7a2a08ba5ae493c7e878fe5f3cf7909e89045cca696422f03b284b147daf6b93c47bc53dd61ceeae60f73149d183032f029761d0d59aab49a26be4f6af71cd8194ace937642bdcb515f07530096122e97cfe6c8549a843530f71c24c7e3dab8")] -[assembly: InternalsVisibleTo("Roslynator.CSharp.Analyzers.CodeFixes, PublicKey=0024000004800000940000000602000000240000525341310004000001000100d348e1a51bc190259aed17cfe132736241fef462de45a5de6c881c7f9d705073c7a2a08ba5ae493c7e878fe5f3cf7909e89045cca696422f03b284b147daf6b93c47bc53dd61ceeae60f73149d183032f029761d0d59aab49a26be4f6af71cd8194ace937642bdcb515f07530096122e97cfe6c8549a843530f71c24c7e3dab8")] -[assembly: InternalsVisibleTo("Roslynator.CSharp.CodeFixes, PublicKey=0024000004800000940000000602000000240000525341310004000001000100d348e1a51bc190259aed17cfe132736241fef462de45a5de6c881c7f9d705073c7a2a08ba5ae493c7e878fe5f3cf7909e89045cca696422f03b284b147daf6b93c47bc53dd61ceeae60f73149d183032f029761d0d59aab49a26be4f6af71cd8194ace937642bdcb515f07530096122e97cfe6c8549a843530f71c24c7e3dab8")] -[assembly: InternalsVisibleTo("Roslynator.CSharp.Refactorings, PublicKey=0024000004800000940000000602000000240000525341310004000001000100d348e1a51bc190259aed17cfe132736241fef462de45a5de6c881c7f9d705073c7a2a08ba5ae493c7e878fe5f3cf7909e89045cca696422f03b284b147daf6b93c47bc53dd61ceeae60f73149d183032f029761d0d59aab49a26be4f6af71cd8194ace937642bdcb515f07530096122e97cfe6c8549a843530f71c24c7e3dab8")] -[assembly: InternalsVisibleTo("Roslynator.Testing.Common, PublicKey=0024000004800000940000000602000000240000525341310004000001000100d348e1a51bc190259aed17cfe132736241fef462de45a5de6c881c7f9d705073c7a2a08ba5ae493c7e878fe5f3cf7909e89045cca696422f03b284b147daf6b93c47bc53dd61ceeae60f73149d183032f029761d0d59aab49a26be4f6af71cd8194ace937642bdcb515f07530096122e97cfe6c8549a843530f71c24c7e3dab8")] -[assembly: InternalsVisibleTo("Roslynator.Testing.CSharp, PublicKey=0024000004800000940000000602000000240000525341310004000001000100d348e1a51bc190259aed17cfe132736241fef462de45a5de6c881c7f9d705073c7a2a08ba5ae493c7e878fe5f3cf7909e89045cca696422f03b284b147daf6b93c47bc53dd61ceeae60f73149d183032f029761d0d59aab49a26be4f6af71cd8194ace937642bdcb515f07530096122e97cfe6c8549a843530f71c24c7e3dab8")] -[assembly: InternalsVisibleTo("Roslynator.Testing.VisualBasic, PublicKey=0024000004800000940000000602000000240000525341310004000001000100d348e1a51bc190259aed17cfe132736241fef462de45a5de6c881c7f9d705073c7a2a08ba5ae493c7e878fe5f3cf7909e89045cca696422f03b284b147daf6b93c47bc53dd61ceeae60f73149d183032f029761d0d59aab49a26be4f6af71cd8194ace937642bdcb515f07530096122e97cfe6c8549a843530f71c24c7e3dab8")] -[assembly: InternalsVisibleTo("Roslynator.Core.Tests, PublicKey=0024000004800000940000000602000000240000525341310004000001000100d348e1a51bc190259aed17cfe132736241fef462de45a5de6c881c7f9d705073c7a2a08ba5ae493c7e878fe5f3cf7909e89045cca696422f03b284b147daf6b93c47bc53dd61ceeae60f73149d183032f029761d0d59aab49a26be4f6af71cd8194ace937642bdcb515f07530096122e97cfe6c8549a843530f71c24c7e3dab8")] -[assembly: InternalsVisibleTo("Roslynator.CSharp.Tests, PublicKey=0024000004800000940000000602000000240000525341310004000001000100d348e1a51bc190259aed17cfe132736241fef462de45a5de6c881c7f9d705073c7a2a08ba5ae493c7e878fe5f3cf7909e89045cca696422f03b284b147daf6b93c47bc53dd61ceeae60f73149d183032f029761d0d59aab49a26be4f6af71cd8194ace937642bdcb515f07530096122e97cfe6c8549a843530f71c24c7e3dab8")] -[assembly: InternalsVisibleTo("Roslynator.CSharp.Workspaces.Tests, PublicKey=0024000004800000940000000602000000240000525341310004000001000100d348e1a51bc190259aed17cfe132736241fef462de45a5de6c881c7f9d705073c7a2a08ba5ae493c7e878fe5f3cf7909e89045cca696422f03b284b147daf6b93c47bc53dd61ceeae60f73149d183032f029761d0d59aab49a26be4f6af71cd8194ace937642bdcb515f07530096122e97cfe6c8549a843530f71c24c7e3dab8")] -[assembly: InternalsVisibleTo("Roslynator.Analyzers.Tests, PublicKey=0024000004800000940000000602000000240000525341310004000001000100d348e1a51bc190259aed17cfe132736241fef462de45a5de6c881c7f9d705073c7a2a08ba5ae493c7e878fe5f3cf7909e89045cca696422f03b284b147daf6b93c47bc53dd61ceeae60f73149d183032f029761d0d59aab49a26be4f6af71cd8194ace937642bdcb515f07530096122e97cfe6c8549a843530f71c24c7e3dab8")] -[assembly: InternalsVisibleTo("Roslynator.CodeFixes.Tests, PublicKey=0024000004800000940000000602000000240000525341310004000001000100d348e1a51bc190259aed17cfe132736241fef462de45a5de6c881c7f9d705073c7a2a08ba5ae493c7e878fe5f3cf7909e89045cca696422f03b284b147daf6b93c47bc53dd61ceeae60f73149d183032f029761d0d59aab49a26be4f6af71cd8194ace937642bdcb515f07530096122e97cfe6c8549a843530f71c24c7e3dab8")] -[assembly: InternalsVisibleTo("Roslynator.Refactorings.Tests, PublicKey=0024000004800000940000000602000000240000525341310004000001000100d348e1a51bc190259aed17cfe132736241fef462de45a5de6c881c7f9d705073c7a2a08ba5ae493c7e878fe5f3cf7909e89045cca696422f03b284b147daf6b93c47bc53dd61ceeae60f73149d183032f029761d0d59aab49a26be4f6af71cd8194ace937642bdcb515f07530096122e97cfe6c8549a843530f71c24c7e3dab8")] -[assembly: InternalsVisibleTo("Roslynator.CodeAnalysis.Analyzers, PublicKey=0024000004800000940000000602000000240000525341310004000001000100d348e1a51bc190259aed17cfe132736241fef462de45a5de6c881c7f9d705073c7a2a08ba5ae493c7e878fe5f3cf7909e89045cca696422f03b284b147daf6b93c47bc53dd61ceeae60f73149d183032f029761d0d59aab49a26be4f6af71cd8194ace937642bdcb515f07530096122e97cfe6c8549a843530f71c24c7e3dab8")] -[assembly: InternalsVisibleTo("Roslynator.CodeAnalysis.Analyzers.CodeFixes, PublicKey=0024000004800000940000000602000000240000525341310004000001000100d348e1a51bc190259aed17cfe132736241fef462de45a5de6c881c7f9d705073c7a2a08ba5ae493c7e878fe5f3cf7909e89045cca696422f03b284b147daf6b93c47bc53dd61ceeae60f73149d183032f029761d0d59aab49a26be4f6af71cd8194ace937642bdcb515f07530096122e97cfe6c8549a843530f71c24c7e3dab8")] -[assembly: InternalsVisibleTo("Roslynator.CodeAnalysis.Analyzers.Tests, PublicKey=0024000004800000940000000602000000240000525341310004000001000100d348e1a51bc190259aed17cfe132736241fef462de45a5de6c881c7f9d705073c7a2a08ba5ae493c7e878fe5f3cf7909e89045cca696422f03b284b147daf6b93c47bc53dd61ceeae60f73149d183032f029761d0d59aab49a26be4f6af71cd8194ace937642bdcb515f07530096122e97cfe6c8549a843530f71c24c7e3dab8")] -[assembly: InternalsVisibleTo("Roslynator.Formatting.Analyzers, PublicKey=0024000004800000940000000602000000240000525341310004000001000100d348e1a51bc190259aed17cfe132736241fef462de45a5de6c881c7f9d705073c7a2a08ba5ae493c7e878fe5f3cf7909e89045cca696422f03b284b147daf6b93c47bc53dd61ceeae60f73149d183032f029761d0d59aab49a26be4f6af71cd8194ace937642bdcb515f07530096122e97cfe6c8549a843530f71c24c7e3dab8")] -[assembly: InternalsVisibleTo("Roslynator.Formatting.Analyzers.CodeFixes, PublicKey=0024000004800000940000000602000000240000525341310004000001000100d348e1a51bc190259aed17cfe132736241fef462de45a5de6c881c7f9d705073c7a2a08ba5ae493c7e878fe5f3cf7909e89045cca696422f03b284b147daf6b93c47bc53dd61ceeae60f73149d183032f029761d0d59aab49a26be4f6af71cd8194ace937642bdcb515f07530096122e97cfe6c8549a843530f71c24c7e3dab8")] -[assembly: InternalsVisibleTo("Roslynator.Formatting.Analyzers.Tests, PublicKey=0024000004800000940000000602000000240000525341310004000001000100d348e1a51bc190259aed17cfe132736241fef462de45a5de6c881c7f9d705073c7a2a08ba5ae493c7e878fe5f3cf7909e89045cca696422f03b284b147daf6b93c47bc53dd61ceeae60f73149d183032f029761d0d59aab49a26be4f6af71cd8194ace937642bdcb515f07530096122e97cfe6c8549a843530f71c24c7e3dab8")] diff --git a/src/Directory.Build.props b/src/Directory.Build.props index 48b8e687b8..207476adb6 100644 --- a/src/Directory.Build.props +++ b/src/Directory.Build.props @@ -8,24 +8,24 @@ Copyright (c) 2016-2023 Josef Pihrt false 0024000004800000940000000602000000240000525341310004000001000100d348e1a51bc190259aed17cfe132736241fef462de45a5de6c881c7f9d705073c7a2a08ba5ae493c7e878fe5f3cf7909e89045cca696422f03b284b147daf6b93c47bc53dd61ceeae60f73149d183032f029761d0d59aab49a26be4f6af71cd8194ace937642bdcb515f07530096122e97cfe6c8549a843530f71c24c7e3dab8 + 4.6.0 - 4.3.0.0 - 4.3.0 - 4.3.0.0 - 4.3.0 - 0.6.0.0 - 0.6.0 - 4.3.0.0 - 4.3.0 - 4.3.0.0 - 4.3.0 - 4.3.0.0 - 4.3.0 - 2.0.0 - 1.0.0 - 4.6.0 + + $(RoslynatorCliVersion) + + $(Version) + $(RoslynatorPackageVersion) + + $(RoslynatorVersion) + $(RoslynatorVersion) + $(RoslynatorVersion) + + $(RoslynatorPackageVersion) + $(RoslynatorPackageVersion) + $(RoslynatorPackageVersion) + @@ -44,4 +44,19 @@ Roslynator_Formatting_Analyzers_ + + + runtime; build; native; contentfiles; analyzers; buildtransitive + all + + + runtime; build; native; contentfiles; analyzers; buildtransitive + all + + + runtime; build; native; contentfiles; analyzers; buildtransitive + all + + + diff --git a/src/Documentation/Documentation.csproj b/src/Documentation/Documentation.csproj index c1cdb7bd18..419c1b880e 100644 --- a/src/Documentation/Documentation.csproj +++ b/src/Documentation/Documentation.csproj @@ -21,7 +21,6 @@ false Roslynator.Documentation - $(RoslynatorDocumentationPackageVersion) This API enables to generate documentation for your .NET library @@ -52,4 +51,10 @@ Roslynator.Documentation.DocumentationGenerator + + + <_Parameter1>Roslynator, PublicKey=$(RoslynatorPublicKey) + + + \ No newline at end of file diff --git a/src/Documentation/DocumentationWriter.cs b/src/Documentation/DocumentationWriter.cs index 095a293dcd..07563b2118 100644 --- a/src/Documentation/DocumentationWriter.cs +++ b/src/Documentation/DocumentationWriter.cs @@ -354,7 +354,7 @@ internal void WriteMemberTitle(ISymbol symbol, bool isOverloaded) { WriteStartHeading(1); - if ((symbol as IMethodSymbol)?.MethodKind == MethodKind.Constructor) + if (symbol is IMethodSymbol { MethodKind: MethodKind.Constructor }) { if (isOverloaded) { diff --git a/src/Documentation/Extensions/SymbolExtensions.cs b/src/Documentation/Extensions/SymbolExtensions.cs index 12634e28f5..b798b77cca 100644 --- a/src/Documentation/Extensions/SymbolExtensions.cs +++ b/src/Documentation/Extensions/SymbolExtensions.cs @@ -191,7 +191,7 @@ public static ImmutableArray ToDisplayParts(this ISymbol symb case "this": { if ((additionalOptions & SymbolDisplayAdditionalMemberOptions.UseItemPropertyName) != 0 - && (symbol as IPropertySymbol)?.IsIndexer == true) + && symbol is IPropertySymbol { IsIndexer: true }) { parts = parts.Replace(part, SymbolDisplayPartFactory.PropertyName("Item", part.Symbol)); } @@ -211,7 +211,8 @@ public static ImmutableArray ToDisplayParts(this ISymbol symb if (name.StartsWith("op_", StringComparison.Ordinal) && i < length - 2 && parts[i + 1].IsSpace() - && parts[i + 2].Kind == SymbolDisplayPartKind.MethodName) + && parts[i + 2].Kind == SymbolDisplayPartKind.Operator + && parts[i + 2].Symbol is IMethodSymbol { MethodKind: MethodKind.UserDefinedOperator }) { parts = parts.Replace(parts[i + 2], SymbolDisplayPartFactory.MethodName(name.Substring(3), parts[i + 2].Symbol)); parts = parts.RemoveRange(i, 2); diff --git a/src/Documentation/Properties/AssemblyInfo.cs b/src/Documentation/Properties/AssemblyInfo.cs deleted file mode 100644 index 957df63d81..0000000000 --- a/src/Documentation/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,5 +0,0 @@ -// Copyright (c) Josef Pihrt and Contributors. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. - -using System.Runtime.CompilerServices; - -[assembly: InternalsVisibleTo("Roslynator, PublicKey=0024000004800000940000000602000000240000525341310004000001000100d348e1a51bc190259aed17cfe132736241fef462de45a5de6c881c7f9d705073c7a2a08ba5ae493c7e878fe5f3cf7909e89045cca696422f03b284b147daf6b93c47bc53dd61ceeae60f73149d183032f029761d0d59aab49a26be4f6af71cd8194ace937642bdcb515f07530096122e97cfe6c8549a843530f71c24c7e3dab8")] diff --git a/src/Documentation/SymbolDefinitionDisplay.cs b/src/Documentation/SymbolDefinitionDisplay.cs index 337ecb0190..d19c7ee6f6 100644 --- a/src/Documentation/SymbolDefinitionDisplay.cs +++ b/src/Documentation/SymbolDefinitionDisplay.cs @@ -1145,14 +1145,6 @@ private static void AddKeyword(this ImmutableArray.Builder bu builder.Add(SymbolDisplayPartFactory.Keyword(text)); } - private static void InsertRange(this ImmutableArray.Builder builder, int index, ImmutableArray parts) - { - for (int i = parts.Length - 1; i >= 0; i--) - { - builder.Insert(index, parts[i]); - } - } - private static bool HasOption(this SymbolDisplayAdditionalOptions options, SymbolDisplayAdditionalOptions option) { return (options & option) == option; diff --git a/src/Documentation/SymbolDefinitionWriter.cs b/src/Documentation/SymbolDefinitionWriter.cs index 163b274ae3..43c19f52b9 100644 --- a/src/Documentation/SymbolDefinitionWriter.cs +++ b/src/Documentation/SymbolDefinitionWriter.cs @@ -757,20 +757,13 @@ public void WriteAttributes(ISymbol symbol) protected virtual void WriteAttributeName(ISymbol symbol) { - SymbolDisplayFormat format = GetAttributeNameFormat(symbol); - - ImmutableArray parts = symbol.ToDisplayParts(format); + ImmutableArray parts = symbol.ToDisplayParts(_definitionNameFormat); parts = SymbolDefinitionWriterHelpers.RemoveAttributeSuffix(symbol, parts); Write(parts); } - protected SymbolDisplayFormat GetAttributeNameFormat(ISymbol symbol) - { - return _definitionNameFormat; - } - public virtual void WriteAttribute(AttributeData attribute) { INamedTypeSymbol attributeSymbol = attribute.AttributeClass; diff --git a/src/Documentation/SymbolDefinitionWriterHelpers.cs b/src/Documentation/SymbolDefinitionWriterHelpers.cs index bd02d80dff..c10bea2f22 100644 --- a/src/Documentation/SymbolDefinitionWriterHelpers.cs +++ b/src/Documentation/SymbolDefinitionWriterHelpers.cs @@ -242,7 +242,8 @@ public static (int start, int end, ISymbol symbol) FindDefinitionName( case "operator": { if (Peek(j + 1).IsSpace() - && Peek(j + 2).Kind == SymbolDisplayPartKind.MethodName) + && Peek(j + 2).Kind == SymbolDisplayPartKind.Operator + && Peek(j + 2).Symbol is IMethodSymbol { MethodKind: MethodKind.UserDefinedOperator }) { j += 3; return (i, j, parts[j].Symbol); diff --git a/src/Documentation/UrlProviders/DefaultUrlSegmentProvider.cs b/src/Documentation/UrlProviders/DefaultUrlSegmentProvider.cs index 92adb69fa3..9e10d79142 100644 --- a/src/Documentation/UrlProviders/DefaultUrlSegmentProvider.cs +++ b/src/Documentation/UrlProviders/DefaultUrlSegmentProvider.cs @@ -72,7 +72,7 @@ public override ImmutableArray GetSegments(ISymbol symbol) builder.Add(name); } - else if ((symbol as IPropertySymbol)?.IsIndexer == true) + else if (symbol is IPropertySymbol { IsIndexer: true }) { builder.Add("Item"); } diff --git a/src/Formatting.Analyzers.CodeFixes/CSharp/CodeFixHelpers.cs b/src/Formatting.Analyzers.CodeFixes/CSharp/CodeFixHelpers.cs index b3cf1a9a15..5437a0c171 100644 --- a/src/Formatting.Analyzers.CodeFixes/CSharp/CodeFixHelpers.cs +++ b/src/Formatting.Analyzers.CodeFixes/CSharp/CodeFixHelpers.cs @@ -1098,7 +1098,7 @@ internal static List GetFixListChanges( if (indentationAdded && node is ArgumentSyntax argument - && (argument.Expression as AnonymousFunctionExpressionSyntax)?.Block is not null) + && argument.Expression is AnonymousFunctionExpressionSyntax { Block: not null }) { indentationAdded = false; } diff --git a/src/Formatting.Analyzers.CodeFixes/Formatting.Analyzers.CodeFixes.csproj b/src/Formatting.Analyzers.CodeFixes/Formatting.Analyzers.CodeFixes.csproj index 215a5afb02..7064ccb45b 100644 --- a/src/Formatting.Analyzers.CodeFixes/Formatting.Analyzers.CodeFixes.csproj +++ b/src/Formatting.Analyzers.CodeFixes/Formatting.Analyzers.CodeFixes.csproj @@ -5,11 +5,11 @@ - $(RoslynatorFormattingAnalyzersVersion) + $(RoslynatorAnalyzersVersion) Roslynator.Formatting.Analyzers.CodeFixes Roslynator.Formatting Roslynator.Formatting.Analyzers.nuspec - configuration=$(Configuration);version=$(RoslynatorFormattingAnalyzersPackageVersion) + configuration=$(Configuration);version=$(RoslynatorAnalyzersPackageVersion) @@ -34,4 +34,10 @@ + + + <_Parameter1>Roslynator.Formatting.Analyzers.Tests, PublicKey=$(RoslynatorPublicKey) + + + \ No newline at end of file diff --git a/src/Formatting.Analyzers.CodeFixes/Properties/AssemblyInfo.cs b/src/Formatting.Analyzers.CodeFixes/Properties/AssemblyInfo.cs deleted file mode 100644 index 98a69f4217..0000000000 --- a/src/Formatting.Analyzers.CodeFixes/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,5 +0,0 @@ -// Copyright (c) Josef Pihrt and Contributors. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. - -using System.Runtime.CompilerServices; - -[assembly: InternalsVisibleTo("Roslynator.Formatting.Analyzers.Tests, PublicKey=0024000004800000940000000602000000240000525341310004000001000100d348e1a51bc190259aed17cfe132736241fef462de45a5de6c881c7f9d705073c7a2a08ba5ae493c7e878fe5f3cf7909e89045cca696422f03b284b147daf6b93c47bc53dd61ceeae60f73149d183032f029761d0d59aab49a26be4f6af71cd8194ace937642bdcb515f07530096122e97cfe6c8549a843530f71c24c7e3dab8")] diff --git a/src/Formatting.Analyzers/Formatting.Analyzers.csproj b/src/Formatting.Analyzers/Formatting.Analyzers.csproj index 4cfaa567de..bb4a933bf6 100644 --- a/src/Formatting.Analyzers/Formatting.Analyzers.csproj +++ b/src/Formatting.Analyzers/Formatting.Analyzers.csproj @@ -5,7 +5,7 @@ - $(RoslynatorFormattingAnalyzersVersion) + $(RoslynatorAnalyzersVersion) Roslynator.Formatting.Analyzers Roslynator.Formatting false @@ -24,4 +24,13 @@ + + + <_Parameter1>Roslynator.Formatting.Analyzers.Tests, PublicKey=$(RoslynatorPublicKey) + + + <_Parameter1>Roslynator.Formatting.Analyzers.CodeFixes, PublicKey=$(RoslynatorPublicKey) + + + \ No newline at end of file diff --git a/src/Formatting.Analyzers/Properties/AssemblyInfo.cs b/src/Formatting.Analyzers/Properties/AssemblyInfo.cs deleted file mode 100644 index 6a53ca946c..0000000000 --- a/src/Formatting.Analyzers/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,6 +0,0 @@ -// Copyright (c) Josef Pihrt and Contributors. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. - -using System.Runtime.CompilerServices; - -[assembly: InternalsVisibleTo("Roslynator.Formatting.Analyzers.Tests, PublicKey=0024000004800000940000000602000000240000525341310004000001000100d348e1a51bc190259aed17cfe132736241fef462de45a5de6c881c7f9d705073c7a2a08ba5ae493c7e878fe5f3cf7909e89045cca696422f03b284b147daf6b93c47bc53dd61ceeae60f73149d183032f029761d0d59aab49a26be4f6af71cd8194ace937642bdcb515f07530096122e97cfe6c8549a843530f71c24c7e3dab8")] -[assembly: InternalsVisibleTo("Roslynator.Formatting.Analyzers.CodeFixes, PublicKey=0024000004800000940000000602000000240000525341310004000001000100d348e1a51bc190259aed17cfe132736241fef462de45a5de6c881c7f9d705073c7a2a08ba5ae493c7e878fe5f3cf7909e89045cca696422f03b284b147daf6b93c47bc53dd61ceeae60f73149d183032f029761d0d59aab49a26be4f6af71cd8194ace937642bdcb515f07530096122e97cfe6c8549a843530f71c24c7e3dab8")] diff --git a/src/Refactorings/CSharp/Refactorings/AddUsingStaticDirectiveRefactoring.cs b/src/Refactorings/CSharp/Refactorings/AddUsingStaticDirectiveRefactoring.cs index dd54b402a3..b35758845b 100644 --- a/src/Refactorings/CSharp/Refactorings/AddUsingStaticDirectiveRefactoring.cs +++ b/src/Refactorings/CSharp/Refactorings/AddUsingStaticDirectiveRefactoring.cs @@ -73,12 +73,4 @@ private static async Task RefactorAsync( return document.WithSyntaxRoot(newRoot); } - - private static MemberAccessExpressionSyntax GetTopmostMemberAccessExpression(MemberAccessExpressionSyntax memberAccess) - { - while (memberAccess.IsParentKind(SyntaxKind.SimpleMemberAccessExpression)) - memberAccess = (MemberAccessExpressionSyntax)memberAccess.Parent; - - return memberAccess; - } } diff --git a/src/Refactorings/CSharp/Refactorings/RoslynatorCodeRefactoringProvider.cs b/src/Refactorings/CSharp/Refactorings/RoslynatorCodeRefactoringProvider.cs index 278b1048e6..bcaac26254 100644 --- a/src/Refactorings/CSharp/Refactorings/RoslynatorCodeRefactoringProvider.cs +++ b/src/Refactorings/CSharp/Refactorings/RoslynatorCodeRefactoringProvider.cs @@ -14,21 +14,20 @@ public sealed class RoslynatorCodeRefactoringProvider : CodeRefactoringProvider public override async Task ComputeRefactoringsAsync(CodeRefactoringContext context) { SyntaxNode root = await context.Document.GetSyntaxRootAsync(context.CancellationToken).ConfigureAwait(false); - #if DEBUG try { -#endif var refactoringContext = new RefactoringContext(context, root); - await refactoringContext.ComputeRefactoringsAsync().ConfigureAwait(false); -#if DEBUG } catch (Exception ex) when (ex is not OperationCanceledException) { Debug.Fail(nameof(RoslynatorCodeRefactoringProvider)); throw; } +#else + var refactoringContext = new RefactoringContext(context, root); + await refactoringContext.ComputeRefactoringsAsync().ConfigureAwait(false); #endif } } diff --git a/src/Refactorings/Properties/AssemblyInfo.cs b/src/Refactorings/Properties/AssemblyInfo.cs deleted file mode 100644 index 81259124a9..0000000000 --- a/src/Refactorings/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,5 +0,0 @@ -// Copyright (c) Josef Pihrt and Contributors. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. - -using System.Runtime.CompilerServices; - -[assembly: InternalsVisibleTo("Roslynator.Refactorings.Tests, PublicKey=0024000004800000940000000602000000240000525341310004000001000100d348e1a51bc190259aed17cfe132736241fef462de45a5de6c881c7f9d705073c7a2a08ba5ae493c7e878fe5f3cf7909e89045cca696422f03b284b147daf6b93c47bc53dd61ceeae60f73149d183032f029761d0d59aab49a26be4f6af71cd8194ace937642bdcb515f07530096122e97cfe6c8549a843530f71c24c7e3dab8")] diff --git a/src/Refactorings/Refactorings.csproj b/src/Refactorings/Refactorings.csproj index 14ac851c66..0128ee47a9 100644 --- a/src/Refactorings/Refactorings.csproj +++ b/src/Refactorings/Refactorings.csproj @@ -34,4 +34,10 @@ + + + <_Parameter1>Roslynator.Refactorings.Tests, PublicKey=$(RoslynatorPublicKey) + + + diff --git a/src/Roslynator.CoreAndTesting.slnf b/src/Roslynator.CoreAndTesting.slnf new file mode 100644 index 0000000000..b4b2081510 --- /dev/null +++ b/src/Roslynator.CoreAndTesting.slnf @@ -0,0 +1,23 @@ +{ + "solution": { + "path": "Roslynator.sln", + "projects": [ + "CSharp.Workspaces\\CSharp.Workspaces.csproj", + "CSharp\\CSharp.csproj", + "Core\\Core.csproj", + "Tests\\CSharp.Tests\\CSharp.Tests.csproj", + "Tests\\CSharp.Workspaces.Tests\\CSharp.Workspaces.Tests.csproj", + "Tests\\Core.Tests\\Core.Tests.csproj", + "Tests\\Testing.CSharp.MSTest\\Testing.CSharp.MSTest.csproj", + "Tests\\Testing.CSharp.Xunit\\Testing.CSharp.Xunit.csproj", + "Tests\\Testing.CSharp\\Testing.CSharp.csproj", + "Tests\\Testing.Common\\Testing.Common.csproj", + "Tests\\Testing.VisualBasic\\Testing.VisualBasic.csproj", + "Tests\\Tests.Common\\Tests.Common.csproj", + "VisualBasic.Workspaces\\VisualBasic.Workspaces.csproj", + "VisualBasic\\VisualBasic.csproj", + "Workspaces.Common\\Workspaces.Common.csproj", + "Workspaces.Core\\Workspaces.Core.csproj" + ] + } +} \ No newline at end of file diff --git a/src/Roslynator.sln b/src/Roslynator.sln index 567de88069..266c2dfd05 100644 --- a/src/Roslynator.sln +++ b/src/Roslynator.sln @@ -52,8 +52,6 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Analyzers", "Analyzers\Anal EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "CodeGenerator", "Tools\CodeGenerator\CodeGenerator.csproj", "{BCCA00EB-08E2-4B22-BECF-10864A6BB456}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "VisualStudio", "VisualStudio\VisualStudio.csproj", "{6CCFB4D4-21DF-4991-831D-DDAA5B2E58D9}" -EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Metadata", "Tools\Metadata\Metadata.csproj", "{7F6F6533-E406-4225-A435-DEE22C717F48}" EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Common", "Common\Common.csproj", "{814C7BD5-F7FA-441D-897F-F7876B038B30}" @@ -148,9 +146,6 @@ Global {BCCA00EB-08E2-4B22-BECF-10864A6BB456}.Debug|Any CPU.Build.0 = Debug|Any CPU {BCCA00EB-08E2-4B22-BECF-10864A6BB456}.Release|Any CPU.ActiveCfg = Release|Any CPU {BCCA00EB-08E2-4B22-BECF-10864A6BB456}.Release|Any CPU.Build.0 = Release|Any CPU - {6CCFB4D4-21DF-4991-831D-DDAA5B2E58D9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {6CCFB4D4-21DF-4991-831D-DDAA5B2E58D9}.Release|Any CPU.ActiveCfg = Release|Any CPU - {6CCFB4D4-21DF-4991-831D-DDAA5B2E58D9}.Release|Any CPU.Build.0 = Release|Any CPU {7F6F6533-E406-4225-A435-DEE22C717F48}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {7F6F6533-E406-4225-A435-DEE22C717F48}.Debug|Any CPU.Build.0 = Debug|Any CPU {7F6F6533-E406-4225-A435-DEE22C717F48}.Release|Any CPU.ActiveCfg = Release|Any CPU @@ -181,8 +176,10 @@ Global {56DA29A3-C179-471C-9941-42426EEB84D0}.Release|Any CPU.Build.0 = Release|Any CPU {B26059E8-E5D8-415F-AF7C-210750DB4CB0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {B26059E8-E5D8-415F-AF7C-210750DB4CB0}.Release|Any CPU.ActiveCfg = Release|Any CPU + {B26059E8-E5D8-415F-AF7C-210750DB4CB0}.Release|Any CPU.Build.0 = Release|Any CPU {09B4373A-8AA6-48CF-804C-E209CC12BC5C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {09B4373A-8AA6-48CF-804C-E209CC12BC5C}.Release|Any CPU.ActiveCfg = Release|Any CPU + {09B4373A-8AA6-48CF-804C-E209CC12BC5C}.Release|Any CPU.Build.0 = Release|Any CPU {D6B3FAF2-C92D-4B2D-82DF-D6B3DD7F4107}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {D6B3FAF2-C92D-4B2D-82DF-D6B3DD7F4107}.Debug|Any CPU.Build.0 = Debug|Any CPU {D6B3FAF2-C92D-4B2D-82DF-D6B3DD7F4107}.Release|Any CPU.ActiveCfg = Release|Any CPU @@ -217,8 +214,10 @@ Global {51056D0E-3697-4419-9760-B46BF3B4A16C}.Release|Any CPU.Build.0 = Release|Any CPU {BE5E7831-F687-47E6-BC60-969BDEA93EAC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {BE5E7831-F687-47E6-BC60-969BDEA93EAC}.Release|Any CPU.ActiveCfg = Release|Any CPU + {BE5E7831-F687-47E6-BC60-969BDEA93EAC}.Release|Any CPU.Build.0 = Release|Any CPU {A865E4D9-30C3-4CC8-A1AB-A897A7A1DA0C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {A865E4D9-30C3-4CC8-A1AB-A897A7A1DA0C}.Release|Any CPU.ActiveCfg = Release|Any CPU + {A865E4D9-30C3-4CC8-A1AB-A897A7A1DA0C}.Release|Any CPU.Build.0 = Release|Any CPU {4FD3D777-11FC-4FF9-985B-2756E39F7AD7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {4FD3D777-11FC-4FF9-985B-2756E39F7AD7}.Debug|Any CPU.Build.0 = Debug|Any CPU {4FD3D777-11FC-4FF9-985B-2756E39F7AD7}.Release|Any CPU.ActiveCfg = Release|Any CPU diff --git a/src/Roslynator.slnf b/src/Roslynator.slnf deleted file mode 100644 index e5118ac47e..0000000000 --- a/src/Roslynator.slnf +++ /dev/null @@ -1,28 +0,0 @@ -{ - "solution": { - "path": "Roslynator.sln", - "projects": [ - "Analyzers.CodeFixes\\Analyzers.CodeFixes.csproj", - "Analyzers\\Analyzers.csproj", - "CSharp.Workspaces\\CSharp.Workspaces.csproj", - "CSharp\\CSharp.csproj", - "CodeFixes\\CodeFixes.csproj", - "CommandLine\\CommandLine.csproj", - "Common\\Common.csproj", - "Core\\Core.csproj", - "Documentation\\Documentation.csproj", - "Refactorings\\Refactorings.csproj", - "Tests\\Analyzers.Tests\\Analyzers.Tests.csproj", - "Tests\\CodeFixes.Tests\\CodeFixes.Tests.csproj", - "Tests\\Refactorings.Tests\\Refactorings.Tests.csproj", - "Tests\\TestConsole\\TestConsole.csproj", - "Tests\\TestLibrary\\TestLibrary.csproj", - "Tests\\Testing.CSharp\\Testing.CSharp.csproj", - "Tests\\Testing.Common\\Testing.Common.csproj", - "Tests\\Testing.Xunit\\Testing.Xunit.csproj", - "Tools\\CodeGeneration\\CodeGeneration.csproj", - "Workspaces.Common\\Workspaces.Common.csproj", - "Workspaces.Core\\Workspaces.Core.csproj" - ] - } -} \ No newline at end of file diff --git a/src/Tests/Analyzers.Tests/RCS1056AvoidUsageOfUsingAliasDirectiveTests.cs b/src/Tests/Analyzers.Tests/RCS1056AvoidUsageOfUsingAliasDirectiveTests.cs index 0064422da6..81ed053dfc 100644 --- a/src/Tests/Analyzers.Tests/RCS1056AvoidUsageOfUsingAliasDirectiveTests.cs +++ b/src/Tests/Analyzers.Tests/RCS1056AvoidUsageOfUsingAliasDirectiveTests.cs @@ -51,7 +51,7 @@ void M() } "); } - + [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.AvoidUsageOfUsingAliasDirective)] public async Task Test_FileScopedNamespaces() { @@ -78,7 +78,7 @@ void M() } "); } - + [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.AvoidUsageOfUsingAliasDirective)] public async Task Test_BlockNamespaces() { diff --git a/src/Tests/Analyzers.Tests/RCS1084UseCoalesceExpressionInsteadOfConditionalExpressionTests.cs b/src/Tests/Analyzers.Tests/RCS1084UseCoalesceExpressionInsteadOfConditionalExpressionTests.cs index e9b9362682..95fbb1b850 100644 --- a/src/Tests/Analyzers.Tests/RCS1084UseCoalesceExpressionInsteadOfConditionalExpressionTests.cs +++ b/src/Tests/Analyzers.Tests/RCS1084UseCoalesceExpressionInsteadOfConditionalExpressionTests.cs @@ -31,7 +31,7 @@ void M() } ", source, expected); } - + [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UseCoalesceExpressionInsteadOfConditionalExpression)] public async Task Test_PolymorphicType_WithNullable() { @@ -53,7 +53,7 @@ void M() IBase c = [|a != null ? a : new B()|]; } } -",@" +", @" #nullable enable class C { @@ -94,7 +94,7 @@ void M() IBase c = [|a != null ? a : new B()|]; } } -",@" +", @" class C { private interface IBase { } diff --git a/src/Tests/Analyzers.Tests/RCS1169MakeFieldReadOnlyTests.cs b/src/Tests/Analyzers.Tests/RCS1169MakeFieldReadOnlyTests.cs index 2c7fa37c51..75b5d4f021 100644 --- a/src/Tests/Analyzers.Tests/RCS1169MakeFieldReadOnlyTests.cs +++ b/src/Tests/Analyzers.Tests/RCS1169MakeFieldReadOnlyTests.cs @@ -350,7 +350,7 @@ ref int M() } "); } - + [Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.MakeFieldReadOnly)] public async Task TestNoDiagnostic_SuppressNullableWarning() { diff --git a/src/Tests/CSharp.Workspaces.Tests/SyntaxLogicalInverterTests.cs b/src/Tests/CSharp.Workspaces.Tests/SyntaxLogicalInverterTests.cs index 90640c8612..a2c41238ac 100644 --- a/src/Tests/CSharp.Workspaces.Tests/SyntaxLogicalInverterTests.cs +++ b/src/Tests/CSharp.Workspaces.Tests/SyntaxLogicalInverterTests.cs @@ -10,7 +10,7 @@ namespace Roslynator.CSharp.Workspaces.Tests; public class SyntaxLogicallyInvertTests { - private SyntaxLogicalInverter _inverter; + private readonly SyntaxLogicalInverter _inverter; public SyntaxLogicallyInvertTests() { @@ -18,53 +18,52 @@ public SyntaxLogicallyInvertTests() } [Theory] - [InlineData(@"x", @"!x")] - [InlineData(@"!x", @"x")] + [InlineData("x", "!x")] + [InlineData("!x", "x")] [InlineData(@"x is ""abc""", @"x is not ""abc""")] - [InlineData(@"x is 1", @"x is not 1")] - [InlineData(@"x is null", @"x is not null")] - [InlineData(@"x is true", @"x is false")] - [InlineData(@"true", @"false")] - [InlineData(@"false", @"true")] - [InlineData(@"x >= 3", @"x < 3")] - [InlineData(@"x > 3", @"x <= 3")] - [InlineData(@"x <= 3", @"x > 3")] - [InlineData(@"x < 3", @"x >= 3")] - [InlineData(@"x == y", @"x != y")] - [InlineData(@"x != y", @"x == y")] - [InlineData(@"(bool)x || (bool)y", @"!((bool)x) && !((bool)y)")] - [InlineData(@"(bool)x && (bool)y", @"!((bool)x) || !((bool)y)")] - [InlineData(@"x ?? true", @"x == false")] - [InlineData(@"x ?? false", @"x != true")] - [InlineData(@"(bool)x ? y : z", @"(bool)x ? !y : !z")] - [InlineData(@"x[0]", @"!x[0]")] - [InlineData(@"default(bool)", @"!default(bool)")] - [InlineData(@"checked(x + y)", @"!checked(x + y)")] - [InlineData(@"unchecked(x + y)", @"!unchecked(x + y)")] - [InlineData(@"(bool)x", @"!((bool)x)")] - [InlineData(@"x & y", @"!x | !y")] - [InlineData(@"x ^ y", @"!(x ^ y)")] - [InlineData(@"x | y", @"!x & !y")] - [InlineData(@"x = y", @"!(x = y)")] - [InlineData(@"await x", @"!(await x)")] - [InlineData(@"x ?? y", @"!(x ?? y)")] - [InlineData(@"x.a", @"!x.a")] - [InlineData(@"x.a()", @"!x.a()")] - [InlineData(@"x?.a", @"!x?.a")] + [InlineData("x is 1", "x is not 1")] + [InlineData("x is null", "x is not null")] + [InlineData("x is true", "x is false")] + [InlineData("true", "false")] + [InlineData("false", "true")] + [InlineData("x >= 3", "x < 3")] + [InlineData("x > 3", "x <= 3")] + [InlineData("x <= 3", "x > 3")] + [InlineData("x < 3", "x >= 3")] + [InlineData("x == y", "x != y")] + [InlineData("x != y", "x == y")] + [InlineData("(bool)x || (bool)y", "!((bool)x) && !((bool)y)")] + [InlineData("(bool)x && (bool)y", "!((bool)x) || !((bool)y)")] + [InlineData("x ?? true", "x == false")] + [InlineData("x ?? false", "x != true")] + [InlineData("(bool)x ? y : z", "(bool)x ? !y : !z")] + [InlineData("x[0]", "!x[0]")] + [InlineData("default(bool)", "!default(bool)")] + [InlineData("checked(x + y)", "!checked(x + y)")] + [InlineData("unchecked(x + y)", "!unchecked(x + y)")] + [InlineData("(bool)x", "!((bool)x)")] + [InlineData("x & y", "!x | !y")] + [InlineData("x ^ y", "!(x ^ y)")] + [InlineData("x | y", "!x & !y")] + [InlineData("x = y", "!(x = y)")] + [InlineData("await x", "!(await x)")] + [InlineData("x ?? y", "!(x ?? y)")] + [InlineData("x.a", "!x.a")] + [InlineData("x.a()", "!x.a()")] + [InlineData("x?.a", "!x?.a")] public async Task LogicallyInvert(string source, string expected) { - var sourceCode = $"class C {{ void M(dynamic x, dynamic y, dynamic z){{ if({source})return;}} }}"; + string sourceCode = $"class C {{ void M(dynamic x, dynamic y, dynamic z){{ if({source})return;}} }}"; var workspace = new AdhocWorkspace(); - var newProject = workspace.AddProject("TestProject", LanguageNames.CSharp); - var newDocument = workspace.AddDocument(newProject.Id, "TestDocument.cs", SourceText.From(sourceCode)); - var syntaxTree = await newDocument.GetSyntaxTreeAsync(); - var compilation = await newDocument.Project.GetCompilationAsync(); - var semanticModel = compilation.GetSemanticModel(syntaxTree); + Project newProject = workspace.AddProject("TestProject", LanguageNames.CSharp); + Document newDocument = workspace.AddDocument(newProject.Id, "TestDocument.cs", SourceText.From(sourceCode)); + SyntaxTree syntaxTree = await newDocument.GetSyntaxTreeAsync(); + Compilation compilation = await newDocument.Project.GetCompilationAsync(); + SemanticModel semanticModel = compilation.GetSemanticModel(syntaxTree); - var expression = syntaxTree.GetRoot().DescendantNodes().OfType().Single().Condition; + ExpressionSyntax expression = syntaxTree.GetRoot().DescendantNodes().OfType().Single().Condition; - var result = _inverter.LogicallyInvert(expression, semanticModel, CancellationToken.None); + ExpressionSyntax result = _inverter.LogicallyInvert(expression, semanticModel, CancellationToken.None); Assert.Equal(expected, result.NormalizeWhitespace().ToFullString()); } - } diff --git a/src/Tests/Core.Tests/GeneratedCodeUtilityTests.cs b/src/Tests/Core.Tests/GeneratedCodeUtilityTests.cs index 97a1755098..e17845e321 100644 --- a/src/Tests/Core.Tests/GeneratedCodeUtilityTests.cs +++ b/src/Tests/Core.Tests/GeneratedCodeUtilityTests.cs @@ -1,5 +1,6 @@ // Copyright (c) Josef Pihrt and Contributors. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. +using System.Runtime.InteropServices; using Xunit; using static Roslynator.GeneratedCodeUtility; @@ -10,15 +11,17 @@ public static class GeneratedCodeUtilityTests [Fact] public static void TestIsGeneratedCodeFile() { + string basePath = (RuntimeInformation.IsOSPlatform(OSPlatform.Windows)) + ? "c:/foo/" + : "/foo/"; + Assert.True(IsGeneratedCodeFile("TemporaryGeneratedFile_")); Assert.True(IsGeneratedCodeFile("TemporaryGeneratedFile_Foo")); Assert.True(IsGeneratedCodeFile("TemporaryGeneratedFile_.cs")); Assert.True(IsGeneratedCodeFile("TemporaryGeneratedFile_Foo.cs")); - Assert.True(IsGeneratedCodeFile(@"c:\TemporaryGeneratedFile_.cs")); - Assert.True(IsGeneratedCodeFile(@"c:\TemporaryGeneratedFile_Foo.cs")); - Assert.True(IsGeneratedCodeFile("c:TemporaryGeneratedFile_.cs")); - Assert.True(IsGeneratedCodeFile("c:TemporaryGeneratedFile_Foo.cs")); + Assert.True(IsGeneratedCodeFile($"{basePath}TemporaryGeneratedFile_.cs")); + Assert.True(IsGeneratedCodeFile($"{basePath}TemporaryGeneratedFile_Foo.cs")); Assert.True(IsGeneratedCodeFile(".designer.cs")); Assert.True(IsGeneratedCodeFile(".generated.cs")); @@ -32,29 +35,35 @@ public static void TestIsGeneratedCodeFile() Assert.True(IsGeneratedCodeFile("Foo.g.i.cs")); Assert.True(IsGeneratedCodeFile("Foo.AssemblyAttributes.cs")); - Assert.True(IsGeneratedCodeFile(@"c:\.designer.cs")); - Assert.True(IsGeneratedCodeFile(@"c:\.generated.cs")); - Assert.True(IsGeneratedCodeFile(@"c:\.g.cs")); - Assert.True(IsGeneratedCodeFile(@"c:\.g.i.cs")); - Assert.True(IsGeneratedCodeFile(@"c:\.AssemblyAttributes.cs")); + Assert.True(IsGeneratedCodeFile($"{basePath}.designer.cs")); + Assert.True(IsGeneratedCodeFile($"{basePath}.generated.cs")); + Assert.True(IsGeneratedCodeFile($"{basePath}.g.cs")); + Assert.True(IsGeneratedCodeFile($"{basePath}.g.i.cs")); + Assert.True(IsGeneratedCodeFile($"{basePath}.AssemblyAttributes.cs")); + + Assert.True(IsGeneratedCodeFile($"{basePath}Foo.designer.cs")); + Assert.True(IsGeneratedCodeFile($"{basePath}Foo.generated.cs")); + Assert.True(IsGeneratedCodeFile($"{basePath}Foo.g.cs")); + Assert.True(IsGeneratedCodeFile($"{basePath}Foo.g.i.cs")); + Assert.True(IsGeneratedCodeFile($"{basePath}Foo.AssemblyAttributes.cs")); - Assert.True(IsGeneratedCodeFile("c:.designer.cs")); - Assert.True(IsGeneratedCodeFile("c:.generated.cs")); - Assert.True(IsGeneratedCodeFile("c:.g.cs")); - Assert.True(IsGeneratedCodeFile("c:.g.i.cs")); - Assert.True(IsGeneratedCodeFile("c:.AssemblyAttributes.cs")); + if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows)) + { + Assert.True(IsGeneratedCodeFile("c:TemporaryGeneratedFile_.cs")); + Assert.True(IsGeneratedCodeFile("c:TemporaryGeneratedFile_Foo.cs")); - Assert.True(IsGeneratedCodeFile(@"c:\Foo.designer.cs")); - Assert.True(IsGeneratedCodeFile(@"c:\Foo.generated.cs")); - Assert.True(IsGeneratedCodeFile(@"c:\Foo.g.cs")); - Assert.True(IsGeneratedCodeFile(@"c:\Foo.g.i.cs")); - Assert.True(IsGeneratedCodeFile(@"c:\Foo.AssemblyAttributes.cs")); + Assert.True(IsGeneratedCodeFile("c:.designer.cs")); + Assert.True(IsGeneratedCodeFile("c:.generated.cs")); + Assert.True(IsGeneratedCodeFile("c:.g.cs")); + Assert.True(IsGeneratedCodeFile("c:.g.i.cs")); + Assert.True(IsGeneratedCodeFile("c:.AssemblyAttributes.cs")); - Assert.True(IsGeneratedCodeFile("c:Foo.designer.cs")); - Assert.True(IsGeneratedCodeFile("c:Foo.generated.cs")); - Assert.True(IsGeneratedCodeFile("c:Foo.g.cs")); - Assert.True(IsGeneratedCodeFile("c:Foo.g.i.cs")); - Assert.True(IsGeneratedCodeFile("c:Foo.AssemblyAttributes.cs")); + Assert.True(IsGeneratedCodeFile("c:Foo.designer.cs")); + Assert.True(IsGeneratedCodeFile("c:Foo.generated.cs")); + Assert.True(IsGeneratedCodeFile("c:Foo.g.cs")); + Assert.True(IsGeneratedCodeFile("c:Foo.g.i.cs")); + Assert.True(IsGeneratedCodeFile("c:Foo.AssemblyAttributes.cs")); + } } [Fact] diff --git a/src/Tests/Refactorings.Tests/RR0078JoinStringExpressionsTests.cs b/src/Tests/Refactorings.Tests/RR0078JoinStringExpressionsTests.cs index acb5aa29c6..dcc10c5ba5 100644 --- a/src/Tests/Refactorings.Tests/RR0078JoinStringExpressionsTests.cs +++ b/src/Tests/Refactorings.Tests/RR0078JoinStringExpressionsTests.cs @@ -1,5 +1,6 @@ // Copyright (c) Josef Pihrt and Contributors. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. +using System; using System.Threading.Tasks; using Roslynator.Testing.CSharp; using Xunit; @@ -129,6 +130,8 @@ void M() [Fact, Trait(Traits.Refactoring, RefactoringIdentifiers.JoinStringExpressions)] public async Task Test_RegularAndMultilineVerbatim() { + string newLineText = (Environment.NewLine == "\r\n") ? @"\r\n" : @"\n"; + await VerifyRefactoringAsync(@" class C { @@ -139,15 +142,15 @@ void M() ""|]; } } -", @" +", $@" class C -{ +{{ void M() - { + {{ string s = null; - s = "" \r\n \r\n""; - } -} + s = "" \r\n {newLineText}""; + }} +}} ", equivalenceKey: EquivalenceKey.Create(RefactoringId)); } diff --git a/src/Tests/TestLibrary/Foo.cs b/src/Tests/TestLibrary/Foo.cs index 788469fb79..3f3ed93503 100644 --- a/src/Tests/TestLibrary/Foo.cs +++ b/src/Tests/TestLibrary/Foo.cs @@ -15,7 +15,7 @@ using Roslynator; #endregion usings -#pragma warning disable RCS1018, RCS1213, CA1822 +#pragma warning disable RCS1018, RCS1213, CA1822, IDE0051 namespace Roslynator; diff --git a/src/Tests/Testing.CSharp.Xunit/Properties/AssemblyInfo.cs b/src/Tests/Testing.CSharp.Xunit/Properties/AssemblyInfo.cs deleted file mode 100644 index 9938f42d2d..0000000000 --- a/src/Tests/Testing.CSharp.Xunit/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,5 +0,0 @@ -// Copyright (c) Josef Pihrt and Contributors. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. - -using System.Runtime.CompilerServices; - -[assembly: InternalsVisibleTo("Roslynator.CSharp.Tests, PublicKey=0024000004800000940000000602000000240000525341310004000001000100d348e1a51bc190259aed17cfe132736241fef462de45a5de6c881c7f9d705073c7a2a08ba5ae493c7e878fe5f3cf7909e89045cca696422f03b284b147daf6b93c47bc53dd61ceeae60f73149d183032f029761d0d59aab49a26be4f6af71cd8194ace937642bdcb515f07530096122e97cfe6c8549a843530f71c24c7e3dab8")] diff --git a/src/Tests/Testing.CSharp.Xunit/Testing.CSharp.Xunit.csproj b/src/Tests/Testing.CSharp.Xunit/Testing.CSharp.Xunit.csproj index b60bedaefc..29d178aa37 100644 --- a/src/Tests/Testing.CSharp.Xunit/Testing.CSharp.Xunit.csproj +++ b/src/Tests/Testing.CSharp.Xunit/Testing.CSharp.Xunit.csproj @@ -43,4 +43,10 @@ + + + <_Parameter1>Roslynator.CSharp.Tests, PublicKey=$(RoslynatorPublicKey) + + + diff --git a/src/Tests/Testing.CSharp.sln b/src/Tests/Testing.CSharp.sln deleted file mode 100644 index f3ee4e1b54..0000000000 --- a/src/Tests/Testing.CSharp.sln +++ /dev/null @@ -1,53 +0,0 @@ -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio Version 17 -VisualStudioVersion = 17.3.33027.108 -MinimumVisualStudioVersion = 10.0.40219.1 -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{228E25E1-FDE6-40C1-98AF-8E636D174D94}" - ProjectSection(SolutionItems) = preProject - ..\global.ruleset = ..\global.ruleset - EndProjectSection -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Testing.CSharp", "Testing.CSharp\Testing.CSharp.csproj", "{7377C15F-29AE-4E4D-BE98-C79F36E438BA}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Core", "..\Core\Core.csproj", "{EFA1C63D-F3E9-4A10-B135-DAD202D26595}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Testing.Common", "Testing.Common\Testing.Common.csproj", "{0DFBCFDC-E1DA-4447-B317-C3CD3ECD63C2}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Testing.CSharp.Xunit", "Testing.CSharp.Xunit\Testing.CSharp.Xunit.csproj", "{AD1C3E62-672B-405A-9D90-4CB89CF58112}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Testing.CSharp.MSTest", "Testing.CSharp.MSTest\Testing.CSharp.MSTest.csproj", "{ED3B8F45-8BF0-4842-8A6C-C0FA91690D87}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Any CPU = Debug|Any CPU - Release|Any CPU = Release|Any CPU - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {7377C15F-29AE-4E4D-BE98-C79F36E438BA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {7377C15F-29AE-4E4D-BE98-C79F36E438BA}.Debug|Any CPU.Build.0 = Debug|Any CPU - {7377C15F-29AE-4E4D-BE98-C79F36E438BA}.Release|Any CPU.ActiveCfg = Release|Any CPU - {7377C15F-29AE-4E4D-BE98-C79F36E438BA}.Release|Any CPU.Build.0 = Release|Any CPU - {EFA1C63D-F3E9-4A10-B135-DAD202D26595}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {EFA1C63D-F3E9-4A10-B135-DAD202D26595}.Debug|Any CPU.Build.0 = Debug|Any CPU - {EFA1C63D-F3E9-4A10-B135-DAD202D26595}.Release|Any CPU.ActiveCfg = Release|Any CPU - {EFA1C63D-F3E9-4A10-B135-DAD202D26595}.Release|Any CPU.Build.0 = Release|Any CPU - {0DFBCFDC-E1DA-4447-B317-C3CD3ECD63C2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {0DFBCFDC-E1DA-4447-B317-C3CD3ECD63C2}.Debug|Any CPU.Build.0 = Debug|Any CPU - {0DFBCFDC-E1DA-4447-B317-C3CD3ECD63C2}.Release|Any CPU.ActiveCfg = Release|Any CPU - {0DFBCFDC-E1DA-4447-B317-C3CD3ECD63C2}.Release|Any CPU.Build.0 = Release|Any CPU - {AD1C3E62-672B-405A-9D90-4CB89CF58112}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {AD1C3E62-672B-405A-9D90-4CB89CF58112}.Debug|Any CPU.Build.0 = Debug|Any CPU - {AD1C3E62-672B-405A-9D90-4CB89CF58112}.Release|Any CPU.ActiveCfg = Release|Any CPU - {AD1C3E62-672B-405A-9D90-4CB89CF58112}.Release|Any CPU.Build.0 = Release|Any CPU - {ED3B8F45-8BF0-4842-8A6C-C0FA91690D87}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {ED3B8F45-8BF0-4842-8A6C-C0FA91690D87}.Debug|Any CPU.Build.0 = Debug|Any CPU - {ED3B8F45-8BF0-4842-8A6C-C0FA91690D87}.Release|Any CPU.ActiveCfg = Release|Any CPU - {ED3B8F45-8BF0-4842-8A6C-C0FA91690D87}.Release|Any CPU.Build.0 = Release|Any CPU - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection - GlobalSection(ExtensibilityGlobals) = postSolution - SolutionGuid = {D1943010-8F47-4798-9A3D-97BC24CF1AC4} - EndGlobalSection -EndGlobal diff --git a/src/Tests/Testing.CSharp/Properties/AssemblyInfo.cs b/src/Tests/Testing.CSharp/Properties/AssemblyInfo.cs deleted file mode 100644 index 99b5128233..0000000000 --- a/src/Tests/Testing.CSharp/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,14 +0,0 @@ -// Copyright (c) Josef Pihrt and Contributors. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. - -using System.Runtime.CompilerServices; - -[assembly: InternalsVisibleTo("Roslynator.CSharp.Tests, PublicKey=0024000004800000940000000602000000240000525341310004000001000100d348e1a51bc190259aed17cfe132736241fef462de45a5de6c881c7f9d705073c7a2a08ba5ae493c7e878fe5f3cf7909e89045cca696422f03b284b147daf6b93c47bc53dd61ceeae60f73149d183032f029761d0d59aab49a26be4f6af71cd8194ace937642bdcb515f07530096122e97cfe6c8549a843530f71c24c7e3dab8")] -[assembly: InternalsVisibleTo("Roslynator.CSharp.Workspaces.Tests, PublicKey=0024000004800000940000000602000000240000525341310004000001000100d348e1a51bc190259aed17cfe132736241fef462de45a5de6c881c7f9d705073c7a2a08ba5ae493c7e878fe5f3cf7909e89045cca696422f03b284b147daf6b93c47bc53dd61ceeae60f73149d183032f029761d0d59aab49a26be4f6af71cd8194ace937642bdcb515f07530096122e97cfe6c8549a843530f71c24c7e3dab8")] -[assembly: InternalsVisibleTo("Roslynator.Analyzers.Tests, PublicKey=0024000004800000940000000602000000240000525341310004000001000100d348e1a51bc190259aed17cfe132736241fef462de45a5de6c881c7f9d705073c7a2a08ba5ae493c7e878fe5f3cf7909e89045cca696422f03b284b147daf6b93c47bc53dd61ceeae60f73149d183032f029761d0d59aab49a26be4f6af71cd8194ace937642bdcb515f07530096122e97cfe6c8549a843530f71c24c7e3dab8")] -[assembly: InternalsVisibleTo("Roslynator.CodeFixes.Tests, PublicKey=0024000004800000940000000602000000240000525341310004000001000100d348e1a51bc190259aed17cfe132736241fef462de45a5de6c881c7f9d705073c7a2a08ba5ae493c7e878fe5f3cf7909e89045cca696422f03b284b147daf6b93c47bc53dd61ceeae60f73149d183032f029761d0d59aab49a26be4f6af71cd8194ace937642bdcb515f07530096122e97cfe6c8549a843530f71c24c7e3dab8")] -[assembly: InternalsVisibleTo("Roslynator.Refactorings.Tests, PublicKey=0024000004800000940000000602000000240000525341310004000001000100d348e1a51bc190259aed17cfe132736241fef462de45a5de6c881c7f9d705073c7a2a08ba5ae493c7e878fe5f3cf7909e89045cca696422f03b284b147daf6b93c47bc53dd61ceeae60f73149d183032f029761d0d59aab49a26be4f6af71cd8194ace937642bdcb515f07530096122e97cfe6c8549a843530f71c24c7e3dab8")] -[assembly: InternalsVisibleTo("Roslynator.Testing.Console, PublicKey=0024000004800000940000000602000000240000525341310004000001000100d348e1a51bc190259aed17cfe132736241fef462de45a5de6c881c7f9d705073c7a2a08ba5ae493c7e878fe5f3cf7909e89045cca696422f03b284b147daf6b93c47bc53dd61ceeae60f73149d183032f029761d0d59aab49a26be4f6af71cd8194ace937642bdcb515f07530096122e97cfe6c8549a843530f71c24c7e3dab8")] -[assembly: InternalsVisibleTo("Roslynator.CodeAnalysis.Analyzers.Tests, PublicKey=0024000004800000940000000602000000240000525341310004000001000100d348e1a51bc190259aed17cfe132736241fef462de45a5de6c881c7f9d705073c7a2a08ba5ae493c7e878fe5f3cf7909e89045cca696422f03b284b147daf6b93c47bc53dd61ceeae60f73149d183032f029761d0d59aab49a26be4f6af71cd8194ace937642bdcb515f07530096122e97cfe6c8549a843530f71c24c7e3dab8")] -[assembly: InternalsVisibleTo("Roslynator.Formatting.Analyzers.Tests, PublicKey=0024000004800000940000000602000000240000525341310004000001000100d348e1a51bc190259aed17cfe132736241fef462de45a5de6c881c7f9d705073c7a2a08ba5ae493c7e878fe5f3cf7909e89045cca696422f03b284b147daf6b93c47bc53dd61ceeae60f73149d183032f029761d0d59aab49a26be4f6af71cd8194ace937642bdcb515f07530096122e97cfe6c8549a843530f71c24c7e3dab8")] -[assembly: InternalsVisibleTo("Roslynator.Testing.CSharp.Xunit, PublicKey=0024000004800000940000000602000000240000525341310004000001000100d348e1a51bc190259aed17cfe132736241fef462de45a5de6c881c7f9d705073c7a2a08ba5ae493c7e878fe5f3cf7909e89045cca696422f03b284b147daf6b93c47bc53dd61ceeae60f73149d183032f029761d0d59aab49a26be4f6af71cd8194ace937642bdcb515f07530096122e97cfe6c8549a843530f71c24c7e3dab8")] -[assembly: InternalsVisibleTo("Roslynator.Testing.CSharp.MSTest, PublicKey=0024000004800000940000000602000000240000525341310004000001000100d348e1a51bc190259aed17cfe132736241fef462de45a5de6c881c7f9d705073c7a2a08ba5ae493c7e878fe5f3cf7909e89045cca696422f03b284b147daf6b93c47bc53dd61ceeae60f73149d183032f029761d0d59aab49a26be4f6af71cd8194ace937642bdcb515f07530096122e97cfe6c8549a843530f71c24c7e3dab8")] diff --git a/src/Tests/Testing.CSharp/Testing.CSharp.csproj b/src/Tests/Testing.CSharp/Testing.CSharp.csproj index 572d8f03b2..63ec59097b 100644 --- a/src/Tests/Testing.CSharp/Testing.CSharp.csproj +++ b/src/Tests/Testing.CSharp/Testing.CSharp.csproj @@ -44,4 +44,37 @@ + + + <_Parameter1>Roslynator.CSharp.Tests, PublicKey=$(RoslynatorPublicKey) + + + <_Parameter1>Roslynator.CSharp.Workspaces.Tests, PublicKey=$(RoslynatorPublicKey) + + + <_Parameter1>Roslynator.Analyzers.Tests, PublicKey=$(RoslynatorPublicKey) + + + <_Parameter1>Roslynator.CodeFixes.Tests, PublicKey=$(RoslynatorPublicKey) + + + <_Parameter1>Roslynator.Refactorings.Tests, PublicKey=$(RoslynatorPublicKey) + + + <_Parameter1>Roslynator.Testing.Console, PublicKey=$(RoslynatorPublicKey) + + + <_Parameter1>Roslynator.CodeAnalysis.Analyzers.Tests, PublicKey=$(RoslynatorPublicKey) + + + <_Parameter1>Roslynator.Formatting.Analyzers.Tests, PublicKey=$(RoslynatorPublicKey) + + + <_Parameter1>Roslynator.Testing.CSharp.Xunit, PublicKey=$(RoslynatorPublicKey) + + + <_Parameter1>Roslynator.Testing.CSharp.MSTest, PublicKey=$(RoslynatorPublicKey) + + + diff --git a/src/Tests/Testing.Common/Properties/AssemblyInfo.cs b/src/Tests/Testing.Common/Properties/AssemblyInfo.cs deleted file mode 100644 index 4f8d362ae5..0000000000 --- a/src/Tests/Testing.Common/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,18 +0,0 @@ -// Copyright (c) Josef Pihrt and Contributors. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. - -using System.Runtime.CompilerServices; - -[assembly: InternalsVisibleTo("Roslynator.Testing.CSharp, PublicKey=0024000004800000940000000602000000240000525341310004000001000100d348e1a51bc190259aed17cfe132736241fef462de45a5de6c881c7f9d705073c7a2a08ba5ae493c7e878fe5f3cf7909e89045cca696422f03b284b147daf6b93c47bc53dd61ceeae60f73149d183032f029761d0d59aab49a26be4f6af71cd8194ace937642bdcb515f07530096122e97cfe6c8549a843530f71c24c7e3dab8")] -[assembly: InternalsVisibleTo("Roslynator.Testing.VisualBasic, PublicKey=0024000004800000940000000602000000240000525341310004000001000100d348e1a51bc190259aed17cfe132736241fef462de45a5de6c881c7f9d705073c7a2a08ba5ae493c7e878fe5f3cf7909e89045cca696422f03b284b147daf6b93c47bc53dd61ceeae60f73149d183032f029761d0d59aab49a26be4f6af71cd8194ace937642bdcb515f07530096122e97cfe6c8549a843530f71c24c7e3dab8")] -[assembly: InternalsVisibleTo("Roslynator.Testing.CSharp.Xunit, PublicKey=0024000004800000940000000602000000240000525341310004000001000100d348e1a51bc190259aed17cfe132736241fef462de45a5de6c881c7f9d705073c7a2a08ba5ae493c7e878fe5f3cf7909e89045cca696422f03b284b147daf6b93c47bc53dd61ceeae60f73149d183032f029761d0d59aab49a26be4f6af71cd8194ace937642bdcb515f07530096122e97cfe6c8549a843530f71c24c7e3dab8")] -[assembly: InternalsVisibleTo("Roslynator.Testing.CSharp.MSTest, PublicKey=0024000004800000940000000602000000240000525341310004000001000100d348e1a51bc190259aed17cfe132736241fef462de45a5de6c881c7f9d705073c7a2a08ba5ae493c7e878fe5f3cf7909e89045cca696422f03b284b147daf6b93c47bc53dd61ceeae60f73149d183032f029761d0d59aab49a26be4f6af71cd8194ace937642bdcb515f07530096122e97cfe6c8549a843530f71c24c7e3dab8")] -[assembly: InternalsVisibleTo("Roslynator.Tests.Common, PublicKey=0024000004800000940000000602000000240000525341310004000001000100d348e1a51bc190259aed17cfe132736241fef462de45a5de6c881c7f9d705073c7a2a08ba5ae493c7e878fe5f3cf7909e89045cca696422f03b284b147daf6b93c47bc53dd61ceeae60f73149d183032f029761d0d59aab49a26be4f6af71cd8194ace937642bdcb515f07530096122e97cfe6c8549a843530f71c24c7e3dab8")] -[assembly: InternalsVisibleTo("Roslynator.Core.Tests, PublicKey=0024000004800000940000000602000000240000525341310004000001000100d348e1a51bc190259aed17cfe132736241fef462de45a5de6c881c7f9d705073c7a2a08ba5ae493c7e878fe5f3cf7909e89045cca696422f03b284b147daf6b93c47bc53dd61ceeae60f73149d183032f029761d0d59aab49a26be4f6af71cd8194ace937642bdcb515f07530096122e97cfe6c8549a843530f71c24c7e3dab8")] -[assembly: InternalsVisibleTo("Roslynator.CSharp.Tests, PublicKey=0024000004800000940000000602000000240000525341310004000001000100d348e1a51bc190259aed17cfe132736241fef462de45a5de6c881c7f9d705073c7a2a08ba5ae493c7e878fe5f3cf7909e89045cca696422f03b284b147daf6b93c47bc53dd61ceeae60f73149d183032f029761d0d59aab49a26be4f6af71cd8194ace937642bdcb515f07530096122e97cfe6c8549a843530f71c24c7e3dab8")] -[assembly: InternalsVisibleTo("Roslynator.CSharp.Workspaces.Tests, PublicKey=0024000004800000940000000602000000240000525341310004000001000100d348e1a51bc190259aed17cfe132736241fef462de45a5de6c881c7f9d705073c7a2a08ba5ae493c7e878fe5f3cf7909e89045cca696422f03b284b147daf6b93c47bc53dd61ceeae60f73149d183032f029761d0d59aab49a26be4f6af71cd8194ace937642bdcb515f07530096122e97cfe6c8549a843530f71c24c7e3dab8")] -[assembly: InternalsVisibleTo("Roslynator.Analyzers.Tests, PublicKey=0024000004800000940000000602000000240000525341310004000001000100d348e1a51bc190259aed17cfe132736241fef462de45a5de6c881c7f9d705073c7a2a08ba5ae493c7e878fe5f3cf7909e89045cca696422f03b284b147daf6b93c47bc53dd61ceeae60f73149d183032f029761d0d59aab49a26be4f6af71cd8194ace937642bdcb515f07530096122e97cfe6c8549a843530f71c24c7e3dab8")] -[assembly: InternalsVisibleTo("Roslynator.CodeFixes.Tests, PublicKey=0024000004800000940000000602000000240000525341310004000001000100d348e1a51bc190259aed17cfe132736241fef462de45a5de6c881c7f9d705073c7a2a08ba5ae493c7e878fe5f3cf7909e89045cca696422f03b284b147daf6b93c47bc53dd61ceeae60f73149d183032f029761d0d59aab49a26be4f6af71cd8194ace937642bdcb515f07530096122e97cfe6c8549a843530f71c24c7e3dab8")] -[assembly: InternalsVisibleTo("Roslynator.Refactorings.Tests, PublicKey=0024000004800000940000000602000000240000525341310004000001000100d348e1a51bc190259aed17cfe132736241fef462de45a5de6c881c7f9d705073c7a2a08ba5ae493c7e878fe5f3cf7909e89045cca696422f03b284b147daf6b93c47bc53dd61ceeae60f73149d183032f029761d0d59aab49a26be4f6af71cd8194ace937642bdcb515f07530096122e97cfe6c8549a843530f71c24c7e3dab8")] -[assembly: InternalsVisibleTo("Roslynator.Testing.Console, PublicKey=0024000004800000940000000602000000240000525341310004000001000100d348e1a51bc190259aed17cfe132736241fef462de45a5de6c881c7f9d705073c7a2a08ba5ae493c7e878fe5f3cf7909e89045cca696422f03b284b147daf6b93c47bc53dd61ceeae60f73149d183032f029761d0d59aab49a26be4f6af71cd8194ace937642bdcb515f07530096122e97cfe6c8549a843530f71c24c7e3dab8")] -[assembly: InternalsVisibleTo("Roslynator.CodeAnalysis.Analyzers.Tests, PublicKey=0024000004800000940000000602000000240000525341310004000001000100d348e1a51bc190259aed17cfe132736241fef462de45a5de6c881c7f9d705073c7a2a08ba5ae493c7e878fe5f3cf7909e89045cca696422f03b284b147daf6b93c47bc53dd61ceeae60f73149d183032f029761d0d59aab49a26be4f6af71cd8194ace937642bdcb515f07530096122e97cfe6c8549a843530f71c24c7e3dab8")] -[assembly: InternalsVisibleTo("Roslynator.Formatting.Analyzers.Tests, PublicKey=0024000004800000940000000602000000240000525341310004000001000100d348e1a51bc190259aed17cfe132736241fef462de45a5de6c881c7f9d705073c7a2a08ba5ae493c7e878fe5f3cf7909e89045cca696422f03b284b147daf6b93c47bc53dd61ceeae60f73149d183032f029761d0d59aab49a26be4f6af71cd8194ace937642bdcb515f07530096122e97cfe6c8549a843530f71c24c7e3dab8")] diff --git a/src/Tests/Testing.Common/Testing.Common.csproj b/src/Tests/Testing.Common/Testing.Common.csproj index 8b7c49e91d..dc73e66dd7 100644 --- a/src/Tests/Testing.Common/Testing.Common.csproj +++ b/src/Tests/Testing.Common/Testing.Common.csproj @@ -44,4 +44,49 @@ + + + <_Parameter1>Roslynator.Testing.CSharp, PublicKey=$(RoslynatorPublicKey) + + + <_Parameter1>Roslynator.Testing.VisualBasic, PublicKey=$(RoslynatorPublicKey) + + + <_Parameter1>Roslynator.Testing.CSharp.Xunit, PublicKey=$(RoslynatorPublicKey) + + + <_Parameter1>Roslynator.Testing.CSharp.MSTest, PublicKey=$(RoslynatorPublicKey) + + + <_Parameter1>Roslynator.Tests.Common, PublicKey=$(RoslynatorPublicKey) + + + <_Parameter1>Roslynator.Core.Tests, PublicKey=$(RoslynatorPublicKey) + + + <_Parameter1>Roslynator.CSharp.Tests, PublicKey=$(RoslynatorPublicKey) + + + <_Parameter1>Roslynator.CSharp.Workspaces.Tests, PublicKey=$(RoslynatorPublicKey) + + + <_Parameter1>Roslynator.Analyzers.Tests, PublicKey=$(RoslynatorPublicKey) + + + <_Parameter1>Roslynator.CodeFixes.Tests, PublicKey=$(RoslynatorPublicKey) + + + <_Parameter1>Roslynator.Refactorings.Tests, PublicKey=$(RoslynatorPublicKey) + + + <_Parameter1>Roslynator.Testing.Console, PublicKey=$(RoslynatorPublicKey) + + + <_Parameter1>Roslynator.CodeAnalysis.Analyzers.Tests, PublicKey=$(RoslynatorPublicKey) + + + <_Parameter1>Roslynator.Formatting.Analyzers.Tests, PublicKey=$(RoslynatorPublicKey) + + + diff --git a/src/Tests/Testing.Common/Testing/CodeVerifier.cs b/src/Tests/Testing.Common/Testing/CodeVerifier.cs index 42c611d7a3..0c7c5fcb86 100644 --- a/src/Tests/Testing.Common/Testing/CodeVerifier.cs +++ b/src/Tests/Testing.Common/Testing/CodeVerifier.cs @@ -6,6 +6,7 @@ using System.Globalization; using System.IO; using System.Linq; +using System.Runtime.InteropServices; using System.Text; using System.Threading; using System.Threading.Tasks; @@ -304,7 +305,9 @@ internal static (Document document, ImmutableArray expectedDoc .AddProject(projectInfo) .GetProject(projectId); - const string directoryPath = "z:"; + string directoryPath = (RuntimeInformation.IsOSPlatform(OSPlatform.Windows)) + ? "z:" + : "/"; if (options.ConfigOptions.Count > 0) { diff --git a/src/Tests/Testing.VisualBasic/Properties/AssemblyInfo.cs b/src/Tests/Testing.VisualBasic/Properties/AssemblyInfo.cs deleted file mode 100644 index 9620d518d9..0000000000 --- a/src/Tests/Testing.VisualBasic/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,10 +0,0 @@ -// Copyright (c) Josef Pihrt and Contributors. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. - -using System.Runtime.CompilerServices; - -[assembly: InternalsVisibleTo("Roslynator.Analyzers.Tests, PublicKey=0024000004800000940000000602000000240000525341310004000001000100d348e1a51bc190259aed17cfe132736241fef462de45a5de6c881c7f9d705073c7a2a08ba5ae493c7e878fe5f3cf7909e89045cca696422f03b284b147daf6b93c47bc53dd61ceeae60f73149d183032f029761d0d59aab49a26be4f6af71cd8194ace937642bdcb515f07530096122e97cfe6c8549a843530f71c24c7e3dab8")] -[assembly: InternalsVisibleTo("Roslynator.CodeFixes.Tests, PublicKey=0024000004800000940000000602000000240000525341310004000001000100d348e1a51bc190259aed17cfe132736241fef462de45a5de6c881c7f9d705073c7a2a08ba5ae493c7e878fe5f3cf7909e89045cca696422f03b284b147daf6b93c47bc53dd61ceeae60f73149d183032f029761d0d59aab49a26be4f6af71cd8194ace937642bdcb515f07530096122e97cfe6c8549a843530f71c24c7e3dab8")] -[assembly: InternalsVisibleTo("Roslynator.Refactorings.Tests, PublicKey=0024000004800000940000000602000000240000525341310004000001000100d348e1a51bc190259aed17cfe132736241fef462de45a5de6c881c7f9d705073c7a2a08ba5ae493c7e878fe5f3cf7909e89045cca696422f03b284b147daf6b93c47bc53dd61ceeae60f73149d183032f029761d0d59aab49a26be4f6af71cd8194ace937642bdcb515f07530096122e97cfe6c8549a843530f71c24c7e3dab8")] -[assembly: InternalsVisibleTo("Roslynator.Testing.Console, PublicKey=0024000004800000940000000602000000240000525341310004000001000100d348e1a51bc190259aed17cfe132736241fef462de45a5de6c881c7f9d705073c7a2a08ba5ae493c7e878fe5f3cf7909e89045cca696422f03b284b147daf6b93c47bc53dd61ceeae60f73149d183032f029761d0d59aab49a26be4f6af71cd8194ace937642bdcb515f07530096122e97cfe6c8549a843530f71c24c7e3dab8")] -[assembly: InternalsVisibleTo("Roslynator.CodeAnalysis.Analyzers.Tests, PublicKey=0024000004800000940000000602000000240000525341310004000001000100d348e1a51bc190259aed17cfe132736241fef462de45a5de6c881c7f9d705073c7a2a08ba5ae493c7e878fe5f3cf7909e89045cca696422f03b284b147daf6b93c47bc53dd61ceeae60f73149d183032f029761d0d59aab49a26be4f6af71cd8194ace937642bdcb515f07530096122e97cfe6c8549a843530f71c24c7e3dab8")] -[assembly: InternalsVisibleTo("Roslynator.Formatting.Analyzers.Tests, PublicKey=0024000004800000940000000602000000240000525341310004000001000100d348e1a51bc190259aed17cfe132736241fef462de45a5de6c881c7f9d705073c7a2a08ba5ae493c7e878fe5f3cf7909e89045cca696422f03b284b147daf6b93c47bc53dd61ceeae60f73149d183032f029761d0d59aab49a26be4f6af71cd8194ace937642bdcb515f07530096122e97cfe6c8549a843530f71c24c7e3dab8")] diff --git a/src/Tests/Testing.VisualBasic/Testing.VisualBasic.csproj b/src/Tests/Testing.VisualBasic/Testing.VisualBasic.csproj index 57afa5bc2d..14d9b2fffc 100644 --- a/src/Tests/Testing.VisualBasic/Testing.VisualBasic.csproj +++ b/src/Tests/Testing.VisualBasic/Testing.VisualBasic.csproj @@ -44,4 +44,25 @@ + + + <_Parameter1>Roslynator.Analyzers.Tests, PublicKey=$(RoslynatorPublicKey) + + + <_Parameter1>Roslynator.CodeFixes.Tests, PublicKey=$(RoslynatorPublicKey) + + + <_Parameter1>Roslynator.Refactorings.Tests, PublicKey=$(RoslynatorPublicKey) + + + <_Parameter1>Roslynator.Testing.Console, PublicKey=$(RoslynatorPublicKey) + + + <_Parameter1>Roslynator.CodeAnalysis.Analyzers.Tests, PublicKey=$(RoslynatorPublicKey) + + + <_Parameter1>Roslynator.Formatting.Analyzers.Tests, PublicKey=$(RoslynatorPublicKey) + + + diff --git a/src/Tests/Tests.Common/Tests.Common.csproj b/src/Tests/Tests.Common/Tests.Common.csproj index 99ecfdfa84..ec66f5b6e0 100644 --- a/src/Tests/Tests.Common/Tests.Common.csproj +++ b/src/Tests/Tests.Common/Tests.Common.csproj @@ -15,10 +15,6 @@ - - - - diff --git a/src/Tools/AddCodeFileHeader/Properties/AssemblyInfo.cs b/src/Tools/AddCodeFileHeader/Properties/AssemblyInfo.cs deleted file mode 100644 index 3136e35782..0000000000 --- a/src/Tools/AddCodeFileHeader/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,3 +0,0 @@ -// Copyright (c) Josef Pihrt and Contributors. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. - -[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Redundancy", "RCS1093:Remove file with no code.")] diff --git a/src/Tools/Cleaner/Properties/AssemblyInfo.cs b/src/Tools/Cleaner/Properties/AssemblyInfo.cs deleted file mode 100644 index 3136e35782..0000000000 --- a/src/Tools/Cleaner/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,3 +0,0 @@ -// Copyright (c) Josef Pihrt and Contributors. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. - -[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Redundancy", "RCS1093:Remove file with no code.")] diff --git a/src/Tools/CodeGeneration/CSharp/SyntaxWalker/CSharpSyntaxWalkerGenerator.cs b/src/Tools/CodeGeneration/CSharp/SyntaxWalker/CSharpSyntaxWalkerGenerator.cs index c0f17c0d59..1f608b797f 100644 --- a/src/Tools/CodeGeneration/CSharp/SyntaxWalker/CSharpSyntaxWalkerGenerator.cs +++ b/src/Tools/CodeGeneration/CSharp/SyntaxWalker/CSharpSyntaxWalkerGenerator.cs @@ -383,54 +383,6 @@ protected virtual void CreateTypeVisitStatements(MethodGenerationContext context } } - private void CreateVisitListSyntaxStatements(MethodGenerationContext context) - { - string variableName = context.CreateVariableName(context.PropertyName); - - context.AddStatement(LocalDeclarationStatement(context.PropertyType, variableName, context.ParameterName, context.PropertyName)); - - IPropertySymbol listPropertySymbol = FindListPropertySymbol(context.PropertySymbol); - - ITypeSymbol typeSymbol = ((INamedTypeSymbol)listPropertySymbol.Type).TypeArguments.Single(); - - IMethodSymbol methodSymbol = FindVisitMethod(typeSymbol); - - string methodName = null; - - if (methodSymbol is not null) - { - methodName = methodSymbol.Name; - } - else if (EliminateDefaultVisit) - { - methodName = GetMethodName(typeSymbol); - } - - StatementSyntax statement; - - if (methodName is not null) - { - string forEachVariableName = context.CreateVariableName(typeSymbol.Name.Remove(typeSymbol.Name.Length - 6)); - - statement = ForEachVisitStatement( - typeSymbol.Name, - forEachVariableName, - SimpleMemberAccessExpression( - IdentifierName(variableName), - IdentifierName(listPropertySymbol.Name)), - VisitStatement(methodName, forEachVariableName), - checkShouldVisit: true); - } - else - { - methodName = (SymbolEqualityComparer.Default.Equals(listPropertySymbol.Type.OriginalDefinition, SyntaxListSymbol)) ? "VisitList" : "VisitSeparatedList"; - - statement = VisitStatement(methodName, variableName, listPropertySymbol.Name); - } - - context.AddStatement(IfNotEqualsToNullStatement(variableName, statement)); - } - private static string GetMethodName(ITypeSymbol typeSymbol) { do diff --git a/src/Tools/CodeGeneration/Properties/AssemblyInfo.cs b/src/Tools/CodeGeneration/Properties/AssemblyInfo.cs deleted file mode 100644 index 3136e35782..0000000000 --- a/src/Tools/CodeGeneration/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,3 +0,0 @@ -// Copyright (c) Josef Pihrt and Contributors. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. - -[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Redundancy", "RCS1093:Remove file with no code.")] diff --git a/src/Tools/CodeGenerator/Configuration.md b/src/Tools/CodeGenerator/Configuration.md index e043d070ea..dc2dd05b76 100644 --- a/src/Tools/CodeGenerator/Configuration.md +++ b/src/Tools/CodeGenerator/Configuration.md @@ -33,15 +33,21 @@ if an analyzer is enabled but required option is not set. ROS0003 is disabled by ## Default Configuration -If you want to configure Roslynator on a user-wide basis you have to use Roslynator config file. -Default configuration file can be used with extension for Visual Studio or VS code. +If you want to configure Roslynator on a user-wide basis you have to use Roslynator config file (`.roslynatorconfig`). -### Format of Default Configuration File +**IMPORTANT:** Default configuration file can be used only with VS extension or VS code extension. + +### Format Format of the file is same as format of [global AnalyzerConfig](https://docs.microsoft.com/en-us/dotnet/fundamentals/code-analysis/configuration-files#global-analyzerconfig). -It essentially means that file must contain top-level entry `is_global = true` and cannot contain section headers (such as `[*.cs]`). +Namely, file must contain top-level entry `is_global = true` and cannot contain section headers (such as `[*.cs]`), For example: + +```ini +is_global = true +roslynator_analyzers.enabled_by_default = true +``` -### Location of Default Configuration File +### Location Configuration file is located at `%LOCALAPPDATA%/JosefPihrt/Roslynator/.roslynatorconfig`. Location of `%LOCALAPPDATA%` depends on the operating system: diff --git a/src/Tools/CodeGenerator/Program.cs b/src/Tools/CodeGenerator/Program.cs index 97ef9144bd..2e7d0264f2 100644 --- a/src/Tools/CodeGenerator/Program.cs +++ b/src/Tools/CodeGenerator/Program.cs @@ -20,11 +20,7 @@ private static void Main(string[] args) { if (args is null || args.Length == 0) { -#if DEBUG - args = new[] { @"..\..\..\..\.." }; -#else args = new string[] { Environment.CurrentDirectory }; -#endif } string rootPath = args[0]; diff --git a/src/Tools/CodeGenerator/Properties/AssemblyInfo.cs b/src/Tools/CodeGenerator/Properties/AssemblyInfo.cs deleted file mode 100644 index 3136e35782..0000000000 --- a/src/Tools/CodeGenerator/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,3 +0,0 @@ -// Copyright (c) Josef Pihrt and Contributors. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. - -[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Redundancy", "RCS1093:Remove file with no code.")] diff --git a/src/Tools/CodeGenerator/Properties/launchSettings.json b/src/Tools/CodeGenerator/Properties/launchSettings.json new file mode 100644 index 0000000000..fb7f3bf2ab --- /dev/null +++ b/src/Tools/CodeGenerator/Properties/launchSettings.json @@ -0,0 +1,8 @@ +{ + "profiles": { + "CodeGenerator": { + "commandName": "Project", + "commandLineArgs": "\"../../../../..\"" + } + } +} \ No newline at end of file diff --git a/src/Tools/Metadata/Properties/AssemblyInfo.cs b/src/Tools/Metadata/Properties/AssemblyInfo.cs deleted file mode 100644 index 3136e35782..0000000000 --- a/src/Tools/Metadata/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,3 +0,0 @@ -// Copyright (c) Josef Pihrt and Contributors. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. - -[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Redundancy", "RCS1093:Remove file with no code.")] diff --git a/src/Tools/MetadataGenerator/Program.cs b/src/Tools/MetadataGenerator/Program.cs index f88c9ea0a6..5d8d05ac0f 100644 --- a/src/Tools/MetadataGenerator/Program.cs +++ b/src/Tools/MetadataGenerator/Program.cs @@ -29,11 +29,7 @@ private static async Task Main(string[] args) { if (args is null || args.Length == 0) { -#if DEBUG - args = new[] { @"..\..\..\..\.." }; -#else args = new string[] { Environment.CurrentDirectory }; -#endif } string rootPath = args[0]; diff --git a/src/Tools/MetadataGenerator/Properties/AssemblyInfo.cs b/src/Tools/MetadataGenerator/Properties/AssemblyInfo.cs deleted file mode 100644 index 3136e35782..0000000000 --- a/src/Tools/MetadataGenerator/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,3 +0,0 @@ -// Copyright (c) Josef Pihrt and Contributors. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. - -[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Redundancy", "RCS1093:Remove file with no code.")] diff --git a/src/Tools/MetadataGenerator/Properties/launchSettings.json b/src/Tools/MetadataGenerator/Properties/launchSettings.json new file mode 100644 index 0000000000..980b3602ac --- /dev/null +++ b/src/Tools/MetadataGenerator/Properties/launchSettings.json @@ -0,0 +1,8 @@ +{ + "profiles": { + "MetadataGenerator": { + "commandName": "Project", + "commandLineArgs": "\"../../../../..\"" + } + } +} \ No newline at end of file diff --git a/src/Tools/Utilities/Properties/AssemblyInfo.cs b/src/Tools/Utilities/Properties/AssemblyInfo.cs deleted file mode 100644 index 3136e35782..0000000000 --- a/src/Tools/Utilities/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,3 +0,0 @@ -// Copyright (c) Josef Pihrt and Contributors. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. - -[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Redundancy", "RCS1093:Remove file with no code.")] diff --git a/src/VisualBasic.Workspaces/Properties/AssemblyInfo.cs b/src/VisualBasic.Workspaces/Properties/AssemblyInfo.cs deleted file mode 100644 index 7f96c7074b..0000000000 --- a/src/VisualBasic.Workspaces/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,18 +0,0 @@ -// Copyright (c) Josef Pihrt and Contributors. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. - -using System.Runtime.CompilerServices; - -[assembly: InternalsVisibleTo("Roslynator, PublicKey=0024000004800000940000000602000000240000525341310004000001000100d348e1a51bc190259aed17cfe132736241fef462de45a5de6c881c7f9d705073c7a2a08ba5ae493c7e878fe5f3cf7909e89045cca696422f03b284b147daf6b93c47bc53dd61ceeae60f73149d183032f029761d0d59aab49a26be4f6af71cd8194ace937642bdcb515f07530096122e97cfe6c8549a843530f71c24c7e3dab8")] -[assembly: InternalsVisibleTo("Roslynator.CodeGeneration, PublicKey=0024000004800000940000000602000000240000525341310004000001000100d348e1a51bc190259aed17cfe132736241fef462de45a5de6c881c7f9d705073c7a2a08ba5ae493c7e878fe5f3cf7909e89045cca696422f03b284b147daf6b93c47bc53dd61ceeae60f73149d183032f029761d0d59aab49a26be4f6af71cd8194ace937642bdcb515f07530096122e97cfe6c8549a843530f71c24c7e3dab8")] -[assembly: InternalsVisibleTo("Roslynator.CSharp.Analyzers, PublicKey=0024000004800000940000000602000000240000525341310004000001000100d348e1a51bc190259aed17cfe132736241fef462de45a5de6c881c7f9d705073c7a2a08ba5ae493c7e878fe5f3cf7909e89045cca696422f03b284b147daf6b93c47bc53dd61ceeae60f73149d183032f029761d0d59aab49a26be4f6af71cd8194ace937642bdcb515f07530096122e97cfe6c8549a843530f71c24c7e3dab8")] -[assembly: InternalsVisibleTo("Roslynator.CSharp.Analyzers.CodeFixes, PublicKey=0024000004800000940000000602000000240000525341310004000001000100d348e1a51bc190259aed17cfe132736241fef462de45a5de6c881c7f9d705073c7a2a08ba5ae493c7e878fe5f3cf7909e89045cca696422f03b284b147daf6b93c47bc53dd61ceeae60f73149d183032f029761d0d59aab49a26be4f6af71cd8194ace937642bdcb515f07530096122e97cfe6c8549a843530f71c24c7e3dab8")] -[assembly: InternalsVisibleTo("Roslynator.CSharp.Refactorings, PublicKey=0024000004800000940000000602000000240000525341310004000001000100d348e1a51bc190259aed17cfe132736241fef462de45a5de6c881c7f9d705073c7a2a08ba5ae493c7e878fe5f3cf7909e89045cca696422f03b284b147daf6b93c47bc53dd61ceeae60f73149d183032f029761d0d59aab49a26be4f6af71cd8194ace937642bdcb515f07530096122e97cfe6c8549a843530f71c24c7e3dab8")] -[assembly: InternalsVisibleTo("Roslynator.CSharp.CodeFixes, PublicKey=0024000004800000940000000602000000240000525341310004000001000100d348e1a51bc190259aed17cfe132736241fef462de45a5de6c881c7f9d705073c7a2a08ba5ae493c7e878fe5f3cf7909e89045cca696422f03b284b147daf6b93c47bc53dd61ceeae60f73149d183032f029761d0d59aab49a26be4f6af71cd8194ace937642bdcb515f07530096122e97cfe6c8549a843530f71c24c7e3dab8")] -[assembly: InternalsVisibleTo("Roslynator.VisualStudio, PublicKey=0024000004800000940000000602000000240000525341310004000001000100d348e1a51bc190259aed17cfe132736241fef462de45a5de6c881c7f9d705073c7a2a08ba5ae493c7e878fe5f3cf7909e89045cca696422f03b284b147daf6b93c47bc53dd61ceeae60f73149d183032f029761d0d59aab49a26be4f6af71cd8194ace937642bdcb515f07530096122e97cfe6c8549a843530f71c24c7e3dab8")] -[assembly: InternalsVisibleTo("Roslynator.Analyzers.Tests, PublicKey=0024000004800000940000000602000000240000525341310004000001000100d348e1a51bc190259aed17cfe132736241fef462de45a5de6c881c7f9d705073c7a2a08ba5ae493c7e878fe5f3cf7909e89045cca696422f03b284b147daf6b93c47bc53dd61ceeae60f73149d183032f029761d0d59aab49a26be4f6af71cd8194ace937642bdcb515f07530096122e97cfe6c8549a843530f71c24c7e3dab8")] -[assembly: InternalsVisibleTo("Roslynator.CodeFixes.Tests, PublicKey=0024000004800000940000000602000000240000525341310004000001000100d348e1a51bc190259aed17cfe132736241fef462de45a5de6c881c7f9d705073c7a2a08ba5ae493c7e878fe5f3cf7909e89045cca696422f03b284b147daf6b93c47bc53dd61ceeae60f73149d183032f029761d0d59aab49a26be4f6af71cd8194ace937642bdcb515f07530096122e97cfe6c8549a843530f71c24c7e3dab8")] -[assembly: InternalsVisibleTo("Roslynator.Refactorings.Tests, PublicKey=0024000004800000940000000602000000240000525341310004000001000100d348e1a51bc190259aed17cfe132736241fef462de45a5de6c881c7f9d705073c7a2a08ba5ae493c7e878fe5f3cf7909e89045cca696422f03b284b147daf6b93c47bc53dd61ceeae60f73149d183032f029761d0d59aab49a26be4f6af71cd8194ace937642bdcb515f07530096122e97cfe6c8549a843530f71c24c7e3dab8")] -[assembly: InternalsVisibleTo("Roslynator.CodeAnalysis.Analyzers.CodeFixes, PublicKey=0024000004800000940000000602000000240000525341310004000001000100d348e1a51bc190259aed17cfe132736241fef462de45a5de6c881c7f9d705073c7a2a08ba5ae493c7e878fe5f3cf7909e89045cca696422f03b284b147daf6b93c47bc53dd61ceeae60f73149d183032f029761d0d59aab49a26be4f6af71cd8194ace937642bdcb515f07530096122e97cfe6c8549a843530f71c24c7e3dab8")] -[assembly: InternalsVisibleTo("Roslynator.CodeAnalysis.Analyzers.Tests, PublicKey=0024000004800000940000000602000000240000525341310004000001000100d348e1a51bc190259aed17cfe132736241fef462de45a5de6c881c7f9d705073c7a2a08ba5ae493c7e878fe5f3cf7909e89045cca696422f03b284b147daf6b93c47bc53dd61ceeae60f73149d183032f029761d0d59aab49a26be4f6af71cd8194ace937642bdcb515f07530096122e97cfe6c8549a843530f71c24c7e3dab8")] -[assembly: InternalsVisibleTo("Roslynator.Formatting.Analyzers.CodeFixes, PublicKey=0024000004800000940000000602000000240000525341310004000001000100d348e1a51bc190259aed17cfe132736241fef462de45a5de6c881c7f9d705073c7a2a08ba5ae493c7e878fe5f3cf7909e89045cca696422f03b284b147daf6b93c47bc53dd61ceeae60f73149d183032f029761d0d59aab49a26be4f6af71cd8194ace937642bdcb515f07530096122e97cfe6c8549a843530f71c24c7e3dab8")] -[assembly: InternalsVisibleTo("Roslynator.Formatting.Analyzers.Tests, PublicKey=0024000004800000940000000602000000240000525341310004000001000100d348e1a51bc190259aed17cfe132736241fef462de45a5de6c881c7f9d705073c7a2a08ba5ae493c7e878fe5f3cf7909e89045cca696422f03b284b147daf6b93c47bc53dd61ceeae60f73149d183032f029761d0d59aab49a26be4f6af71cd8194ace937642bdcb515f07530096122e97cfe6c8549a843530f71c24c7e3dab8")] diff --git a/src/VisualBasic.Workspaces/VisualBasic.Workspaces.csproj b/src/VisualBasic.Workspaces/VisualBasic.Workspaces.csproj index 3ed7bacf7d..53a35a5f6b 100644 --- a/src/VisualBasic.Workspaces/VisualBasic.Workspaces.csproj +++ b/src/VisualBasic.Workspaces/VisualBasic.Workspaces.csproj @@ -35,6 +35,48 @@ <_Parameter1>$(RoslynatorDllPrefix)Roslynator.Workspaces.Common, PublicKey=$(RoslynatorPublicKey) + + <_Parameter1>Roslynator, PublicKey=$(RoslynatorPublicKey) + + + <_Parameter1>Roslynator.CodeGeneration, PublicKey=$(RoslynatorPublicKey) + + + <_Parameter1>Roslynator.CSharp.Analyzers, PublicKey=$(RoslynatorPublicKey) + + + <_Parameter1>Roslynator.CSharp.Analyzers.CodeFixes, PublicKey=$(RoslynatorPublicKey) + + + <_Parameter1>Roslynator.CSharp.Refactorings, PublicKey=$(RoslynatorPublicKey) + + + <_Parameter1>Roslynator.CSharp.CodeFixes, PublicKey=$(RoslynatorPublicKey) + + + <_Parameter1>Roslynator.VisualStudio, PublicKey=$(RoslynatorPublicKey) + + + <_Parameter1>Roslynator.Analyzers.Tests, PublicKey=$(RoslynatorPublicKey) + + + <_Parameter1>Roslynator.CodeFixes.Tests, PublicKey=$(RoslynatorPublicKey) + + + <_Parameter1>Roslynator.Refactorings.Tests, PublicKey=$(RoslynatorPublicKey) + + + <_Parameter1>Roslynator.CodeAnalysis.Analyzers.CodeFixes, PublicKey=$(RoslynatorPublicKey) + + + <_Parameter1>Roslynator.CodeAnalysis.Analyzers.Tests, PublicKey=$(RoslynatorPublicKey) + + + <_Parameter1>Roslynator.Formatting.Analyzers.CodeFixes, PublicKey=$(RoslynatorPublicKey) + + + <_Parameter1>Roslynator.Formatting.Analyzers.Tests, PublicKey=$(RoslynatorPublicKey) + diff --git a/src/VisualBasic.Workspaces/VisualBasic/VisualBasicSyntaxFactsService.cs b/src/VisualBasic.Workspaces/VisualBasic/VisualBasicSyntaxFactsService.cs index ce8cfca0c8..64991af7fc 100644 --- a/src/VisualBasic.Workspaces/VisualBasic/VisualBasicSyntaxFactsService.cs +++ b/src/VisualBasic.Workspaces/VisualBasic/VisualBasicSyntaxFactsService.cs @@ -59,6 +59,7 @@ public bool AreEquivalent(SyntaxTree oldTree, SyntaxTree newTree) return SyntaxFactory.AreEquivalent(oldTree, newTree, topLevel: false); } + [System.Diagnostics.CodeAnalysis.SuppressMessage("Roslynator", "RCS1079:Throwing of new NotImplementedException.")] public SyntaxNode GetSymbolDeclaration(SyntaxToken identifier) => throw new NotImplementedException(); public bool IsValidIdentifier(string name) diff --git a/src/VisualBasic/Properties/AssemblyInfo.cs b/src/VisualBasic/Properties/AssemblyInfo.cs deleted file mode 100644 index 957df63d81..0000000000 --- a/src/VisualBasic/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,5 +0,0 @@ -// Copyright (c) Josef Pihrt and Contributors. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. - -using System.Runtime.CompilerServices; - -[assembly: InternalsVisibleTo("Roslynator, PublicKey=0024000004800000940000000602000000240000525341310004000001000100d348e1a51bc190259aed17cfe132736241fef462de45a5de6c881c7f9d705073c7a2a08ba5ae493c7e878fe5f3cf7909e89045cca696422f03b284b147daf6b93c47bc53dd61ceeae60f73149d183032f029761d0d59aab49a26be4f6af71cd8194ace937642bdcb515f07530096122e97cfe6c8549a843530f71c24c7e3dab8")] diff --git a/src/VisualBasic/VisualBasic.csproj b/src/VisualBasic/VisualBasic.csproj index b8b5f6d3b0..444c52c2c0 100644 --- a/src/VisualBasic/VisualBasic.csproj +++ b/src/VisualBasic/VisualBasic.csproj @@ -29,6 +29,9 @@ <_Parameter1>$(RoslynatorDllPrefix)Roslynator.VisualBasic.Workspaces, PublicKey=$(RoslynatorPublicKey) + + <_Parameter1>Roslynator, PublicKey=$(RoslynatorPublicKey) + diff --git a/src/VisualStudio/manifest.json b/src/VisualStudio/manifest.json new file mode 100644 index 0000000000..8818ece82b --- /dev/null +++ b/src/VisualStudio/manifest.json @@ -0,0 +1,13 @@ +{ + "$schema": "http://json.schemastore.org/vsix-publish", + "categories": [ "coding", "other" ], + "identity": { + "internalName": "Roslynator2022" + }, + "overview": "Overview.md", + "priceCategory": "free", + "publisher": "josefpihrt", + "private": false, + "qna": true, + "repo": "https://github.com/JosefPihrt/Roslynator" +} diff --git a/src/VisualStudio/source.extension.vsixmanifest b/src/VisualStudio/source.extension.vsixmanifest index 5323237d68..cb48e0db46 100644 --- a/src/VisualStudio/source.extension.vsixmanifest +++ b/src/VisualStudio/source.extension.vsixmanifest @@ -1,7 +1,7 @@ - + - + Roslynator 2022 A collection of 500+ analyzers, refactorings and fixes for C#, powered by Roslyn. https://github.com/JosefPihrt/Roslynator diff --git a/src/VisualStudioCode/Properties/AssemblyInfo.cs b/src/VisualStudioCode/Properties/AssemblyInfo.cs deleted file mode 100644 index 8cb3880dea..0000000000 --- a/src/VisualStudioCode/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,4 +0,0 @@ -// Copyright (c) Josef Pihrt and Contributors. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. - -using System.Runtime.CompilerServices; - diff --git a/src/VisualStudioCode/package/package.json b/src/VisualStudioCode/package/package.json index 28c7fd27c2..0f87d2b817 100644 --- a/src/VisualStudioCode/package/package.json +++ b/src/VisualStudioCode/package/package.json @@ -4,7 +4,7 @@ "displayName": "Roslynator", "description": "A collection of 500+ analyzers, refactorings and fixes for C#, powered by Roslyn.", "icon": "images/icon.png", - "version": "4.3.0", + "version": "1.0.0", "author": "Josef Pihrt", "license": "Apache-2.0", "homepage": "https://github.com/josefpihrt/roslynator", diff --git a/src/Workspaces.Common/Properties/AssemblyInfo.cs b/src/Workspaces.Common/Properties/AssemblyInfo.cs deleted file mode 100644 index bc7bdb4718..0000000000 --- a/src/Workspaces.Common/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,17 +0,0 @@ -// Copyright (c) Josef Pihrt and Contributors. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. - -using System.Runtime.CompilerServices; - -[assembly: InternalsVisibleTo("Roslynator.CSharp.Analyzers, PublicKey=0024000004800000940000000602000000240000525341310004000001000100d348e1a51bc190259aed17cfe132736241fef462de45a5de6c881c7f9d705073c7a2a08ba5ae493c7e878fe5f3cf7909e89045cca696422f03b284b147daf6b93c47bc53dd61ceeae60f73149d183032f029761d0d59aab49a26be4f6af71cd8194ace937642bdcb515f07530096122e97cfe6c8549a843530f71c24c7e3dab8")] -[assembly: InternalsVisibleTo("Roslynator.CSharp.Analyzers.CodeFixes, PublicKey=0024000004800000940000000602000000240000525341310004000001000100d348e1a51bc190259aed17cfe132736241fef462de45a5de6c881c7f9d705073c7a2a08ba5ae493c7e878fe5f3cf7909e89045cca696422f03b284b147daf6b93c47bc53dd61ceeae60f73149d183032f029761d0d59aab49a26be4f6af71cd8194ace937642bdcb515f07530096122e97cfe6c8549a843530f71c24c7e3dab8")] -[assembly: InternalsVisibleTo("Roslynator.CSharp.CodeFixes, PublicKey=0024000004800000940000000602000000240000525341310004000001000100d348e1a51bc190259aed17cfe132736241fef462de45a5de6c881c7f9d705073c7a2a08ba5ae493c7e878fe5f3cf7909e89045cca696422f03b284b147daf6b93c47bc53dd61ceeae60f73149d183032f029761d0d59aab49a26be4f6af71cd8194ace937642bdcb515f07530096122e97cfe6c8549a843530f71c24c7e3dab8")] -[assembly: InternalsVisibleTo("Roslynator.CSharp.Refactorings, PublicKey=0024000004800000940000000602000000240000525341310004000001000100d348e1a51bc190259aed17cfe132736241fef462de45a5de6c881c7f9d705073c7a2a08ba5ae493c7e878fe5f3cf7909e89045cca696422f03b284b147daf6b93c47bc53dd61ceeae60f73149d183032f029761d0d59aab49a26be4f6af71cd8194ace937642bdcb515f07530096122e97cfe6c8549a843530f71c24c7e3dab8")] -[assembly: InternalsVisibleTo("Roslynator.Analyzers.Tests, PublicKey=0024000004800000940000000602000000240000525341310004000001000100d348e1a51bc190259aed17cfe132736241fef462de45a5de6c881c7f9d705073c7a2a08ba5ae493c7e878fe5f3cf7909e89045cca696422f03b284b147daf6b93c47bc53dd61ceeae60f73149d183032f029761d0d59aab49a26be4f6af71cd8194ace937642bdcb515f07530096122e97cfe6c8549a843530f71c24c7e3dab8")] -[assembly: InternalsVisibleTo("Roslynator.CodeFixes.Tests, PublicKey=0024000004800000940000000602000000240000525341310004000001000100d348e1a51bc190259aed17cfe132736241fef462de45a5de6c881c7f9d705073c7a2a08ba5ae493c7e878fe5f3cf7909e89045cca696422f03b284b147daf6b93c47bc53dd61ceeae60f73149d183032f029761d0d59aab49a26be4f6af71cd8194ace937642bdcb515f07530096122e97cfe6c8549a843530f71c24c7e3dab8")] -[assembly: InternalsVisibleTo("Roslynator.Refactorings.Tests, PublicKey=0024000004800000940000000602000000240000525341310004000001000100d348e1a51bc190259aed17cfe132736241fef462de45a5de6c881c7f9d705073c7a2a08ba5ae493c7e878fe5f3cf7909e89045cca696422f03b284b147daf6b93c47bc53dd61ceeae60f73149d183032f029761d0d59aab49a26be4f6af71cd8194ace937642bdcb515f07530096122e97cfe6c8549a843530f71c24c7e3dab8")] -[assembly: InternalsVisibleTo("Roslynator.CodeAnalysis.Analyzers, PublicKey=0024000004800000940000000602000000240000525341310004000001000100d348e1a51bc190259aed17cfe132736241fef462de45a5de6c881c7f9d705073c7a2a08ba5ae493c7e878fe5f3cf7909e89045cca696422f03b284b147daf6b93c47bc53dd61ceeae60f73149d183032f029761d0d59aab49a26be4f6af71cd8194ace937642bdcb515f07530096122e97cfe6c8549a843530f71c24c7e3dab8")] -[assembly: InternalsVisibleTo("Roslynator.CodeAnalysis.Analyzers.CodeFixes, PublicKey=0024000004800000940000000602000000240000525341310004000001000100d348e1a51bc190259aed17cfe132736241fef462de45a5de6c881c7f9d705073c7a2a08ba5ae493c7e878fe5f3cf7909e89045cca696422f03b284b147daf6b93c47bc53dd61ceeae60f73149d183032f029761d0d59aab49a26be4f6af71cd8194ace937642bdcb515f07530096122e97cfe6c8549a843530f71c24c7e3dab8")] -[assembly: InternalsVisibleTo("Roslynator.CodeAnalysis.Analyzers.Tests, PublicKey=0024000004800000940000000602000000240000525341310004000001000100d348e1a51bc190259aed17cfe132736241fef462de45a5de6c881c7f9d705073c7a2a08ba5ae493c7e878fe5f3cf7909e89045cca696422f03b284b147daf6b93c47bc53dd61ceeae60f73149d183032f029761d0d59aab49a26be4f6af71cd8194ace937642bdcb515f07530096122e97cfe6c8549a843530f71c24c7e3dab8")] -[assembly: InternalsVisibleTo("Roslynator.Formatting.Analyzers, PublicKey=0024000004800000940000000602000000240000525341310004000001000100d348e1a51bc190259aed17cfe132736241fef462de45a5de6c881c7f9d705073c7a2a08ba5ae493c7e878fe5f3cf7909e89045cca696422f03b284b147daf6b93c47bc53dd61ceeae60f73149d183032f029761d0d59aab49a26be4f6af71cd8194ace937642bdcb515f07530096122e97cfe6c8549a843530f71c24c7e3dab8")] -[assembly: InternalsVisibleTo("Roslynator.Formatting.Analyzers.CodeFixes, PublicKey=0024000004800000940000000602000000240000525341310004000001000100d348e1a51bc190259aed17cfe132736241fef462de45a5de6c881c7f9d705073c7a2a08ba5ae493c7e878fe5f3cf7909e89045cca696422f03b284b147daf6b93c47bc53dd61ceeae60f73149d183032f029761d0d59aab49a26be4f6af71cd8194ace937642bdcb515f07530096122e97cfe6c8549a843530f71c24c7e3dab8")] -[assembly: InternalsVisibleTo("Roslynator.Formatting.Analyzers.Tests, PublicKey=0024000004800000940000000602000000240000525341310004000001000100d348e1a51bc190259aed17cfe132736241fef462de45a5de6c881c7f9d705073c7a2a08ba5ae493c7e878fe5f3cf7909e89045cca696422f03b284b147daf6b93c47bc53dd61ceeae60f73149d183032f029761d0d59aab49a26be4f6af71cd8194ace937642bdcb515f07530096122e97cfe6c8549a843530f71c24c7e3dab8")] diff --git a/src/Workspaces.Common/Workspaces.Common.csproj b/src/Workspaces.Common/Workspaces.Common.csproj index 602b3fff56..ec633b25d0 100644 --- a/src/Workspaces.Common/Workspaces.Common.csproj +++ b/src/Workspaces.Common/Workspaces.Common.csproj @@ -31,4 +31,46 @@ + + + <_Parameter1>Roslynator.CSharp.Analyzers, PublicKey=$(RoslynatorPublicKey) + + + <_Parameter1>Roslynator.CSharp.Analyzers.CodeFixes, PublicKey=$(RoslynatorPublicKey) + + + <_Parameter1>Roslynator.CSharp.CodeFixes, PublicKey=$(RoslynatorPublicKey) + + + <_Parameter1>Roslynator.CSharp.Refactorings, PublicKey=$(RoslynatorPublicKey) + + + <_Parameter1>Roslynator.Analyzers.Tests, PublicKey=$(RoslynatorPublicKey) + + + <_Parameter1>Roslynator.CodeFixes.Tests, PublicKey=$(RoslynatorPublicKey) + + + <_Parameter1>Roslynator.Refactorings.Tests, PublicKey=$(RoslynatorPublicKey) + + + <_Parameter1>Roslynator.CodeAnalysis.Analyzers, PublicKey=$(RoslynatorPublicKey) + + + <_Parameter1>Roslynator.CodeAnalysis.Analyzers.CodeFixes, PublicKey=$(RoslynatorPublicKey) + + + <_Parameter1>Roslynator.CodeAnalysis.Analyzers.Tests, PublicKey=$(RoslynatorPublicKey) + + + <_Parameter1>Roslynator.Formatting.Analyzers, PublicKey=$(RoslynatorPublicKey) + + + <_Parameter1>Roslynator.Formatting.Analyzers.CodeFixes, PublicKey=$(RoslynatorPublicKey) + + + <_Parameter1>Roslynator.Formatting.Analyzers.Tests, PublicKey=$(RoslynatorPublicKey) + + + diff --git a/src/Workspaces.Core/CodeFixes/DiagnosticFix.cs b/src/Workspaces.Core/CodeFixes/DiagnosticFix.cs index 9cf7805e9c..f4d567e8e3 100644 --- a/src/Workspaces.Core/CodeFixes/DiagnosticFix.cs +++ b/src/Workspaces.Core/CodeFixes/DiagnosticFix.cs @@ -6,7 +6,7 @@ namespace Roslynator.CodeFixes; -internal struct DiagnosticFix +internal readonly struct DiagnosticFix { public DiagnosticFix(CodeAction codeAction, Document document, CodeFixProvider fixProvider, CodeFixProvider fixProvider2) { diff --git a/src/Workspaces.Core/Extensions/Extensions.cs b/src/Workspaces.Core/Extensions/Extensions.cs index 528d1a2cb9..2b61c5b495 100644 --- a/src/Workspaces.Core/Extensions/Extensions.cs +++ b/src/Workspaces.Core/Extensions/Extensions.cs @@ -411,6 +411,9 @@ public static bool IsEffective( if (!codeAnalysisOptions.IsSupportedDiagnosticId(diagnostic.Id)) return false; + if (diagnostic.Descriptor.CustomTags.Contains(WellKnownDiagnosticTags.Compiler)) + return true; + SyntaxTree tree = diagnostic.Location.SourceTree; ReportDiagnostic reportDiagnostic = (tree is not null) diff --git a/src/Workspaces.Core/Formatting/CodeFormatter.cs b/src/Workspaces.Core/Formatting/CodeFormatter.cs index 3b48dfbd51..9458b617df 100644 --- a/src/Workspaces.Core/Formatting/CodeFormatter.cs +++ b/src/Workspaces.Core/Formatting/CodeFormatter.cs @@ -55,6 +55,7 @@ public static async Task FormatProjectAsync( return project; } + [System.Diagnostics.CodeAnalysis.SuppressMessage("Roslynator", "RCS1163:Unused parameter.")] internal static async Task> GetFormattedDocumentsAsync( Project project, Project newProject, diff --git a/src/Workspaces.Core/Logging/LogHelpers.cs b/src/Workspaces.Core/Logging/LogHelpers.cs index d42e4802e6..83052a65fb 100644 --- a/src/Workspaces.Core/Logging/LogHelpers.cs +++ b/src/Workspaces.Core/Logging/LogHelpers.cs @@ -384,7 +384,7 @@ public static void WriteSymbolDefinition( sb.Append(symbol.Name); sb.Append("': "); - if ((symbol.ContainingSymbol as IMethodSymbol)?.MethodKind == MethodKind.LambdaMethod) + if (symbol.ContainingSymbol is IMethodSymbol { MethodKind: MethodKind.LambdaMethod }) { sb.Append("anonymous function"); } diff --git a/src/Workspaces.Core/Logging/Logger.cs b/src/Workspaces.Core/Logging/Logger.cs index 29cd17f486..66e3417b1e 100644 --- a/src/Workspaces.Core/Logging/Logger.cs +++ b/src/Workspaces.Core/Logging/Logger.cs @@ -272,15 +272,6 @@ public static void WriteError( Exception exception, ConsoleColor color = ConsoleColor.Red, Verbosity verbosity = Verbosity.Quiet) - { - WriteError(exception, exception.Message, color, verbosity); - } - - public static void WriteError( - Exception exception, - string message, - ConsoleColor color = ConsoleColor.Red, - Verbosity verbosity = Verbosity.Quiet) { var colors = new ConsoleColors(color); diff --git a/src/Workspaces.Core/Properties/AssemblyInfo.cs b/src/Workspaces.Core/Properties/AssemblyInfo.cs deleted file mode 100644 index 2d89c3572f..0000000000 --- a/src/Workspaces.Core/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,15 +0,0 @@ -// Copyright (c) Josef Pihrt and Contributors. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. - -using System.Runtime.CompilerServices; - -[assembly: InternalsVisibleTo("Roslynator, PublicKey=0024000004800000940000000602000000240000525341310004000001000100d348e1a51bc190259aed17cfe132736241fef462de45a5de6c881c7f9d705073c7a2a08ba5ae493c7e878fe5f3cf7909e89045cca696422f03b284b147daf6b93c47bc53dd61ceeae60f73149d183032f029761d0d59aab49a26be4f6af71cd8194ace937642bdcb515f07530096122e97cfe6c8549a843530f71c24c7e3dab8")] -[assembly: InternalsVisibleTo("Roslynator.CSharp.Analyzers.CodeFixes, PublicKey=0024000004800000940000000602000000240000525341310004000001000100d348e1a51bc190259aed17cfe132736241fef462de45a5de6c881c7f9d705073c7a2a08ba5ae493c7e878fe5f3cf7909e89045cca696422f03b284b147daf6b93c47bc53dd61ceeae60f73149d183032f029761d0d59aab49a26be4f6af71cd8194ace937642bdcb515f07530096122e97cfe6c8549a843530f71c24c7e3dab8")] -[assembly: InternalsVisibleTo("Roslynator.CSharp.Refactorings, PublicKey=0024000004800000940000000602000000240000525341310004000001000100d348e1a51bc190259aed17cfe132736241fef462de45a5de6c881c7f9d705073c7a2a08ba5ae493c7e878fe5f3cf7909e89045cca696422f03b284b147daf6b93c47bc53dd61ceeae60f73149d183032f029761d0d59aab49a26be4f6af71cd8194ace937642bdcb515f07530096122e97cfe6c8549a843530f71c24c7e3dab8")] -[assembly: InternalsVisibleTo("Roslynator.CSharp.CodeFixes, PublicKey=0024000004800000940000000602000000240000525341310004000001000100d348e1a51bc190259aed17cfe132736241fef462de45a5de6c881c7f9d705073c7a2a08ba5ae493c7e878fe5f3cf7909e89045cca696422f03b284b147daf6b93c47bc53dd61ceeae60f73149d183032f029761d0d59aab49a26be4f6af71cd8194ace937642bdcb515f07530096122e97cfe6c8549a843530f71c24c7e3dab8")] -[assembly: InternalsVisibleTo("Roslynator.Analyzers.Tests, PublicKey=0024000004800000940000000602000000240000525341310004000001000100d348e1a51bc190259aed17cfe132736241fef462de45a5de6c881c7f9d705073c7a2a08ba5ae493c7e878fe5f3cf7909e89045cca696422f03b284b147daf6b93c47bc53dd61ceeae60f73149d183032f029761d0d59aab49a26be4f6af71cd8194ace937642bdcb515f07530096122e97cfe6c8549a843530f71c24c7e3dab8")] -[assembly: InternalsVisibleTo("Roslynator.CodeFixes.Tests, PublicKey=0024000004800000940000000602000000240000525341310004000001000100d348e1a51bc190259aed17cfe132736241fef462de45a5de6c881c7f9d705073c7a2a08ba5ae493c7e878fe5f3cf7909e89045cca696422f03b284b147daf6b93c47bc53dd61ceeae60f73149d183032f029761d0d59aab49a26be4f6af71cd8194ace937642bdcb515f07530096122e97cfe6c8549a843530f71c24c7e3dab8")] -[assembly: InternalsVisibleTo("Roslynator.Refactorings.Tests, PublicKey=0024000004800000940000000602000000240000525341310004000001000100d348e1a51bc190259aed17cfe132736241fef462de45a5de6c881c7f9d705073c7a2a08ba5ae493c7e878fe5f3cf7909e89045cca696422f03b284b147daf6b93c47bc53dd61ceeae60f73149d183032f029761d0d59aab49a26be4f6af71cd8194ace937642bdcb515f07530096122e97cfe6c8549a843530f71c24c7e3dab8")] -[assembly: InternalsVisibleTo("Roslynator.CodeAnalysis.Analyzers.CodeFixes, PublicKey=0024000004800000940000000602000000240000525341310004000001000100d348e1a51bc190259aed17cfe132736241fef462de45a5de6c881c7f9d705073c7a2a08ba5ae493c7e878fe5f3cf7909e89045cca696422f03b284b147daf6b93c47bc53dd61ceeae60f73149d183032f029761d0d59aab49a26be4f6af71cd8194ace937642bdcb515f07530096122e97cfe6c8549a843530f71c24c7e3dab8")] -[assembly: InternalsVisibleTo("Roslynator.CodeAnalysis.Analyzers.Tests, PublicKey=0024000004800000940000000602000000240000525341310004000001000100d348e1a51bc190259aed17cfe132736241fef462de45a5de6c881c7f9d705073c7a2a08ba5ae493c7e878fe5f3cf7909e89045cca696422f03b284b147daf6b93c47bc53dd61ceeae60f73149d183032f029761d0d59aab49a26be4f6af71cd8194ace937642bdcb515f07530096122e97cfe6c8549a843530f71c24c7e3dab8")] -[assembly: InternalsVisibleTo("Roslynator.Formatting.Analyzers.CodeFixes, PublicKey=0024000004800000940000000602000000240000525341310004000001000100d348e1a51bc190259aed17cfe132736241fef462de45a5de6c881c7f9d705073c7a2a08ba5ae493c7e878fe5f3cf7909e89045cca696422f03b284b147daf6b93c47bc53dd61ceeae60f73149d183032f029761d0d59aab49a26be4f6af71cd8194ace937642bdcb515f07530096122e97cfe6c8549a843530f71c24c7e3dab8")] -[assembly: InternalsVisibleTo("Roslynator.Formatting.Analyzers.Tests, PublicKey=0024000004800000940000000602000000240000525341310004000001000100d348e1a51bc190259aed17cfe132736241fef462de45a5de6c881c7f9d705073c7a2a08ba5ae493c7e878fe5f3cf7909e89045cca696422f03b284b147daf6b93c47bc53dd61ceeae60f73149d183032f029761d0d59aab49a26be4f6af71cd8194ace937642bdcb515f07530096122e97cfe6c8549a843530f71c24c7e3dab8")] diff --git a/src/Workspaces.Core/Rename/LocalSymbolComparer.cs b/src/Workspaces.Core/Rename/LocalSymbolComparer.cs index 712efd8096..5ff1c43408 100644 --- a/src/Workspaces.Core/Rename/LocalSymbolComparer.cs +++ b/src/Workspaces.Core/Rename/LocalSymbolComparer.cs @@ -27,7 +27,7 @@ public int Compare(ISymbol x, ISymbol y) { ISymbol cs = x.ContainingSymbol; - while ((cs as IMethodSymbol)?.MethodKind == MethodKind.LocalFunction) + while (cs is IMethodSymbol { MethodKind: MethodKind.LocalFunction }) { if (SymbolEqualityComparer.Default.Equals(cs, y)) return 1; @@ -37,7 +37,7 @@ public int Compare(ISymbol x, ISymbol y) cs = y.ContainingSymbol; - while ((cs as IMethodSymbol)?.MethodKind == MethodKind.LocalFunction) + while (cs is IMethodSymbol { MethodKind: MethodKind.LocalFunction }) { if (SymbolEqualityComparer.Default.Equals(cs, x)) return -1; @@ -58,7 +58,7 @@ static int GetRank(ISymbol symbol) if (symbol.Kind == SymbolKind.Parameter) { - if ((symbol.ContainingSymbol as IMethodSymbol)?.MethodKind == MethodKind.AnonymousFunction) + if (symbol.ContainingSymbol is IMethodSymbol { MethodKind: MethodKind.AnonymousFunction }) return 0; return 1; @@ -66,7 +66,7 @@ static int GetRank(ISymbol symbol) if (symbol.Kind == SymbolKind.TypeParameter) { - Debug.Assert((symbol.ContainingSymbol as IMethodSymbol)?.MethodKind == MethodKind.LocalFunction); + Debug.Assert(symbol.ContainingSymbol is IMethodSymbol { MethodKind: MethodKind.LocalFunction }); return 1; } diff --git a/src/Workspaces.Core/Rename/SymbolRenamer.cs b/src/Workspaces.Core/Rename/SymbolRenamer.cs index 04145f4fcc..9ef8f0aec4 100644 --- a/src/Workspaces.Core/Rename/SymbolRenamer.cs +++ b/src/Workspaces.Core/Rename/SymbolRenamer.cs @@ -342,7 +342,7 @@ private async Task> RenameLocalSymbolsAsync( { if (symbol.Kind == SymbolKind.Method || (symbol.IsKind(SymbolKind.Parameter, SymbolKind.TypeParameter) - && (symbol.ContainingSymbol as IMethodSymbol)?.MethodKind == MethodKind.LocalFunction)) + && symbol.ContainingSymbol is IMethodSymbol { MethodKind: MethodKind.LocalFunction })) { (localFunctionIndexes ??= new HashSet()).Add(i); } @@ -1026,7 +1026,7 @@ private static string GetSymbolId(ISymbol symbol) id = symbol.Name; ISymbol cs = symbol.ContainingSymbol; - while ((cs as IMethodSymbol)?.MethodKind == MethodKind.LocalFunction) + while (cs is IMethodSymbol { MethodKind: MethodKind.LocalFunction }) { id = cs.Name + "." + id; cs = cs.ContainingSymbol; @@ -1052,7 +1052,7 @@ private static string GetSymbolId(ISymbol symbol) id = cs.Name + " " + symbol.Name; cs = cs.ContainingSymbol; - while ((cs as IMethodSymbol)?.MethodKind == MethodKind.LocalFunction) + while (cs is IMethodSymbol { MethodKind: MethodKind.LocalFunction }) { id = cs.Name + "." + id; cs = cs.ContainingSymbol; diff --git a/src/Workspaces.Core/Workspaces.Core.csproj b/src/Workspaces.Core/Workspaces.Core.csproj index 1e5877fc41..dd431f8df0 100644 --- a/src/Workspaces.Core/Workspaces.Core.csproj +++ b/src/Workspaces.Core/Workspaces.Core.csproj @@ -55,6 +55,39 @@ <_Parameter1>$(RoslynatorDllPrefix)Roslynator.Documentation, PublicKey=$(RoslynatorPublicKey) + + <_Parameter1>Roslynator, PublicKey=$(RoslynatorPublicKey) + + + <_Parameter1>Roslynator.CSharp.Analyzers.CodeFixes, PublicKey=$(RoslynatorPublicKey) + + + <_Parameter1>Roslynator.CSharp.Refactorings, PublicKey=$(RoslynatorPublicKey) + + + <_Parameter1>Roslynator.CSharp.CodeFixes, PublicKey=$(RoslynatorPublicKey) + + + <_Parameter1>Roslynator.Analyzers.Tests, PublicKey=$(RoslynatorPublicKey) + + + <_Parameter1>Roslynator.CodeFixes.Tests, PublicKey=$(RoslynatorPublicKey) + + + <_Parameter1>Roslynator.Refactorings.Tests, PublicKey=$(RoslynatorPublicKey) + + + <_Parameter1>Roslynator.CodeAnalysis.Analyzers.CodeFixes, PublicKey=$(RoslynatorPublicKey) + + + <_Parameter1>Roslynator.CodeAnalysis.Analyzers.Tests, PublicKey=$(RoslynatorPublicKey) + + + <_Parameter1>Roslynator.Formatting.Analyzers.CodeFixes, PublicKey=$(RoslynatorPublicKey) + + + <_Parameter1>Roslynator.Formatting.Analyzers.Tests, PublicKey=$(RoslynatorPublicKey) + diff --git a/text/ReleaseCheckList.md b/text/ReleaseCheckList.md deleted file mode 100644 index 777a43b436..0000000000 --- a/text/ReleaseCheckList.md +++ /dev/null @@ -1,33 +0,0 @@ -* Update version - * build.cmd - * Roslynator.Core - * Roslynator.Workspaces.Core - * Roslynator.CSharp - * Roslynator.CSharp.Workspaces - * Roslynator.VisualBasic - * Roslynator.VisualBasic.Workspaces -* Update ChangeLog.md -* Run build.cmd -* Publish VS Extensions - * Roslynator 2019 - * Roslynator 2017 - * Roslynator Refactorings 2017 -* Publish Packages - * Roslynator.Analyzers -* Publish Packages (API) - * Roslynator.Core - * Roslynator.Workspaces.Core - * Roslynator.CSharp - * Roslynator.CSharp.Workspaces -* Push to GitHub -* Add release to GitHub - -### CLI - -* Update version - * Roslynator.CommandLine - * Roslynator.Documentation -* Update CommandLine/ChangeLog.md -* Run build.commandline.cmd -* Publish Package Roslynator.CommandLine -* Push to GitHub \ No newline at end of file diff --git a/tools/build.cmd b/tools/build.cmd deleted file mode 100644 index 6ae9ca6127..0000000000 --- a/tools/build.cmd +++ /dev/null @@ -1,149 +0,0 @@ -@echo off - -set _programFiles=%ProgramFiles% - -set _msbuildPath="%_programFiles%\Microsoft Visual Studio\2022\Community\MSBuild\Current\Bin\MSBuild" -set _properties=Configuration=Release,Deterministic=true,TreatWarningsAsErrors=true,WarningsNotAsErrors=1591 -set _outDir=..\out\Release -set _version=4.3.0 -set _version4=4.3.0.0 - -orang replace "..\src\VisualStudio\source.extension.vsixmanifest" ^ - -c "patterns\vsix_manifest_version.txt" from-file -t m r ^ - -r %_version% - -orang replace ^ - "..\src\VisualStudio\Properties\AssemblyInfo.cs" ^ - -c "patterns\assembly_info_version.txt" from-file -t m r ^ - -r %_version4% - -orang delete "..\src" -a d -n "bin,obj" l li e -i "packages,node_modules" l li e ne -t n --content-only -u - -echo. - -dotnet restore "..\src\Roslynator.sln" -dotnet restore "..\src\VisualStudio.sln" -dotnet restore "..\src\Tools\Tools.sln" - -dotnet build "..\src\Tools\Tools.sln" ^ - /p:%_properties% ^ - /v:normal ^ - /m - -if errorlevel 1 ( - pause - exit -) - -"..\src\Tools\MetadataGenerator\bin\Release\net7.0\Roslynator.MetadataGenerator.exe" "..\src" -dotnet "..\src\Tools\CodeGenerator\bin\Release\netcoreapp3.1\Roslynator.CodeGenerator.dll" "..\src" - -%_msbuildPath% "..\src\Roslynator.sln" ^ - /t:Build ^ - /p:%_properties% ^ - /v:normal ^ - /m - -if errorlevel 1 ( - pause - exit -) - -dotnet test -c Release --no-build "..\src\Tests\Core.Tests\Core.Tests.csproj" - -if errorlevel 1 ( - pause - exit -) - -dotnet test -c Release --no-build "..\src\Tests\CSharp.Tests\CSharp.Tests.csproj" - -if errorlevel 1 ( - pause - exit -) - -dotnet test -c Release --no-build "..\src\Tests\CSharp.Workspaces.Tests\CSharp.Workspaces.Tests.csproj" - -if errorlevel 1 ( - pause - exit -) - -dotnet test -c Release --no-build "..\src\Tests\Analyzers.Tests\Analyzers.Tests.csproj" - -if errorlevel 1 ( - pause - exit -) - -dotnet test -c Release --no-build "..\src\Tests\CodeAnalysis.Analyzers.Tests\CodeAnalysis.Analyzers.Tests.csproj" - -if errorlevel 1 ( - pause - exit -) - -dotnet test -c Release --no-build "..\src\Tests\Formatting.Analyzers.Tests\Formatting.Analyzers.Tests.csproj" - -if errorlevel 1 ( - pause - exit -) - -dotnet test -c Release --no-build "..\src\Tests\CodeFixes.Tests\CodeFixes.Tests.csproj" - -if errorlevel 1 ( - pause - exit -) - -dotnet test -c Release --no-build "..\src\Tests\Refactorings.Tests\Refactorings.Tests.csproj" - -if errorlevel 1 ( - pause - exit -) - -md "%_outDir%" -orang delete "%_outDir%" - -orang rename "../src/VisualStudio" -n "(?=\.vsix\z)" -r ".%_version%" - -dotnet pack -c Release --no-build -v normal "..\src\Core\Core.csproj" -dotnet pack -c Release --no-build -v normal "..\src\Workspaces.Core\Workspaces.Core.csproj" -dotnet pack -c Release --no-build -v normal "..\src\CSharp\CSharp.csproj" -dotnet pack -c Release --no-build -v normal "..\src\CSharp.Workspaces\CSharp.Workspaces.csproj" -dotnet pack -c Release --no-build -v normal "..\src\Tests\Testing.Common\Testing.Common.csproj" -dotnet pack -c Release --no-build -v normal "..\src\Tests\Testing.CSharp\Testing.CSharp.csproj" -dotnet pack -c Release --no-build -v normal "..\src\Tests\Testing.CSharp.Xunit\Testing.CSharp.Xunit.csproj" -dotnet pack -c Release --no-build -v normal "..\src\Tests\Testing.CSharp.MSTest\Testing.CSharp.MSTest.csproj" - -orang copy "../src" "%_outDir%" -e nupkg,vsix --flat -i packages e ne - -orang replace "../src" -n "AssemblyInfo.cs" e -c "patterns/assembly_names_to_be_prefixed.txt" f -r "Roslynator_Analyzers_" -orang delete "../src" -a d -n "bin,obj" l li e -i "packages,node_modules" l li e ne -t n --content-only -y su s -dotnet restore --force "../src\Roslynator.sln" -%_msbuildPath% "../src\Roslynator.sln" /t:Build /p:%_properties%,RoslynatorAnalyzersNuGet=true /v:normal /m -dotnet pack -c Release --no-build -v normal "..\src\Analyzers.CodeFixes\Analyzers.CodeFixes.csproj" -copy "..\src\Analyzers.CodeFixes\bin\Release\Roslynator.Analyzers.*.nupkg" "%_outDir%" -orang replace "../src" -n "AssemblyInfo.cs" e -c "patterns/assembly_names_to_be_prefixed.txt" f -r "" - -orang replace "../src" -n "AssemblyInfo.cs" e -c "patterns/assembly_names_to_be_prefixed.txt" f -r "Roslynator_CodeAnalysis_Analyzers_" -orang delete "../src" -a d -n "bin,obj" l li e -i "packages,node_modules" l li e ne -t n --content-only -y su s -dotnet restore --force "../src\Roslynator.sln" -%_msbuildPath% "../src\Roslynator.sln" /t:Build /p:%_properties%,RoslynatorCodeAnalysisAnalyzersNuGet=true /v:normal /m -dotnet pack -c Release --no-build -v normal "..\src\CodeAnalysis.Analyzers.CodeFixes\CodeAnalysis.Analyzers.CodeFixes.csproj" -copy "..\src\CodeAnalysis.Analyzers.CodeFixes\bin\Release\Roslynator.CodeAnalysis.Analyzers.*.nupkg" "%_outDir%" -orang replace "../src" -n "AssemblyInfo.cs" e -c "patterns/assembly_names_to_be_prefixed.txt" f -r "" - -orang replace "../src" -n "AssemblyInfo.cs" e -c "patterns/assembly_names_to_be_prefixed.txt" f -r "Roslynator_Formatting_Analyzers_" -orang delete "../src" -a d -n "bin,obj" l li e -i "packages,node_modules" l li e ne -t n --content-only -y su s -dotnet restore --force "../src\Roslynator.sln" -%_msbuildPath% "../src\Roslynator.sln" /t:Build /p:%_properties%,RoslynatorFormattingAnalyzersNuGet=true /v:normal /m -dotnet pack -c Release --no-build -v normal "..\src\Formatting.Analyzers.CodeFixes\Formatting.Analyzers.CodeFixes.csproj" -copy "..\src\Formatting.Analyzers.CodeFixes\bin\Release\Roslynator.Formatting.Analyzers.*.nupkg" "%_outDir%" -orang replace "../src" -n "AssemblyInfo.cs" e -c "patterns/assembly_names_to_be_prefixed.txt" f -r "" - -echo OK -pause diff --git a/tools/build_cli.cmd b/tools/build_cli.cmd deleted file mode 100644 index 360ec2a96b..0000000000 --- a/tools/build_cli.cmd +++ /dev/null @@ -1,37 +0,0 @@ -@echo off - -set _outDir=..\out\Release -md "%_outDir%" -del /Q "%_outDir%\Roslynator.CommandLine.*.nupkg" -del /Q "%_outDir%\Roslynator.DotNet.Cli.*.nupkg" - -orang delete "../src" -a d -n "bin,obj" l li e -i "packages,node_modules" l li e ne -t n --content-only -u - -dotnet restore --force "..\src\CommandLine.sln" /p:RoslynatorCommandLine=true - -rd /S /Q "..\src\CommandLine\bin\Release" - -dotnet build "..\src\CommandLine.sln" ^ - /t:Clean,Publish ^ - /p:Configuration=Release,RoslynatorCommandLine=true,Deterministic=true,TreatWarningsAsErrors=true,WarningsNotAsErrors="1591" ^ - /v:normal ^ - /m - -if errorlevel 1 ( - pause - exit -) - -dotnet pack -c Release --no-build -v normal /p:RoslynatorCommandLine=true "..\src\CommandLine\CommandLine.csproj" - -copy "..\src\CommandLine\bin\Release\Roslynator.CommandLine.*.nupkg" "%_outDir%" - -orang delete "../src" -a d -n "bin,obj" l li e -i "packages,node_modules" l li e ne -t n --content-only -u - -dotnet pack "..\src\CommandLine\CommandLine.csproj" -c Release -v normal ^ - /p:RoslynatorDotNetCli=true,Deterministic=true,TreatWarningsAsErrors=true,WarningsNotAsErrors="1591" - -copy "..\src\CommandLine\bin\Release\Roslynator.DotNet.Cli.*.nupkg" "%_outDir%" - -echo OK -pause diff --git a/tools/build_cli.ps1 b/tools/build_cli.ps1 deleted file mode 100644 index ff964c1308..0000000000 --- a/tools/build_cli.ps1 +++ /dev/null @@ -1,31 +0,0 @@ -#dotnet tool install -g orang.dotnet.cli - -$outDir = "../out/Release" - -New-Item -Path $outDir -ItemType directory -Remove-Item "$outDir/Roslynator.CommandLine.*.nupkg" -Remove-Item "$outDir/Roslynator.DotNet.Cli.*.nupkg" -Remove-Item -Path "../src/CommandLine/bin/Release" -Recurse - -orang delete "../src" -a d -n "bin,obj" l li e -i "packages,node_modules" l li e ne -t n --content-only -u -dotnet clean "../src/CommandLine.sln" ` - -dotnet publish "../src/CommandLine.sln" -c Release ` - /p:RoslynatorCommandLine=true,Deterministic=true,TreatWarningsAsErrors=true,WarningsNotAsErrors="1591" ` - /v:normal ` - /m - -dotnet pack -c Release --no-build -v normal /p:RoslynatorCommandLine=true "../src/CommandLine/CommandLine.csproj" - -Copy-Item -Path "../src/CommandLine/bin/Release/Roslynator.CommandLine.*.nupkg" -Destination "$outDir" - -orang delete "../src" -a d -n "bin,obj" l li e -i "packages,node_modules" l li e ne -t n --content-only -u -dotnet clean "../src/CommandLine.sln" - -dotnet pack "../src/CommandLine/CommandLine.csproj" -c Release -v normal ` - /p:RoslynatorDotNetCli=true,Deterministic=true,TreatWarningsAsErrors=true,WarningsNotAsErrors="1591" - -Copy-Item -Path "../src/CommandLine/bin/Release/Roslynator.DotNet.Cli.*.nupkg" -Destination "$outDir" - -Write-Host "DONE" -Read-Host diff --git a/tools/build_cli_debug.cmd b/tools/build_cli_debug.cmd deleted file mode 100644 index 5f5695ce1d..0000000000 --- a/tools/build_cli_debug.cmd +++ /dev/null @@ -1,14 +0,0 @@ -@echo off - -set _programFiles=%ProgramFiles% - -dotnet restore "..\src\CommandLine.sln" - -"%_programFiles%\Microsoft Visual Studio\2022\Enterprise\MSBuild\Current\Bin\MSBuild" "..\src\CommandLine.sln" ^ - /t:Clean,Build ^ - /p:Configuration=Debug ^ - /v:minimal ^ - /m - -echo OK -pause diff --git a/tools/build_cli_debug.ps1 b/tools/build_cli_debug.ps1 new file mode 100644 index 0000000000..250aea94dd --- /dev/null +++ b/tools/build_cli_debug.ps1 @@ -0,0 +1,5 @@ +dotnet clean "../src/CommandLine.sln" ` -c Debug + +dotnet build "../src/CommandLine.sln" -c Debug -v minimal /p:RoslynatorDotNetCli=true /m + +Write-Host "DONE" diff --git a/tools/build_debug.cmd b/tools/build_debug.cmd deleted file mode 100644 index 80b2754b32..0000000000 --- a/tools/build_debug.cmd +++ /dev/null @@ -1,20 +0,0 @@ -@echo off - -set _programFiles=%ProgramFiles% - -set _outDir=..\out\Debug - -"%_programFiles%\Microsoft Visual Studio\2022\Enterprise\MSBuild\Current\Bin\MSBuild" "..\src\VisualStudio.sln" ^ - /t:Clean,Build ^ - /p:Configuration=Debug,RunCodeAnalysis=false,DeployExtension=false ^ - /nr:false ^ - /v:normal ^ - /m - -md "%_outDir%" - -del /Q "%_outDir%\*" - -copy "..\src\VisualStudio\bin\Debug\Roslynator.VisualStudio.vsix" "%_outDir%" - -pause \ No newline at end of file diff --git a/tools/build_testing.cmd b/tools/build_testing.cmd deleted file mode 100644 index a7d03cd65c..0000000000 --- a/tools/build_testing.cmd +++ /dev/null @@ -1,16 +0,0 @@ -@echo off - -dotnet build "..\src\Tests\Tests.sln" -c Release --no-incremental -v n - -if errorlevel 1 ( - pause - exit -) - -dotnet pack -c Release --no-build -v normal "..\src\Tests\Testing.Common\Testing.Common.csproj" -dotnet pack -c Release --no-build -v normal "..\src\Tests\Testing.CSharp\Testing.CSharp.csproj" -dotnet pack -c Release --no-build -v normal "..\src\Tests\Testing.CSharp.Xunit\Testing.CSharp.Xunit.csproj" -dotnet pack -c Release --no-build -v normal "..\src\Tests\Testing.CSharp.MSTest\Testing.CSharp.MSTest.csproj" - -echo OK -pause diff --git a/tools/build_vscode.cmd b/tools/build_vscode.cmd deleted file mode 100644 index 2a5e69a434..0000000000 --- a/tools/build_vscode.cmd +++ /dev/null @@ -1,56 +0,0 @@ -@echo off - -set _version=4.3.0 - -orang replace "..\src\VisualStudioCode\package\package.json" ^ - -c "patterns\vscode_version.txt" from-file -t m r ^ - -r %_version% - -dotnet restore --force "..\src\VisualStudioCode.sln" - -dotnet build "..\src\VisualStudioCode.sln" ^ - /t:Clean,Build ^ - /p:Configuration=Release,Deterministic=true,TreatWarningsAsErrors=true,WarningsNotAsErrors=1591,DefineConstants=VSCODE ^ - /v:normal ^ - /m - -if errorlevel 1 ( - pause - exit -) - -cd ..\src\VisualStudioCode\package - -del /S /Q roslyn\*.dll - -cd roslyn - -md common -md analyzers -md fixes -md refactorings - -copy /Y ..\..\bin\Release\netstandard2.0\Roslynator.Core.dll common -copy /Y ..\..\bin\Release\netstandard2.0\Roslynator.Common.dll common -copy /Y ..\..\bin\Release\netstandard2.0\Roslynator.CSharp.dll common -copy /Y ..\..\bin\Release\netstandard2.0\Roslynator.Workspaces.Core.dll common -copy /Y ..\..\bin\Release\netstandard2.0\Roslynator.Workspaces.Common.dll common -copy /Y ..\..\bin\Release\netstandard2.0\Roslynator.CSharp.Workspaces.dll common -copy /Y ..\..\bin\Release\netstandard2.0\Roslynator.CSharp.Analyzers.dll analyzers -copy /Y ..\..\bin\Release\netstandard2.0\Roslynator.CSharp.Analyzers.CodeFixes.dll analyzers -copy /Y ..\..\bin\Release\netstandard2.0\Roslynator.Formatting.Analyzers.dll analyzers -copy /Y ..\..\bin\Release\netstandard2.0\Roslynator.Formatting.Analyzers.CodeFixes.dll analyzers -copy /Y ..\..\bin\Release\netstandard2.0\Roslynator.CSharp.Refactorings.dll refactorings -copy /Y ..\..\bin\Release\netstandard2.0\Roslynator.CSharp.CodeFixes.dll fixes - -cd .. - -npm install - -echo Package is being created -vsce package -echo Package successfully created - -echo OK - -pause diff --git a/tools/clean_debug.cmd b/tools/clean_debug.cmd deleted file mode 100644 index cb1fdb1779..0000000000 --- a/tools/clean_debug.cmd +++ /dev/null @@ -1,9 +0,0 @@ -@echo off - -set _programFiles=%ProgramFiles% - -"%_programFiles%\Microsoft Visual Studio\2022\Enterprise\MSBuild\Current\Bin\MSBuild" "..\src\Roslynator.sln" ^ - /t:Clean ^ - /p:Configuration=Debug ^ - /v:minimal ^ - /m diff --git a/tools/clean_release.cmd b/tools/clean_release.cmd deleted file mode 100644 index 8444a7e362..0000000000 --- a/tools/clean_release.cmd +++ /dev/null @@ -1,9 +0,0 @@ -@echo off - -set _programFiles=%ProgramFiles% - -"%_programFiles%\Microsoft Visual Studio\2022\Enterprise\MSBuild\Current\Bin\MSBuild" "..\src\Roslynator.sln" ^ - /t:Clean ^ - /p:Configuration=Release ^ - /v:minimal ^ - /m diff --git a/tools/clean_vscode.cmd b/tools/clean_vscode.cmd deleted file mode 100644 index 1ff60db7b7..0000000000 --- a/tools/clean_vscode.cmd +++ /dev/null @@ -1,12 +0,0 @@ -@echo off - -cd ..\src\VisualStudioCode\package - -del /S /Q roslyn\*.dll - -del /S /Q roslynator-*.vsix - -if errorlevel 1 ( - pause - exit -) diff --git a/tools/cli_add_file_banner.ps1 b/tools/cli_add_file_banner.ps1 index b576847b6f..6d280eace7 100644 --- a/tools/cli_add_file_banner.ps1 +++ b/tools/cli_add_file_banner.ps1 @@ -1,8 +1,8 @@ #dotnet tool install -g roslynator.dotnet.cli -dotnet build "..\src\CommandLine.sln" /p:Configuration=Debug /v:m /m +dotnet build "../src/CommandLine.sln" /p:Configuration=Debug /v:m /m -roslynator fix "..\src\Roslynator.sln" ` +roslynator fix "../src/Roslynator.sln" ` --verbosity d ` --file-log "roslynator.log" ` --file-log-verbosity diag ` diff --git a/tools/cli_analyze.ps1 b/tools/cli_analyze.ps1 index 39976101d8..96b365bd35 100644 --- a/tools/cli_analyze.ps1 +++ b/tools/cli_analyze.ps1 @@ -1,12 +1,12 @@ #dotnet tool install -g roslynator.dotnet.cli -dotnet build "..\src\CommandLine.sln" /p:Configuration=Debug /v:m /m +dotnet build "../src/CommandLine.sln" /p:Configuration=Debug /v:m /m -roslynator analyze "..\src\Roslynator.sln" ` +roslynator analyze "../src/Roslynator.sln" ` --analyzer-assemblies ` - "..\src\Analyzers.CodeFixes\bin\Debug\netstandard2.0\Roslynator.CSharp.Analyzers.dll" ` - "..\src\CodeAnalysis.Analyzers.CodeFixes\bin\Debug\netstandard2.0\Roslynator.CodeAnalysis.Analyzers.dll" ` - "..\src\Formatting.Analyzers.CodeFixes\bin\Debug\netstandard2.0\Roslynator.Formatting.Analyzers.dll" ` + "../src/Analyzers.CodeFixes/bin/Debug/netstandard2.0/Roslynator.CSharp.Analyzers.dll" ` + "../src/CodeAnalysis.Analyzers.CodeFixes/bin/Debug/netstandard2.0/Roslynator.CodeAnalysis.Analyzers.dll" ` + "../src/Formatting.Analyzers.CodeFixes/bin/Debug/netstandard2.0/Roslynator.Formatting.Analyzers.dll" ` --ignore-analyzer-references ` --ignored-diagnostics CS1591 ` --severity-level info ` diff --git a/tools/cli_fix.ps1 b/tools/cli_fix.ps1 index 4d378efde0..7a2afa1a4d 100644 --- a/tools/cli_fix.ps1 +++ b/tools/cli_fix.ps1 @@ -3,20 +3,20 @@ $visualStudioPath = Get-VSSetupInstance -All | Select-VSSetupInstance -Require 'Microsoft.VisualStudio.Workload.ManagedDesktop' -Latest | Select-Object -ExpandProperty "InstallationPath" -dotnet build "..\src\CommandLine.sln" /p:Configuration=Debug /v:m /m +dotnet build "../src/CommandLine.sln" /p:Configuration=Debug /v:m /m -roslynator fix "..\src\Roslynator.sln" ` +roslynator fix "../src/Roslynator.sln" ` --analyzer-assemblies ` - "..\src\Analyzers.CodeFixes\bin\Debug\netstandard2.0\Roslynator.CSharp.Analyzers.dll" ` - "..\src\Analyzers.CodeFixes\bin\Debug\netstandard2.0\Roslynator.CSharp.Analyzers.CodeFixes.dll" ` - "..\src\CodeAnalysis.Analyzers.CodeFixes\bin\Debug\netstandard2.0\Roslynator.CodeAnalysis.Analyzers.dll" ` - "..\src\CodeAnalysis.Analyzers.CodeFixes\bin\Debug\netstandard2.0\Roslynator.CodeAnalysis.Analyzers.CodeFixes.dll" ` - "..\src\Formatting.Analyzers.CodeFixes\bin\Debug\netstandard2.0\Roslynator.Formatting.Analyzers.dll" ` - "..\src\Formatting.Analyzers.CodeFixes\bin\Debug\netstandard2.0\Roslynator.Formatting.Analyzers.CodeFixes.dll" ` - "$visualStudioPath\Common7\IDE\CommonExtensions\Microsoft\VBCSharp\LanguageServices\Microsoft.CodeAnalysis.CSharp.EditorFeatures.dll" ` - "$visualStudioPath\Common7\IDE\CommonExtensions\Microsoft\VBCSharp\LanguageServices\Microsoft.CodeAnalysis.CSharp.Features.dll" ` - "$visualStudioPath\Common7\IDE\CommonExtensions\Microsoft\VBCSharp\LanguageServices\Microsoft.CodeAnalysis.EditorFeatures.dll" ` - "$visualStudioPath\Common7\IDE\CommonExtensions\Microsoft\VBCSharp\LanguageServices\Microsoft.CodeAnalysis.Features.dll" ` + "../src/Analyzers.CodeFixes/bin/Debug/netstandard2.0/Roslynator.CSharp.Analyzers.dll" ` + "../src/Analyzers.CodeFixes/bin/Debug/netstandard2.0/Roslynator.CSharp.Analyzers.CodeFixes.dll" ` + "../src/CodeAnalysis.Analyzers.CodeFixes/bin/Debug/netstandard2.0/Roslynator.CodeAnalysis.Analyzers.dll" ` + "../src/CodeAnalysis.Analyzers.CodeFixes/bin/Debug/netstandard2.0/Roslynator.CodeAnalysis.Analyzers.CodeFixes.dll" ` + "../src/Formatting.Analyzers.CodeFixes/bin/Debug/netstandard2.0/Roslynator.Formatting.Analyzers.dll" ` + "../src/Formatting.Analyzers.CodeFixes/bin/Debug/netstandard2.0/Roslynator.Formatting.Analyzers.CodeFixes.dll" ` + "$visualStudioPath/Common7/IDE/CommonExtensions/Microsoft/VBCSharp/LanguageServices/Microsoft.CodeAnalysis.CSharp.EditorFeatures.dll" ` + "$visualStudioPath/Common7/IDE/CommonExtensions/Microsoft/VBCSharp/LanguageServices/Microsoft.CodeAnalysis.CSharp.Features.dll" ` + "$visualStudioPath/Common7/IDE/CommonExtensions/Microsoft/VBCSharp/LanguageServices/Microsoft.CodeAnalysis.EditorFeatures.dll" ` + "$visualStudioPath/Common7/IDE/CommonExtensions/Microsoft/VBCSharp/LanguageServices/Microsoft.CodeAnalysis.Features.dll" ` --format ` --verbosity d ` --file-log "roslynator.log" ` diff --git a/tools/cli_format.ps1 b/tools/cli_format.ps1 index 7cc0c9b8ff..9d753b5dd2 100644 --- a/tools/cli_format.ps1 +++ b/tools/cli_format.ps1 @@ -1,8 +1,8 @@ #dotnet tool install -g roslynator.dotnet.cli -dotnet build "..\src\CommandLine.sln" /p:Configuration=Debug /v:m /m +dotnet build "../src/CommandLine.sln" /p:Configuration=Debug /v:m /m -roslynator format "..\src\Roslynator.sln" ` +roslynator format "../src/Roslynator.sln" ` --verbosity d ` --file-log "roslynator.log" ` --file-log-verbosity diag ` diff --git a/tools/cli_lloc.ps1 b/tools/cli_lloc.ps1 index 3c96dfb48d..c9e8c9dbd6 100644 --- a/tools/cli_lloc.ps1 +++ b/tools/cli_lloc.ps1 @@ -1,8 +1,8 @@ #dotnet tool install -g roslynator.dotnet.cli -dotnet build "..\src\CommandLine.sln" /p:Configuration=Debug /v:m /m +dotnet build "../src/CommandLine.sln" /p:Configuration=Debug /v:m /m -roslynator lloc "..\src\Roslynator.sln" ` +roslynator lloc "../src/Roslynator.sln" ` --verbosity d ` --file-log "roslynator.log" ` --file-log-verbosity diag diff --git a/tools/cli_loc.ps1 b/tools/cli_loc.ps1 index 8a9a181a72..df414b812a 100644 --- a/tools/cli_loc.ps1 +++ b/tools/cli_loc.ps1 @@ -1,8 +1,8 @@ #dotnet tool install -g roslynator.dotnet.cli -dotnet build "..\src\CommandLine.sln" /p:Configuration=Debug /v:m /m +dotnet build "../src/CommandLine.sln" /p:Configuration=Debug /v:m /m -roslynator loc "..\src\Roslynator.sln" ` +roslynator loc "../src/Roslynator.sln" ` --ignore-block-boundary ` --verbosity d ` --file-log "roslynator.log" ` diff --git a/tools/copy_spelling_from_orang.cmd b/tools/copy_spelling_from_orang.cmd deleted file mode 100644 index 9f446d2b50..0000000000 --- a/tools/copy_spelling_from_orang.cmd +++ /dev/null @@ -1,29 +0,0 @@ -@echo off - -set _spellingPath="..\src\Workspaces.Core\Spelling\Core" - -orang delete %_spellingPath% -e cs - -orang copy "..\..\Orang\src\Spelling\Spelling" --target %_spellingPath% -e cs - -orang replace %_spellingPath% -e cs -c "public(?= ((((static|sealed|abstract) )?class)|((readonly )?struct)|enum))" w -r "internal" - -orang replace %_spellingPath% -e cs -c "namespace Orang.Spelling" w l -r "namespace Roslynator.Spelling" - -orang replace %_spellingPath% -e cs -c "[NotNullWhen(true)] " l -t m - -orang replace %_spellingPath% -e cs -c "\[(?[\w\.]+)\.\.\]" -r ".Substring(${x})" - -orang replace %_spellingPath% -e cs -c "\[(?[\w\.]+)\.\.(?[\w\.]+)\]" -r ".Substring(${x}, ${y} - ${x})" - -orang replace %_spellingPath% -e cs -c " : ICapture" l -t m - -orang replace %_spellingPath% -n WordList.cs e -c "StringComparer.FromComparison" l -r "StringComparerUtility.FromComparison" - -orang replace %_spellingPath% -n WordChar.cs e -c "HashCode." l -r "Hash." - -orang replace %_spellingPath% -e cs ^ - -c "// Copyright (c) Josef Pihrt and Contributors. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information." l ^ - -r "// This code is originally from https://github.com/josefpihrt/orang. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information." - -pause \ No newline at end of file diff --git a/tools/copy_spelling_from_orang.ps1 b/tools/copy_spelling_from_orang.ps1 new file mode 100644 index 0000000000..aa70c5a05d --- /dev/null +++ b/tools/copy_spelling_from_orang.ps1 @@ -0,0 +1,27 @@ +$spellingPath="../src/Workspaces.Core/Spelling/Core" + +orang delete $spellingPath -e cs + +orang copy "../../Orang/src/Spelling/Spelling" --target $spellingPath -e cs + +orang replace $spellingPath -e cs -c "public(?= ((((static|sealed|abstract) )?class)|((readonly )?struct)|enum))" w -r "internal" + +orang replace $spellingPath -e cs -c "namespace Orang.Spelling" w l -r "namespace Roslynator.Spelling" + +orang replace $spellingPath -e cs -c "[NotNullWhen(true)] " l -t m + +orang replace $spellingPath -e cs -c "/[(?[/w/.]+)/././]" -r ".Substring(${x})" + +orang replace $spellingPath -e cs -c "/[(?[/w/.]+)/./.(?[/w/.]+)/]" -r ".Substring(${x}, ${y} - ${x})" + +orang replace $spellingPath -e cs -c " : ICapture" l -t m + +orang replace $spellingPath -n WordList.cs e -c "StringComparer.FromComparison" l -r "StringComparerUtility.FromComparison" + +orang replace $spellingPath -n WordChar.cs e -c "HashCode." l -r "Hash." + +orang replace $spellingPath -e cs ` + -c "// Copyright (c) Josef Pihrt and Contributors. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information." l ` + -r "// This code is originally from https://github.com/josefpihrt/orang. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information." + +Write-Host DONE \ No newline at end of file diff --git a/tools/generate_all.ps1 b/tools/generate_all.ps1 new file mode 100644 index 0000000000..6adbef24a5 --- /dev/null +++ b/tools/generate_all.ps1 @@ -0,0 +1,4 @@ +./generate_code.ps1 +./generate_metadata.ps1 +./generate_cli_docs.ps1 +./generate_ref_docs.ps1 diff --git a/tools/generate_cli_docs.ps1 b/tools/generate_cli_docs.ps1 new file mode 100644 index 0000000000..a70e6f878b --- /dev/null +++ b/tools/generate_cli_docs.ps1 @@ -0,0 +1,11 @@ +dotnet restore "../src/CommandLine.DocumentationGenerator/CommandLine.DocumentationGenerator.csproj" + +dotnet build "../src/CommandLine.DocumentationGenerator/CommandLine.DocumentationGenerator.csproj" -c Release -v minimal ` + /p:Deterministic=true,TreatWarningsAsErrors=true,WarningsNotAsErrors="1591,RS1024" ` + + if(!$?) { Read-Host; Exit } + +& "../src/CommandLine.DocumentationGenerator/bin/Release/net7.0/Roslynator.CommandLine.DocumentationGenerator.exe" ` + "../docs/cli" ` + "../src/CommandLine.DocumentationGenerator/data" ` + "help,migrate" diff --git a/tools/generate_cli_documentation.cmd b/tools/generate_cli_documentation.cmd deleted file mode 100644 index 27beb1d24f..0000000000 --- a/tools/generate_cli_documentation.cmd +++ /dev/null @@ -1,22 +0,0 @@ -@echo off - -dotnet restore "..\src\CommandLine.DocumentationGenerator\CommandLine.DocumentationGenerator.csproj" - -dotnet build "..\src\CommandLine.DocumentationGenerator\CommandLine.DocumentationGenerator.csproj" ^ - /p:Configuration=Release,Deterministic=true,TreatWarningsAsErrors=true,WarningsNotAsErrors=1591 ^ - /v:minimal - -if errorlevel 1 ( - pause - exit -) - -"..\src\CommandLine.DocumentationGenerator\bin\Release\net7.0\Roslynator.CommandLine.DocumentationGenerator.exe" "..\docs\cli" - -if errorlevel 1 ( - pause - exit -) - -echo OK -pause diff --git a/tools/generate_cli_documentation_debug.cmd b/tools/generate_cli_documentation_debug.cmd deleted file mode 100644 index d58387d33a..0000000000 --- a/tools/generate_cli_documentation_debug.cmd +++ /dev/null @@ -1,27 +0,0 @@ -@echo off - -set _programFiles=%ProgramFiles% - -set _msbuildPath="%_programFiles%\Microsoft Visual Studio\2022\Enterprise\MSBuild\Current\Bin\MSBuild" -set _properties=Configuration=Debug,Deterministic=true - -%_msbuildPath% "..\src\CommandLine.DocumentationGenerator\CommandLine.DocumentationGenerator.csproj" ^ - /t:Build ^ - /p:%_properties% ^ - /v:minimal ^ - /m - -if errorlevel 1 ( - pause - exit -) - -"..\src\CommandLine.DocumentationGenerator\bin\Debug\net5.0\Roslynator.CommandLine.DocumentationGenerator.exe" "..\docs\cli" - -if errorlevel 1 ( - pause - exit -) - -echo OK -pause diff --git a/tools/generate_code.cmd b/tools/generate_code.cmd deleted file mode 100644 index 1f714af23b..0000000000 --- a/tools/generate_code.cmd +++ /dev/null @@ -1,13 +0,0 @@ -@echo off - -set _programFiles=%ProgramFiles% - -"%_programFiles%\Microsoft Visual Studio\2022\Enterprise\MSBuild\Current\Bin\MSBuild" "..\src\Tools\Tools.sln" ^ - /t:Build ^ - /p:Configuration=Debug,RunCodeAnalysis=false ^ - /v:minimal ^ - /m - -dotnet "..\src\Tools\CodeGenerator\bin\Debug\netcoreapp3.1\Roslynator.CodeGenerator.dll" "..\src" - -pause diff --git a/tools/generate_code.ps1 b/tools/generate_code.ps1 new file mode 100644 index 0000000000..806de0ce30 --- /dev/null +++ b/tools/generate_code.ps1 @@ -0,0 +1,8 @@ +$properties="Configuration=Release,Deterministic=true,TreatWarningsAsErrors=true,WarningsNotAsErrors=1591" + +dotnet restore "../src/Tools/Tools.sln" --force +dotnet build "../src/Tools/Tools.sln" --no-restore /p:$properties /m + +if(!$?) { Read-Host; Exit } + +dotnet "../src/Tools/CodeGenerator/bin/Release/netcoreapp3.1/Roslynator.CodeGenerator.dll" "../src" diff --git a/tools/generate_documentation.cmd b/tools/generate_documentation.cmd deleted file mode 100644 index bbde0688d0..0000000000 --- a/tools/generate_documentation.cmd +++ /dev/null @@ -1,64 +0,0 @@ -@echo off - -set _programFiles=%ProgramFiles% - -set _roslynatorExe="..\src\CommandLine\bin\Debug\net7.0\roslynator" -set _msbuildProperties="Configuration=Release" -set _rootDirectoryUrl="../../docs/api/" - -dotnet build "..\src\CommandLine.sln" /t:Clean,Build /p:Configuration=Debug /v:m /m - -%_roslynatorExe% generate-doc "..\src\Core.sln" ^ - --properties %_msbuildProperties% ^ - -o "..\docs\api" ^ - --host github ^ - --heading "Roslynator API Reference" - -%_roslynatorExe% list-symbols "..\src\Core.sln" ^ - --properties %_msbuildProperties% ^ - --visibility public ^ - --depth member ^ - --ignored-parts containing-namespace assembly-attributes ^ - --output "..\docs\api.txt" - -%_roslynatorExe% generate-doc-root "..\src\Core.sln" ^ - --properties %_msbuildProperties% ^ - --projects Core ^ - -o "..\src\Core\README.md" ^ - --host github ^ - --heading "Roslynator.Core" ^ - --root-directory-url %_rootDirectoryUrl% - -%_roslynatorExe% generate-doc-root "..\src\Core.sln" ^ - --properties %_msbuildProperties% ^ - --projects CSharp ^ - -o "..\src\CSharp\README.md" ^ - --host github ^ - --heading "Roslynator.CSharp" ^ - --root-directory-url %_rootDirectoryUrl% - -%_roslynatorExe% generate-doc-root "..\src\Core.sln" ^ - --properties %_msbuildProperties% ^ - --projects Workspaces.Core ^ - -o "..\src\Workspaces.Core\README.md" ^ - --host github ^ - --heading "Roslynator.CSharp.Workspaces" ^ - --root-directory-url %_rootDirectoryUrl% - -%_roslynatorExe% generate-doc-root "..\src\Core.sln" ^ - --properties %_msbuildProperties% ^ - --projects CSharp.Workspaces ^ - -o "..\src\CSharp.Workspaces\README.md" ^ - --host github ^ - --heading "Roslynator.CSharp.Workspaces" ^ - --root-directory-url %_rootDirectoryUrl% - -%_roslynatorExe% generate-doc-root "..\src\Core.sln" ^ - --properties %_msbuildProperties% ^ - --projects Testing.Common Testing.CSharp Testing.CSharp.Xunit Testing.CSharp.MSTest ^ - -o "..\src\Tests\README.md" ^ - --host github ^ - --heading "Roslynator Testing Framework" ^ - --root-directory-url %_rootDirectoryUrl% - -pause diff --git a/tools/generate_metadata.cmd b/tools/generate_metadata.cmd deleted file mode 100644 index 2e0be7f571..0000000000 --- a/tools/generate_metadata.cmd +++ /dev/null @@ -1,13 +0,0 @@ -@echo off - -set _programFiles=%ProgramFiles% - -"%_programFiles%\Microsoft Visual Studio\2022\Enterprise\MSBuild\Current\Bin\MSBuild" "..\src\Tools\Tools.sln" ^ - /t:Build ^ - /p:Configuration=Debug,RunCodeAnalysis=false ^ - /v:minimal ^ - /m - -"..\src\Tools\MetadataGenerator\bin\Debug\net48\Roslynator.MetadataGenerator.exe" "..\src" - -pause diff --git a/tools/generate_metadata.ps1 b/tools/generate_metadata.ps1 new file mode 100644 index 0000000000..3e01651765 --- /dev/null +++ b/tools/generate_metadata.ps1 @@ -0,0 +1,8 @@ +$properties="Configuration=Release,Deterministic=true,TreatWarningsAsErrors=true,WarningsNotAsErrors=1591" + +dotnet restore "../src/Tools/Tools.sln" --force +dotnet build "../src/Tools/Tools.sln" --no-restore /p:$properties /m + +if(!$?) { Read-Host; Exit } + +& "../src/Tools/MetadataGenerator/bin/Release/net7.0/Roslynator.MetadataGenerator.exe" "../src" diff --git a/tools/generate_ref_docs.ps1 b/tools/generate_ref_docs.ps1 new file mode 100644 index 0000000000..9447de7bd3 --- /dev/null +++ b/tools/generate_ref_docs.ps1 @@ -0,0 +1,58 @@ +$roslynatorExe="../src/CommandLine/bin/Debug/net7.0/roslynator" +$rootDirectoryUrl="../../docs/api/" + +dotnet restore "../src/CommandLine.sln" -v minimal /m +dotnet build "../src/CommandLine.sln" --no-restore -c Debug -v minimal /m + +& $roslynatorExe generate-doc generate_ref_docs.sln ` + --properties Configuration=Release ` + -o "../docs/api" ` + --host github ` + --heading "Roslynator API Reference" + +& $roslynatorExe list-symbols generate_ref_docs.sln ` + --properties Configuration=Release ` + --visibility public ` + --depth member ` + --ignored-parts containing-namespace assembly-attributes ` + --output "../docs/api.txt" + +& $roslynatorExe generate-doc-root generate_ref_docs.sln ` + --properties Configuration=Release ` + --projects Core ` + -o "../src/Core/README.md" ` + --host github ` + --heading "Roslynator.Core" ` + --root-directory-url $rootDirectoryUrl + +& $roslynatorExe generate-doc-root generate_ref_docs.sln ` + --properties Configuration=Release ` + --projects CSharp ` + -o "../src/CSharp/README.md" ` + --host github ` + --heading "Roslynator.CSharp" ` + --root-directory-url $rootDirectoryUrl + +& $roslynatorExe generate-doc-root generate_ref_docs.sln ` + --properties Configuration=Release ` + --projects Workspaces.Core ` + -o "../src/Workspaces.Core/README.md" ` + --host github ` + --heading "Roslynator.CSharp.Workspaces" ` + --root-directory-url $rootDirectoryUrl + +& $roslynatorExe generate-doc-root generate_ref_docs.sln ` + --properties Configuration=Release ` + --projects CSharp.Workspaces ` + -o "../src/CSharp.Workspaces/README.md" ` + --host github ` + --heading "Roslynator.CSharp.Workspaces" ` + --root-directory-url $rootDirectoryUrl + +& $roslynatorExe generate-doc-root generate_ref_docs.sln ` + --properties Configuration=Release ` + --projects Testing.Common Testing.CSharp Testing.CSharp.Xunit Testing.CSharp.MSTest ` + -o "../src/Tests/README.md" ` + --host github ` + --heading "Roslynator Testing Framework" ` + --root-directory-url $rootDirectoryUrl diff --git a/src/Core.sln b/tools/generate_ref_docs.sln similarity index 69% rename from src/Core.sln rename to tools/generate_ref_docs.sln index 9bef229a17..b10a1cc085 100644 --- a/src/Core.sln +++ b/tools/generate_ref_docs.sln @@ -2,28 +2,21 @@ Microsoft Visual Studio Solution File, Format Version 12.00 # Visual Studio Version 17 VisualStudioVersion = 17.3.33027.108 MinimumVisualStudioVersion = 10.0.40219.1 -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{228E25E1-FDE6-40C1-98AF-8E636D174D94}" - ProjectSection(SolutionItems) = preProject - global.ruleset = global.ruleset - EndProjectSection +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "CSharp", "..\src\CSharp\CSharp.csproj", "{34A3E42E-2254-4EE7-A152-EEDB18E3D7E3}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "CSharp", "CSharp\CSharp.csproj", "{34A3E42E-2254-4EE7-A152-EEDB18E3D7E3}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "CSharp.Workspaces", "..\src\CSharp.Workspaces\CSharp.Workspaces.csproj", "{56DA29A3-C179-471C-9941-42426EEB84D0}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "CSharp.Workspaces", "CSharp.Workspaces\CSharp.Workspaces.csproj", "{56DA29A3-C179-471C-9941-42426EEB84D0}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Core", "..\src\Core\Core.csproj", "{8783ECCC-696E-435A-8F60-98FC23920289}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Core", "Core\Core.csproj", "{8783ECCC-696E-435A-8F60-98FC23920289}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Workspaces.Core", "..\src\Workspaces.Core\Workspaces.Core.csproj", "{A6AA72AA-5313-4718-AEFE-3D2E68B9145B}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Workspaces.Core", "Workspaces.Core\Workspaces.Core.csproj", "{A6AA72AA-5313-4718-AEFE-3D2E68B9145B}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Testing.Common", "..\src\Tests\Testing.Common\Testing.Common.csproj", "{4B793EFF-2DF6-44DF-AF71-C94422E310D4}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Testing.Common", "Tests\Testing.Common\Testing.Common.csproj", "{4B793EFF-2DF6-44DF-AF71-C94422E310D4}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Testing.CSharp", "..\src\Tests\Testing.CSharp\Testing.CSharp.csproj", "{F61EB339-5B02-4AD7-A3C7-BF80B8F00F95}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Testing.CSharp", "Tests\Testing.CSharp\Testing.CSharp.csproj", "{F61EB339-5B02-4AD7-A3C7-BF80B8F00F95}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Testing.CSharp.Xunit", "..\src\Tests\Testing.CSharp.Xunit\Testing.CSharp.Xunit.csproj", "{D4823929-83FD-46FF-986F-87457550F4CF}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Testing.CSharp.Xunit", "Tests\Testing.CSharp.Xunit\Testing.CSharp.Xunit.csproj", "{D4823929-83FD-46FF-986F-87457550F4CF}" -EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Testing", "Testing", "{EB3BBB7E-3C50-4C99-B644-54E79B9D9057}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Testing.CSharp.MSTest", "Tests\Testing.CSharp.MSTest\Testing.CSharp.MSTest.csproj", "{E3B53E76-EFCF-4D93-B015-06FE4697AE4E}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Testing.CSharp.MSTest", "..\src\Tests\Testing.CSharp.MSTest\Testing.CSharp.MSTest.csproj", "{E3B53E76-EFCF-4D93-B015-06FE4697AE4E}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution @@ -67,12 +60,6 @@ Global GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE EndGlobalSection - GlobalSection(NestedProjects) = preSolution - {4B793EFF-2DF6-44DF-AF71-C94422E310D4} = {EB3BBB7E-3C50-4C99-B644-54E79B9D9057} - {F61EB339-5B02-4AD7-A3C7-BF80B8F00F95} = {EB3BBB7E-3C50-4C99-B644-54E79B9D9057} - {D4823929-83FD-46FF-986F-87457550F4CF} = {EB3BBB7E-3C50-4C99-B644-54E79B9D9057} - {E3B53E76-EFCF-4D93-B015-06FE4697AE4E} = {EB3BBB7E-3C50-4C99-B644-54E79B9D9057} - EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution SolutionGuid = {D1943010-8F47-4798-9A3D-97BC24CF1AC4} EndGlobalSection diff --git a/tools/generate_test_files.cmd b/tools/generate_test_files.cmd deleted file mode 100644 index 5e7de882c3..0000000000 --- a/tools/generate_test_files.cmd +++ /dev/null @@ -1,7 +0,0 @@ -@echo off - -set /p _ids=Enter ID(s): - -dotnet "..\src\Tools\TestCodeGenerator\bin\Debug\netcoreapp3.1\TestCodeGenerator.dll" "..\src" %_ids% - -pause diff --git a/tools/list_syntax_node_hierarchy.cmd b/tools/list_syntax_node_hierarchy.cmd deleted file mode 100644 index fa246d57b2..0000000000 --- a/tools/list_syntax_node_hierarchy.cmd +++ /dev/null @@ -1,22 +0,0 @@ -@echo off - -set _programFiles=%ProgramFiles% - -set _msbuildPath="%_programFiles%\Microsoft Visual Studio\2022\Enterprise\MSBuild\Current\Bin" - -%_msbuildPath%\msbuild "..\src\CommandLine.sln" /t:Build /p:Configuration=Debug /v:m /m - -"..\src\CommandLine\bin\Debug\net48\roslynator" list-symbols "..\src\CommandLine\CommandLine.csproj" ^ - -m %_msbuildPath% ^ - --depth type ^ - --visibility public ^ - --external-assemblies Microsoft.CodeAnalysis.dll Microsoft.CodeAnalysis.CSharp.dll ^ - --hierarchy-root Microsoft.CodeAnalysis.SyntaxNode ^ - --layout type-hierarchy ^ - --ignored-parts assemblies containing-namespace-in-type-hierarchy assembly-attributes accessibility base-type constraints ^ - --output syntax_node.txt ^ - --verbosity d ^ - --file-log "roslynator.log" ^ - --file-log-verbosity diag - -pause diff --git a/tools/list_syntax_node_hierarchy.ps1 b/tools/list_syntax_node_hierarchy.ps1 new file mode 100644 index 0000000000..7b8244d190 --- /dev/null +++ b/tools/list_syntax_node_hierarchy.ps1 @@ -0,0 +1,13 @@ +dotnet build "../src/CommandLine.sln" -c Debug -v minimal /m + +roslynator list-symbols "../src/CommandLine/CommandLine.csproj" ` + --depth type ` + --visibility public ` + --external-assemblies Microsoft.CodeAnalysis.dll Microsoft.CodeAnalysis.CSharp.dll ` + --hierarchy-root Microsoft.CodeAnalysis.SyntaxNode ` + --layout type-hierarchy ` + --ignored-parts assemblies containing-namespace-in-type-hierarchy assembly-attributes accessibility base-type constraints ` + --output syntax_node.txt ` + --verbosity d ` + --file-log "roslynator.log" ` + --file-log-verbosity diag diff --git a/tools/nuget_push.cmd b/tools/nuget_push.cmd deleted file mode 100644 index 4554f6d8d4..0000000000 --- a/tools/nuget_push.cmd +++ /dev/null @@ -1,24 +0,0 @@ -@echo off - -set /p _apiKey=Enter API key: -set _nugetSource=https://api.nuget.org/v3/index.json - -dotnet nuget push "..\out\release\Roslynator.Core.*.nupkg" --source %_nugetSource% --api-key %_apiKey% -dotnet nuget push "..\out\release\Roslynator.CSharp.*.nupkg" --source %_nugetSource% --api-key %_apiKey% -dotnet nuget push "..\out\release\Roslynator.Workspaces.Core.*.nupkg" --source %_nugetSource% --api-key %_apiKey% -dotnet nuget push "..\out\release\Roslynator.CSharp.Workspaces.*.nupkg" --source %_nugetSource% --api-key %_apiKey% - -dotnet nuget push "..\out\release\Roslynator.Testing.Common.*.nupkg" --source %_nugetSource% --api-key %_apiKey% -dotnet nuget push "..\out\release\Roslynator.Testing.CSharp.*.nupkg" --source %_nugetSource% --api-key %_apiKey% -dotnet nuget push "..\out\release\Roslynator.Testing.CSharp.Xunit.*.nupkg" --source %_nugetSource% --api-key %_apiKey% -dotnet nuget push "..\out\release\Roslynator.Testing.CSharp.MSTest.*.nupkg" --source %_nugetSource% --api-key %_apiKey% - -dotnet nuget push "..\out\release\Roslynator.Analyzers.*.nupkg" --source %_nugetSource% --api-key %_apiKey% -dotnet nuget push "..\out\release\Roslynator.Formatting.Analyzers.*.nupkg" --source %_nugetSource% --api-key %_apiKey% -dotnet nuget push "..\out\release\Roslynator.CodeAnalysis.Analyzers.*.nupkg" --source %_nugetSource% --api-key %_apiKey% - -dotnet nuget push "..\out\release\Roslynator.CommandLine.*.nupkg" --source %_nugetSource% --api-key %_apiKey% -dotnet nuget push "..\out\release\Roslynator.DotNet.Cli.*.nupkg" --source %_nugetSource% --api-key %_apiKey% - -pause - diff --git a/tools/nuget_push.ps1 b/tools/nuget_push.ps1 new file mode 100644 index 0000000000..2892847b82 --- /dev/null +++ b/tools/nuget_push.ps1 @@ -0,0 +1,21 @@ +$apiKey = Read-Host -Prompt "Enter API key" +$nugetSource = https://api.nuget.org/v3/index.json + +dotnet nuget push "../out/release/Roslynator.Core.*.nupkg" --source $nugetSource --api-key $apiKey +dotnet nuget push "../out/release/Roslynator.CSharp.*.nupkg" --source $nugetSource --api-key $apiKey +dotnet nuget push "../out/release/Roslynator.Workspaces.Core.*.nupkg" --source $nugetSource --api-key $apiKey +dotnet nuget push "../out/release/Roslynator.CSharp.Workspaces.*.nupkg" --source $nugetSource --api-key $apiKey + +dotnet nuget push "../out/release/Roslynator.Testing.Common.*.nupkg" --source $nugetSource --api-key $apiKey +dotnet nuget push "../out/release/Roslynator.Testing.CSharp.*.nupkg" --source $nugetSource --api-key $apiKey +dotnet nuget push "../out/release/Roslynator.Testing.CSharp.Xunit.*.nupkg" --source $nugetSource --api-key $apiKey +dotnet nuget push "../out/release/Roslynator.Testing.CSharp.MSTest.*.nupkg" --source $nugetSource --api-key $apiKey + +dotnet nuget push "../out/release/Roslynator.Analyzers.*.nupkg" --source $nugetSource --api-key $apiKey +dotnet nuget push "../out/release/Roslynator.Formatting.Analyzers.*.nupkg" --source $nugetSource --api-key $apiKey +dotnet nuget push "../out/release/Roslynator.CodeAnalysis.Analyzers.*.nupkg" --source $nugetSource --api-key $apiKey + +dotnet nuget push "../out/release/Roslynator.CommandLine.*.nupkg" --source $nugetSource --api-key $apiKey +dotnet nuget push "../out/release/Roslynator.DotNet.Cli.*.nupkg" --source $nugetSource --api-key $apiKey + +Write-Host DONE diff --git a/tools/patterns/assembly_info_version.txt b/tools/patterns/assembly_info_version.txt deleted file mode 100644 index de67c64677..0000000000 --- a/tools/patterns/assembly_info_version.txt +++ /dev/null @@ -1,4 +0,0 @@ -(?x) -(?<=\[assembly:\ AssemblyVersion\(") -\d+\.\d+\.\d+\.\d+ -(?="\)]) diff --git a/tools/patterns/assembly_names_to_be_prefixed.txt b/tools/patterns/assembly_names_to_be_prefixed.txt deleted file mode 100644 index b5ac677a84..0000000000 --- a/tools/patterns/assembly_names_to_be_prefixed.txt +++ /dev/null @@ -1,30 +0,0 @@ -(?x) -(?<= - assembly:\ InternalsVisibleTo\(" -) -( - Roslynator_Cli_ - | - Roslynator_Analyzers_ - | - Roslynator_CodeAnalysis_Analyzers_ - | - Roslynator_Formatting_Analyzers_ -)? -(?= - Roslynator\. - ( - Core - | - Common - | - CSharp(\.Workspaces)? - | - VisualBasic(\.Workspaces)? - | - Workspaces\.(Core|Common) - | - Documentation - ) - , -) diff --git a/tools/patterns/vscode_version.txt b/tools/patterns/vscode_version.txt deleted file mode 100644 index 67b1c84c82..0000000000 --- a/tools/patterns/vscode_version.txt +++ /dev/null @@ -1,4 +0,0 @@ -(?x) -(?<="version":\ ") -\d+\.\d+\.\d+ -(?=") \ No newline at end of file diff --git a/tools/patterns/vsix_manifest_version.txt b/tools/patterns/vsix_manifest_version.txt deleted file mode 100644 index 4c83c467ac..0000000000 --- a/tools/patterns/vsix_manifest_version.txt +++ /dev/null @@ -1,4 +0,0 @@ -(?x) -(?<=