Skip to content
This repository was archived by the owner on Apr 5, 2024. It is now read-only.

Commit b48e046

Browse files
committed
New style api following vscode guidelines.
Halt on exception seems to work. Removed old attach.js and generate it from typescript version, using npm script targets. Refactored UnityDebugSession to follow naming conventions. Unhandled exceptions is not supported yet.
1 parent 8ebd84f commit b48e046

14 files changed

+1124
-519
lines changed

.vscodeignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@
22
**
33
**/.DS_Store
44
**/.mdb
5-
!attach.js
5+
!MonoDebug/**
6+
!attach.ts
67
!package.json
78
!bin/**
89
!Changelog.txt

External/Newtonsoft.Json.dll

-7 KB
Binary file not shown.

External/Newtonsoft.Json.xml

Lines changed: 69 additions & 231 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Makefile

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,13 @@ clean:
99
$UNITY_DEBUG:
1010
xbuild /p:Configuration=Release
1111

12+
build:
13+
tsc -p ./typescript
14+
@echo "build finished"
15+
1216
zip: $UNITY_DEBUG
1317
rm -f unity-debug.zip
14-
zip -r9 unity-debug.zip bin/ attach.js package.json Changelog.txt -x "*.DS_Store"
18+
zip -r9 unity-debug.zip bin/ attach.ts package.json Changelog.txt -x "*.DS_Store"
1519

1620
vsix: clean $UNITY_DEBUG
1721
rm -f *.vsix

MonoDebug

UnityDebug/Program.cs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
using System.Reflection;
55
using Mono.Debugging.Client;
66
using MonoDevelop.Debugger.Soft.Unity;
7+
using MonoDevelop.Debugger.VsCodeDebugProtocol;
78
using VSCodeDebug;
89

910
namespace UnityDebug
@@ -81,6 +82,12 @@ static void RunSession(Stream inputStream, Stream outputStream)
8182
debugSession.Start(inputStream, outputStream).Wait();
8283
}
8384

85+
static void RunVSSession(Stream inputStream, Stream outputStream)
86+
{
87+
VSCodeDebuggerSession debugSession = new VSCodeDebuggerSession();
88+
debugSession.Start(inputStream, outputStream);
89+
}
90+
8491
static string GetUnityProcesses()
8592
{
8693
var processes = UnityProcessDiscovery.GetAttachableProcesses();

UnityDebug/UnityDebug.csproj

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,9 @@
5757
<Reference Include="ICSharpCode.NRefactory.CSharp, Version=5.0.0.0, Culture=neutral, PublicKeyToken=d4bfe873e7598c49">
5858
<HintPath>..\External\ICSharpCode.NRefactory.CSharp.dll</HintPath>
5959
</Reference>
60+
<Reference Include="Microsoft.VisualStudio.Shared.VSCodeDebugProtocol, Version=15.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
61+
<HintPath>..\External\Microsoft.VisualStudio.Shared.VSCodeDebugProtocol.dll</HintPath>
62+
</Reference>
6063
<Reference Include="Microsoft.VisualStudio.Shared.VSCodeDebugProtocol, Version=15.6.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
6164
<HintPath>..\packages\Microsoft.VisualStudio.Shared.VsCodeDebugProtocol.15.6.20118.1\lib\net45\Microsoft.VisualStudio.Shared.VSCodeDebugProtocol.dll</HintPath>
6265
<Private>True</Private>
@@ -118,10 +121,13 @@
118121
<Reference Include="MonoDevelop.Debugger.Soft, Version=2.6.0.0, Culture=neutral, PublicKeyToken=3ead7498f347467b">
119122
<HintPath>..\External\MonoDevelop.Debugger.Soft.dll</HintPath>
120123
</Reference>
124+
<Reference Include="MonoDevelop.Debugger.VsCodeDebugProtocol, Version=0.0.0.0, Culture=neutral, PublicKeyToken=3ead7498f347467b">
125+
<HintPath>..\External\MonoDevelop.Debugger.VsCodeDebugProtocol.dll</HintPath>
126+
</Reference>
121127
<Reference Include="MonoDevelop.Unity, Version=1.4.0.3, Culture=neutral, PublicKeyToken=31bf3856ad364e35">
122128
<HintPath>..\External\MonoDevelop.Unity.dll</HintPath>
123129
</Reference>
124-
<Reference Include="Newtonsoft.Json, Version=9.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed">
130+
<Reference Include="Newtonsoft.Json, Version=8.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed">
125131
<HintPath>..\External\Newtonsoft.Json.dll</HintPath>
126132
</Reference>
127133
<Reference Include="pango-sharp, Version=2.12.0.0, Culture=neutral, PublicKeyToken=35e10195dab3c99f">
@@ -189,6 +195,10 @@
189195
</Compile>
190196
<Compile Include="Platform.cs" />
191197
<Compile Include="Util.cs" />
198+
<Compile Include="VSCodeDebugger\VsCodeBacktrace.cs" />
199+
<Compile Include="VSCodeDebugger\VSCodeDebuggerSession.cs" />
200+
<Compile Include="VSCodeDebugger\VsCodeObjectSource.cs" />
201+
<Compile Include="VSCodeDebugger\VsCodeStackFrame.cs" />
192202
</ItemGroup>
193203
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
194204
<ItemGroup>

0 commit comments

Comments
 (0)