Lua VS Code:有没有工具可以替换变量或函数,直到重定义?

有没有一个扩展或应用程序可以替换变量或函数,直到它被重新定义?

代码:

function Test(arg)
  print("[怒骂] " .. arg)
end
Test("超级测试")
Test("asd")

function Test()
  return false
end
if Test() then
  print("True")
else
  print("False")
end

替换后的代码:

function Foo(arg)
  print("[怒骂] " .. arg)
end
Foo("超级测试")
Foo("asd")

function Test()
  return false
end
if Test() then
  print("True")
else
  print("False")
end
点赞
用户2858170
用户2858170

Test(arg) 替换为 Foo(arg) 不会影响 Test()

可以使用搜索和替换功能完成此操作。不需要任何插件。

2021-03-06 17:44:45