You've already forked com.unity.ide.cursor
mirror of
https://github.com/boxqkrtm/com.unity.ide.cursor.git
synced 2026-05-14 22:30:10 +00:00
com.unity.ide.visualstudio@2.0.7
## [2.0.7] - 2021-02-02 Integration: Remove com.unity.nuget.newtonsoft-json dependency in favor of the built-in JsonUtility for the VS Test Runner. ## [2.0.6] - 2021-01-20 Project generation: - Improved language version detection. Integration: - Added support for the VS Test Runner. - Added initial support for displaying asset usage. - Fixed remaining issues with special characters in file/path.
This commit is contained in:
27
Editor/UnityInstallation.cs
Normal file
27
Editor/UnityInstallation.cs
Normal file
@@ -0,0 +1,27 @@
|
||||
/*---------------------------------------------------------------------------------------------
|
||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
* Licensed under the MIT License. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
using System;
|
||||
using UnityEditor.Compilation;
|
||||
|
||||
namespace Microsoft.Unity.VisualStudio.Editor
|
||||
{
|
||||
internal static class UnityInstallation
|
||||
{
|
||||
public static Version LatestLanguageVersionSupported(Assembly assembly)
|
||||
{
|
||||
#if UNITY_2020_2_OR_NEWER
|
||||
if (assembly?.compilerOptions != null && Version.TryParse(assembly.compilerOptions.LanguageVersion, out var result))
|
||||
return result;
|
||||
|
||||
// if parsing fails, we know at least we have support for 8.0
|
||||
return new Version(8, 0);
|
||||
#else
|
||||
return new Version(7, 3);
|
||||
#endif
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user