Skip to content

Commit d2614cf

Browse files
committed
Treat unused private field as errors (and fix)
1 parent 30bfdb7 commit d2614cf

File tree

4 files changed

+2
-7
lines changed

4 files changed

+2
-7
lines changed

.editorconfig

+2
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@ dotnet_diagnostic.CS0414.severity = error
2525
dotnet_diagnostic.CA2007.severity = error
2626
# CA1822: Mark members as static
2727
dotnet_diagnostic.CA1822.severity = error
28+
# CA1823: Avoid unused private fields
29+
dotnet_diagnostic.CA1823.severity = error
2830
# All maintainability issues (dead code etc.)
2931
# See: https://docs.microsoft.com/en-us/dotnet/fundamentals/code-analysis/quality-rules/maintainability-warnings
3032
dotnet_analyzer_diagnostic.category-Maintainability.severity = error

src/PowerShellEditorServices/Services/TextDocument/TokenOperations.cs

-3
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,6 @@ namespace Microsoft.PowerShell.EditorServices.Services.TextDocument
1414
/// </summary>
1515
internal static class TokenOperations
1616
{
17-
// Region kinds to align with VSCode's region kinds
18-
private const string RegionKindComment = "comment";
19-
private const string RegionKindRegion = "region";
2017
private static readonly FoldingRangeKind? RegionKindNone = null;
2118

2219
// These regular expressions are used to match lines which mark the start and end of region comment in a PowerShell

test/PowerShellEditorServices.Test.Shared/TestUtilities/TestUtilities.cs

-2
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,6 @@ namespace Microsoft.PowerShell.EditorServices.Test.Shared
1414
/// </summary>
1515
public static class TestUtilities
1616
{
17-
private static readonly char[] s_unixPathSeparators = new [] { '/' };
18-
1917
private static readonly char[] s_unixNewlines = new [] { '\n' };
2018

2119
/// <summary>

test/PowerShellEditorServices.Test/Session/WorkspaceTests.cs

-2
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,6 @@ namespace Microsoft.PowerShell.EditorServices.Test.Session
1414
{
1515
public class WorkspaceTests
1616
{
17-
private static readonly Version PowerShellVersion = new Version("5.0");
18-
1917
private static readonly Lazy<string> s_lazyDriveLetter = new Lazy<string>(() => Path.GetFullPath("\\").Substring(0, 1));
2018

2119
public static string CurrentDriveLetter => RuntimeInformation.IsOSPlatform(OSPlatform.Windows)

0 commit comments

Comments
 (0)