Skip to content

Commit 8071442

Browse files
authoredMay 30, 2024
Remove unnecessary variable assignments (#10428)
1 parent 2f0f5fc commit 8071442

File tree

6 files changed

+7
-8
lines changed

6 files changed

+7
-8
lines changed
 

‎.globalconfig

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
is_global = true
2+
3+
# IDE0059: Remove unnecessary value assignment
4+
dotnet_diagnostic.IDE0059.severity = warning

‎src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/MapCode/MapCodeEndpoint.cs

+2-2
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ public void ApplyCapabilities(VSInternalServerCapabilities serverCapabilities, V
7676
}
7777

7878
private async Task<WorkspaceEdit?> HandleMappingsAsync(VSInternalMapCodeMapping[] mappings, Guid mapCodeCorrelationId, CancellationToken cancellationToken)
79-
{
79+
{
8080
using var _ = ArrayBuilderPool<TextDocumentEdit>.GetPooledObject(out var changes);
8181
foreach (var mapping in mappings)
8282
{
@@ -316,7 +316,7 @@ private async Task<bool> TrySendCSharpDelegatedMappingRequestAsync(
316316
[nodeToMap.ToFullString()],
317317
FocusLocations: focusLocations);
318318

319-
WorkspaceEdit? edits = null;
319+
WorkspaceEdit? edits;
320320
try
321321
{
322322
edits = await _clientConnection.SendRequestAsync<DelegatedMapCodeParams, WorkspaceEdit?>(

‎src/Razor/src/Microsoft.AspNetCore.Razor.ProjectEngineHost/Serialization/MessagePack/Formatters/RazorConfigurationFormatter.cs

+1-3
Original file line numberDiff line numberDiff line change
@@ -25,11 +25,9 @@ public override RazorConfiguration Deserialize(ref MessagePackReader reader, Ser
2525

2626
count -= 2;
2727

28-
var forceRuntimeCodeGeneration = false;
29-
3028
if (reader.NextMessagePackType is MessagePackType.Boolean)
3129
{
32-
forceRuntimeCodeGeneration = reader.ReadBoolean();
30+
reader.ReadBoolean(); // forceRuntimeCodeGeneration
3331
count -= 1;
3432
}
3533

‎src/Razor/src/Microsoft.VisualStudio.LanguageServer.ContainedLanguage/DefaultLSPRequestInvoker.cs

-1
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,6 @@ public override async Task<ReinvokeResponse<TOut>> ReinvokeRequestOnServerAsync<
8181
throw new ArgumentException("message", nameof(method));
8282
}
8383

84-
var serializedParams = JToken.FromObject(parameters);
8584
var response = await _languageServiceBroker.RequestAsync(
8685
new GeneralRequest<TIn, TOut> { LanguageServerName = languageServerName, Method = method, Request = parameters },
8786
cancellationToken);

‎src/Shared/Microsoft.AspNetCore.Razor.Test.Common/Language/IntegrationTests/IntegrationTestBase.cs

-1
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,6 @@ protected RazorProjectItem CreateProjectItemFromFile(string? filePath = null, st
177177
throw new XunitException($"The resource {sourceFileName} was not found.");
178178
}
179179
var fileContent = testFile.ReadAllText();
180-
var normalizedContent = NormalizeNewLines(fileContent);
181180

182181
var workingDirectory = Path.GetDirectoryName(fileName);
183182
var fullPath = sourceFileName;

‎src/Shared/Microsoft.AspNetCore.Razor.Test.Common/Language/IntegrationTests/RazorBaselineIntegrationTestBase.cs

-1
Original file line numberDiff line numberDiff line change
@@ -235,7 +235,6 @@ private string GetBaselineFilePath(RazorCodeDocument codeDocument, string extens
235235

236236
private static void WriteBaseline(string text, string filePath)
237237
{
238-
var lines = text.Replace("\r", "").Replace("\n", "\r\n");
239238
File.WriteAllText(filePath, text, _baselineEncoding);
240239
}
241240

0 commit comments

Comments
 (0)