From 8878c0e1626ce579048032db054322fee0555064 Mon Sep 17 00:00:00 2001 From: Marco Peyrot Date: Wed, 7 Dec 2022 14:48:11 -0800 Subject: [PATCH] Create DkmCustomUIVisualizerInfo instances with ExtensionPartId field (#65730) * Create DkmCustomUIVisualizerInfo instances with ExtensionPartId field * Address Comments --- eng/Versions.props | 4 +-- .../DebuggerVisualizerAttributeTests.cs | 6 +++-- .../ResultProvider/Helpers/TypeHelpers.cs | 3 ++- .../DkmClrDebuggerVisualizerAttribute.cs | 6 ++++- .../Debugger/Engine/DkmClrType.cs | 3 ++- .../Engine/DkmCustomUIVisualizerInfo.cs | 27 +++++++++++++++++++ .../ResultProvider/ResultProviderTestBase.cs | 3 ++- 7 files changed, 44 insertions(+), 8 deletions(-) diff --git a/eng/Versions.props b/eng/Versions.props index 97cc64c666424..81d0e858f3712 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -142,8 +142,8 @@ $(VisualStudioEditorPackagesVersion) 17.4.0-beta.22368.1 17.4.0-beta.22368.1 - 17.0.1042805-preview - 17.0.1042805-preview + 17.5.1120201-preview + 17.5.1120201-preview $(MicrosoftVisualStudioShellPackagesVersion) 17.0.0-preview-1-30928-1112 $(MicrosoftVisualStudioShellPackagesVersion) diff --git a/src/ExpressionEvaluator/CSharp/Test/ResultProvider/DebuggerVisualizerAttributeTests.cs b/src/ExpressionEvaluator/CSharp/Test/ResultProvider/DebuggerVisualizerAttributeTests.cs index 81fe8fbecc5ae..6980821259182 100644 --- a/src/ExpressionEvaluator/CSharp/Test/ResultProvider/DebuggerVisualizerAttributeTests.cs +++ b/src/ExpressionEvaluator/CSharp/Test/ResultProvider/DebuggerVisualizerAttributeTests.cs @@ -59,13 +59,15 @@ public Q() { } UISideVisualizerAssemblyName = typeP.Assembly.FullName, UISideVisualizerAssemblyLocation = DkmClrCustomVisualizerAssemblyLocation.Unknown, DebuggeeSideVisualizerTypeName = defaultDebuggeeSideVisualizerTypeName, - DebuggeeSideVisualizerAssemblyName = defaultDebuggeeSideVisualizerAssemblyName}, + DebuggeeSideVisualizerAssemblyName = defaultDebuggeeSideVisualizerAssemblyName, + ExtensionPartId = Guid.Empty}, new DkmCustomUIVisualizerInfo { Id = 1, Description = "Q Visualizer", MenuName = "Q Visualizer", Metric = "ClrCustomVisualizerVSHost", UISideVisualizerTypeName = typeQ.FullName, UISideVisualizerAssemblyName = typeQ.Assembly.FullName, UISideVisualizerAssemblyLocation = DkmClrCustomVisualizerAssemblyLocation.Unknown, DebuggeeSideVisualizerTypeName = defaultDebuggeeSideVisualizerTypeName, - DebuggeeSideVisualizerAssemblyName = defaultDebuggeeSideVisualizerAssemblyName} + DebuggeeSideVisualizerAssemblyName = defaultDebuggeeSideVisualizerAssemblyName, + ExtensionPartId = Guid.Empty} }; Verify(evalResult, diff --git a/src/ExpressionEvaluator/Core/Source/ResultProvider/Helpers/TypeHelpers.cs b/src/ExpressionEvaluator/Core/Source/ResultProvider/Helpers/TypeHelpers.cs index 5c2c5b83c23cc..606f3053d70f1 100644 --- a/src/ExpressionEvaluator/Core/Source/ResultProvider/Helpers/TypeHelpers.cs +++ b/src/ExpressionEvaluator/Core/Source/ResultProvider/Helpers/TypeHelpers.cs @@ -633,7 +633,8 @@ internal static DkmCustomUIVisualizerInfo[] GetDebuggerCustomUIVisualizerInfo(th visualizerAttribute.UISideVisualizerAssemblyName, visualizerAttribute.UISideVisualizerAssemblyLocation, visualizerAttribute.DebuggeeSideVisualizerTypeName, - visualizerAttribute.DebuggeeSideVisualizerAssemblyName)); + visualizerAttribute.DebuggeeSideVisualizerAssemblyName, + visualizerAttribute.ExtensionPartId)); } underlyingType = underlyingType.GetBaseTypeOrNull(appDomain, out type); diff --git a/src/ExpressionEvaluator/Core/Test/ResultProvider/Debugger/Engine/DkmClrDebuggerVisualizerAttribute.cs b/src/ExpressionEvaluator/Core/Test/ResultProvider/Debugger/Engine/DkmClrDebuggerVisualizerAttribute.cs index b40d7da466d27..09a006e0fb304 100644 --- a/src/ExpressionEvaluator/Core/Test/ResultProvider/Debugger/Engine/DkmClrDebuggerVisualizerAttribute.cs +++ b/src/ExpressionEvaluator/Core/Test/ResultProvider/Debugger/Engine/DkmClrDebuggerVisualizerAttribute.cs @@ -25,13 +25,15 @@ public class DkmClrDebuggerVisualizerAttribute : DkmClrEvalAttribute /// [Required] The full name of the debuggee-side visualizer type /// [Required] The full name of the debuggee-side visualizer assembly /// [Required] The visualizer description + /// [Required] This is a unique id for visualizers that are installed via the ExtensionPartManager. internal DkmClrDebuggerVisualizerAttribute(string targetMember, string uiSideVisualizerTypeName, string uiSideVisualizerAssemblyName, DkmClrCustomVisualizerAssemblyLocation uiSideVisualizerAssemblyLocation, string debuggeeSideVisualizerTypeName, string debuggeeSideVisualizerAssemblyName, - string visualizerDescription) : + string visualizerDescription, + System.Guid extensionPartId) : base(null) { UISideVisualizerTypeName = uiSideVisualizerTypeName; @@ -40,6 +42,7 @@ internal DkmClrDebuggerVisualizerAttribute(string targetMember, DebuggeeSideVisualizerTypeName = debuggeeSideVisualizerTypeName; DebuggeeSideVisualizerAssemblyName = debuggeeSideVisualizerAssemblyName; VisualizerDescription = visualizerDescription; + ExtensionPartId = extensionPartId; } public readonly string UISideVisualizerTypeName; @@ -48,6 +51,7 @@ internal DkmClrDebuggerVisualizerAttribute(string targetMember, public readonly string DebuggeeSideVisualizerTypeName; public readonly string DebuggeeSideVisualizerAssemblyName; public readonly string VisualizerDescription; + public readonly System.Guid ExtensionPartId; } } diff --git a/src/ExpressionEvaluator/Core/Test/ResultProvider/Debugger/Engine/DkmClrType.cs b/src/ExpressionEvaluator/Core/Test/ResultProvider/Debugger/Engine/DkmClrType.cs index 7d2a6b0411ba9..20339c168082e 100644 --- a/src/ExpressionEvaluator/Core/Test/ResultProvider/Debugger/Engine/DkmClrType.cs +++ b/src/ExpressionEvaluator/Core/Test/ResultProvider/Debugger/Engine/DkmClrType.cs @@ -364,7 +364,8 @@ private static DkmClrDebuggerVisualizerAttribute[] GetDebuggerVisualizerAttribut uiSideVisualizerAssemblyLocation: Evaluation.DkmClrCustomVisualizerAssemblyLocation.Unknown, debuggeeSideVisualizerTypeName: debuggeeSideVisualizerTypeName, debuggeeSideVisualizerAssemblyName: debuggeeSideVisualizerAssemblyName, - visualizerDescription: visualizerDescription)); + visualizerDescription: visualizerDescription, + extensionPartId: System.Guid.Empty)); } return builder.ToArrayAndFree(); diff --git a/src/ExpressionEvaluator/Core/Test/ResultProvider/Debugger/Engine/DkmCustomUIVisualizerInfo.cs b/src/ExpressionEvaluator/Core/Test/ResultProvider/Debugger/Engine/DkmCustomUIVisualizerInfo.cs index 30887c7b8d5ab..8862ede162608 100644 --- a/src/ExpressionEvaluator/Core/Test/ResultProvider/Debugger/Engine/DkmCustomUIVisualizerInfo.cs +++ b/src/ExpressionEvaluator/Core/Test/ResultProvider/Debugger/Engine/DkmCustomUIVisualizerInfo.cs @@ -19,6 +19,7 @@ public class DkmCustomUIVisualizerInfo public DkmClrCustomVisualizerAssemblyLocation UISideVisualizerAssemblyLocation; public string DebuggeeSideVisualizerTypeName; public string DebuggeeSideVisualizerAssemblyName; + public Guid ExtensionPartId; public static DkmCustomUIVisualizerInfo Create(uint Id, string MenuName, string Description, string Metric) { @@ -54,5 +55,31 @@ public static DkmCustomUIVisualizerInfo Create(uint Id, DebuggeeSideVisualizerAssemblyName = DebuggeeSideVisualizerAssemblyName }; } + + public static DkmCustomUIVisualizerInfo Create(uint Id, + string MenuName, + string Description, + string Metric, + string UISideVisualizerTypeName, + string UISideVisualizerAssemblyName, + DkmClrCustomVisualizerAssemblyLocation UISideVisualizerAssemblyLocation, + string DebuggeeSideVisualizerTypeName, + string DebuggeeSideVisualizerAssemblyName, + Guid ExtensionPartId) + { + return new DkmCustomUIVisualizerInfo + { + Id = Id, + MenuName = MenuName, + Description = Description, + Metric = Metric, + UISideVisualizerTypeName = UISideVisualizerTypeName, + UISideVisualizerAssemblyName = UISideVisualizerAssemblyName, + UISideVisualizerAssemblyLocation = UISideVisualizerAssemblyLocation, + DebuggeeSideVisualizerTypeName = DebuggeeSideVisualizerTypeName, + DebuggeeSideVisualizerAssemblyName = DebuggeeSideVisualizerAssemblyName, + ExtensionPartId = ExtensionPartId + }; + } } } diff --git a/src/ExpressionEvaluator/Core/Test/ResultProvider/ResultProviderTestBase.cs b/src/ExpressionEvaluator/Core/Test/ResultProvider/ResultProviderTestBase.cs index 634ef933a7c6d..f975b2faf9285 100644 --- a/src/ExpressionEvaluator/Core/Test/ResultProvider/ResultProviderTestBase.cs +++ b/src/ExpressionEvaluator/Core/Test/ResultProvider/ResultProviderTestBase.cs @@ -553,7 +553,8 @@ bool IEqualityComparer.Equals(DkmCustomUIVisualizerIn x.UISideVisualizerAssemblyName == y.UISideVisualizerAssemblyName && x.UISideVisualizerAssemblyLocation == y.UISideVisualizerAssemblyLocation && x.DebuggeeSideVisualizerTypeName == y.DebuggeeSideVisualizerTypeName && - x.DebuggeeSideVisualizerAssemblyName == y.DebuggeeSideVisualizerAssemblyName); + x.DebuggeeSideVisualizerAssemblyName == y.DebuggeeSideVisualizerAssemblyName && + x.ExtensionPartId == y.ExtensionPartId); } int IEqualityComparer.GetHashCode(DkmCustomUIVisualizerInfo obj)