diff --git a/CHANGELOG.md b/CHANGELOG.md index 07cc95b..3e3ad28 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ # Code Editor Package for Visual Studio +## [1.0.11] - 2019-05-21 + +Fix detection of visual studio for mac installation. + ## [1.0.10] - 2019-05-04 Fix ignored comintegration executable diff --git a/Editor/VSEditor.cs b/Editor/VSEditor.cs index 598c20a..5973145 100644 --- a/Editor/VSEditor.cs +++ b/Editor/VSEditor.cs @@ -73,7 +73,7 @@ namespace VisualStudioEditor internal static Dictionary InstalledVisualStudios { get; private set; } - internal static bool IsOSX => Environment.OSVersion.Platform == PlatformID.Unix; + internal static bool IsOSX => Application.platform == RuntimePlatform.OSXEditor; internal static bool IsWindows => !IsOSX && Path.DirectorySeparatorChar == '\\' && Environment.NewLine == "\r\n"; public CodeEditor.Installation[] Installations => m_Discoverability.PathCallback(); @@ -89,7 +89,7 @@ namespace VisualStudioEditor public bool TryGetInstallationForPath(string editorPath, out CodeEditor.Installation installation) { var lowerCasePath = editorPath.ToLower(); - if (lowerCasePath.EndsWith("vcsexpress.exe")) + if (lowerCasePath.EndsWith("vcsexpress.exe", StringComparison.OrdinalIgnoreCase)) { installation = new CodeEditor.Installation { @@ -100,7 +100,9 @@ namespace VisualStudioEditor return true; } - if (lowerCasePath.EndsWith("devenv.exe")) + if (lowerCasePath.EndsWith("devenv.exe", StringComparison.OrdinalIgnoreCase) + || lowerCasePath.Replace(" ", "").EndsWith("visualstudio.app", StringComparison.OrdinalIgnoreCase) + || lowerCasePath.Replace(" ", "").EndsWith("visualstudio(preview).app", StringComparison.OrdinalIgnoreCase)) { installation = new CodeEditor.Installation { @@ -110,9 +112,9 @@ namespace VisualStudioEditor m_Installation = installation; return true; } - var filename = Path.GetFileName(lowerCasePath.Replace('\\', Path.DirectorySeparatorChar).Replace('/', Path.DirectorySeparatorChar)).Replace(" ", ""); - if (filename == "visualstudio.app" || filename == "visualstudio(preview).app" || lowerCasePath.Contains("monodevelop") || lowerCasePath.Contains("xamarinstudio") || lowerCasePath.Contains("xamarin studio")) + if (lowerCasePath.Contains("monodevelop") + || lowerCasePath.Replace(" ", "").Contains("xamarinstudio")) { installation = new CodeEditor.Installation { diff --git a/Editor/VSInitializer.cs b/Editor/VSInitializer.cs index 7dcab6f..41d4809 100644 --- a/Editor/VSInitializer.cs +++ b/Editor/VSInitializer.cs @@ -129,6 +129,9 @@ namespace VisualStudioEditor case VisualStudioVersion.VisualStudio2017: vsVersion = "15.0"; break; + case VisualStudioVersion.VisualStudio2019: + vsVersion = "16.0"; + break; // VS 2015 and under are still installed in the registry // using their project names case VisualStudioVersion.VisualStudio2015: @@ -209,6 +212,9 @@ namespace VisualStudioEditor case 15: vsVersion = VisualStudioVersion.VisualStudio2017; return true; + case 16: + vsVersion = VisualStudioVersion.VisualStudio2019; + return true; } vsVersion = VisualStudioVersion.Invalid; diff --git a/package.json b/package.json index 2a25167..22fcd54 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "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": "1.0.10", + "version": "1.0.11", "unity": "2019.2", "unityRelease": "0a12", "dependencies": {}, @@ -12,6 +12,6 @@ "repository": { "type": "git", "url": "git@github.cds.internal.unity3d.com:unity/com.unity.ide.visualstudio.git", - "revision": "6924aaf1b1348340ecfb22efee40faadd4fa379a" + "revision": "7378597cbd075d617aade65f1aa9c13a22c00d1c" } }