summaryrefslogtreecommitdiff
path: root/script/core/hint.lua
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/hint.lua
parent6846a670da889ae45228a91bdbca7e695ff97b69 (diff)
downloadlua-language-server-554ddae7b4174131fadf16bda5a32e5e967abda5.zip
guide -> searcher
Diffstat (limited to 'script/core/hint.lua')
-rw-r--r--script/core/hint.lua18
1 files changed, 9 insertions, 9 deletions
diff --git a/script/core/hint.lua b/script/core/hint.lua
index 13d01dc7..9c0d9cf0 100644
--- a/script/core/hint.lua
+++ b/script/core/hint.lua
@@ -1,7 +1,7 @@
-local files = require 'files'
-local guide = require 'core.guide'
-local vm = require 'vm'
-local config = require 'config'
+local files = require 'files'
+local searcher = require 'core.searcher'
+local vm = require 'vm'
+local config = require 'config'
local function typeHint(uri, edits, start, finish)
local ast = files.getAst(uri)
@@ -9,7 +9,7 @@ local function typeHint(uri, edits, start, finish)
return
end
local mark = {}
- guide.eachSourceBetween(ast.ast, start, finish, function (source)
+ searcher.eachSourceBetween(ast.ast, start, finish, function (source)
if source.type ~= 'local'
and source.type ~= 'setglobal'
and source.type ~= 'tablefield'
@@ -21,7 +21,7 @@ local function typeHint(uri, edits, start, finish)
if source[1] == '_' then
return
end
- if source.value and guide.isLiteral(source.value) then
+ if source.value and searcher.isLiteral(source.value) then
return
end
if source.parent.type == 'funcargs' then
@@ -84,7 +84,7 @@ local function hasLiteralArgInCall(call)
return false
end
for _, arg in ipairs(call.args) do
- if guide.isLiteral(arg) then
+ if searcher.isLiteral(arg) then
return true
end
end
@@ -100,7 +100,7 @@ local function paramName(uri, edits, start, finish)
return
end
local mark = {}
- guide.eachSourceBetween(ast.ast, start, finish, function (source)
+ searcher.eachSourceBetween(ast.ast, start, finish, function (source)
if source.type ~= 'call' then
return
end
@@ -130,7 +130,7 @@ local function paramName(uri, edits, start, finish)
table.remove(args, 1)
end
for i, arg in ipairs(source.args) do
- if not mark[arg] and guide.isLiteral(arg) then
+ if not mark[arg] and searcher.isLiteral(arg) then
mark[arg] = true
if args[i] and args[i] ~= '' then
edits[#edits+1] = {