LuaCoderAssist icon indicating copy to clipboard operation
LuaCoderAssist copied to clipboard

某些情况下会自动将注释与其他语句交换位置,严重影响调试

Open cpdroid opened this issue 5 years ago • 1 comments

一个最小demo如下:

local count=2
if (count > 1) then
	local prePrice = 200
	-- print(prePrice)
else
	print(count)
end

使用本插件格式化后,注释的那句print会与上面的"local prePrice = 200"交换位置,如果此时放开注释,就会出现"prePrice"为空的错误,严重影响调试,奇怪的是把else分支去掉后,就没有这个bug了

cpdroid avatar Oct 12 '19 02:10 cpdroid

這個是luaFmt插件的BUG,我試下看能不能修復。

liwangqian avatar Oct 19 '19 15:10 liwangqian