summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorunknown <sumnekosun@intranet.123u.com>2019-04-01 19:24:14 +0800
committerunknown <sumnekosun@intranet.123u.com>2019-04-01 19:24:14 +0800
commit09578bf7b01b1f01b744fb12a2beb44273c26802 (patch)
tree46ac917f4bf519783bc31bf47e2c9d61e063edf1
parent6bd19d31f2f666682fcd04c5436ece8c0bb9b56c (diff)
downloadlua-language-server-09578bf7b01b1f01b744fb12a2beb44273c26802.zip
修正bug
-rw-r--r--server/src/method/textDocument/definition.lua16
-rw-r--r--server/src/method/textDocument/implementation.lua16
-rw-r--r--server/src/method/textDocument/references.lua16
3 files changed, 45 insertions, 3 deletions
diff --git a/server/src/method/textDocument/definition.lua b/server/src/method/textDocument/definition.lua
index 07f0f3d8..e419b57e 100644
--- a/server/src/method/textDocument/definition.lua
+++ b/server/src/method/textDocument/definition.lua
@@ -38,7 +38,7 @@ local function findResult(lsp, params)
if valueLines then
local start_row, start_col = valueLines:rowcol(start)
local finish_row, finish_col = valueLines:rowcol(finish)
- locations[i] = {
+ locations[#locations+1] = {
uri = valueUri,
range = {
start = {
@@ -52,6 +52,20 @@ local function findResult(lsp, params)
},
}
}
+ else
+ locations[#locations+1] = {
+ uri = valueUri,
+ range = {
+ start = {
+ line = 0,
+ character = 0,
+ },
+ ['end'] = {
+ line = 0,
+ character = 0,
+ },
+ }
+ }
end
end
diff --git a/server/src/method/textDocument/implementation.lua b/server/src/method/textDocument/implementation.lua
index 250909cb..8f878850 100644
--- a/server/src/method/textDocument/implementation.lua
+++ b/server/src/method/textDocument/implementation.lua
@@ -37,7 +37,7 @@ local function findResult(lsp, params)
if valueLines then
local start_row, start_col = valueLines:rowcol(start)
local finish_row, finish_col = valueLines:rowcol(finish)
- locations[i] = {
+ locations[#locations] = {
uri = valueUri,
range = {
start = {
@@ -51,6 +51,20 @@ local function findResult(lsp, params)
},
}
}
+ else
+ locations[#locations] = {
+ uri = valueUri,
+ range = {
+ start = {
+ line = 0,
+ character = 0,
+ },
+ ['end'] = {
+ line = 0,
+ character = 0,
+ },
+ }
+ }
end
end
diff --git a/server/src/method/textDocument/references.lua b/server/src/method/textDocument/references.lua
index 13ddbe41..017999df 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[i] = {
+ locations[#locations] = {
uri = valueUri,
range = {
start = {
@@ -30,6 +30,20 @@ local function findReferences(lsp, uri, position, declarat)
},
}
}
+ else
+ locations[#locations] = {
+ uri = valueUri,
+ range = {
+ start = {
+ line = 0,
+ character = 0,
+ },
+ ['end'] = {
+ line = 0,
+ character = 0,
+ },
+ }
+ }
end
end