summaryrefslogtreecommitdiff
path: root/server/src
diff options
context:
space:
mode:
author最萌小汐 <sumneko@hotmail.com>2019-07-09 16:07:32 +0800
committer最萌小汐 <sumneko@hotmail.com>2019-07-09 16:07:32 +0800
commitb6a99fe50a46812696848f0ad68bd4ef343dc9b3 (patch)
tree1b49eefe02be68a38cb1a81de1a53942b1635b2c /server/src
parentbd30197133b5c6ccb3dc977826646fc30e6a1ef2 (diff)
downloadlua-language-server-b6a99fe50a46812696848f0ad68bd4ef343dc9b3.zip
修正歧义识别bug
Diffstat (limited to 'server/src')
-rw-r--r--server/src/core/diagnostics.lua2
-rw-r--r--server/src/method/workspace/executeCommand.lua2
2 files changed, 4 insertions, 0 deletions
diff --git a/server/src/core/diagnostics.lua b/server/src/core/diagnostics.lua
index 1a72d504..badf3b00 100644
--- a/server/src/core/diagnostics.lua
+++ b/server/src/core/diagnostics.lua
@@ -288,6 +288,7 @@ function mt:searchAmbiguity1(callback)
-- a + (b or 0) --> (a + b) or 0
do
if opMap[first.op]
+ and first.type ~= 'unary'
and not second.op
and literalMap[second.type]
then
@@ -297,6 +298,7 @@ function mt:searchAmbiguity1(callback)
-- (a or 0) + c --> a or (0 + c)
do
if opMap[second.op]
+ and second.type ~= 'unary'
and not first.op
and literalMap[second[1].type]
then
diff --git a/server/src/method/workspace/executeCommand.lua b/server/src/method/workspace/executeCommand.lua
index 95d90fec..b622ec11 100644
--- a/server/src/method/workspace/executeCommand.lua
+++ b/server/src/method/workspace/executeCommand.lua
@@ -167,6 +167,7 @@ function command.solve(lsp, data)
-- (a + b) or 0 --> a + (b or 0)
do
if opMap[first.op]
+ and first.type ~= 'unary'
and not second.op
and literalMap[second.type]
then
@@ -179,6 +180,7 @@ function command.solve(lsp, data)
-- a or (b + c) --> (a or b) + c
do
if opMap[second.op]
+ and second.type ~= 'unary'
and not first.op
and literalMap[second[1].type]
then