Use actual parameter names instead of generic 'argN' names#191
Use actual parameter names instead of generic 'argN' names#191LlamaLad7 merged 6 commits intoFabricMC:mainfrom
Conversation
Earthcomputer
left a comment
There was a problem hiding this comment.
Three problems:
Locals.getLocalsAtalso needs to be changed.- Even though the
thisparameter is going to be namedthisin the LVT by any Java compiler, it would be good to fetch this one from the LVT if it is there as well. Maybe some compilers from some other JVM languages might name it differently. - This needs to be gated behind a Fabric compatibility version so it doesn't break anyone that is somehow relying on the old names. See
FabricUtilandLocals.getLocalsAt.
Earthcomputer
left a comment
There was a problem hiding this comment.
There's a lot of duplicated code in this PR now, the duplicates could easily be merged into one method.
Inside LocalVariableDiscriminator, the compatibility version isn't checked, and the this name still isn't taken into account.
seems my commit got banished into the shadow realm that resolved that |
LlamaLad7
left a comment
There was a problem hiding this comment.
Few things left. Also happy to finish it up myself but you're more than welcome to.
LlamaLad7
left a comment
There was a problem hiding this comment.
Will test thoroughly either later today or tomorrow morning, this is the last thing I can see for now.
When LVT is unavailable at injection point, extract parameter names from method's local variable table as fallback instead of generating generic names like 'arg0', 'arg1', etc.
Hopefully fixes #189