summaryrefslogtreecommitdiff
path: root/script/core/rename.lua
diff options
context:
space:
mode:
author最萌小汐 <sumneko@hotmail.com>2022-07-08 17:26:18 +0800
committer最萌小汐 <sumneko@hotmail.com>2022-07-08 17:26:18 +0800
commit7c29a6012bf5fe2cc1ff79598f8be6f80528e767 (patch)
tree6afee29f52c8862bfe7d6e780022bfb6d4ecabd5 /script/core/rename.lua
parent4c71c56f925246618cce854ab9773311a7812055 (diff)
downloadlua-language-server-7c29a6012bf5fe2cc1ff79598f8be6f80528e767.zip
cleanup
Diffstat (limited to 'script/core/rename.lua')
-rw-r--r--script/core/rename.lua19
1 files changed, 9 insertions, 10 deletions
diff --git a/script/core/rename.lua b/script/core/rename.lua
index 5ba93684..a4b6dd7c 100644
--- a/script/core/rename.lua
+++ b/script/core/rename.lua
@@ -242,16 +242,15 @@ end
local function ofDocParamName(source, newname, callback)
callback(source, source.start, source.finish, newname)
local doc = source.parent
- if doc.bindSources then
- for _, src in ipairs(doc.bindSources) do
- if src.type == 'local'
- and src.parent.type == 'funcargs'
- and src[1] == source[1] then
- renameLocal(src, newname, callback)
- if src.ref then
- for _, ref in ipairs(src.ref) do
- renameLocal(ref, newname, callback)
- end
+ local src = doc.bindSource
+ if src then
+ if src.type == 'local'
+ and src.parent.type == 'funcargs'
+ and src[1] == source[1] then
+ renameLocal(src, newname, callback)
+ if src.ref then
+ for _, ref in ipairs(src.ref) do
+ renameLocal(ref, newname, callback)
end
end
end