corona icon indicating copy to clipboard operation
corona copied to clipboard

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

Open yu66433 opened this issue 4 years ago • 4 comments

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

yu66433 avatar Jun 04 '20 06:06 yu66433

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

Shchvova avatar Jun 15 '20 13:06 Shchvova

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 avatar Jul 26 '20 06:07 yu66433

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

yu66433 avatar Jul 26 '20 06:07 yu66433

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/).

sekodev avatar Jul 26 '20 16:07 sekodev

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

scottrules44 avatar Feb 28 '23 14:02 scottrules44