Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
## [2.0.5] - 2020-10-30

Integration:

Disable legacy pdb symbol checking for Unity packages
  • Loading branch information
Unity Technologies committed Oct 30, 2020
1 parent 32027b4 commit 08ab0fb
Show file tree
Hide file tree
Showing 25 changed files with 1,481 additions and 1,157 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# Code Editor Package for Visual Studio

## [2.0.5] - 2020-10-30

Integration:

Disable legacy pdb symbol checking for Unity packages


## [2.0.3] - 2020-09-09

Project generation:
Expand Down
4 changes: 4 additions & 0 deletions Editor/AssemblyInfo.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
using System.Runtime.CompilerServices;

[assembly:InternalsVisibleTo("Unity.VisualStudio.EditorTests")]
[assembly: InternalsVisibleTo("DynamicProxyGenAssembly2")]
3 changes: 3 additions & 0 deletions Editor/AssemblyInfo.cs.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

15 changes: 9 additions & 6 deletions Editor/Discovery.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,10 @@ namespace Microsoft.Unity.VisualStudio.Editor
{
internal static class Discovery
{
public static IEnumerable<VisualStudioInstallation> GetVisualStudioInstallations()
internal const string ManagedWorkload = "Microsoft.VisualStudio.Workload.ManagedGame";


public static IEnumerable<IVisualStudioInstallation> GetVisualStudioInstallations()
{
if (VisualStudioEditor.IsWindows)
{
Expand Down Expand Up @@ -45,7 +48,7 @@ private static bool IsCandidateToDiscovery(string path)
return false;
}

public static bool TryDiscoverInstallation(string editorPath, out VisualStudioInstallation installation)
public static bool TryDiscoverInstallation(string editorPath, out IVisualStudioInstallation installation)
{
installation = null;

Expand All @@ -61,7 +64,7 @@ public static bool TryDiscoverInstallation(string editorPath, out VisualStudioIn
// On Mac we use the .app folder, so we need to access to main assembly
if (VisualStudioEditor.IsOSX)
fvi = Path.Combine(editorPath, "Contents", "Resources", "lib", "monodevelop", "bin", "VisualStudio.exe");

if (!File.Exists(fvi))
return false;

Expand All @@ -82,7 +85,7 @@ public static bool TryDiscoverInstallation(string editorPath, out VisualStudioIn
}

#region VsWhere Json Schema
#pragma warning disable CS0649
#pragma warning disable CS0649
[Serializable]
internal class VsWhereResult
{
Expand All @@ -95,7 +98,7 @@ public static VsWhereResult FromJson(string json)

public IEnumerable<VisualStudioInstallation> ToVisualStudioInstallations()
{
foreach(var entry in entries)
foreach (var entry in entries)
{
yield return new VisualStudioInstallation()
{
Expand Down Expand Up @@ -123,7 +126,7 @@ internal class VsWhereCatalog
public string productDisplayVersion; // non parseable like "16.3.0 Preview 3.0"
public string buildVersion;
}
#pragma warning restore CS3021
#pragma warning restore CS3021
#endregion

private static IEnumerable<VisualStudioInstallation> QueryVsWhere()
Expand Down
8 changes: 8 additions & 0 deletions Editor/FileUtility.cs
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,14 @@ public static string Normalize(string path)
return path.Replace(string.Concat(WinSeparator, WinSeparator), WinSeparator.ToString());
}

public static string NormalizeWindowsToUnix(string path)
{
if (string.IsNullOrEmpty(path))
return path;

return path.Replace(WinSeparator, UnixSeparator);
}

internal static bool IsFileInProjectDirectory(string fileName)
{
var basePath = Path.GetFullPath(Path.Combine(Application.dataPath, ".."));
Expand Down
65 changes: 33 additions & 32 deletions Editor/Image.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,28 +7,29 @@

namespace Microsoft.Unity.VisualStudio.Editor
{
public sealed class Image : IDisposable {
public sealed class Image : IDisposable
{

long position;
Stream stream;

Image (Stream stream)
Image(Stream stream)
{
this.stream = stream;
this.position = stream.Position;
this.stream.Position = 0;
}

bool Advance (int length)
bool Advance(int length)
{
if (stream.Position + length >= stream.Length)
return false;

stream.Seek (length, SeekOrigin.Current);
stream.Seek(length, SeekOrigin.Current);
return true;
}

bool MoveTo (uint position)
bool MoveTo(uint position)
{
if (position >= stream.Length)
return false;
Expand All @@ -37,65 +38,65 @@ bool MoveTo (uint position)
return true;
}

void IDisposable.Dispose ()
void IDisposable.Dispose()
{
stream.Position = position;
}

ushort ReadUInt16 ()
ushort ReadUInt16()
{
return (ushort) (stream.ReadByte ()
| (stream.ReadByte () << 8));
return (ushort)(stream.ReadByte()
| (stream.ReadByte() << 8));
}

uint ReadUInt32 ()
uint ReadUInt32()
{
return (uint) (stream.ReadByte ()
| (stream.ReadByte () << 8)
| (stream.ReadByte () << 16)
| (stream.ReadByte () << 24));
return (uint)(stream.ReadByte()
| (stream.ReadByte() << 8)
| (stream.ReadByte() << 16)
| (stream.ReadByte() << 24));
}

bool IsManagedAssembly ()
bool IsManagedAssembly()
{
if (stream.Length < 318)
return false;
if (ReadUInt16 () != 0x5a4d)
if (ReadUInt16() != 0x5a4d)
return false;
if (!Advance (58))
if (!Advance(58))
return false;
if (!MoveTo (ReadUInt32 ()))
if (!MoveTo(ReadUInt32()))
return false;
if (ReadUInt32 () != 0x00004550)
if (ReadUInt32() != 0x00004550)
return false;
if (!Advance (20))
if (!Advance(20))
return false;
if (!Advance (ReadUInt16 () == 0x20b ? 222 : 206))
if (!Advance(ReadUInt16() == 0x20b ? 222 : 206))
return false;

return ReadUInt32 () != 0;
return ReadUInt32() != 0;
}

public static bool IsAssembly (string file)
public static bool IsAssembly(string file)
{
if (file == null)
throw new ArgumentNullException ("file");
throw new ArgumentNullException("file");

using (var stream = new FileStream (file, FileMode.Open, FileAccess.Read, FileShare.Read))
return IsAssembly (stream);
using (var stream = new FileStream(file, FileMode.Open, FileAccess.Read, FileShare.Read))
return IsAssembly(stream);
}

public static bool IsAssembly (Stream stream)
public static bool IsAssembly(Stream stream)
{
if (stream == null)
throw new ArgumentNullException (nameof(stream));
throw new ArgumentNullException(nameof(stream));
if (!stream.CanRead)
throw new ArgumentException (nameof(stream));
throw new ArgumentException(nameof(stream));
if (!stream.CanSeek)
throw new ArgumentException (nameof(stream));
throw new ArgumentException(nameof(stream));

using (var image = new Image (stream))
return image.IsManagedAssembly ();
using (var image = new Image(stream))
return image.IsManagedAssembly();
}
}
}
2 changes: 1 addition & 1 deletion Editor/Plugins/AppleEventIntegration.bundle/Contents.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

20 changes: 13 additions & 7 deletions Editor/Plugins/AppleEventIntegration.bundle/Contents/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<plist version="1.0">
<dict>
<key>BuildMachineOSBuild</key>
<string>19B88</string>
<string>19H2</string>
<key>CFBundleDevelopmentRegion</key>
<string>en</string>
<key>CFBundleExecutable</key>
Expand All @@ -14,6 +14,8 @@
<string>6.0</string>
<key>CFBundleName</key>
<string>AppleEventIntegration</string>
<key>CFBundlePackageType</key>
<string>BNDL</string>
<key>CFBundleShortVersionString</key>
<string>1.0</string>
<key>CFBundleSupportedPlatforms</key>
Expand All @@ -25,17 +27,21 @@
<key>DTCompiler</key>
<string>com.apple.compilers.llvm.clang.1_0</string>
<key>DTPlatformBuild</key>
<string>10E125</string>
<string>12A7300</string>
<key>DTPlatformName</key>
<string>macosx</string>
<key>DTPlatformVersion</key>
<string>GM</string>
<string>10.15.6</string>
<key>DTSDKBuild</key>
<string>18E219</string>
<string>19G68</string>
<key>DTSDKName</key>
<string>macosx10.14</string>
<string>macosx10.15</string>
<key>DTXcode</key>
<string>1020</string>
<string>1201</string>
<key>DTXcodeBuild</key>
<string>10E125</string>
<string>12A7300</string>
<key>LSMinimumSystemVersion</key>
<string>10.13</string>
<key>NSHumanReadableCopyright</key>
<string>Copyright © 2019 Unity. All rights reserved.</string>
</dict>
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file not shown.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 08ab0fb

Please sign in to comment.