summaryrefslogtreecommitdiff
path: root/server/src/method/workspace/executeCommand.lua
diff options
context:
space:
mode:
author最萌小汐 <sumneko@hotmail.com>2019-07-05 15:15:44 +0800
committer最萌小汐 <sumneko@hotmail.com>2019-07-05 15:15:44 +0800
commitb73c30b3bec7c56e9b46021ccf9824df3d0a529b (patch)
tree68eaedea046f53af904101f0e8ef66eac0611a4e /server/src/method/workspace/executeCommand.lua
parentd91adfe4ebd18099fde3e4389655d4532fc9b00c (diff)
downloadlua-language-server-b73c30b3bec7c56e9b46021ccf9824df3d0a529b.zip
符号限制
Diffstat (limited to 'server/src/method/workspace/executeCommand.lua')
-rw-r--r--server/src/method/workspace/executeCommand.lua17
1 files changed, 16 insertions, 1 deletions
diff --git a/server/src/method/workspace/executeCommand.lua b/server/src/method/workspace/executeCommand.lua
index 9b234fc1..6ae407ae 100644
--- a/server/src/method/workspace/executeCommand.lua
+++ b/server/src/method/workspace/executeCommand.lua
@@ -123,6 +123,21 @@ function command.removeSpace(lsp, data)
})
end
+local opMap = {
+ ['+'] = true,
+ ['-'] = true,
+ ['*'] = true,
+ ['/'] = true,
+ ['//'] = true,
+ ['^'] = true,
+ ['<<'] = true,
+ ['>>'] = true,
+ ['&'] = true,
+ ['|'] = true,
+ ['~'] = true,
+ ['..'] = true,
+}
+
function command.solve(lsp, data)
local uri = data.uri
local vm, lines = lsp:getVM(uri)
@@ -144,7 +159,7 @@ function command.solve(lsp, data)
local y = x % 2 + 1
local exp = source[x]
local other = source[y]
- if exp.op and not other.op then
+ if opMap[exp.op] and not opMap[other.op] then
if x == 1 then
-- (a + b) or c --> a + (b or c)
return {