-
Notifications
You must be signed in to change notification settings - Fork 4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #57578 from dotnet/release/dev17.0-vs-deps
Merge release/dev17.0-vs-deps to release/dev17.0
- Loading branch information
Showing
81 changed files
with
1,658 additions
and
450 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
69 changes: 69 additions & 0 deletions
69
src/EditorFeatures/Core/Implementation/EditAndContinue/Contracts/ContractWrappers.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
// 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. | ||
|
||
using System.Collections.Immutable; | ||
using Microsoft.VisualStudio.Debugger.Contracts.EditAndContinue; | ||
using Microsoft.VisualStudio.Debugger.Contracts.HotReload; | ||
|
||
using Contracts = Microsoft.CodeAnalysis.EditAndContinue.Contracts; | ||
|
||
namespace Microsoft.CodeAnalysis.Editor.Implementation.EditAndContinue | ||
{ | ||
internal static class ContractWrappers | ||
{ | ||
public static Contracts.ManagedActiveStatementDebugInfo ToContract(this ManagedActiveStatementDebugInfo info) | ||
=> new(ToContract(info.ActiveInstruction), info.DocumentName, ToContract(info.SourceSpan), (Contracts.ActiveStatementFlags)info.Flags); | ||
|
||
public static Contracts.ManagedInstructionId ToContract(this ManagedInstructionId id) | ||
=> new(ToContract(id.Method), id.ILOffset); | ||
|
||
public static Contracts.ManagedMethodId ToContract(this ManagedMethodId id) | ||
=> new(id.Module, id.Token, id.Version); | ||
|
||
public static Contracts.SourceSpan ToContract(this SourceSpan id) | ||
=> new(id.StartLine, id.StartColumn, id.EndLine, id.EndColumn); | ||
|
||
public static Contracts.ManagedHotReloadAvailability ToContract(this ManagedHotReloadAvailability value) | ||
=> new((Contracts.ManagedHotReloadAvailabilityStatus)value.Status, value.LocalizedMessage); | ||
|
||
public static ManagedModuleUpdates FromContract(this Contracts.ManagedModuleUpdates updates) | ||
=> new((ManagedModuleUpdateStatus)updates.Status, updates.Updates.SelectAsArray(FromContract)); | ||
|
||
public static ManagedModuleUpdate FromContract(this Contracts.ManagedModuleUpdate update) | ||
=> new( | ||
update.Module, | ||
update.ILDelta, | ||
update.MetadataDelta, | ||
update.PdbDelta, | ||
update.SequencePoints.SelectAsArray(FromContract), | ||
update.UpdatedMethods, | ||
update.UpdatedTypes, | ||
update.ActiveStatements.SelectAsArray(FromContract), | ||
update.ExceptionRegions.SelectAsArray(FromContract)); | ||
|
||
public static SequencePointUpdates FromContract(this Contracts.SequencePointUpdates updates) | ||
=> new(updates.FileName, updates.LineUpdates.SelectAsArray(FromContract)); | ||
|
||
public static SourceLineUpdate FromContract(this Contracts.SourceLineUpdate update) | ||
=> new(update.OldLine, update.NewLine); | ||
|
||
public static ManagedActiveStatementUpdate FromContract(this Contracts.ManagedActiveStatementUpdate update) | ||
=> new(FromContract(update.Method), update.ILOffset, FromContract(update.NewSpan)); | ||
|
||
public static ManagedModuleMethodId FromContract(this Contracts.ManagedModuleMethodId update) | ||
=> new(update.Token, update.Version); | ||
|
||
public static SourceSpan FromContract(this Contracts.SourceSpan id) | ||
=> new(id.StartLine, id.StartColumn, id.EndLine, id.EndColumn); | ||
|
||
public static ManagedExceptionRegionUpdate FromContract(this Contracts.ManagedExceptionRegionUpdate update) | ||
=> new(FromContract(update.Method), update.Delta, FromContract(update.NewSpan)); | ||
|
||
public static ImmutableArray<ManagedHotReloadDiagnostic> FromContract(this ImmutableArray<Contracts.ManagedHotReloadDiagnostic> diagnostics) | ||
=> diagnostics.SelectAsArray(FromContract); | ||
|
||
public static ManagedHotReloadDiagnostic FromContract(this Contracts.ManagedHotReloadDiagnostic diagnostic) | ||
=> new(diagnostic.Id, diagnostic.Message, (ManagedHotReloadDiagnosticSeverity)diagnostic.Severity, diagnostic.FilePath, FromContract(diagnostic.Span)); | ||
} | ||
} |
34 changes: 34 additions & 0 deletions
34
...itorFeatures/Core/Implementation/EditAndContinue/Contracts/ManagedHotReloadServiceImpl.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
// 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. | ||
|
||
using System; | ||
using System.Collections.Immutable; | ||
using System.Threading; | ||
using System.Threading.Tasks; | ||
using Microsoft.VisualStudio.Debugger.Contracts.HotReload; | ||
|
||
using Contracts = Microsoft.CodeAnalysis.EditAndContinue.Contracts; | ||
|
||
namespace Microsoft.CodeAnalysis.Editor.Implementation.EditAndContinue | ||
{ | ||
internal sealed class ManagedHotReloadServiceImpl : Contracts.IManagedHotReloadService | ||
{ | ||
private readonly IManagedHotReloadService _service; | ||
|
||
public ManagedHotReloadServiceImpl(IManagedHotReloadService service) | ||
=> _service = service; | ||
|
||
public async ValueTask<ImmutableArray<Contracts.ManagedActiveStatementDebugInfo>> GetActiveStatementsAsync(CancellationToken cancellation) | ||
=> (await _service.GetActiveStatementsAsync(cancellation).ConfigureAwait(false)).SelectAsArray(a => a.ToContract()); | ||
|
||
public async ValueTask<Contracts.ManagedHotReloadAvailability> GetAvailabilityAsync(Guid module, CancellationToken cancellation) | ||
=> (await _service.GetAvailabilityAsync(module, cancellation).ConfigureAwait(false)).ToContract(); | ||
|
||
public ValueTask<ImmutableArray<string>> GetCapabilitiesAsync(CancellationToken cancellation) | ||
=> _service.GetCapabilitiesAsync(cancellation); | ||
|
||
public ValueTask PrepareModuleForUpdateAsync(Guid module, CancellationToken cancellation) | ||
=> _service.PrepareModuleForUpdateAsync(module, cancellation); | ||
} | ||
} |
34 changes: 34 additions & 0 deletions
34
src/EditorFeatures/Core/Implementation/EditAndContinue/DebuggerContractVersionCheck.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
// 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. | ||
|
||
using System; | ||
using System.Runtime.CompilerServices; | ||
using Microsoft.VisualStudio.Debugger.Contracts.HotReload; | ||
|
||
namespace Microsoft.CodeAnalysis.EditAndContinue | ||
{ | ||
/// <summary> | ||
/// Temporaroly needed to allow us to run integration tests on older VS than build that has the required version of Microsoft.VisualStudio.Debugger.Contracts. | ||
/// TODO: Remove (https://github.com/dotnet/roslyn/issues/56742) | ||
/// </summary> | ||
internal static class DebuggerContractVersionCheck | ||
{ | ||
public static bool IsRequiredDebuggerContractVersionAvailable() | ||
{ | ||
try | ||
{ | ||
_ = LoadContracts(); | ||
return true; | ||
} | ||
catch | ||
{ | ||
return false; | ||
} | ||
} | ||
|
||
[MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.NoOptimization)] | ||
private static Type LoadContracts() | ||
=> typeof(ManagedHotReloadAvailability); | ||
} | ||
} |
Oops, something went wrong.