minetest_x_bows/bin/lua-language-server-3.5.6-l.../meta/3rd/example/plugin.lua

17 lines
399 B
Lua
Raw Normal View History

2022-11-03 10:37:33 -05:00
-- if this file exists, then change setting `Lua.runtime.plugin`
-- see https://github.com/sumneko/lua-language-server/wiki/Plugins
function OnSetText(uri, text)
local diffs = {}
for start, finish in text:gmatch '()pairs()' do
diffs[#diffs+1] = {
start = start,
finish = finish - 1,
text = 'safepairs'
}
end
return diffs
end