Skip to content

Commit d34575d

Browse files
Fix static constructor disassembly and publish output path (#8)
* Add runtimeId to output directory path for publish * Fix static constructor ignore
1 parent af3638b commit d34575d

File tree

2 files changed

+14
-5
lines changed

2 files changed

+14
-5
lines changed

src/dotnet/ReSharperPlugin.DotNetDisassembler/JitDisasm/JitCodegenProvider.cs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,9 @@ public async Task<Result<JitCodeGenResult, Error>> GetJitCodegenAsync(DisasmTarg
4747
clrCheckedFilesDir = result.Value;
4848
}
4949

50-
var resultOutDir = Path.Combine(projectContext.OutputPath!,
51-
"DotNetDisassembler" + (configuration.UseDotnetPublishForReload ? "_published" : ""), tfm.UniqueString);
50+
var resultOutDir = configuration.UseDotnetPublishForReload
51+
? Path.Combine(projectContext.OutputPath!, "DotNetDisassembler_published", tfm.UniqueString, runtimeId)
52+
: Path.Combine(projectContext.OutputPath!, "DotNetDisassembler", tfm.UniqueString);
5253

5354
var dotnetCliExePath = projectContext.DotNetCliExePath!;
5455
var projectFilePath = projectContext.ProjectFilePath!;

src/dotnet/ReSharperPlugin.DotNetDisassembler/JitDisasm/JitDisasmTargetUtils.cs

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -54,9 +54,17 @@ public static DisasmTarget GetTarget(IDeclaredElement declaredElement)
5454
methodName = "*";
5555
hostType = containingType.ShortName;
5656
break;
57-
case IConstructor:
58-
target = prefix + ":.ctor";
59-
methodName = "*";
57+
case IConstructor constructor:
58+
if (constructor.IsStatic)
59+
{
60+
target = prefix + ":.cctor";
61+
methodName = ".cctor";
62+
}
63+
else
64+
{
65+
target = prefix + ":.ctor";
66+
methodName = "*";
67+
}
6068
hostType = containingType.ShortName;
6169
break;
6270
case IFunction function:

0 commit comments

Comments
 (0)