summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
author最萌小汐 <sumneko@hotmail.com>2022-07-14 18:00:40 +0800
committer最萌小汐 <sumneko@hotmail.com>2022-07-14 18:00:40 +0800
commit6c750bc0fcd0c76282ab61367d661c5e49844253 (patch)
tree281d3511cdba3533657adf95bff3eb5dfcb38619 /test
parent9ad3fdce5bd6c889f5734eddd04708595e1fa621 (diff)
downloadlua-language-server-6c750bc0fcd0c76282ab61367d661c5e49844253.zip
support char
Diffstat (limited to 'test')
-rw-r--r--test/tclient/tests/jump-source.lua38
1 files changed, 38 insertions, 0 deletions
diff --git a/test/tclient/tests/jump-source.lua b/test/tclient/tests/jump-source.lua
index ff679826..5b9b7fb6 100644
--- a/test/tclient/tests/jump-source.lua
+++ b/test/tclient/tests/jump-source.lua
@@ -25,6 +25,12 @@ local mt = {}
---@source file:///yyy.lua:30
function mt:ff() end
+
+---@source file:///lib.c
+XX = 1
+
+---@source file:///lib.c:30:20
+YY = 1
]]
}
})
@@ -40,6 +46,8 @@ local a
print(a.x)
print(a.ff)
+print(XX)
+print(YY)
]]
}
})
@@ -73,4 +81,34 @@ print(a.ff)
}
}
}))
+
+ local locations = client:awaitRequest('textDocument/definition', {
+ textDocument = { uri = furi.encode('main.lua') },
+ position = { line = 5, character = 7 },
+ })
+
+ 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 = 6, character = 7 },
+ })
+
+ assert(util.equal(locations, {
+ {
+ uri = 'file:///lib.c',
+ range = {
+ start = { line = 29, character = 20 },
+ ['end'] = { line = 29, character = 20 },
+ }
+ }
+ }))
end)