From a83e2ad7489864cf461c1eb39668d4c75dce6c3b Mon Sep 17 00:00:00 2001 From: Sandy Armstrong Date: Thu, 17 Mar 2022 20:08:30 -0700 Subject: [PATCH] EditorFeatures.Cocoa: Build with net6.0 (#59429) Co-authored-by: David Wengier --- eng/Versions.props | 55 ++++++++++--------- ...t.CodeAnalysis.EditorFeatures.Cocoa.csproj | 43 +++++++++++++-- .../Core.Cocoa/Preview/PreviewPane.cs | 3 +- .../InProcess/EditorInProcess.cs | 4 +- 4 files changed, 71 insertions(+), 34 deletions(-) diff --git a/eng/Versions.props b/eng/Versions.props index caad4d4c66a94..9c839f3c31199 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -25,12 +25,11 @@ 0.1.132-beta 4.1.0 - 16.10.230 - 17.0.487 + 17.2.178-preview 5.0.0-alpha1.19409.1 5.0.0-preview.1.20112.8 17.2.3 - 17.0.31723.112 + 17.2.0-preview-1-32131-009 16.5.0 4.5.0 4.5.4 - 2.0.4 + 2.0.7 1.1.0.14 1.1.33 17.0.1056-Dev17PIAs-g9dffd635 @@ -266,7 +269,7 @@ create a test insertion in Visual Studio to validate. --> 13.0.1 - 2.11.14-alpha + 2.11.16-alpha + net6.0 $(DefineConstants);COCOA + + false + + + $(NoWarn);NU1701;CA1416;CS8601;CS8618;CS8622 true @@ -30,19 +37,34 @@ - - + - - - + + + + + + + + + + + + + + @@ -62,4 +84,13 @@ + + + + + + + + \ No newline at end of file diff --git a/src/EditorFeatures/Core.Cocoa/Preview/PreviewPane.cs b/src/EditorFeatures/Core.Cocoa/Preview/PreviewPane.cs index b395e9abea6dd..310dc50111ba5 100644 --- a/src/EditorFeatures/Core.Cocoa/Preview/PreviewPane.cs +++ b/src/EditorFeatures/Core.Cocoa/Preview/PreviewPane.cs @@ -6,6 +6,7 @@ using System.Collections.Generic; using AppKit; using Foundation; +using ObjCRuntime; using Microsoft.CodeAnalysis.Editor.Shared.Extensions; using Microsoft.VisualStudio.Text.Differencing; @@ -95,7 +96,7 @@ public PreviewPane(string? id, string? title, Uri? helpLink, string? helpLinkToo new Microsoft.VisualStudio.Text.SnapshotPoint(_differenceViewerPreview.Viewer.InlineView.TextSnapshot, 0)); } - public PreviewPane(IntPtr ptr) + public PreviewPane(NativeHandle ptr) : base(ptr) { } diff --git a/src/VisualStudio/IntegrationTest/New.IntegrationTests/InProcess/EditorInProcess.cs b/src/VisualStudio/IntegrationTest/New.IntegrationTests/InProcess/EditorInProcess.cs index b6643a1f77ae1..b6a4ee7ba475c 100644 --- a/src/VisualStudio/IntegrationTest/New.IntegrationTests/InProcess/EditorInProcess.cs +++ b/src/VisualStudio/IntegrationTest/New.IntegrationTests/InProcess/EditorInProcess.cs @@ -5,6 +5,7 @@ using System; using System.Collections.Generic; using System.Collections.Immutable; +using System.Diagnostics; using System.Linq; using System.Runtime.InteropServices; using System.Text; @@ -962,7 +963,8 @@ public async Task GoToBaseAsync(CancellationToken cancellationToken) { await JoinableTaskFactory.SwitchToMainThreadAsync(cancellationToken); - await TestServices.Shell.ExecuteCommandAsync(EditorConstants.EditorCommandID.GoToBase, cancellationToken); + Debug.Assert(new Version("17.2.32210.308") >= await TestServices.Shell.GetVersionAsync(cancellationToken), "After updating CI to 17.2 Preview 2, the following call to ExecuteCommandAsync should has its first parameter, and uint cast, removed leaving just EditorConstants.EditorCommandID.GoToBase instead of an explicit CommandID and Guid."); + await TestServices.Shell.ExecuteCommandAsync(EditorConstants.EditorCommandSet, (uint)EditorConstants.EditorCommandID.GoToBase, cancellationToken); await TestServices.Workspace.WaitForAsyncOperationsAsync(FeatureAttribute.Workspace, cancellationToken);