diff --git a/CHANGELOG.md b/CHANGELOG.md index a1a1395..3219ca2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,14 @@ # Code Editor Package for Visual Studio +## [2.0.12] - 2021-10-20 + +Integration: + +- Do not block asset opening when only a VS instance without a loaded solution is found. +- Only check package version once per Unity session. +- Improved support for Visual Studio For Mac 2022. + + ## [2.0.11] - 2021-07-01 Integration: diff --git a/Editor/COMIntegration/COMIntegration~/COMIntegration.cpp b/Editor/COMIntegration/COMIntegration~/COMIntegration.cpp index 9c48032..da7927b 100644 --- a/Editor/COMIntegration/COMIntegration~/COMIntegration.cpp +++ b/Editor/COMIntegration/COMIntegration~/COMIntegration.cpp @@ -256,8 +256,10 @@ static win::ComPtr FindRunningVisualStudioWithSolution( continue; std::filesystem::path currentSolutionPath = std::wstring(solutionFullName); - if (!currentSolutionPath.empty()) - std::wcout << "Visual Studio opened on " << currentSolutionPath.wstring() << std::endl; + if (currentSolutionPath.empty()) + continue; + + std::wcout << "Visual Studio opened on " << currentSolutionPath.wstring() << std::endl; // If the name matches the solution we want to open and we have a Visual Studio installation path to use and this one matches that path, then use it. // If we don't have a Visual Studio installation path to use, just use this solution. diff --git a/Editor/COMIntegration/Release/COMIntegration.exe b/Editor/COMIntegration/Release/COMIntegration.exe index 4930d8c..e6fc377 100644 Binary files a/Editor/COMIntegration/Release/COMIntegration.exe and b/Editor/COMIntegration/Release/COMIntegration.exe differ diff --git a/Editor/Discovery.cs b/Editor/Discovery.cs index cdb64e1..8b6f93e 100644 --- a/Editor/Discovery.cs +++ b/Editor/Discovery.cs @@ -74,6 +74,9 @@ namespace Microsoft.Unity.VisualStudio.Editor if (!File.Exists(fvi)) fvi = Path.Combine(editorPath, "Contents/MonoBundle/VisualStudio.exe"); + + if (!File.Exists(fvi)) + fvi = Path.Combine(editorPath, "Contents/MonoBundle/VisualStudio.dll"); } if (!File.Exists(fvi)) diff --git a/Editor/SessionSettings.cs b/Editor/SessionSettings.cs new file mode 100644 index 0000000..b5a99d0 --- /dev/null +++ b/Editor/SessionSettings.cs @@ -0,0 +1,31 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ + +using System.Runtime.CompilerServices; +using UnityEditor; +using UnityEngine; + +namespace Microsoft.Unity.VisualStudio.Editor +{ + internal static class SessionSettings + { + internal static string GetKey([CallerMemberName] string memberName = "") + { + return $"{typeof(SessionSettings).FullName}.{memberName}"; + } + + public static bool PackageVersionChecked + { + get + { + return SessionState.GetBool(GetKey(), false); + } + set + { + SessionState.SetBool(GetKey(), value); + } + } + } +} diff --git a/Editor/SessionSettings.cs.meta b/Editor/SessionSettings.cs.meta new file mode 100644 index 0000000..879aab4 --- /dev/null +++ b/Editor/SessionSettings.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 4d1e1d921eed0044e9fe0cd3ab6444ba +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Editor/VisualStudioIntegration.cs b/Editor/VisualStudioIntegration.cs index 5683170..1ba5ea5 100644 --- a/Editor/VisualStudioIntegration.cs +++ b/Editor/VisualStudioIntegration.cs @@ -41,7 +41,8 @@ namespace Microsoft.Unity.VisualStudio.Editor if (!VisualStudioEditor.IsEnabled) return; - _listRequest = UnityEditor.PackageManager.Client.List(); + if (!SessionSettings.PackageVersionChecked) + _listRequest = UnityEditor.PackageManager.Client.List(); RunOnceOnUpdate(() => { @@ -148,6 +149,8 @@ namespace Microsoft.Unity.VisualStudio.Editor { Debug.LogWarning($"Visual Studio Editor Package version {package.versions.latest} is available, we strongly encourage you to update from the Unity Package Manager for a better Visual Studio integration"); } + + SessionSettings.PackageVersionChecked = true; } _listRequest = null; diff --git a/package.json b/package.json index 792e140..a1fd85c 100644 --- a/package.json +++ b/package.json @@ -2,21 +2,21 @@ "name": "com.unity.ide.visualstudio", "displayName": "Visual Studio Editor", "description": "Code editor integration for supporting Visual Studio as code editor for unity. Adds support for generating csproj files for intellisense purposes, auto discovery of installations, etc.", - "version": "2.0.11", + "version": "2.0.12", "unity": "2019.4", "unityRelease": "25f1", "dependencies": { "com.unity.test-framework": "1.1.9" }, "relatedPackages": { - "com.unity.ide.visualstudio.tests": "2.0.11" + "com.unity.ide.visualstudio.tests": "2.0.12" }, "upmCi": { - "footprint": "321c90e37eb1ab86fe68d5f7e838c7e4553fc37e" + "footprint": "bccd4d0383df110ebef0c62f85b5ac7cb9464de3" }, "repository": { "url": "https://github.cds.internal.unity3d.com/unity/com.unity.ide.visualstudio.git", "type": "git", - "revision": "680e06d94ffca728223ae2cb14bb919cd354e2c1" + "revision": "8d436ff053b9c59677b5e9799208143553cd02d9" } }