summaryrefslogtreecommitdiff
path: root/script/core/command
diff options
context:
space:
mode:
author最萌小汐 <sumneko@hotmail.com>2021-01-22 10:58:43 +0800
committer最萌小汐 <sumneko@hotmail.com>2021-01-22 10:58:43 +0800
commit489fcbaa9da91ac8275a2ba5dadc6bd88b9cd5ec (patch)
treeeabc184d1a8d3df2bed43ddebe429183fd284120 /script/core/command
parent59b9f2343ef3c7b526a4ea5c4694cdc1ef8c4011 (diff)
downloadlua-language-server-489fcbaa9da91ac8275a2ba5dadc6bd88b9cd5ec.zip
clean up code
Diffstat (limited to 'script/core/command')
-rw-r--r--script/core/command/removeSpace.lua2
-rw-r--r--script/core/command/solve.lua6
2 files changed, 4 insertions, 4 deletions
diff --git a/script/core/command/removeSpace.lua b/script/core/command/removeSpace.lua
index e8b09932..29513951 100644
--- a/script/core/command/removeSpace.lua
+++ b/script/core/command/removeSpace.lua
@@ -32,7 +32,7 @@ return function (data)
goto NEXT_LINE
end
textEdit[#textEdit+1] = {
- range = define.range(lines, text, start, finish),
+ range = files.range(uri, start, finish),
newText = '',
}
goto NEXT_LINE
diff --git a/script/core/command/solve.lua b/script/core/command/solve.lua
index d3b8f94e..ff14bf40 100644
--- a/script/core/command/solve.lua
+++ b/script/core/command/solve.lua
@@ -35,8 +35,8 @@ return function (data)
return
end
- local start = define.offsetOfWord(lines, text, data.range.start)
- local finish = define.offsetOfWord(lines, text, data.range['end'])
+ local start = files.offsetOfWord(uri, data.range.start)
+ local finish = files.offsetOfWord(uri, data.range['end'])
local result = guide.eachSourceContain(ast.ast, start, function (source)
if source.start ~= start
@@ -86,7 +86,7 @@ return function (data)
changes = {
[uri] = {
{
- range = define.range(lines, text, result.start, result.finish),
+ range = files.range(uri, result.start, result.finish),
newText = ('(%s)'):format(text:sub(result.start, result.finish)),
}
},