Skip to content

Commit

Permalink
fix: Debugging setup/install improvements (#43)
Browse files Browse the repository at this point in the history
* UX improvements and future debugger support plumbing.
* Add 'Done' message for project script resolution logging output.
  • Loading branch information
joelday authored Jun 6, 2019
1 parent 2f5eb7b commit b867442
Show file tree
Hide file tree
Showing 21 changed files with 1,769 additions and 2,043 deletions.
7 changes: 6 additions & 1 deletion DarkId.Papyrus.sln
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,9 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Shared", "Shared", "{61D956
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Languages", "Languages", "{2933A950-7B3F-43C3-9898-F22276472C5C}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DarkId.Papyrus.DebugAdapterProxy", "src\DarkId.Papyrus.DebugAdapterProxy\DarkId.Papyrus.DebugAdapterProxy.csproj", "{65A1E272-F2C1-47AC-BAEA-B0723409A103}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DarkId.Papyrus.DebugAdapterProxy.Fallout4", "src\DarkId.Papyrus.DebugAdapterProxy\DarkId.Papyrus.DebugAdapterProxy.Fallout4.csproj", "{65A1E272-F2C1-47AC-BAEA-B0723409A103}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DarkId.Papyrus.DebugAdapterProxy.Skyrim", "src\DarkId.Papyrus.DebugAdapterProxy\DarkId.Papyrus.DebugAdapterProxy.Skyrim.csproj", "{75A6BAA6-EC18-4203-9925-ECE93578AAFD}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Expand All @@ -56,6 +58,8 @@ Global
{B638D66E-BFC9-4C3D-8915-F1A3B7A083A8}.Debug|Any CPU.Build.0 = Debug|Any CPU
{65A1E272-F2C1-47AC-BAEA-B0723409A103}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{65A1E272-F2C1-47AC-BAEA-B0723409A103}.Debug|Any CPU.Build.0 = Debug|Any CPU
{75A6BAA6-EC18-4203-9925-ECE93578AAFD}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{75A6BAA6-EC18-4203-9925-ECE93578AAFD}.Debug|Any CPU.Build.0 = Debug|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand All @@ -73,6 +77,7 @@ Global
{3061E13A-7189-4F14-BBDA-34E4EBF84224} = {8D95165B-14A6-4315-92D7-4B49D712259E}
{B638D66E-BFC9-4C3D-8915-F1A3B7A083A8} = {8D95165B-14A6-4315-92D7-4B49D712259E}
{65A1E272-F2C1-47AC-BAEA-B0723409A103} = {59C1930E-6E4E-41CD-BA96-38A74DAD66DA}
{75A6BAA6-EC18-4203-9925-ECE93578AAFD} = {8D95165B-14A6-4315-92D7-4B49D712259E}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {F463939D-09F7-4C69-9379-87B29449255B}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@
<ApplicationIcon />
<OutputType>Exe</OutputType>
<StartupObject />
<DefineConstants>TRACE;FALLOUT4</DefineConstants>
<RootNamespace>DarkId.Papyrus.DebugAdapterProxy</RootNamespace>
</PropertyGroup>

<Import Project="Sdk.targets" Sdk="Microsoft.NET.Sdk" />
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
<Project>
<PropertyGroup>
<BaseIntermediateOutputPath>obj\$(MSBuildProjectName)</BaseIntermediateOutputPath>
</PropertyGroup>

<Import Project="Sdk.props" Sdk="Microsoft.NET.Sdk" />

<PropertyGroup>
<TargetFramework>net461</TargetFramework>
<PlatformTarget>x86</PlatformTarget>
<Configurations>Debug</Configurations>
<OutputPath>bin\$(Configuration)\$(TargetFramework)\$(MSBuildProjectName)</OutputPath>
<DefaultItemExcludes>$(DefaultItemExcludes);obj\**</DefaultItemExcludes>
<AppendTargetFrameworkToOutputPath>false</AppendTargetFrameworkToOutputPath>
</PropertyGroup>

<PropertyGroup>
<DebugType>full</DebugType>
<DebugSymbols>true</DebugSymbols>
<RootNamespace>DarkId.Papyrus.DebugAdapterProxy</RootNamespace>
<ApplicationIcon />
<OutputType>Exe</OutputType>
<StartupObject />
<DefineConstants>TRACE;SKYRIM</DefineConstants>
<RootNamespace>DarkId.Papyrus.DebugAdapterProxy</RootNamespace>
</PropertyGroup>

<Import Project="Sdk.targets" Sdk="Microsoft.NET.Sdk" />

<ItemGroup>
<PackageReference Include="CommandLineParser" Version="2.3.0" />
<PackageReference Include="Microsoft.Extensions.Logging.Debug" Version="2.2.0" />
<PackageReference Include="Serilog.Extensions.Logging.File" Version="2.0.0-dev-00032" />
<PackageReference Include="Newtonsoft.Json" Version="12.0.2" />
<PackageReference Include="WebSocketSharp-netstandard" Version="1.0.1" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\DarkId.Papyrus.Common\DarkId.Papyrus.Common.csproj" />
<ProjectReference Include="..\DarkId.Papyrus.LanguageService\DarkId.Papyrus.LanguageService.Skyrim.csproj" />
</ItemGroup>
</Project>
14 changes: 12 additions & 2 deletions src/DarkId.Papyrus.DebugAdapterProxy/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,12 @@ namespace DarkId.Papyrus.DebugAdapterProxy
public class Options
{
[Option("port")]
public int Port { get; set; } = 2077;
public int Port { get; set; } =
#if FALLOUT4
2077;
#else
43201;
#endif

[Option("projectPath")]
public string ProjectPath { get; set; }
Expand Down Expand Up @@ -54,7 +59,12 @@ static int Main(string[] args)
.AddFile(
Path.Combine(
Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments),
"My Games\\Fallout4\\F4SE\\DarkId.Papyrus.DebugAdapterProxy.log"),
#if FALLOUT4
"My Games\\Fallout4\\F4SE\\DarkId.Papyrus.DebugAdapterProxy.log"
#else
"My Games\\Skyrim Special Edition\\SKSE\\DarkId.Papyrus.DebugAdapterProxy.log"
#endif
),
Microsoft.Extensions.Logging.LogLevel.Information);

logger = loggerFactory.CreateLogger<Program>();
Expand Down
5 changes: 4 additions & 1 deletion src/DarkId.Papyrus.Server/ProjectHost.cs
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,8 @@ private void HandleScriptFileChanged(object sender, ScriptFileChangedEventArgs e
if (!_debouncedChangeHandlers.ContainsKey(e.ScriptFile.Id))
{
_debouncedChangeHandlers.Add(e.ScriptFile.Id,
new Debounce(() => Task.Run(() => {
new Debounce(() => Task.Run(() =>
{
_program.ScriptFiles.TryGetValue(e.ScriptFile.Id, out var scriptFile);
if (scriptFile != null)
{
Expand Down Expand Up @@ -72,6 +73,8 @@ public void ResolveSources()
{
_logger.LogInformation("Resolving script files for {0}...", Name);
_program.ResolveSources().Wait();

_logger.LogInformation("Done");
}
}

Expand Down
Loading

0 comments on commit b867442

Please sign in to comment.