summaryrefslogtreecommitdiff
path: root/test/tclient/tests
diff options
context:
space:
mode:
author最萌小汐 <sumneko@hotmail.com>2022-07-14 18:46:12 +0800
committer最萌小汐 <sumneko@hotmail.com>2022-07-14 18:46:12 +0800
commit4a0a07f81df346170bc71ca83b154448faf1f586 (patch)
treedfe3f77b680e5373dca52713fd799e109bcb905f /test/tclient/tests
parentb154ddeb48450cdb78a589abf3705d3f9df758d7 (diff)
downloadlua-language-server-4a0a07f81df346170bc71ca83b154448faf1f586.zip
bind source for class
Diffstat (limited to 'test/tclient/tests')
-rw-r--r--test/tclient/tests/jump-source.lua37
1 files changed, 37 insertions, 0 deletions
diff --git a/test/tclient/tests/jump-source.lua b/test/tclient/tests/jump-source.lua
index 5b9b7fb6..b6ad4da0 100644
--- a/test/tclient/tests/jump-source.lua
+++ b/test/tclient/tests/jump-source.lua
@@ -31,6 +31,11 @@ XX = 1
---@source file:///lib.c:30:20
YY = 1
+
+---@source file:///lib.c
+---@class BBB
+---@source file:///lib.c
+BBB = {}
]]
}
})
@@ -48,6 +53,8 @@ print(a.x)
print(a.ff)
print(XX)
print(YY)
+---@type BBB
+print(BBB)
]]
}
})
@@ -111,4 +118,34 @@ print(YY)
}
}
}))
+
+ local locations = client:awaitRequest('textDocument/definition', {
+ textDocument = { uri = furi.encode('main.lua') },
+ position = { line = 7, character = 10 },
+ })
+
+ assert(util.equal(locations, {
+ {
+ uri = 'file:///lib.c',
+ range = {
+ start = { line = 0, character = 0 },
+ ['end'] = { line = 0, character = 0 },
+ }
+ }
+ }))
+
+ local locations = client:awaitRequest('textDocument/definition', {
+ textDocument = { uri = furi.encode('main.lua') },
+ position = { line = 8, character = 7 },
+ })
+
+ assert(util.equal(locations, {
+ {
+ uri = 'file:///lib.c',
+ range = {
+ start = { line = 0, character = 0 },
+ ['end'] = { line = 0, character = 0 },
+ }
+ }
+ }))
end)