summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
author最萌小汐 <sumneko@hotmail.com>2018-10-11 10:22:38 +0800
committer最萌小汐 <sumneko@hotmail.com>2018-10-11 10:22:38 +0800
commite574b0b2ef33e8f456abe7d5c48c925701c9df8f (patch)
tree92eeccaa3445934e5dc6bf40684dad57a52f4b80 /src
parentf156994cb041cc9022e5af5cf9628a3a97119347 (diff)
downloadlua-language-server-e574b0b2ef33e8f456abe7d5c48c925701c9df8f.zip
区分错误原因
Diffstat (limited to 'src')
-rw-r--r--src/matcher/definition.lua6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/matcher/definition.lua b/src/matcher/definition.lua
index c449f7ad..35de5ab4 100644
--- a/src/matcher/definition.lua
+++ b/src/matcher/definition.lua
@@ -66,11 +66,11 @@ return function (buf, pos_)
parser.grammar(buf, 'Lua', defs)
if not result then
- return nil
+ return false, 'No word'
end
local name, start = result[1], result[2]
if not start then
- return nil
+ return false, 'No match'
end
- return start, start + #name - 1
+ return true, start, start + #name - 1
end