summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
author最萌小汐 <sumneko@hotmail.com>2021-09-27 18:17:01 +0800
committer最萌小汐 <sumneko@hotmail.com>2021-09-27 18:17:01 +0800
commit8d319e07d95274c53ca7ee19dada6046cc015f97 (patch)
treea09cdf75ff8018fd74cd57348eebec0f80b28734 /test
parent01f2b4679667384223bc3e2c3275fe7164b622be (diff)
downloadlua-language-server-8d319e07d95274c53ca7ee19dada6046cc015f97.zip
no longer infer by usage
Diffstat (limited to 'test')
-rw-r--r--test/completion/common.lua21
-rw-r--r--test/signature/init.lua2
-rw-r--r--test/type_inference/init.lua44
3 files changed, 1 insertions, 66 deletions
diff --git a/test/completion/common.lua b/test/completion/common.lua
index 33cbdf4d..c5740e15 100644
--- a/test/completion/common.lua
+++ b/test/completion/common.lua
@@ -1870,27 +1870,6 @@ end",
},
}
-TEST [[
----<??>
-local function f(a, b, c)
- return a + 1, b .. '', c[1]
-end
-]]
-{
- {
- label = '@param;@return',
- kind = define.CompletionItemKind.Snippet,
- insertText = "\z
-${1:comment}\
----@param a ${2:number}\
----@param b ${3:string}\
----@param c ${4:table}\
----@return ${5:number}\
----@return ${6:string}\
----@return ${7:any}",
- },
-}
-
Cared['insertText'] = nil
TEST [[
diff --git a/test/signature/init.lua b/test/signature/init.lua
index 43bce29e..f1057ae0 100644
--- a/test/signature/init.lua
+++ b/test/signature/init.lua
@@ -164,7 +164,7 @@ end
m.f(<??>)
]]
-'function m.f(<!self: table!>)'
+'function m.f(<!self: any!>)'
TEST [[
---@alias nnn table<number, string>
diff --git a/test/type_inference/init.lua b/test/type_inference/init.lua
index 23ebf54e..ba3ca304 100644
--- a/test/type_inference/init.lua
+++ b/test/type_inference/init.lua
@@ -92,10 +92,6 @@ TEST 'any' [[
<?x?>()
]]
-TEST 'table' [[
-<?t?>.x = 1
-]]
-
TEST 'boolean' [[
<?x?> = not y
]]
@@ -230,20 +226,6 @@ end
_, <?y?> = xpcall(x)
]]
-TEST 'string|table' [[
-local y = #<?x?>
-]]
-
-TEST 'integer' [[
-local y = <?x?> << 0
-]]
-
-TEST 'integer' [[
-local function f(<?a?>, b)
- return a << b
-end
-]]
-
TEST 'A' [[
---@class A
@@ -360,10 +342,6 @@ TEST 'A<string, number>' [[
local <?x?>
]]
-TEST 'table' [[
-self.<?t?>[#self.t+1] = {}
-]]
-
TEST 'string' [[
---@class string
@@ -382,28 +360,6 @@ local <?y?> = x[1]
]]
TEST 'table' [[
-local <?t?>
-print(t.sub())
-]]
-
-TEST 'string|table' [[
-local <?t?>
-print(t:sub())
-]]
-
-TEST 'string' [[
-local <?t?>
-print(t:sub())
-print(t .. 'a')
-]]
-
-TEST 'string' [[
-local <?t?>
-print(#t)
-print(t .. 'a')
-]]
-
-TEST 'table' [[
local t = {}
local <?v?> = setmetatable(t)
]]