diff options
author | 最萌小汐 <sumneko@hotmail.com> | 2019-11-20 11:04:03 +0800 |
---|---|---|
committer | 最萌小汐 <sumneko@hotmail.com> | 2019-11-20 11:04:03 +0800 |
commit | 5a81e88863dc0024ac95f9904e772710c092bbc4 (patch) | |
tree | e5ecaec23b028bab7c1da48309a19010ed378980 /server-beta/src | |
parent | 03a56a63e1c943e985b73082be34749a3bd5533b (diff) | |
download | lua-language-server-5a81e88863dc0024ac95f9904e772710c092bbc4.zip |
修正bug
Diffstat (limited to 'server-beta/src')
-rw-r--r-- | server-beta/src/core/rename.lua | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/server-beta/src/core/rename.lua b/server-beta/src/core/rename.lua index 4c67bc9c..1a1dbd17 100644 --- a/server-beta/src/core/rename.lua +++ b/server-beta/src/core/rename.lua @@ -127,10 +127,10 @@ local function renameField(source, newname, callback) if parent.type == 'setfield' or parent.type == 'getfield' then local dot = parent.dot - local newstr = '[' .. util.viewString('"', newname) .. ']' + local newstr = '[' .. util.viewString(newname) .. ']' callback(source, dot.start, source.finish, newstr) elseif parent.type == 'tablefield' then - local newstr = '[' .. util.viewString('"', newname) .. ']' + local newstr = '[' .. util.viewString(newname) .. ']' callback(source, source.start, source.finish, newstr) elseif parent.type == 'getmethod' then if not askForcing(newname) then @@ -144,7 +144,7 @@ local function renameField(source, newname, callback) -- function mt:name () end --> mt['newname'] = function (self) end local newstr = string.format('%s[%s] = function ' , text:sub(parent.start, parent.node.finish) - , util.viewString('"', newname) + , util.viewString(newname) ) callback(source, func.start, parent.finish, newstr) local pl = text:find('(', parent.finish, true) @@ -164,7 +164,7 @@ local function renameGlobal(source, newname, callback) callback(source, source.start, source.finish, newname) return true end - local newstr = '_ENV[' .. util.viewString('"', newname) .. ']' + local newstr = '_ENV[' .. util.viewString(newname) .. ']' -- function name () end --> _ENV['newname'] = function () end if source.value and source.value.type == 'function' and source.value.start < source.start then @@ -192,7 +192,7 @@ local function ofField(source, newname, callback) end if src.type == 'string' then local quo = src[2] - local text = util.viewString(quo, newname) + local text = util.viewString(newname, quo) callback(src, src.start, src.finish, text) return elseif src.type == 'field' |