w3ts icon indicating copy to clipboard operation
w3ts copied to clipboard

Question: source mapping for the output Lua file

Open BribeFromTheHive opened this issue 2 years ago • 1 comments

Hi @cipherxof,

Do you know if there is already some kind of source mapping done with TypeScript2Lua? I'd be keen to set up an environment where runtime errors in the Lua environment are parsed through a source map that relays back to the user which TypeScript module it came from. I think this would also significantly enhance the quality of Lua debugging anyway, since currently only being able to get line numbers during runtime is not helpful, hence the complexities of things like Eikonium's DebugUtils.

BribeFromTheHive avatar Jan 23 '24 20:01 BribeFromTheHive

TSTL supports source mapping, but it relies on debug.traceback, which is not enabled in Reforged. It does work in W3CE with the debug module enabled, however.

https://typescripttolua.github.io/docs/configuration/

You'll have to find a way around this. Perhaps this thread can help: https://www.hiveworkshop.com/threads/lua-getstacktrace.340173/

cipherxof avatar Jan 23 '24 22:01 cipherxof