diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index b63a2fc717..5fc74cf50e 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -198,6 +198,28 @@ jobs: pattern: vs_extension_* delete-merged: true + build_vs_extension_with_analyzers: + 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 + RoslynatorExtensionWithAnalyzers: true + defaults: + run: + working-directory: src/VisualStudio + steps: + - uses: actions/checkout@v4 + - run: (Get-Content source.extension-with-analyzers.vsixmanifest) -replace 'Version="1.0.0"', 'Version="${{ needs.pre_build.outputs.version3 }}"' | Set-Content source.extension-with-analyzers.vsixmanifest + - run: dotnet restore + - uses: microsoft/setup-msbuild@v2 + - run: msbuild -m + - uses: actions/upload-artifact@v4 + with: + name: vs_extension_with_analyzers + path: src/VisualStudio/bin/Release/net472/*.vsix + build_vs_code_extension: if: github.ref_type != 'tag' || startsWith(github.ref_name, 'v') needs: [ pre_build, build_analyzers ] @@ -221,10 +243,6 @@ jobs: 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 @@ -248,6 +266,46 @@ jobs: name: ovsx_extension path: src/VisualStudioCode/package/*.vsix + build_vs_code_extension_with_analyzers: + if: github.ref_type != 'tag' || startsWith(github.ref_name, 'v') + needs: [ pre_build, build_analyzers ] + runs-on: ubuntu-22.04 + env: + Version: ${{ needs.pre_build.outputs.version }} + defaults: + run: + working-directory: src/VisualStudioCode + steps: + - uses: actions/checkout@v4 + - run: dotnet restore + - run: dotnet build --no-restore + - 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.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@v4 + with: + name: vs_code_extension_with_analyzers + path: src/VisualStudioCode/package/*.vsix + build_core_cli: if: github.ref_type != 'tag' || startsWith(github.ref_name, 'cli-v') needs: pre_build diff --git a/README.md b/README.md index f7e573b0b5..1b17740298 100644 --- a/README.md +++ b/README.md @@ -2,9 +2,6 @@ Roslynator is a set of code analysis tools for C#, powered by [Roslyn](https://github.com/dotnet/roslyn). -IMPORTANT: Analyzers will be removed from Roslynator IDE extensions in the next major release. -It's recommended to use Roslynator NuGet packages (e.g. [Roslynator.Analyzers](https://www.nuget.org/packages/roslynator.analyzers)) instead. - ## Tools - IDE extensions for: @@ -14,8 +11,8 @@ It's recommended to use Roslynator NuGet packages (e.g. [Roslynator.Analyzers](h - [Open VSX](https://open-vsx.org/extension/josefpihrt-vscode/roslynator) - [NuGet packages](#nuget-packages) that contain collection of analyzers - [Roslynator.Analyzers](https://www.nuget.org/packages/Roslynator.Analyzers) - - [Roslynator.CodeAnalysis.Analyzers](https://www.nuget.org/packages/Roslynator.CodeAnalysis.Analyzers) - [Roslynator.Formatting.Analyzers](https://www.nuget.org/packages/Roslynator.Formatting.Analyzers) + - [Roslynator.CodeAnalysis.Analyzers](https://www.nuget.org/packages/Roslynator.CodeAnalysis.Analyzers) - [Testing framework](#testing-framework) that allows unit testing of analyzers, refactoring and code fixes - [.NET client libraries](#client-libraries) that extend Roslyn API - [Command line tool](#command-line-tool) diff --git a/src/Common/Configuration/EditorConfigCodeAnalysisConfig.cs b/src/Common/Configuration/EditorConfigCodeAnalysisConfig.cs index 82e450ab86..87d59e7d3d 100644 --- a/src/Common/Configuration/EditorConfigCodeAnalysisConfig.cs +++ b/src/Common/Configuration/EditorConfigCodeAnalysisConfig.cs @@ -19,20 +19,11 @@ internal class EditorConfigCodeAnalysisConfig is_global = true -# Options in this file can be used to change default configuration of analyzers, refactorings and compiler diagnostic fixes. +# Options in this file can be used to change default configuration of refactorings and compiler diagnostic fixes. +# Options can be used both in default configuration file (.roslynatorconfig) and in standard .editorconfig file. # Default configuration is loaded once when IDE starts. Therefore, it may be necessary to restart IDE for changes to take effect. # Full list of available options: https://josefpihrt.github.io/docs/roslynator/configuration -# Set severity for all analyzers that are enabled by default (https://docs.microsoft.com/en-us/visualstudio/code-quality/use-roslyn-analyzers?view=vs-2022#set-rule-severity-of-multiple-analyzer-rules-at-once-in-an-editorconfig-file) -dotnet_analyzer_diagnostic.category-roslynator.severity = default|none|silent|suggestion|warning|error - -# Enable/disable all analyzers by default. -# NOTE: This option can be used only in .roslynatorconfig file -roslynator_analyzers.enabled_by_default = true|false - -## Set severity for a specific analyzer -#dotnet_diagnostic..severity = default|none|silent|suggestion|warning|error - ## Enable/disable all refactorings #roslynator_refactorings.enabled = true|false diff --git a/src/Tools/CodeGeneration/EditorConfig/EditorConfigGenerator.cs b/src/Tools/CodeGeneration/EditorConfig/EditorConfigGenerator.cs index 1a4bfba0d2..251d9bb4af 100644 --- a/src/Tools/CodeGeneration/EditorConfig/EditorConfigGenerator.cs +++ b/src/Tools/CodeGeneration/EditorConfig/EditorConfigGenerator.cs @@ -12,88 +12,94 @@ namespace Roslynator.CodeGeneration.EditorConfig; public static class EditorConfigGenerator { - public static string GenerateEditorConfig(RoslynatorMetadata metadata, bool commentOut) + public static string GenerateEditorConfig(RoslynatorMetadata metadata, bool includeAnalyzers, bool commentOut) { var optionMap = new Dictionary>(); - foreach (AnalyzerMetadata analyzer in metadata.Analyzers) + if (includeAnalyzers) { - foreach (AnalyzerConfigOption option in analyzer.ConfigOptions) + foreach (AnalyzerMetadata analyzer in metadata.Analyzers) { - if (!optionMap.TryGetValue(option.Key, out HashSet optionAnalyzers)) - optionAnalyzers = new HashSet(); + foreach (AnalyzerConfigOption option in analyzer.ConfigOptions) + { + if (!optionMap.TryGetValue(option.Key, out HashSet optionAnalyzers)) + optionAnalyzers = new HashSet(); - optionAnalyzers.Add(analyzer); - optionMap[option.Key] = optionAnalyzers; + optionAnalyzers.Add(analyzer); + optionMap[option.Key] = optionAnalyzers; + } } } using (var w = new EditorConfigWriter(new StringWriter())) { - w.WriteLine(); - w.WriteLine("# Options"); - w.WriteLine(); - - var isSeparatedWithNewLine = true; - - foreach (AnalyzerOptionMetadata option in metadata.ConfigOptions - .Where(f => !f.IsObsolete) - .OrderBy(f => f.Key)) + if (includeAnalyzers) { - if (optionMap.TryGetValue(option.Key, out HashSet analyzers) - && !isSeparatedWithNewLine) - { - w.WriteLine(); - } - - w.WriteCommentCharIf(commentOut); - w.WriteEntry($"{option.Key}", option.DefaultValuePlaceholder); - - string defaultValue = option.DefaultValue; + w.WriteLine(); + w.WriteLine("# Options"); + w.WriteLine(); - if (defaultValue is not null) - w.WriteLine($"# Default: {defaultValue}"); + var isSeparatedWithNewLine = true; - if (analyzers?.Count > 0) + foreach (AnalyzerOptionMetadata option in metadata.ConfigOptions + .Where(f => !f.IsObsolete) + .OrderBy(f => f.Key)) { - w.WriteLine("# Applicable to: " + string.Join(", ", analyzers.OrderBy(f => f.Id).Select(f => f.Id.ToLowerInvariant()))); - w.WriteLine(); - isSeparatedWithNewLine = true; + if (optionMap.TryGetValue(option.Key, out HashSet analyzers) + && !isSeparatedWithNewLine) + { + w.WriteLine(); + } + + w.WriteCommentCharIf(commentOut); + w.WriteEntry($"{option.Key}", option.DefaultValuePlaceholder); + + string defaultValue = option.DefaultValue; + + if (defaultValue is not null) + w.WriteLine($"# Default: {defaultValue}"); + + if (analyzers?.Count > 0) + { + w.WriteLine("# Applicable to: " + string.Join(", ", analyzers.OrderBy(f => f.Id).Select(f => f.Id.ToLowerInvariant()))); + w.WriteLine(); + isSeparatedWithNewLine = true; + } + else + { + isSeparatedWithNewLine = false; + } } - else - { - isSeparatedWithNewLine = false; - } - } - - w.WriteLine(); - w.WriteLine("# Analyzers"); - w.WriteLine(); - foreach (AnalyzerMetadata analyzer in metadata.Analyzers - .Where(f => f.Status == AnalyzerStatus.Enabled && !f.Tags.Contains("HideFromConfiguration")) - .OrderBy(f => f.Id)) - { - w.WriteLine($"# {analyzer.Title.TrimEnd('.')}"); - w.WriteCommentCharIf(commentOut); - w.WriteAnalyzer( - analyzer.Id.ToLowerInvariant(), - (analyzer.IsEnabledByDefault) - ? ((DiagnosticSeverity)Enum.Parse(typeof(DiagnosticSeverity), analyzer.DefaultSeverity)).ToReportDiagnostic() - : ReportDiagnostic.Suppress); + w.WriteLine(); + w.WriteLine("# Analyzers"); + w.WriteLine(); - if (analyzer.ConfigOptions.Count > 0) + foreach (AnalyzerMetadata analyzer in metadata.Analyzers + .Where(f => f.Status == AnalyzerStatus.Enabled && !f.Tags.Contains("HideFromConfiguration")) + .OrderBy(f => f.Id)) { - w.WriteLine("# Options: " - + string.Join( - ", ", - analyzer.ConfigOptions - .Where(f => metadata.ConfigOptions.FirstOrDefault(ff => ff.Key == f.Key)?.IsObsolete != true) - .OrderBy(f => f.Key) - .Select(f2 => metadata.ConfigOptions.First(f => f.Key == f2.Key).Key))); - } + w.WriteLine($"# {analyzer.Title.TrimEnd('.')}"); + w.WriteCommentCharIf(commentOut); + w.WriteAnalyzer( + analyzer.Id.ToLowerInvariant(), + (analyzer.IsEnabledByDefault) + ? ((DiagnosticSeverity)Enum.Parse(typeof(DiagnosticSeverity), analyzer.DefaultSeverity)).ToReportDiagnostic() + : ReportDiagnostic.Suppress); + + if (analyzer.ConfigOptions.Count > 0) + { + w.WriteLine("# Options: " + + string.Join( + ", ", + analyzer.ConfigOptions + .Where(f => metadata.ConfigOptions.FirstOrDefault(ff => ff.Key == f.Key)?.IsObsolete != true) + .OrderBy(f => f.Key) + .Select(f2 => metadata.ConfigOptions.First(f => f.Key == f2.Key).Key))); + } - w.WriteLine(); + w.WriteLine(); + } } w.WriteLine(); diff --git a/src/Tools/CodeGeneration/Markdown/MarkdownGenerator.cs b/src/Tools/CodeGeneration/Markdown/MarkdownGenerator.cs index fc2fd35175..77cc7bf176 100644 --- a/src/Tools/CodeGeneration/Markdown/MarkdownGenerator.cs +++ b/src/Tools/CodeGeneration/Markdown/MarkdownGenerator.cs @@ -259,13 +259,6 @@ static IEnumerable CreateAppliesTo(AnalyzerMetadata analyzer) { yield return Heading2("Applies to"); - if (!analyzer.Id.StartsWith("RCS9")) - { - yield return BulletItem(Link("Extension for VS 2022", "https://marketplace.visualstudio.com/items?itemName=josefpihrt.Roslynator2022")); - yield return BulletItem(Link("Extension for VS Code", "https://marketplace.visualstudio.com/items?itemName=josefpihrt-vscode.roslynator")); - yield return BulletItem(Link("Extension for Open VSX", "https://open-vsx.org/extension/josefpihrt-vscode/roslynator")); - } - if (analyzer.Id.StartsWith("RCS0")) yield return BulletItem(Link(new[] { "Package ", "Roslynator.Formatting.Analyzers" }, "https://www.nuget.org/packages/Roslynator.Formatting.Analyzers")); diff --git a/src/Tools/CodeGenerator/Program.cs b/src/Tools/CodeGenerator/Program.cs index 08f479e8df..51f892c9f9 100644 --- a/src/Tools/CodeGenerator/Program.cs +++ b/src/Tools/CodeGenerator/Program.cs @@ -101,7 +101,7 @@ private static void Main(string[] args) @"export const configurationFileContent = { roslynatorconfig: `" + EditorConfigCodeAnalysisConfig.FileDefaultContent - + EditorConfigGenerator.GenerateEditorConfig(metadata, commentOut: true) + + EditorConfigGenerator.GenerateEditorConfig(metadata, includeAnalyzers: false, commentOut: true) + @"` };", new UTF8Encoding(encoderShouldEmitUTF8Identifier: false)); diff --git a/src/Tools/ConfigurationFileGenerator/Program.cs b/src/Tools/ConfigurationFileGenerator/Program.cs index fd704d049a..29a814b5f1 100644 --- a/src/Tools/ConfigurationFileGenerator/Program.cs +++ b/src/Tools/ConfigurationFileGenerator/Program.cs @@ -35,7 +35,7 @@ private static void Main(string[] args) ```editorconfig title=".editorconfig" """ - + EditorConfigGenerator.GenerateEditorConfig(metadata, commentOut: false) + + EditorConfigGenerator.GenerateEditorConfig(metadata, includeAnalyzers: true, commentOut: false) + @"``` "; diff --git a/src/Tools/ConfigurationFileGenerator/configuration.md b/src/Tools/ConfigurationFileGenerator/configuration.md index 9475566e83..63801c7743 100644 --- a/src/Tools/ConfigurationFileGenerator/configuration.md +++ b/src/Tools/ConfigurationFileGenerator/configuration.md @@ -6,13 +6,11 @@ Use EditorConfig file to configure analyzers, refactoring and compiler diagnosti # Set severity for all analyzers that are enabled by default (https://docs.microsoft.com/en-us/visualstudio/code-quality/use-roslyn-analyzers?view=vs-2022#set-rule-severity-of-multiple-analyzer-rules-at-once-in-an-editorconfig-file) dotnet_analyzer_diagnostic.category-roslynator.severity = default|none|silent|suggestion|warning|error -# Enable/disable all analyzers by default -# NOTE: This option can be used only in .roslynatorconfig file -roslynator_analyzers.enabled_by_default = true|false - # Set severity for a specific analyzer dotnet_diagnostic..severity = default|none|silent|suggestion|warning|error +# NOTE: Following options can be used both in .editorconfig file and in .roslynatorconfig file (see below): + # Enable/disable all refactorings roslynator_refactorings.enabled = true|false @@ -33,9 +31,7 @@ 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 (`.roslynatorconfig`). - -**IMPORTANT:** Default configuration file can be used only with VS extension or VS code extension. +Default configuration file can be used to configure Visual Studio extension or VS Code extension (refactorings and code fixes). ### Format @@ -44,7 +40,6 @@ Namely, file must contain top-level entry `is_global = true` and cannot contain ```ini is_global = true -roslynator_analyzers.enabled_by_default = true ``` ### Location diff --git a/src/VisualStudio/Overview.md b/src/VisualStudio/Overview.md index 81895e282c..c82e9c1260 100644 --- a/src/VisualStudio/Overview.md +++ b/src/VisualStudio/Overview.md @@ -1,22 +1,22 @@ ## Overview -* A collection of 500+ analyzers, refactorings and fixes for C#, powered by [Roslyn](https://github.com/dotnet/roslyn). +* A collection of refactorings and fixes for C#, powered by [Roslyn](https://github.com/dotnet/roslyn). * [Project website](https://github.com/dotnet/roslynator) -* [List of analyzers](https://josefpihrt.github.io/docs/roslynator/analyzers) * [List of refactorings](https://josefpihrt.github.io/docs/roslynator/refactorings) * [List of code fixes for CS diagnostics](https://josefpihrt.github.io/docs/roslynator/fixes) * [Release notes](https://github.com/dotnet/roslynator/blob/main/ChangeLog.md) -IMPORTANT: Analyzers will be removed from Roslynator extension in the next major release. -As a replacement, use Roslynator NuGet packages (e.g. [Roslynator.Analyzers](https://www.nuget.org/packages/roslynator.analyzers)). +## Analyzers -## Donation +It' recommended to also use Roslynator analyzers to improve code quality. +To use Roslynator analyzers, install following NuGet packages to a project/solution: -Although Roslynator is free of charge, any [donation](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=BX85UA346VTN6) is welcome and supports further development. +- [Roslynator.Analyzers](https://www.nuget.org/packages/Roslynator.Analyzers) +- [Roslynator.Formatting.Analyzers](https://www.nuget.org/packages/Roslynator.Formatting.Analyzers) -## Related Products +## Donation -* Package [Roslynator.Analyzers](http://www.nuget.org/packages/Roslynator.Analyzers/) contains only analyzers. +Although Roslynator is free of charge, any [donation](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=BX85UA346VTN6) is welcome and supports further development. ## Documentation diff --git a/src/VisualStudio/VisualStudio.csproj b/src/VisualStudio/VisualStudio.csproj index 8e442b186d..58b31d1b19 100644 --- a/src/VisualStudio/VisualStudio.csproj +++ b/src/VisualStudio/VisualStudio.csproj @@ -43,20 +43,30 @@ - - - - + + + + + Designer + + + + + + Designer + + + @@ -74,9 +84,6 @@ true - - Designer - diff --git a/src/VisualStudio/source.extension-with-analyzers.vsixmanifest b/src/VisualStudio/source.extension-with-analyzers.vsixmanifest new file mode 100644 index 0000000000..319be0f5d2 --- /dev/null +++ b/src/VisualStudio/source.extension-with-analyzers.vsixmanifest @@ -0,0 +1,61 @@ + + + + + Roslynator 2022 + A collection of refactorings and fixes for C#, powered by Roslyn. + https://github.com/dotnet/roslynator + LICENSE.txt + https://github.com/dotnet/roslynator/blob/main/ChangeLog.md + roslynator-logo-small.png + roslynator-logo-large.png + Roslyn;Refactoring;CodeAnalysis;C#;CSharp;Productivity;Diagnostic + + + + amd64 + + + arm64 + + + amd64 + + + arm64 + + + amd64 + + + arm64 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/VisualStudio/source.extension.vsixmanifest b/src/VisualStudio/source.extension.vsixmanifest index e4b3f5e493..e0f1558c2f 100644 --- a/src/VisualStudio/source.extension.vsixmanifest +++ b/src/VisualStudio/source.extension.vsixmanifest @@ -3,32 +3,32 @@ Roslynator 2022 - A collection of 500+ analyzers, refactorings and fixes for C#, powered by Roslyn. + A collection of refactorings and fixes for C#, powered by Roslyn. https://github.com/dotnet/roslynator LICENSE.txt https://github.com/dotnet/roslynator/blob/main/ChangeLog.md roslynator-logo-small.png roslynator-logo-large.png - Roslyn;Refactoring;Analyzer;CodeAnalysis;C#;CSharp;Productivity;Diagnostic + Roslyn;Refactoring;CodeAnalysis;C#;CSharp;Productivity;Diagnostic amd64 - arm64 + arm64 amd64 - arm64 + arm64 amd64 - arm64 + arm64 @@ -36,24 +36,12 @@ - - - - - - - - - - - - diff --git a/src/VisualStudioCode/package/README.md b/src/VisualStudioCode/package/README.md index a983f88968..b9cb71b3f0 100644 --- a/src/VisualStudioCode/package/README.md +++ b/src/VisualStudioCode/package/README.md @@ -1,9 +1,6 @@ # Roslynator for Visual Studio Code -A collection of 500+ [analyzers](https://josefpihrt.github.io/docs/roslynator/analyzers), [refactorings](https://josefpihrt.github.io/docs/roslynator/refactorings) and [fixes](https://josefpihrt.github.io/docs/roslynator/fixes) for C#, powered by [Roslyn](https://github.com/dotnet/roslyn). - -IMPORTANT: Analyzers will be removed from Roslynator for VS Code in the next major release. -It's recommended to use Roslynator NuGet packages (e.g. [Roslynator.Analyzers](https://www.nuget.org/packages/roslynator.analyzers)) instead. +A collection of [refactorings](https://josefpihrt.github.io/docs/roslynator/refactorings) and [fixes](https://josefpihrt.github.io/docs/roslynator/fixes) for C#, powered by [Roslyn](https://github.com/dotnet/roslyn). ## Prerequsities @@ -18,6 +15,14 @@ NOTE: After each installation, Roslynator updates `omnisharp.json` to include re As an alternative, it's possible to use NuGet packages that provide [refactorings](https://www.nuget.org/packages/roslynator.refactorings) and [code fixes for compiler diagnostics](https://www.nuget.org/packages/roslynator.codefixes). +## Analyzers + +It' recommended to also use Roslynator analyzers to improve code quality. +To use Roslynator analyzers, install following NuGet packages to a project/solution: + +- [Roslynator.Analyzers](https://www.nuget.org/packages/Roslynator.Analyzers) +- [Roslynator.Formatting.Analyzers](https://www.nuget.org/packages/Roslynator.Formatting.Analyzers) + ## Configuration Use EditorConfig file to configure analyzers, refactorings and compiler diagnostic fixes. @@ -26,13 +31,11 @@ Use EditorConfig file to configure analyzers, refactorings and compiler diagnost # Set severity for all analyzers that are enabled by default (https://docs.microsoft.com/en-us/visualstudio/code-quality/use-roslyn-analyzers?view=vs-2022#set-rule-severity-of-multiple-analyzer-rules-at-once-in-an-editorconfig-file) dotnet_analyzer_diagnostic.category-roslynator.severity = default|none|silent|suggestion|warning|error -# Enable/disable all analyzers by default. -# NOTE: This option can be used only in .roslynatorconfig file -roslynator_analyzers.enabled_by_default = true|false - # Set severity for a specific analyzer dotnet_diagnostic..severity = default|none|silent|suggestion|warning|error +# NOTE: Following options can be used both in .editorconfig file and in .roslynatorconfig file (see below): + # Enable/disable all refactorings roslynator_refactorings.enabled = true|false @@ -50,7 +53,7 @@ Full list of available options is [here](https://josefpihrt.github.io/docs/rosly ## 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 to configure Visual Studio extension or VS Code extension (refactorings and code fixes). How to open config file: @@ -73,7 +76,7 @@ Default configuration is loaded once when IDE starts. Therefore, it may be neces ## Requirements -This extension requires [C# for Visual Studio Code](https://marketplace.visualstudio.com/items?itemName=ms-dotnettools.csharp) 1.21.13 or higher. +This extension requires [C# for VS Code](https://marketplace.visualstudio.com/items?itemName=ms-dotnettools.csharp) 1.21.13 or higher. ## Donation diff --git a/src/VisualStudioCode/package/package.json b/src/VisualStudioCode/package/package.json index 7c203ba439..191d920d87 100644 --- a/src/VisualStudioCode/package/package.json +++ b/src/VisualStudioCode/package/package.json @@ -2,7 +2,7 @@ "name": "roslynator", "publisher": "josefpihrt-vscode", "displayName": "Roslynator", - "description": "A collection of 500+ analyzers, refactorings and fixes for C#, powered by Roslyn.", + "description": "A collection of refactorings and fixes for C#, powered by Roslyn.", "icon": "images/icon.png", "version": "1.0.0", "author": "Josef Pihrt", @@ -52,7 +52,6 @@ "onCommand:csharp.listRemoteProcess", "onCommand:csharp.listRemoteDockerProcess", "onCommand:omnisharp.registerLanguageMiddleware", - "onCommand:roslynator.openDefaultConfigurationFile", "workspaceContains:project.json", "workspaceContains:**/*.{csproj,sln,slnf,csx,cake}" ],