Closed wickeym closed 3 years ago
I've used the debugger with Corona on Windows without needing to copy the file. I wonder if environment variables aren't being passed correctly in OSX. Between this and #5 I'll need to find a Mac to do some testing on π
I can also look into it sometime, and/or also can test it on my Mac anytime.
Thanks for the quick response.
For a quick test, can you see what the value of os.getenv("LUA_PATH")
is when running the project in the simulator?
/Users/wickeym/Library/Application Support/Corona/Simulator/Plugins/?.lua;/Users/wickeym/Documents/WW-GIT/ifplus-hashtags/?.lua;/Applications/Corona/CoronaSimulator.app/Contents/Resources/?.lua;
Hmm, yes, it looks like the modification to the environment variable isn't making it through.
BTW - an alternative to moving the file is adding the path to lldebugger.lua to package.path
in lua:
package.path = package.path .. ";path/to/debugger/script/?.lua"
require("lldebugger").start()
Still hacky, though π
Ah good idea, I'll do that for now! π
@wickeym Has this been resolved, or do you still need the workaround?
Ah no, I closed it prematurely. I forgot the original issue was that it didn't find the lldebugger.lua and not the spaces in file path.
Ok - good to know. I do plan to grab a macbook from someone at some point to figure this and other OSX-related bugs.
Hi Tom,
This issue is now resolved ever since you added the tip to load the extension file from an environment variable.
The code I have at the top of my Solar2D (formerly Corona) SDK:
if os.getenv("LOCAL_LUA_DEBUGGER_VSCODE") == "1" then
package.loaded["lldebugger"] = assert(loadfile(os.getenv("LOCAL_LUA_DEBUGGER_FILEPATH")))()
require("lldebugger").start()
end
And this is my launch.json
{
"version": "0.2.0",
"configurations": [
{
"type": "lua-local",
"request": "launch",
"name": "Debug Corona",
"program": {
"command": "/Applications/Corona/Corona Simulator.app/Contents/MacOS/Corona Simulator"
},
"args": [
"-no-console YES -debug 1 -project ${workspaceFolder}/main.lua"
]
}
]
}
Please feel free to use my code in the Readme for Solar2D integration.
Thank you for an awesome debugger!
Sincerely, Michael Wickey
I created a launch environment for Corona SDK, but the one issue I ran into is that it doesn't automatically find lldebugger when I do
require("lldebugger").start()
. What I ended up doing was copying in thelldebugger.lua
file from inside the extension. Is this because it was launched from Corona SDK?For anyone wanting to debug Corona SDK:
Also I removed the spaces from the path and created a copy there. Do you know how to use spaces in the path?
Thanks for the great extension! :)
Sincerely, Michael Wickey