Skip to content

Commit

Permalink
com.unity.ide.visualstudio@2.0.16
Browse files Browse the repository at this point in the history
## [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.
  • Loading branch information
Unity Technologies committed Jun 8, 2022
1 parent b132c03 commit 7c58d41
Show file tree
Hide file tree
Showing 17 changed files with 49 additions and 111 deletions.
11 changes: 8 additions & 3 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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:
Expand All @@ -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:
Expand Down
5 changes: 5 additions & 0 deletions Editor/AppleEventIntegration~/howtobuild.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
Bundle style (release)
xcodebuild -configuration Release

Standalone style (test)
clang++ -D BUILD_APP -framework Foundation -framework AppKit main.mm
26 changes: 0 additions & 26 deletions Editor/COMIntegration/COMIntegration~/BStrHolder.h.meta

This file was deleted.

7 changes: 0 additions & 7 deletions Editor/COMIntegration/COMIntegration~/CMakeLists.txt.meta

This file was deleted.

7 changes: 7 additions & 0 deletions Editor/COMIntegration/COMIntegration~/COMIntegration.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@
#include <windows.h>
#include <shlwapi.h>

#include <fcntl.h>
#include <io.h>

#include "BStrHolder.h"
#include "ComPtr.h"
#include "dte80a.tlh"
Expand Down Expand Up @@ -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++) {
Expand Down
27 changes: 0 additions & 27 deletions Editor/COMIntegration/COMIntegration~/COMIntegration.cpp.meta

This file was deleted.

26 changes: 0 additions & 26 deletions Editor/COMIntegration/COMIntegration~/ComPtr.h.meta

This file was deleted.

7 changes: 0 additions & 7 deletions Editor/COMIntegration/COMIntegration~/dte80a.tlh.meta

This file was deleted.

6 changes: 6 additions & 0 deletions Editor/COMIntegration/COMIntegration~/howtobuild.txt
Original file line number Diff line number Diff line change
@@ -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=..
1 change: 0 additions & 1 deletion Editor/COMIntegration/COMIntegration~/release-build.txt

This file was deleted.

7 changes: 0 additions & 7 deletions Editor/COMIntegration/COMIntegration~/release-build.txt.meta

This file was deleted.

Binary file modified Editor/COMIntegration/Release/COMIntegration.exe
Binary file not shown.
Binary file not shown.
12 changes: 12 additions & 0 deletions Editor/UnityInstallation.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
*--------------------------------------------------------------------------------------------*/

using System;
using UnityEditor;
using UnityEditor.Compilation;

namespace Microsoft.Unity.VisualStudio.Editor
Expand Down Expand Up @@ -37,6 +38,17 @@ public static bool IsMainUnityEditorProcess
}
}

private static readonly Lazy<bool> _lazyIsInSafeMode = new Lazy<bool>(() =>
{
// 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
Expand Down
3 changes: 2 additions & 1 deletion Editor/VisualStudioEditor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,6 @@ public void SyncIfNeeded(string[] addedFiles, string[] deletedFiles, string[] mo

public void SyncAll()
{
AssetDatabase.Refresh();
_generator.Sync();
}

Expand Down Expand Up @@ -319,7 +318,9 @@ private bool OpenWindowsApp(string path, int line)
CreateNoWindow = true,
UseShellExecute = false,
RedirectStandardOutput = true,
StandardOutputEncoding = System.Text.Encoding.Unicode,
RedirectStandardError = true,
StandardErrorEncoding = System.Text.Encoding.Unicode,
}
};
var result = process.Start();
Expand Down
3 changes: 3 additions & 0 deletions Editor/VisualStudioIntegration.cs
Original file line number Diff line number Diff line change
Expand Up @@ -239,6 +239,9 @@ private static void Refresh()
if (!EditorPrefs.GetBool("kAutoRefresh", true))
return;

if (UnityInstallation.IsInSafeMode)
return;

RunOnceOnUpdate(AssetDatabase.Refresh);
}

Expand Down
12 changes: 6 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
}

0 comments on commit 7c58d41

Please sign in to comment.