diff options
author | unknown <sumnekosun@intranet.123u.com> | 2019-04-01 19:31:34 +0800 |
---|---|---|
committer | unknown <sumnekosun@intranet.123u.com> | 2019-04-01 19:31:34 +0800 |
commit | c5f24b97a38c2c34b9ab5c182f19f5a02260dc74 (patch) | |
tree | 87f113f0f5e3ecb4513770b1bbc0f7740462e228 /server/src/method/textDocument/references.lua | |
parent | 09578bf7b01b1f01b744fb12a2beb44273c26802 (diff) | |
download | lua-language-server-c5f24b97a38c2c34b9ab5c182f19f5a02260dc74.zip |
还是找到结果就返回吧
Diffstat (limited to 'server/src/method/textDocument/references.lua')
-rw-r--r-- | server/src/method/textDocument/references.lua | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/server/src/method/textDocument/references.lua b/server/src/method/textDocument/references.lua index 017999df..d969e919 100644 --- a/server/src/method/textDocument/references.lua +++ b/server/src/method/textDocument/references.lua @@ -16,7 +16,7 @@ local function findReferences(lsp, uri, position, declarat) if valueLines then local start_row, start_col = valueLines:rowcol(start) local finish_row, finish_col = valueLines:rowcol(finish) - locations[#locations] = { + locations[#locations+1] = { uri = valueUri, range = { start = { @@ -31,7 +31,7 @@ local function findReferences(lsp, uri, position, declarat) } } else - locations[#locations] = { + locations[#locations+1] = { uri = valueUri, range = { start = { @@ -75,15 +75,16 @@ return function (lsp, params) local positions = findReferences(lsp, uri, position, declarat) if positions then response(positions) + t:remove() + LastTask = nil + return end if lsp:isWaitingCompile() then return end + response(nil) t:remove() LastTask = nil - if not positions then - response(nil) - end end) end end |