Skip to content

Commit 3182e27

Browse files
committed
Rolyn Lint Fixes
1 parent 8dc1e3c commit 3182e27

File tree

9 files changed

+6
-14
lines changed

9 files changed

+6
-14
lines changed

src/PowerShellEditorServices/Services/PowerShell/Refactoring/Exceptions.cs

-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
using System;
55
namespace Microsoft.PowerShell.EditorServices.Refactoring
66
{
7-
87
public class TargetSymbolNotFoundException : Exception
98
{
109
public TargetSymbolNotFoundException()

src/PowerShellEditorServices/Services/TextDocument/Handlers/RenameHandler.cs

-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
// Licensed under the MIT License.
33
#nullable enable
44

5-
65
using System.Threading;
76
using System.Threading.Tasks;
87
using Microsoft.PowerShell.EditorServices.Services;

src/PowerShellEditorServices/Services/TextDocument/RenameService.cs

-2
Original file line numberDiff line numberDiff line change
@@ -180,8 +180,6 @@ private TextEdit[] RenameVariable(Ast symbol, Ast scriptAst, RenameParams reques
180180
}
181181
}
182182

183-
184-
185183
return ast;
186184
}
187185

src/PowerShellEditorServices/Utility/AstExtensions.cs

-3
Original file line numberDiff line numberDiff line change
@@ -438,7 +438,6 @@ public static bool TryGetFunction(this ParameterAst ast, out FunctionDefinitionA
438438
{
439439
return splatParamReference;
440440
}
441-
442441
}
443442

444443
// If nothing found, search parent scopes for a variable assignment until we hit the top of the document
@@ -508,7 +507,6 @@ public static bool TryGetFunction(this ParameterAst ast, out FunctionDefinitionA
508507
&& foundFunction?.Parent?.Parent == scope
509508
),
510509

511-
512510
_ => null
513511
};
514512

@@ -560,7 +558,6 @@ public static bool HasParent(this Ast ast, Ast parent)
560558
return false;
561559
}
562560

563-
564561
/// <summary>
565562
/// Return an extent that only contains the position of the name of the function, for Client highlighting purposes.
566563
/// </summary>

test/PowerShellEditorServices.Test.Shared/Refactoring/Functions/_RefactorFunctionTestCases.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
namespace PowerShellEditorServices.Test.Shared.Refactoring;
55

6-
public class RefactorFunctionTestCases
6+
public static class RefactorFunctionTestCases
77
{
88
/// <summary>
99
/// Defines where functions should be renamed. These numbers are 1-based.

test/PowerShellEditorServices.Test.Shared/Refactoring/Variables/_RefactorVariableTestCases.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// Copyright (c) Microsoft Corporation.
22
// Licensed under the MIT License.
33
namespace PowerShellEditorServices.Test.Shared.Refactoring;
4-
public class RefactorVariableTestCases
4+
public static class RefactorVariableTestCases
55
{
66
public static RenameTestTarget[] TestCases =
77
[

test/PowerShellEditorServices.Test/Refactoring/PrepareRenameHandlerTests.cs

-2
Original file line numberDiff line numberDiff line change
@@ -164,8 +164,6 @@ public async Task<TResponse> SendRequest<TResponse>(IRequest<TResponse> request,
164164
public bool TryGetRequest(long id, out string method, out TaskCompletionSource<JToken> pendingTask) => throw new NotImplementedException();
165165
}
166166

167-
168-
169167
public class EmptyConfiguration : ConfigurationRoot, ILanguageServerConfiguration, IScopedConfiguration
170168
{
171169
public EmptyConfiguration() : base([]) { }

test/PowerShellEditorServices.Test/Refactoring/RefactorUtilities.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99

1010
namespace PowerShellEditorServices.Test.Refactoring
1111
{
12-
public class RefactorUtilities
12+
public static class RefactorUtilities
1313
{
1414
/// <summary>
1515
/// A simplistic "Mock" implementation of vscode client performing rename activities. It is not comprehensive and an E2E test is recommended.

test/PowerShellEditorServices.Test/Refactoring/RenameHandlerTests.cs

+3-2
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
using System.Threading;
1414
using Xunit;
1515
using PowerShellEditorServices.Test.Shared.Refactoring;
16+
using System.Threading.Tasks;
1617

1718
namespace PowerShellEditorServices.Test.Handlers;
1819
#pragma warning disable VSTHRD100 // XUnit handles async void with a custom SyncContext
@@ -53,7 +54,7 @@ public static TheoryData<RenameTestTargetSerializable> FunctionTestCases()
5354

5455
[Theory]
5556
[MemberData(nameof(FunctionTestCases))]
56-
public async void RenamedFunction(RenameTestTarget s)
57+
public async Task RenamedFunction(RenameTestTarget s)
5758
{
5859
RenameParams request = s.ToRenameParams("Functions");
5960
WorkspaceEdit response;
@@ -90,7 +91,7 @@ public async void RenamedFunction(RenameTestTarget s)
9091

9192
[Theory]
9293
[MemberData(nameof(VariableTestCases))]
93-
public async void RenamedVariable(RenameTestTarget s)
94+
public async Task RenamedVariable(RenameTestTarget s)
9495
{
9596
RenameParams request = s.ToRenameParams("Variables");
9697
WorkspaceEdit response;

0 commit comments

Comments
 (0)