Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion eng/Versions.props
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<MajorVersion>3</MajorVersion>
<MinorVersion>7</MinorVersion>
<PatchVersion>0</PatchVersion>
<PreReleaseVersionLabel>4</PreReleaseVersionLabel>
<PreReleaseVersionLabel>5</PreReleaseVersionLabel>
<VersionPrefix>$(MajorVersion).$(MinorVersion).$(PatchVersion)</VersionPrefix>
<!--
By default the assembly version in official builds is "$(MajorVersion).$(MinorVersion).0.0".
Expand Down
14 changes: 14 additions & 0 deletions src/VisualStudio/Core/Def/ColorSchemes/VisualStudio2019.pkgdef

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,11 @@
<!-- This column appears empty to sighted users, but provides an improved screenreader
experience that avoids moving cell-by-cell through the DataGrid -->
<DataGridTextColumn x:Name="automationHeader" IsReadOnly="True" Width="0">
<DataGridTextColumn.HeaderStyle>
<Style TargetType="{x:Type DataGridColumnHeader}">
<Setter Property="AutomationProperties.Name" Value="{Binding ElementName=dialog, Path=CurrentParameter}" />
</Style>
</DataGridTextColumn.HeaderStyle>
<DataGridTextColumn.CellStyle>
<Style TargetType="DataGridCell" BasedOn="{StaticResource DataGridCellStyle}">
<Setter Property="AutomationProperties.Name" Value="{Binding FullAutomationText}"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ internal partial class ChangeSignatureDialog : DialogWindow

// Expose localized strings for binding
public string ChangeSignatureDialogTitle { get { return ServicesVSResources.Change_Signature; } }
public string CurrentParameter { get { return ServicesVSResources.Current_parameter; } }
public string Parameters { get { return ServicesVSResources.Parameters_colon2; } }
public string PreviewMethodSignature { get { return ServicesVSResources.Preview_method_signature_colon; } }
public string PreviewReferenceChanges { get { return ServicesVSResources.Preview_reference_changes; } }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
Class="Microsoft.VisualStudio.LanguageServices.Setup.RoslynPackage"
AllowsBackgroundLoad="true"/>
<None Include="PackageRegistration.pkgdef" PkgDefEntry="FileContent" />
<None Include=".\ColorSchemes\VisualStudio2019.pkgdef" PkgDefEntry="FileContent" />
</ItemGroup>
<ItemGroup Label="Build Items">
<Compile Include="..\..\..\Compilers\Shared\GlobalAssemblyCacheHelpers\GlobalAssemblyCacheLocation.cs">
Expand Down
3 changes: 3 additions & 0 deletions src/VisualStudio/Core/Def/ServicesVSResources.resx
Original file line number Diff line number Diff line change
Expand Up @@ -1529,4 +1529,7 @@ I agree to all of the foregoing:</value>
<data name="Warning_colon_type_does_not_bind" xml:space="preserve">
<value>Warning: type does not bind</value>
</data>
<data name="Current_parameter" xml:space="preserve">
<value>Current parameter</value>
</data>
</root>
5 changes: 5 additions & 0 deletions src/VisualStudio/Core/Def/xlf/ServicesVSResources.cs.xlf
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,11 @@
<target state="translated">Aktuální dokument</target>
<note />
</trans-unit>
<trans-unit id="Current_parameter">
<source>Current parameter</source>
<target state="new">Current parameter</target>
<note />
</trans-unit>
<trans-unit id="Edit">
<source>_Edit</source>
<target state="new">_Edit</target>
Expand Down
5 changes: 5 additions & 0 deletions src/VisualStudio/Core/Def/xlf/ServicesVSResources.de.xlf
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,11 @@
<target state="translated">Aktuelles Dokument</target>
<note />
</trans-unit>
<trans-unit id="Current_parameter">
<source>Current parameter</source>
<target state="new">Current parameter</target>
<note />
</trans-unit>
<trans-unit id="Edit">
<source>_Edit</source>
<target state="new">_Edit</target>
Expand Down
5 changes: 5 additions & 0 deletions src/VisualStudio/Core/Def/xlf/ServicesVSResources.es.xlf
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,11 @@
<target state="translated">Documento actual</target>
<note />
</trans-unit>
<trans-unit id="Current_parameter">
<source>Current parameter</source>
<target state="new">Current parameter</target>
<note />
</trans-unit>
<trans-unit id="Edit">
<source>_Edit</source>
<target state="new">_Edit</target>
Expand Down
5 changes: 5 additions & 0 deletions src/VisualStudio/Core/Def/xlf/ServicesVSResources.fr.xlf
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,11 @@
<target state="translated">Document en cours</target>
<note />
</trans-unit>
<trans-unit id="Current_parameter">
<source>Current parameter</source>
<target state="new">Current parameter</target>
<note />
</trans-unit>
<trans-unit id="Edit">
<source>_Edit</source>
<target state="new">_Edit</target>
Expand Down
5 changes: 5 additions & 0 deletions src/VisualStudio/Core/Def/xlf/ServicesVSResources.it.xlf
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,11 @@
<target state="translated">Documento corrente</target>
<note />
</trans-unit>
<trans-unit id="Current_parameter">
<source>Current parameter</source>
<target state="new">Current parameter</target>
<note />
</trans-unit>
<trans-unit id="Edit">
<source>_Edit</source>
<target state="new">_Edit</target>
Expand Down
5 changes: 5 additions & 0 deletions src/VisualStudio/Core/Def/xlf/ServicesVSResources.ja.xlf
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,11 @@
<target state="translated">現在のドキュメント</target>
<note />
</trans-unit>
<trans-unit id="Current_parameter">
<source>Current parameter</source>
<target state="new">Current parameter</target>
<note />
</trans-unit>
<trans-unit id="Edit">
<source>_Edit</source>
<target state="new">_Edit</target>
Expand Down
5 changes: 5 additions & 0 deletions src/VisualStudio/Core/Def/xlf/ServicesVSResources.ko.xlf
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,11 @@
<target state="translated">현재 문서</target>
<note />
</trans-unit>
<trans-unit id="Current_parameter">
<source>Current parameter</source>
<target state="new">Current parameter</target>
<note />
</trans-unit>
<trans-unit id="Edit">
<source>_Edit</source>
<target state="new">_Edit</target>
Expand Down
5 changes: 5 additions & 0 deletions src/VisualStudio/Core/Def/xlf/ServicesVSResources.pl.xlf
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,11 @@
<target state="translated">Bieżący dokument</target>
<note />
</trans-unit>
<trans-unit id="Current_parameter">
<source>Current parameter</source>
<target state="new">Current parameter</target>
<note />
</trans-unit>
<trans-unit id="Edit">
<source>_Edit</source>
<target state="new">_Edit</target>
Expand Down
5 changes: 5 additions & 0 deletions src/VisualStudio/Core/Def/xlf/ServicesVSResources.pt-BR.xlf
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,11 @@
<target state="translated">Documento atual</target>
<note />
</trans-unit>
<trans-unit id="Current_parameter">
<source>Current parameter</source>
<target state="new">Current parameter</target>
<note />
</trans-unit>
<trans-unit id="Edit">
<source>_Edit</source>
<target state="new">_Edit</target>
Expand Down
5 changes: 5 additions & 0 deletions src/VisualStudio/Core/Def/xlf/ServicesVSResources.ru.xlf
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,11 @@
<target state="translated">Текущий документ</target>
<note />
</trans-unit>
<trans-unit id="Current_parameter">
<source>Current parameter</source>
<target state="new">Current parameter</target>
<note />
</trans-unit>
<trans-unit id="Edit">
<source>_Edit</source>
<target state="new">_Edit</target>
Expand Down
5 changes: 5 additions & 0 deletions src/VisualStudio/Core/Def/xlf/ServicesVSResources.tr.xlf
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,11 @@
<target state="translated">Geçerli belge</target>
<note />
</trans-unit>
<trans-unit id="Current_parameter">
<source>Current parameter</source>
<target state="new">Current parameter</target>
<note />
</trans-unit>
<trans-unit id="Edit">
<source>_Edit</source>
<target state="new">_Edit</target>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,11 @@
<target state="translated">当前文档</target>
<note />
</trans-unit>
<trans-unit id="Current_parameter">
<source>Current parameter</source>
<target state="new">Current parameter</target>
<note />
</trans-unit>
<trans-unit id="Edit">
<source>_Edit</source>
<target state="new">_Edit</target>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,11 @@
<target state="translated">目前的文件</target>
<note />
</trans-unit>
<trans-unit id="Current_parameter">
<source>Current parameter</source>
<target state="new">Current parameter</target>
<note />
</trans-unit>
<trans-unit id="Edit">
<source>_Edit</source>
<target state="new">_Edit</target>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,27 +3,22 @@
// See the LICENSE file in the project root for more information.

using System;
using System.Collections.Generic;
using System.Collections.Immutable;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Threading;
using System.Threading.Tasks;
using Microsoft.CodeAnalysis;
using Microsoft.CodeAnalysis.Diagnostics;
using Microsoft.CodeAnalysis.Editor.Shared.Utilities;
using Microsoft.CodeAnalysis.Execution;
using Microsoft.CodeAnalysis.ExternalAccess.UnitTesting.Api;
using Microsoft.CodeAnalysis.Host.Mef;
using Microsoft.CodeAnalysis.CSharp.Execution;
using Microsoft.CodeAnalysis.Editor.Shared.Extensions;
using Microsoft.CodeAnalysis.Editor.UnitTests;
using Microsoft.CodeAnalysis.Remote;
using Microsoft.CodeAnalysis.Shared.TestHooks;
using Microsoft.CodeAnalysis.SolutionCrawler;
using Microsoft.CodeAnalysis.SymbolSearch;
using Microsoft.CodeAnalysis.Test.Utilities;
using Microsoft.CodeAnalysis.Test.Utilities.RemoteHost;
using Microsoft.CodeAnalysis.Text;
using Microsoft.VisualStudio.LanguageServices.Remote;
using Roslyn.Test.Utilities.Remote;
using Roslyn.Utilities;
using Roslyn.VisualStudio.Next.UnitTests.Mocks;
using Xunit;

Expand All @@ -35,11 +30,15 @@ public class RemoteHostClientServiceFactoryTests
[Fact, Trait(Traits.Feature, Traits.Features.RemoteHost)]
public async Task UpdaterService()
{
var exportProvider = TestHostServices.CreateMinimalExportProvider();
var exportProvider = ExportProviderCache
.GetOrCreateExportProviderFactory(ServiceTestExportProvider.CreateAssemblyCatalog()
.WithParts(typeof(InProcRemoteHostClientProvider.Factory), typeof(CSharpOptionsSerializationService)))
.CreateExportProvider();

using var workspace = new AdhocWorkspace(TestHostServices.CreateHostServices(exportProvider));

var options = workspace.CurrentSolution.Options
.WithChangedOption(RemoteHostOptions.SolutionChecksumMonitorBackOffTimeSpanInMS, 1)
.WithChangedOption(Microsoft.VisualStudio.LanguageServices.Remote.RemoteHostOptions.SolutionChecksumMonitorBackOffTimeSpanInMS, 1)
.WithChangedOption(Microsoft.CodeAnalysis.Test.Utilities.RemoteHost.RemoteHostOptions.RemoteHostTest, true);

workspace.TryApplyChanges(workspace.CurrentSolution.WithOptions(options));
Expand All @@ -52,8 +51,11 @@ public async Task UpdaterService()
// make sure client is ready
using var client = await service.TryGetRemoteHostClientAsync(CancellationToken.None);

// add solution
// add solution, change document
workspace.AddSolution(SolutionInfo.Create(SolutionId.CreateNewId(), VersionStamp.Default));
var project = workspace.AddProject("proj", LanguageNames.CSharp);
var document = workspace.AddDocument(project.Id, "doc.cs", SourceText.From("code"));
workspace.ApplyTextChanges(document.Id, new[] { new TextChange(new TextSpan(0, 1), "abc") }, CancellationToken.None);

// wait for listener
var workspaceListener = listenerProvider.GetWaiter(FeatureAttribute.Workspace);
Expand Down
8 changes: 1 addition & 7 deletions src/Workspaces/Remote/Razor/ServiceHubServiceBase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -44,12 +44,6 @@ protected Task<Solution> GetSolutionAsync(CancellationToken cancellationToken)
}

public Task<Solution> GetSolutionAsync(JObject solutionInfo, CancellationToken cancellationToken)
{
var reader = solutionInfo.CreateReader();
var serializer = JsonSerializer.Create(new JsonSerializerSettings() { Converters = new[] { AggregateJsonConverter.Instance } });
var pinnedSolutionInfo = serializer.Deserialize<PinnedSolutionInfo>(reader);

return CreateSolutionService(pinnedSolutionInfo).GetSolutionAsync(pinnedSolutionInfo, cancellationToken);
}
=> GetSolutionImplAsync(solutionInfo, cancellationToken);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,7 @@ protected PythiaServiceBase(IServiceProvider serviceProvider, Stream stream, IEn
=> base.StartService();

public Task<Solution> GetSolutionAsync(JObject solutionInfo, CancellationToken cancellationToken)
{
var reader = solutionInfo.CreateReader();
var serializer = JsonSerializer.Create(new JsonSerializerSettings() { Converters = new[] { AggregateJsonConverter.Instance } });
var pinnedSolutionInfo = serializer.Deserialize<PinnedSolutionInfo>(reader);

return CreateSolutionService(pinnedSolutionInfo).GetSolutionAsync(pinnedSolutionInfo, cancellationToken);
}
=> GetSolutionImplAsync(solutionInfo, cancellationToken);

#pragma warning disable IDE0060 // Remove unused parameter - Avoiding breaking change in External access API
protected Task<T> RunServiceAsync<T>(Func<Task<T>> callAsync, CancellationToken cancellationToken, [CallerMemberName] string? callerName = null)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Licensed to the .NET Foundation under one or more agreements.
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
#nullable enable
Expand Down Expand Up @@ -27,13 +27,7 @@ protected UnitTestingServiceBase(
=> base.StartService();

protected Task<Solution> GetSolutionAsync(JObject solutionInfo, CancellationToken cancellationToken)
{
var reader = solutionInfo.CreateReader();
var serializer = JsonSerializer.Create(new JsonSerializerSettings() { Converters = new[] { AggregateJsonConverter.Instance } });
var pinnedSolutionInfo = serializer.Deserialize<PinnedSolutionInfo>(reader);

return CreateSolutionService(pinnedSolutionInfo).GetSolutionAsync(pinnedSolutionInfo, cancellationToken);
}
=> GetSolutionImplAsync(solutionInfo, cancellationToken);

protected new Task<T> RunServiceAsync<T>(Func<Task<T>> callAsync, CancellationToken cancellationToken)
=> base.RunServiceAsync(callAsync, cancellationToken);
Expand Down
3 changes: 3 additions & 0 deletions src/Workspaces/Remote/ServiceHub/Shared/RemoteEndPoint.cs
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,9 @@ public RemoteEndPoint(Stream stream, TraceSource logger, object? incomingCallTar

var jsonFormatter = new JsonMessageFormatter();

// disable interpreting of strings as DateTime during deserialization:
jsonFormatter.JsonSerializer.DateParseHandling = DateParseHandling.None;

if (jsonConverters != null)
{
jsonFormatter.JsonSerializer.Converters.AddRange(jsonConverters);
Expand Down
10 changes: 10 additions & 0 deletions src/Workspaces/Remote/ServiceHub/Shared/ServiceBase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
using System.Threading.Tasks;
using Microsoft.CodeAnalysis.ErrorReporting;
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
using Roslyn.Utilities;

namespace Microsoft.CodeAnalysis.Remote
Expand Down Expand Up @@ -87,6 +88,15 @@ protected SolutionService CreateSolutionService(PinnedSolutionInfo solutionInfo)
protected Task<Solution> GetSolutionAsync(PinnedSolutionInfo solutionInfo, CancellationToken cancellationToken)
=> CreateSolutionService(solutionInfo).GetSolutionAsync(solutionInfo, cancellationToken);

internal Task<Solution> GetSolutionImplAsync(JObject solutionInfo, CancellationToken cancellationToken)
{
var reader = solutionInfo.CreateReader();
var serializer = JsonSerializer.Create(new JsonSerializerSettings() { Converters = new[] { AggregateJsonConverter.Instance }, DateParseHandling = DateParseHandling.None });
var pinnedSolutionInfo = serializer.Deserialize<PinnedSolutionInfo>(reader);

return CreateSolutionService(pinnedSolutionInfo).GetSolutionAsync(pinnedSolutionInfo, cancellationToken);
}

protected async Task<T> RunServiceAsync<T>(Func<Task<T>> callAsync, CancellationToken cancellationToken)
{
AssetStorage.UpdateLastActivityTime();
Expand Down