summaryrefslogtreecommitdiff
path: root/script/core/command
diff options
context:
space:
mode:
author最萌小汐 <sumneko@hotmail.com>2021-04-20 18:08:20 +0800
committer最萌小汐 <sumneko@hotmail.com>2021-04-20 18:08:20 +0800
commit554ddae7b4174131fadf16bda5a32e5e967abda5 (patch)
treec72e26dfd25150eaff2e87683a3de8a74b3fb3db /script/core/command
parent6846a670da889ae45228a91bdbca7e695ff97b69 (diff)
downloadlua-language-server-554ddae7b4174131fadf16bda5a32e5e967abda5.zip
guide -> searcher
Diffstat (limited to 'script/core/command')
-rw-r--r--script/core/command/removeSpace.lua15
-rw-r--r--script/core/command/solve.lua9
2 files changed, 11 insertions, 13 deletions
diff --git a/script/core/command/removeSpace.lua b/script/core/command/removeSpace.lua
index 527af8d5..ba1ee8eb 100644
--- a/script/core/command/removeSpace.lua
+++ b/script/core/command/removeSpace.lua
@@ -1,11 +1,10 @@
-local files = require 'files'
-local define = require 'proto.define'
-local guide = require 'core.guide'
-local proto = require 'proto'
-local lang = require 'language'
+local files = require 'files'
+local searcher = require 'core.searcher'
+local proto = require 'proto'
+local lang = require 'language'
local function isInString(ast, offset)
- return guide.eachSourceContain(ast.ast, offset, function (source)
+ return searcher.eachSourceContain(ast.ast, offset, function (source)
if source.type == 'string' then
return true
end
@@ -23,10 +22,10 @@ return function (data)
local textEdit = {}
for i = 1, #lines do
- local line = guide.lineContent(lines, text, i, true)
+ local line = searcher.lineContent(lines, text, i, true)
local pos = line:find '[ \t]+$'
if pos then
- local start, finish = guide.lineRange(lines, i, true)
+ local start, finish = searcher.lineRange(lines, i, true)
start = start + pos - 1
if isInString(ast, start) then
goto NEXT_LINE
diff --git a/script/core/command/solve.lua b/script/core/command/solve.lua
index 995a2109..c2cc103e 100644
--- a/script/core/command/solve.lua
+++ b/script/core/command/solve.lua
@@ -1,8 +1,7 @@
-local files = require 'files'
-local define = require 'proto.define'
-local guide = require 'core.guide'
-local proto = require 'proto'
-local lang = require 'language'
+local files = require 'files'
+local searcher = require 'core.searcher'
+local proto = require 'proto'
+local lang = require 'language'
local opMap = {
['+'] = true,