You've already forked com.unity.ide.cursor
mirror of
https://github.com/boxqkrtm/com.unity.ide.cursor.git
synced 2026-05-15 06:40:08 +00:00
com.unity.ide.visualstudio@2.0.14
## [2.0.14] - 2022-01-14 Integration: - Remove package version checking. ## [2.0.13] - 2022-01-12 Integration: - Fixed wrong path to analyzers in generated projects when using external packages. - Fixed selective project generation not creating Analyzer/LangVersion nodes. - Fixed asmdef references with Player projects. Documentation: - Added new documentation including ToC, overview, how to use and images.
This commit is contained in:
@@ -11,8 +11,6 @@ using System.Net.Sockets;
|
||||
using Microsoft.Unity.VisualStudio.Editor.Messaging;
|
||||
using Microsoft.Unity.VisualStudio.Editor.Testing;
|
||||
using UnityEditor;
|
||||
using UnityEditor.PackageManager;
|
||||
using UnityEditor.PackageManager.Requests;
|
||||
using UnityEngine;
|
||||
using MessageType = Microsoft.Unity.VisualStudio.Editor.Messaging.MessageType;
|
||||
|
||||
@@ -34,16 +32,11 @@ namespace Microsoft.Unity.VisualStudio.Editor
|
||||
private static readonly object _incomingLock = new object();
|
||||
private static readonly object _clientsLock = new object();
|
||||
|
||||
private static ListRequest _listRequest;
|
||||
|
||||
static VisualStudioIntegration()
|
||||
{
|
||||
if (!VisualStudioEditor.IsEnabled)
|
||||
return;
|
||||
|
||||
if (!SessionSettings.PackageVersionChecked)
|
||||
_listRequest = UnityEditor.PackageManager.Client.List();
|
||||
|
||||
RunOnceOnUpdate(() =>
|
||||
{
|
||||
// Despite using ReuseAddress|!ExclusiveAddressUse, we can fail here:
|
||||
@@ -134,35 +127,8 @@ namespace Microsoft.Unity.VisualStudio.Editor
|
||||
OnMessage(args.Message);
|
||||
}
|
||||
|
||||
private static void HandleListRequestCompletion()
|
||||
{
|
||||
const string packageName = "com.unity.ide.visualstudio";
|
||||
|
||||
if (_listRequest.Status == StatusCode.Success)
|
||||
{
|
||||
var package = _listRequest.Result.FirstOrDefault(p => p.name == packageName);
|
||||
|
||||
if (package != null
|
||||
&& Version.TryParse(package.version, out var packageVersion)
|
||||
&& Version.TryParse(package.versions.latest, out var latestVersion)
|
||||
&& packageVersion < latestVersion)
|
||||
{
|
||||
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;
|
||||
}
|
||||
|
||||
private static void OnUpdate()
|
||||
{
|
||||
if (_listRequest != null && _listRequest.IsCompleted)
|
||||
{
|
||||
HandleListRequestCompletion();
|
||||
}
|
||||
|
||||
lock (_incomingLock)
|
||||
{
|
||||
while (_incoming.Count > 0)
|
||||
|
||||
Reference in New Issue
Block a user