diff --git a/CHANGELOG.md b/CHANGELOG.md index ba42643..ec430d1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,13 @@ # Code Editor Package for Visual Studio +## [2.0.16] - 2022-06-08 + +Integration: + +- Prevent ADB Refresh while being in safe-mode with a URP project +- Fixed an issue keeping the progress bar visible even after opening a script with Visual Studio. + + ## [2.0.15] - 2022-03-21 Integration: @@ -8,15 +16,12 @@ Integration: - Added support for keeping file/folder structure when working with external packages. - Fixed project generation not being refreshed when selecting Visual Studio as the preferred external editor. - - ## [2.0.14] - 2022-01-14 Integration: - Remove package version checking. - ## [2.0.13] - 2022-01-12 Integration: diff --git a/Editor/AppleEventIntegration~/howtobuild.txt b/Editor/AppleEventIntegration~/howtobuild.txt new file mode 100644 index 0000000..09222d1 --- /dev/null +++ b/Editor/AppleEventIntegration~/howtobuild.txt @@ -0,0 +1,5 @@ +Bundle style (release) +xcodebuild -configuration Release + +Standalone style (test) +clang++ -D BUILD_APP -framework Foundation -framework AppKit main.mm diff --git a/Editor/COMIntegration/COMIntegration~/BStrHolder.h.meta b/Editor/COMIntegration/COMIntegration~/BStrHolder.h.meta deleted file mode 100644 index 09b789f..0000000 --- a/Editor/COMIntegration/COMIntegration~/BStrHolder.h.meta +++ /dev/null @@ -1,26 +0,0 @@ -fileFormatVersion: 2 -guid: 1f68874d6ae00db4a993b9507d065658 -PluginImporter: - externalObjects: {} - serializedVersion: 2 - iconMap: {} - executionOrder: {} - defineConstraints: [] - isPreloaded: 0 - isOverridable: 1 - isExplicitlyReferenced: 0 - platformData: - - first: - Any: - second: - enabled: 1 - settings: {} - - first: - Editor: Editor - second: - enabled: 0 - settings: - DefaultValueInitialized: true - userData: - assetBundleName: - assetBundleVariant: diff --git a/Editor/COMIntegration/COMIntegration~/CMakeLists.txt.meta b/Editor/COMIntegration/COMIntegration~/CMakeLists.txt.meta deleted file mode 100644 index 1d12d0b..0000000 --- a/Editor/COMIntegration/COMIntegration~/CMakeLists.txt.meta +++ /dev/null @@ -1,7 +0,0 @@ -fileFormatVersion: 2 -guid: 7cec3e1820a40be4486946c20d7ffd00 -TextScriptImporter: - externalObjects: {} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Editor/COMIntegration/COMIntegration~/COMIntegration.cpp b/Editor/COMIntegration/COMIntegration~/COMIntegration.cpp index da7927b..375f9fd 100644 --- a/Editor/COMIntegration/COMIntegration~/COMIntegration.cpp +++ b/Editor/COMIntegration/COMIntegration~/COMIntegration.cpp @@ -11,6 +11,9 @@ #include #include +#include +#include + #include "BStrHolder.h" #include "ComPtr.h" #include "dte80a.tlh" @@ -441,6 +444,10 @@ static bool VisualStudioOpenFile( } int wmain(int argc, wchar_t* argv[]) { + + // We need this to properly display UTF16 text on the console + _setmode(_fileno(stdout), _O_U16TEXT); + if (argc != 3 && argc != 5) { std::wcerr << argc << ": wrong number of arguments\n" << "Usage: com.exe installationPath solutionPath [fileName lineNumber]" << std::endl; for (int i = 0; i < argc; i++) { diff --git a/Editor/COMIntegration/COMIntegration~/COMIntegration.cpp.meta b/Editor/COMIntegration/COMIntegration~/COMIntegration.cpp.meta deleted file mode 100644 index d0e71d6..0000000 --- a/Editor/COMIntegration/COMIntegration~/COMIntegration.cpp.meta +++ /dev/null @@ -1,27 +0,0 @@ -fileFormatVersion: 2 -guid: 6ffa4010724f8d54aacbed867d4a5aa6 -PluginImporter: - externalObjects: {} - serializedVersion: 2 - iconMap: {} - executionOrder: {} - defineConstraints: [] - isPreloaded: 0 - isOverridable: 1 - isExplicitlyReferenced: 0 - validateReferences: 1 - platformData: - - first: - Any: - second: - enabled: 1 - settings: {} - - first: - Editor: Editor - second: - enabled: 0 - settings: - DefaultValueInitialized: true - userData: - assetBundleName: - assetBundleVariant: diff --git a/Editor/COMIntegration/COMIntegration~/ComPtr.h.meta b/Editor/COMIntegration/COMIntegration~/ComPtr.h.meta deleted file mode 100644 index 261d1c0..0000000 --- a/Editor/COMIntegration/COMIntegration~/ComPtr.h.meta +++ /dev/null @@ -1,26 +0,0 @@ -fileFormatVersion: 2 -guid: 013868b12dff0dc43adcc33513ae71bf -PluginImporter: - externalObjects: {} - serializedVersion: 2 - iconMap: {} - executionOrder: {} - defineConstraints: [] - isPreloaded: 0 - isOverridable: 1 - isExplicitlyReferenced: 0 - platformData: - - first: - Any: - second: - enabled: 1 - settings: {} - - first: - Editor: Editor - second: - enabled: 0 - settings: - DefaultValueInitialized: true - userData: - assetBundleName: - assetBundleVariant: diff --git a/Editor/COMIntegration/COMIntegration~/dte80a.tlh.meta b/Editor/COMIntegration/COMIntegration~/dte80a.tlh.meta deleted file mode 100644 index 923834a..0000000 --- a/Editor/COMIntegration/COMIntegration~/dte80a.tlh.meta +++ /dev/null @@ -1,7 +0,0 @@ -fileFormatVersion: 2 -guid: 97115cd910ade104a9d05d65a6b6b7d9 -DefaultImporter: - externalObjects: {} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Editor/COMIntegration/COMIntegration~/howtobuild.txt b/Editor/COMIntegration/COMIntegration~/howtobuild.txt new file mode 100644 index 0000000..3045f70 --- /dev/null +++ b/Editor/COMIntegration/COMIntegration~/howtobuild.txt @@ -0,0 +1,6 @@ +Direct style: +cl /EHsc /std:c++17 COMIntegration.cpp /link Shlwapi.lib /out:"..\Release\COMIntegration.exe" + +CMake style: +cmake ../COMIntegration~ -B ./build +cmake --build ./build --config=release -- /p:OutDir=.. diff --git a/Editor/COMIntegration/COMIntegration~/release-build.txt b/Editor/COMIntegration/COMIntegration~/release-build.txt deleted file mode 100644 index 28d89ce..0000000 --- a/Editor/COMIntegration/COMIntegration~/release-build.txt +++ /dev/null @@ -1 +0,0 @@ -cl /EHsc /std:c++17 COMIntegration.cpp /link Shlwapi.lib /out:"..\Release\COMIntegration.exe" diff --git a/Editor/COMIntegration/COMIntegration~/release-build.txt.meta b/Editor/COMIntegration/COMIntegration~/release-build.txt.meta deleted file mode 100644 index f1bd9d7..0000000 --- a/Editor/COMIntegration/COMIntegration~/release-build.txt.meta +++ /dev/null @@ -1,7 +0,0 @@ -fileFormatVersion: 2 -guid: 3b44687349be79f4184ba013fb6ffa0c -TextScriptImporter: - externalObjects: {} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Editor/COMIntegration/Release/COMIntegration.exe b/Editor/COMIntegration/Release/COMIntegration.exe index 829c5cf..cdaaa93 100644 Binary files a/Editor/COMIntegration/Release/COMIntegration.exe and b/Editor/COMIntegration/Release/COMIntegration.exe differ diff --git a/Editor/Plugins/AppleEventIntegration.bundle/Contents/MacOS/AppleEventIntegration b/Editor/Plugins/AppleEventIntegration.bundle/Contents/MacOS/AppleEventIntegration index 2af7832..e6fa05a 100644 Binary files a/Editor/Plugins/AppleEventIntegration.bundle/Contents/MacOS/AppleEventIntegration and b/Editor/Plugins/AppleEventIntegration.bundle/Contents/MacOS/AppleEventIntegration differ diff --git a/Editor/UnityInstallation.cs b/Editor/UnityInstallation.cs index 89f1793..4a6c79d 100644 --- a/Editor/UnityInstallation.cs +++ b/Editor/UnityInstallation.cs @@ -4,6 +4,7 @@ *--------------------------------------------------------------------------------------------*/ using System; +using UnityEditor; using UnityEditor.Compilation; namespace Microsoft.Unity.VisualStudio.Editor @@ -37,6 +38,17 @@ namespace Microsoft.Unity.VisualStudio.Editor } } + private static readonly Lazy _lazyIsInSafeMode = new Lazy(() => + { + // internal static extern bool isInSafeMode { get {} } + var ieu = typeof(EditorUtility); + var pinfo = ieu.GetProperty("isInSafeMode", System.Reflection.BindingFlags.Static | System.Reflection.BindingFlags.NonPublic); + if (pinfo == null) + return false; + + return Convert.ToBoolean(pinfo.GetValue(null)); + }); + public static bool IsInSafeMode => _lazyIsInSafeMode.Value; public static Version LatestLanguageVersionSupported(Assembly assembly) { #if UNITY_2020_2_OR_NEWER diff --git a/Editor/VisualStudioEditor.cs b/Editor/VisualStudioEditor.cs index 4284d65..06816b5 100644 --- a/Editor/VisualStudioEditor.cs +++ b/Editor/VisualStudioEditor.cs @@ -175,7 +175,6 @@ namespace Microsoft.Unity.VisualStudio.Editor public void SyncAll() { - AssetDatabase.Refresh(); _generator.Sync(); } @@ -319,7 +318,9 @@ namespace Microsoft.Unity.VisualStudio.Editor CreateNoWindow = true, UseShellExecute = false, RedirectStandardOutput = true, + StandardOutputEncoding = System.Text.Encoding.Unicode, RedirectStandardError = true, + StandardErrorEncoding = System.Text.Encoding.Unicode, } }; var result = process.Start(); diff --git a/Editor/VisualStudioIntegration.cs b/Editor/VisualStudioIntegration.cs index 461cde1..570203e 100644 --- a/Editor/VisualStudioIntegration.cs +++ b/Editor/VisualStudioIntegration.cs @@ -239,6 +239,9 @@ namespace Microsoft.Unity.VisualStudio.Editor if (!EditorPrefs.GetBool("kAutoRefresh", true)) return; + if (UnityInstallation.IsInSafeMode) + return; + RunOnceOnUpdate(AssetDatabase.Refresh); } diff --git a/package.json b/package.json index 22a1ac7..c787c04 100644 --- a/package.json +++ b/package.json @@ -2,24 +2,24 @@ "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.15", + "version": "2.0.16", "unity": "2019.4", "unityRelease": "25f1", "dependencies": { "com.unity.test-framework": "1.1.9" }, "relatedPackages": { - "com.unity.ide.visualstudio.tests": "2.0.15" + "com.unity.ide.visualstudio.tests": "2.0.16" }, - "upm": { - "changelog": "Integration:\n\n- Improved project generation performance.\n- Added support for keeping file/folder structure when working with external packages.\n- Fixed project generation not being refreshed when selecting Visual Studio as the preferred external editor." + "_upm": { + "changelog": "Integration:\n\n- Prevent ADB Refresh while being in safe-mode with a URP project\n- Fixed an issue keeping the progress bar visible even after opening a script with Visual Studio." }, "upmCi": { - "footprint": "d5d60c3083dbc14a4be33dc1f8c4e7fe147ffb74" + "footprint": "3d5e14bed71dd5b89e088160c170e814d0058248" }, "repository": { "url": "https://github.cds.internal.unity3d.com/unity/com.unity.ide.visualstudio.git", "type": "git", - "revision": "ca1ece42f5a2c5484ba15a15bb975ccc1f6a1a3c" + "revision": "c01855ef6461b821ab0226135e96a4ee86de96be" } }