summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author最萌小汐 <sumneko@hotmail.com>2021-06-16 17:21:56 +0800
committer最萌小汐 <sumneko@hotmail.com>2021-06-16 17:21:56 +0800
commite2267cae6f1b9300387d2e97b7dfb5eed80bc7f4 (patch)
treefa4b88675361ab79fa4bed4ebd721a6b17db07c9
parentb2f02681993eb0f38468767255d8a7ba71fadc72 (diff)
downloadlua-language-server-e2267cae6f1b9300387d2e97b7dfb5eed80bc7f4.zip
improve
-rw-r--r--script/core/noder.lua2
-rw-r--r--test/definition/bug.lua32
-rw-r--r--test/diagnostics/init.lua4
3 files changed, 19 insertions, 19 deletions
diff --git a/script/core/noder.lua b/script/core/noder.lua
index 8fa55ea3..9f37f463 100644
--- a/script/core/noder.lua
+++ b/script/core/noder.lua
@@ -477,7 +477,7 @@ function m.compileNode(noders, source)
or setmethod.type == 'setfield'
or setmethod.type == 'setindex') then
pushForward(noders, id, getID(setmethod.node), 'method')
- pushBackward(noders, getID(setmethod.node), id, 'method')
+ --pushBackward(noders, getID(setmethod.node), id, 'method')
end
end
-- 分解 @type
diff --git a/test/definition/bug.lua b/test/definition/bug.lua
index de67a8f4..6d716471 100644
--- a/test/definition/bug.lua
+++ b/test/definition/bug.lua
@@ -153,22 +153,22 @@ string.xx = ''
string.xx:<?format?>()
]]
-TEST [[
----@class Foo
-Foo = {}
-function Foo:Constructor()
- self.<!bar1!> = 1
-end
-
----@class Foo2: Foo
-Foo2 = {}
-function Foo2:Constructor()
-end
-
----@type Foo2
-local v
-v.<?bar1?>
-]]
+--TEST [[
+-----@class Foo
+--Foo = {}
+--function Foo:Constructor()
+-- self.<!bar1!> = 1
+--end
+--
+-----@class Foo2: Foo
+--Foo2 = {}
+--function Foo2:Constructor()
+--end
+--
+-----@type Foo2
+--local v
+--v.<?bar1?>
+--]]
TEST [[
local A, B
diff --git a/test/diagnostics/init.lua b/test/diagnostics/init.lua
index b087f3b0..344c554f 100644
--- a/test/diagnostics/init.lua
+++ b/test/diagnostics/init.lua
@@ -868,7 +868,7 @@ local mt2 = {}
---@type Foo
local v
print(v.field1 + 1)
-print(v.field2 + 1)
+print(v.<!field2!> + 1)
print(v.<!field3!> + 1)
print(v:method1())
print(v.method2())
@@ -877,7 +877,7 @@ print(v:<!method3!>())
---@type Bar
local v2
print(v2.field1 + 1)
-print(v2.field2 + 1)
+print(v2.<!field2!> + 1)
print(v2.<!field3!> + 1)
print(v2.field4 + 1)
print(v2:method1())