Skip to content

Commit f1d920c

Browse files
committed
Treat unused variable warnings as errors (and fix)
These are all compiler level 3 warnings.
1 parent 864822c commit f1d920c

File tree

3 files changed

+8
-4
lines changed

3 files changed

+8
-4
lines changed

.editorconfig

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,14 @@ trim_trailing_whitespace = true
1313
csharp_space_before_open_square_brackets = true
1414
csharp_space_after_keywords_in_control_flow_statements = true
1515

16+
# CS0168: The variable 'var' is declared but never used
17+
dotnet_diagnostic.CS0168.severity = error
18+
# CS0169: The private field 'class member' is never used
19+
dotnet_diagnostic.CS0169.severity = error
20+
# CS0219: The variable 'variable' is assigned but its value is never used
21+
dotnet_diagnostic.CS0219.severity = error
22+
# CS0414: The private field 'field' is assigned but its value is never used
23+
dotnet_diagnostic.CS0414.severity = error
1624
# CA2007: Do not directly await a Task
1725
dotnet_diagnostic.CA2007.severity = error
1826
# CA1822: Mark members as static

src/PowerShellEditorServices/Services/DebugAdapter/DebugService.cs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,6 @@ internal class DebugService
4343
private StackFrameDetails[] stackFrameDetails;
4444
private readonly PropertyInfo invocationTypeScriptPositionProperty;
4545

46-
private static int breakpointHitCounter;
47-
4846
private readonly SemaphoreSlim debugInfoHandle = AsyncUtils.CreateSimpleLockingSemaphore();
4947
#endregion
5048

test/PowerShellEditorServices.Test.E2E/LanguageServerProtocolMessageTests.cs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,6 @@ public class LanguageServerProtocolMessageTests : IClassFixture<LSPTestsFixture>
3535
private readonly static string s_binDir =
3636
Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location);
3737

38-
private static bool s_registeredOnLogMessage;
39-
4038
private readonly ILanguageClient PsesLanguageClient;
4139
private readonly List<Diagnostic> Diagnostics;
4240
private readonly List<PsesTelemetryEvent> TelemetryEvents;

0 commit comments

Comments
 (0)