diff options
author | 最萌小汐 <sumneko@hotmail.com> | 2022-07-08 17:26:18 +0800 |
---|---|---|
committer | 最萌小汐 <sumneko@hotmail.com> | 2022-07-08 17:26:18 +0800 |
commit | 7c29a6012bf5fe2cc1ff79598f8be6f80528e767 (patch) | |
tree | 6afee29f52c8862bfe7d6e780022bfb6d4ecabd5 /script/core/rename.lua | |
parent | 4c71c56f925246618cce854ab9773311a7812055 (diff) | |
download | lua-language-server-7c29a6012bf5fe2cc1ff79598f8be6f80528e767.zip |
cleanup
Diffstat (limited to 'script/core/rename.lua')
-rw-r--r-- | script/core/rename.lua | 19 |
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 |