Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature : Add original filename to generated filename hash ? #75

Open
builder-main opened this issue May 22, 2023 · 2 comments
Open

Feature : Add original filename to generated filename hash ? #75

builder-main opened this issue May 22, 2023 · 2 comments
Labels
good first issue Good for newcomers help wanted Extra attention is needed nice-to-have Not critical to core functionality

Comments

@builder-main
Copy link

builder-main commented May 22, 2023

It can become hard to read when you look at stacktraces with a lot of rewritten files. If they could be suffixed with the original filename (and shorter/incremental hash ?) it could be a blast.

C:/Users/../AppData/Local/Temp/04d60cd179c04742b6f4a2f89b2deeba.SourceCodeCombined.cs:800)
MoreLinq.MoreEnumerable:ForEach<System.ValueTuple`2<Commons.Domain.IEquipment, System.ValueTuple`3<int, int, int>>> (System.Collections.Generic.IEnumerable`1<System.ValueTuple`2<Commons.Domain.IEquipment, System.ValueTuple`3<int, int, int>>>,System.Action`2<System.ValueTuple`2<Commons.Domain.IEquipment, System.ValueTuple`3<int, int, int>>, int>) (at C:/projects/morelinq/MoreLinq/ForEach.cs:57)
Characters.View.UnitGameStatsView__Patched_:OnPreviewStat (Characters.View.UnitPreviewStatSignal) (at C:/Users/../AppData/Local/Temp/04d60cd179c04742b6f4a2f89b2deeba.SourceCodeCombined.cs:783)
Characters.View.UnitGameStatsView__Patched_:OnEventObject (Characters.View.UnitPreviewStatSignal) (at C:/Users/../AppData/Local/Temp/04d60cd179c04742b6f4a2f89b2deeba.SourceCodeCombined.cs:747)

into

C:/Users/../AppData/Local/Temp/04d60cd179c0474.UnitGameStatsView.cs:800)
MoreLinq.MoreEnumerable:ForEach<System.ValueTuple`2<Commons.Domain.IEquipment, System.ValueTuple`3<int, int, int>>> (System.Collections.Generic.IEnumerable`1<System.ValueTuple`2<Commons.Domain.IEquipment, System.ValueTuple`3<int, int, int>>>,System.Action`2<System.ValueTuple`2<Commons.Domain.IEquipment, System.ValueTuple`3<int, int, int>>, int>) (at C:/projects/morelinq/MoreLinq/ForEach.cs:57)
Characters.View.UnitGameStatsView__Patched_:OnPreviewStat (Characters.View.UnitPreviewStatSignal) (at C:/Users/../AppData/Local/Temp/04d60cd179c0474.UnitGameStatsView.cs:783)
Characters.View.UnitGameStatsView__Patched_:OnEventObject (Characters.View.UnitPreviewStatSignal) (at C:/Users/../AppData/Local/Temp/04d60cd179c0474.UnitGameStatsView.cs:747)
@handzlikchris
Copy link
Owner

sould be fairly straight forward, it'll be here FastScriptReload.Editor.Compilation.DotnetExeDynamicCompilation.Compile

and that's how names are generated

var asmName = Guid.NewGuid().ToString().Replace("-", "");
var rspFile = _tempFolder + $"{asmName}.rsp";
var assemblyAttributeFilePath = _tempFolder + $"{asmName}.DynamicallyCreatedAssemblyAttribute.cs";
sourceCodeCombinedFilePath = _tempFolder + $"{asmName}.SourceCodeCombined.cs";
var outLibraryPath = $"{_tempFolder}{asmName}.dll";

The only requirement is for the assembly name to be unique so it doesn't collide. It's possible to have more than 1 file in single hot reload compilation (defined in filePathsWithSourceCode argument)

@handzlikchris handzlikchris added nice-to-have Not critical to core functionality good first issue Good for newcomers help wanted Extra attention is needed labels May 23, 2023
@builder-main
Copy link
Author

Sorry I didn't saw your answer, I'll take a look at it asap as I'm still in need of this feature. If it works on my side I might do a PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers help wanted Extra attention is needed nice-to-have Not critical to core functionality
Projects
None yet
Development

No branches or pull requests

2 participants