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:
@@ -4,6 +4,7 @@
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
using System;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using Microsoft.Win32;
|
||||
using Unity.CodeEditor;
|
||||
using IOPath = System.IO.Path;
|
||||
@@ -14,7 +15,7 @@ namespace Microsoft.Unity.VisualStudio.Editor
|
||||
{
|
||||
string Path { get; }
|
||||
bool SupportsAnalyzers { get; }
|
||||
bool SupportsCSharp8 { get; }
|
||||
Version LatestLanguageVersionSupported { get; }
|
||||
string[] GetAnalyzers();
|
||||
CodeEditor.Installation ToCodeEditorInstallation();
|
||||
}
|
||||
@@ -40,17 +41,52 @@ namespace Microsoft.Unity.VisualStudio.Editor
|
||||
}
|
||||
}
|
||||
|
||||
public bool SupportsCSharp8
|
||||
// C# language version support for Visual Studio
|
||||
private static VersionPair[] WindowsVersionTable =
|
||||
{
|
||||
// VisualStudio 2019
|
||||
new VersionPair(16,8, /* => */ 9,0),
|
||||
new VersionPair(16,0, /* => */ 8,0),
|
||||
|
||||
// VisualStudio 2017
|
||||
new VersionPair(15,7, /* => */ 7,3),
|
||||
new VersionPair(15,5, /* => */ 7,2),
|
||||
new VersionPair(15,3, /* => */ 7,1),
|
||||
new VersionPair(15,0, /* => */ 7,0),
|
||||
};
|
||||
|
||||
// C# language version support for Visual Studio for Mac
|
||||
private static VersionPair[] OSXVersionTable =
|
||||
{
|
||||
// VisualStudio for Mac 8.x
|
||||
new VersionPair(8,8, /* => */ 9,0),
|
||||
new VersionPair(8,3, /* => */ 8,0),
|
||||
new VersionPair(8,0, /* => */ 7,3),
|
||||
};
|
||||
|
||||
public Version LatestLanguageVersionSupported
|
||||
{
|
||||
get
|
||||
{
|
||||
VersionPair[] versions = null;
|
||||
|
||||
if (VisualStudioEditor.IsWindows)
|
||||
return Version >= new Version(16, 0);
|
||||
versions = WindowsVersionTable;
|
||||
|
||||
if (VisualStudioEditor.IsOSX)
|
||||
return Version >= new Version(8, 2);
|
||||
versions = OSXVersionTable;
|
||||
|
||||
return false;
|
||||
if (versions != null)
|
||||
{
|
||||
foreach(var entry in versions)
|
||||
{
|
||||
if (Version >= entry.IdeVersion)
|
||||
return entry.LanguageVersion;
|
||||
}
|
||||
}
|
||||
|
||||
// default to 7.0 given we support at least VS 2017
|
||||
return new Version(7,0);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user