tomblind / local-lua-debugger-vscode

Local Lua Debugger for VSCode
MIT License
107 stars 26 forks source link

Can't debug io function in lua? #6

Closed DFVSQY closed 5 years ago

DFVSQY commented 5 years ago

Like below, it can't pause at io.write(content) line: gif

Test Code:

local filePath = "./res/test.txt"
local content = "file edit selection view goto debug terminal help\n"

local oldOut = io.output()
io.output(filePath)
io.write(content)
io.output(oldOut)

local oldIn = io.input()
io.input(filePath)
local text = io.read("*a")
print(text)
io.input(oldIn)
tomblind commented 5 years ago

Currently, the debugger uses stdin and stdout to communicate with the vscode plugin. Redirecting stdout with io.output breaks the communication.

If remote debugging is addded in the future (see #2), then debugging scripts which need to use stdin and stdout will be possible. But for now, this won't work.