coronalabs / corona

Solar2D Game Engine main repository (ex Corona SDK)
https://solar2d.com/
MIT License
2.53k stars 272 forks source link

VSCode doesn't show lua's output,in Windows. #81

Closed yu66433 closed 1 year ago

yu66433 commented 4 years ago

i create a task to launch corona with no-console.but vs code doesn't show lua output?

Shchvova commented 4 years ago

Did it work before? Could you attach something which was working so I can fix this.

yu66433 commented 4 years ago

it doesn't output any log when i use json.encode in my project ;

VSCode Launch Config

{
    // Use IntelliSense to learn about possible attributes.
    // Hover to view descriptions of existing attributes.
    // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
    "version": "0.2.0",
    "configurations": [
        {
            "name": "Corona-Run",
            "type": "lua-local",
            "request": "launch",
            "program": {
                "command": "%CORONA_PATH%/Corona Simulator.exe"
            },
            "args": [
                "-no-console",
                "main.lua"
            ]
        }
    ]
}

main.lua

json = require("json")

print("====== before encode")
local sRet = json.encode({a = 1})
print("====== encode result:", sRet)
print("====== after encode")

local iCount = 1
timer.performWithDelay(1000, function()
    print(iCount)
    iCount = iCount + 1
end, -1)

image

yu66433 commented 4 years ago

Did it work before? Could you attach something which was working so I can fix this.

sekodev commented 4 years ago

Seeing that your print statements are working(see "before encode" and "encode result"), this seems like an issue on your side rather than the engine. I'd suggest taking this to the Discord channel(https://discord.gg/Abf5V9G) or the forums(https://forums.solar2d.com/).

scottrules44 commented 1 year ago

I tested printing json.encode via the new Solar2D code extention and seems to work fine :)

https://github.com/solar2d/Solar2D-VSAutocomplete/blob/2bb3128076b69822d56fb0f652a7e1477e8b23fb/extension.js#L58