Skip to content

Commit b867442

Browse files
authored
fix: Debugging setup/install improvements (#43)
* UX improvements and future debugger support plumbing. * Add 'Done' message for project script resolution logging output.
1 parent 2f5eb7b commit b867442

21 files changed

+1769
-2043
lines changed

DarkId.Papyrus.sln

+6-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,9 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Shared", "Shared", "{61D956
2929
EndProject
3030
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Languages", "Languages", "{2933A950-7B3F-43C3-9898-F22276472C5C}"
3131
EndProject
32-
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DarkId.Papyrus.DebugAdapterProxy", "src\DarkId.Papyrus.DebugAdapterProxy\DarkId.Papyrus.DebugAdapterProxy.csproj", "{65A1E272-F2C1-47AC-BAEA-B0723409A103}"
32+
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DarkId.Papyrus.DebugAdapterProxy.Fallout4", "src\DarkId.Papyrus.DebugAdapterProxy\DarkId.Papyrus.DebugAdapterProxy.Fallout4.csproj", "{65A1E272-F2C1-47AC-BAEA-B0723409A103}"
33+
EndProject
34+
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DarkId.Papyrus.DebugAdapterProxy.Skyrim", "src\DarkId.Papyrus.DebugAdapterProxy\DarkId.Papyrus.DebugAdapterProxy.Skyrim.csproj", "{75A6BAA6-EC18-4203-9925-ECE93578AAFD}"
3335
EndProject
3436
Global
3537
GlobalSection(SolutionConfigurationPlatforms) = preSolution
@@ -56,6 +58,8 @@ Global
5658
{B638D66E-BFC9-4C3D-8915-F1A3B7A083A8}.Debug|Any CPU.Build.0 = Debug|Any CPU
5759
{65A1E272-F2C1-47AC-BAEA-B0723409A103}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
5860
{65A1E272-F2C1-47AC-BAEA-B0723409A103}.Debug|Any CPU.Build.0 = Debug|Any CPU
61+
{75A6BAA6-EC18-4203-9925-ECE93578AAFD}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
62+
{75A6BAA6-EC18-4203-9925-ECE93578AAFD}.Debug|Any CPU.Build.0 = Debug|Any CPU
5963
EndGlobalSection
6064
GlobalSection(SolutionProperties) = preSolution
6165
HideSolutionNode = FALSE
@@ -73,6 +77,7 @@ Global
7377
{3061E13A-7189-4F14-BBDA-34E4EBF84224} = {8D95165B-14A6-4315-92D7-4B49D712259E}
7478
{B638D66E-BFC9-4C3D-8915-F1A3B7A083A8} = {8D95165B-14A6-4315-92D7-4B49D712259E}
7579
{65A1E272-F2C1-47AC-BAEA-B0723409A103} = {59C1930E-6E4E-41CD-BA96-38A74DAD66DA}
80+
{75A6BAA6-EC18-4203-9925-ECE93578AAFD} = {8D95165B-14A6-4315-92D7-4B49D712259E}
7681
EndGlobalSection
7782
GlobalSection(ExtensibilityGlobals) = postSolution
7883
SolutionGuid = {F463939D-09F7-4C69-9379-87B29449255B}

src/DarkId.Papyrus.DebugAdapterProxy/DarkId.Papyrus.DebugAdapterProxy.csproj renamed to src/DarkId.Papyrus.DebugAdapterProxy/DarkId.Papyrus.DebugAdapterProxy.Fallout4.csproj

+2
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@
2121
<ApplicationIcon />
2222
<OutputType>Exe</OutputType>
2323
<StartupObject />
24+
<DefineConstants>TRACE;FALLOUT4</DefineConstants>
25+
<RootNamespace>DarkId.Papyrus.DebugAdapterProxy</RootNamespace>
2426
</PropertyGroup>
2527

2628
<Import Project="Sdk.targets" Sdk="Microsoft.NET.Sdk" />
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
<Project>
2+
<PropertyGroup>
3+
<BaseIntermediateOutputPath>obj\$(MSBuildProjectName)</BaseIntermediateOutputPath>
4+
</PropertyGroup>
5+
6+
<Import Project="Sdk.props" Sdk="Microsoft.NET.Sdk" />
7+
8+
<PropertyGroup>
9+
<TargetFramework>net461</TargetFramework>
10+
<PlatformTarget>x86</PlatformTarget>
11+
<Configurations>Debug</Configurations>
12+
<OutputPath>bin\$(Configuration)\$(TargetFramework)\$(MSBuildProjectName)</OutputPath>
13+
<DefaultItemExcludes>$(DefaultItemExcludes);obj\**</DefaultItemExcludes>
14+
<AppendTargetFrameworkToOutputPath>false</AppendTargetFrameworkToOutputPath>
15+
</PropertyGroup>
16+
17+
<PropertyGroup>
18+
<DebugType>full</DebugType>
19+
<DebugSymbols>true</DebugSymbols>
20+
<RootNamespace>DarkId.Papyrus.DebugAdapterProxy</RootNamespace>
21+
<ApplicationIcon />
22+
<OutputType>Exe</OutputType>
23+
<StartupObject />
24+
<DefineConstants>TRACE;SKYRIM</DefineConstants>
25+
<RootNamespace>DarkId.Papyrus.DebugAdapterProxy</RootNamespace>
26+
</PropertyGroup>
27+
28+
<Import Project="Sdk.targets" Sdk="Microsoft.NET.Sdk" />
29+
30+
<ItemGroup>
31+
<PackageReference Include="CommandLineParser" Version="2.3.0" />
32+
<PackageReference Include="Microsoft.Extensions.Logging.Debug" Version="2.2.0" />
33+
<PackageReference Include="Serilog.Extensions.Logging.File" Version="2.0.0-dev-00032" />
34+
<PackageReference Include="Newtonsoft.Json" Version="12.0.2" />
35+
<PackageReference Include="WebSocketSharp-netstandard" Version="1.0.1" />
36+
</ItemGroup>
37+
38+
<ItemGroup>
39+
<ProjectReference Include="..\DarkId.Papyrus.Common\DarkId.Papyrus.Common.csproj" />
40+
<ProjectReference Include="..\DarkId.Papyrus.LanguageService\DarkId.Papyrus.LanguageService.Skyrim.csproj" />
41+
</ItemGroup>
42+
</Project>

src/DarkId.Papyrus.DebugAdapterProxy/Program.cs

+12-2
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,12 @@ namespace DarkId.Papyrus.DebugAdapterProxy
2424
public class Options
2525
{
2626
[Option("port")]
27-
public int Port { get; set; } = 2077;
27+
public int Port { get; set; } =
28+
#if FALLOUT4
29+
2077;
30+
#else
31+
43201;
32+
#endif
2833

2934
[Option("projectPath")]
3035
public string ProjectPath { get; set; }
@@ -54,7 +59,12 @@ static int Main(string[] args)
5459
.AddFile(
5560
Path.Combine(
5661
Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments),
57-
"My Games\\Fallout4\\F4SE\\DarkId.Papyrus.DebugAdapterProxy.log"),
62+
#if FALLOUT4
63+
"My Games\\Fallout4\\F4SE\\DarkId.Papyrus.DebugAdapterProxy.log"
64+
#else
65+
"My Games\\Skyrim Special Edition\\SKSE\\DarkId.Papyrus.DebugAdapterProxy.log"
66+
#endif
67+
),
5868
Microsoft.Extensions.Logging.LogLevel.Information);
5969

6070
logger = loggerFactory.CreateLogger<Program>();

src/DarkId.Papyrus.Server/ProjectHost.cs

+4-1
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,8 @@ private void HandleScriptFileChanged(object sender, ScriptFileChangedEventArgs e
4040
if (!_debouncedChangeHandlers.ContainsKey(e.ScriptFile.Id))
4141
{
4242
_debouncedChangeHandlers.Add(e.ScriptFile.Id,
43-
new Debounce(() => Task.Run(() => {
43+
new Debounce(() => Task.Run(() =>
44+
{
4445
_program.ScriptFiles.TryGetValue(e.ScriptFile.Id, out var scriptFile);
4546
if (scriptFile != null)
4647
{
@@ -72,6 +73,8 @@ public void ResolveSources()
7273
{
7374
_logger.LogInformation("Resolving script files for {0}...", Name);
7475
_program.ResolveSources().Wait();
76+
77+
_logger.LogInformation("Done");
7578
}
7679
}
7780

0 commit comments

Comments
 (0)