diff options
author | 最萌小汐 <sumneko@hotmail.com> | 2022-04-11 18:19:30 +0800 |
---|---|---|
committer | 最萌小汐 <sumneko@hotmail.com> | 2022-04-11 18:19:30 +0800 |
commit | 2e4f530b33467b94376321c7f9879f2a879429bb (patch) | |
tree | 47f3fb4cef9e6cffe9d5484b2ce8cad663c4786e /test/tclient/tests | |
parent | 4f98d5565b416f71d605cafcb22bd76cf697fd03 (diff) | |
download | lua-language-server-2e4f530b33467b94376321c7f9879f2a879429bb.zip |
fix #1036
Diffstat (limited to 'test/tclient/tests')
-rw-r--r-- | test/tclient/tests/single-mode.lua | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/test/tclient/tests/single-mode.lua b/test/tclient/tests/single-mode.lua index 4e14415b..25463f55 100644 --- a/test/tclient/tests/single-mode.lua +++ b/test/tclient/tests/single-mode.lua @@ -15,6 +15,9 @@ lclient():start(function (client) text = [[ local x print(x) + +TEST = 1 +print(TEST) ]] } }) @@ -42,4 +45,19 @@ print(x) }) assert(#locations > 0) + + local locations = client:awaitRequest('textDocument/definition', { + textDocument = { uri = 'file://single-file.lua' }, + position = { line = 3, character = 0 }, + }) + + assert(util.equal(locations, { + { + uri = 'file://single-file.lua', + range = { + start = { line = 3, character = 0 }, + ['end'] = { line = 3, character = 4 }, + } + } + })) end) |