summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
author最萌小汐 <sumneko@hotmail.com>2022-03-10 20:31:47 +0800
committer最萌小汐 <sumneko@hotmail.com>2022-03-10 20:31:47 +0800
commit04601c7da4a485d84be5e0b9864acf27f978c275 (patch)
tree7edcc2cf6868dfb1cf85412591f03faf5bf8c108 /test
parent38a2b7f9df15b8737ba6fba27861eba50b2277b6 (diff)
downloadlua-language-server-04601c7da4a485d84be5e0b9864acf27f978c275.zip
doc.type.integer
Diffstat (limited to 'test')
-rw-r--r--test/type_inference/init.lua34
1 files changed, 34 insertions, 0 deletions
diff --git a/test/type_inference/init.lua b/test/type_inference/init.lua
index 37aa24b0..dead9fab 100644
--- a/test/type_inference/init.lua
+++ b/test/type_inference/init.lua
@@ -365,6 +365,11 @@ TEST 'string' [[
local <?x?>
]]
+TEST '1' [[
+---@type 1
+local <?v?>
+]]
+
TEST 'string[]' [[
---@class string
@@ -390,6 +395,7 @@ TEST '"enum1"|"enum2"' [[
local <?x?>
]]
+config.set(nil, 'Lua.hover.expandAlias', false)
TEST 'A' [[
---@alias A 'enum1' | 'enum2'
@@ -410,6 +416,34 @@ TEST 'A' [[
---@type A
local <?x?>
]]
+config.set(nil, 'Lua.hover.expandAlias', true)
+TEST '"enum1"|"enum2"' [[
+---@alias A 'enum1' | 'enum2'
+
+---@type A
+local <?x?>
+]]
+
+TEST '"enum1"|"enum2"' [[
+---@alias A 'enum1' | 'enum2' | A
+
+---@type A
+local <?x?>
+]]
+
+TEST '"enum1"|"enum2"|B' [[
+---@alias A 'enum1' | 'enum2' | B
+
+---@type A
+local <?x?>
+]]
+
+TEST '1|true' [[
+---@alias A 1 | true
+
+---@type A
+local <?x?>
+]]
TEST 'fun()' [[
---@type fun()