summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--server/src/parser/grammar.lua4
-rw-r--r--server/src/service.lua2
-rw-r--r--server/test/definition/table.lua14
3 files changed, 17 insertions, 3 deletions
diff --git a/server/src/parser/grammar.lua b/server/src/parser/grammar.lua
index e2dad474..87ec0081 100644
--- a/server/src/parser/grammar.lua
+++ b/server/src/parser/grammar.lua
@@ -259,8 +259,8 @@ Prefix <- PL Exp PR
/ Name
Suffix <- DOT Name
/ COLON Name
- / Table
- / String
+ / Table -> Call
+ / String -> Call
/ BL Exp -> Index BR
/ PL (ExpList -> Call) PR
diff --git a/server/src/service.lua b/server/src/service.lua
index 0763a774..c361bd78 100644
--- a/server/src/service.lua
+++ b/server/src/service.lua
@@ -19,7 +19,6 @@ local function listen(self, input, output)
else
subprocess.filemode(io.stdout, 'b')
end
- io.output():setvbuf 'no'
local session = lsp()
local cache = ''
@@ -52,6 +51,7 @@ local function listen(self, input, output)
end)
session:setOutput(function (buf)
io.write(buf)
+ io.flush()
end)
session:setMethod(function (method, params)
local optional
diff --git a/server/test/definition/table.lua b/server/test/definition/table.lua
index 57e61a78..47248508 100644
--- a/server/test/definition/table.lua
+++ b/server/test/definition/table.lua
@@ -74,3 +74,17 @@ local t
local <!x!>
t[<?x?>]()
]]
+
+TEST[[
+local <!t!>
+local _ = {
+ _ = <?t?>
+}
+]]
+
+TEST[[
+local <!t!>
+t {
+ _ = <?t?>.x
+}
+]]