summaryrefslogtreecommitdiff
path: root/server/src/method/workspace/executeCommand.lua
diff options
context:
space:
mode:
author最萌小汐 <sumneko@hotmail.com>2019-03-29 14:53:45 +0800
committer最萌小汐 <sumneko@hotmail.com>2019-03-29 14:53:45 +0800
commitc0f1352581b5a4b046fc775c066feacf576156ba (patch)
treeac2c74f88c9a4cb05703a08d895cfd33c57ec2d5 /server/src/method/workspace/executeCommand.lua
parent5f33254d4ec014ffc9358614b1894a0c7df08103 (diff)
downloadlua-language-server-c0f1352581b5a4b046fc775c066feacf576156ba.zip
用API而不是自己遍历
Diffstat (limited to 'server/src/method/workspace/executeCommand.lua')
-rw-r--r--server/src/method/workspace/executeCommand.lua5
1 files changed, 2 insertions, 3 deletions
diff --git a/server/src/method/workspace/executeCommand.lua b/server/src/method/workspace/executeCommand.lua
index 00ee09a3..5a8612c5 100644
--- a/server/src/method/workspace/executeCommand.lua
+++ b/server/src/method/workspace/executeCommand.lua
@@ -14,12 +14,11 @@ local function isContainPos(obj, start, finish)
end
local function isInString(vm, start, finish)
- for _, source in ipairs(vm.sources) do
+ return vm:eachSource(function (source)
if source.type == 'string' and isContainPos(source, start, finish) then
return true
end
- end
- return false
+ end)
end
local function posToRange(lines, start, finish)