Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
## [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.
  • Loading branch information
Unity Technologies committed Oct 20, 2021
1 parent f6444c6 commit 1543604
Show file tree
Hide file tree
Showing 8 changed files with 66 additions and 7 deletions.
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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:
Expand Down
6 changes: 4 additions & 2 deletions Editor/COMIntegration/COMIntegration~/COMIntegration.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -256,8 +256,10 @@ static win::ComPtr<EnvDTE::_DTE> 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.
Expand Down
Binary file modified Editor/COMIntegration/Release/COMIntegration.exe
Binary file not shown.
3 changes: 3 additions & 0 deletions Editor/Discovery.cs
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,9 @@ public static bool TryDiscoverInstallation(string editorPath, out IVisualStudioI

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))
Expand Down
31 changes: 31 additions & 0 deletions Editor/SessionSettings.cs
Original file line number Diff line number Diff line change
@@ -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);
}
}
}
}
11 changes: 11 additions & 0 deletions Editor/SessionSettings.cs.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 4 additions & 1 deletion Editor/VisualStudioIntegration.cs
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,8 @@ static VisualStudioIntegration()
if (!VisualStudioEditor.IsEnabled)
return;

_listRequest = UnityEditor.PackageManager.Client.List();
if (!SessionSettings.PackageVersionChecked)
_listRequest = UnityEditor.PackageManager.Client.List();

RunOnceOnUpdate(() =>
{
Expand Down Expand Up @@ -148,6 +149,8 @@ private static void HandleListRequestCompletion()
{
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;
Expand Down
8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
}

0 comments on commit 1543604

Please sign in to comment.