summaryrefslogtreecommitdiff
path: root/server/src/method/textDocument/definition.lua
diff options
context:
space:
mode:
Diffstat (limited to 'server/src/method/textDocument/definition.lua')
-rw-r--r--server/src/method/textDocument/definition.lua16
1 files changed, 16 insertions, 0 deletions
diff --git a/server/src/method/textDocument/definition.lua b/server/src/method/textDocument/definition.lua
index 75df54da..1f21d67d 100644
--- a/server/src/method/textDocument/definition.lua
+++ b/server/src/method/textDocument/definition.lua
@@ -1,5 +1,18 @@
local matcher = require 'matcher'
+local function checkWorkSpaceComplete(lsp, result)
+ if result.value then
+ if not result.value.isRequire then
+ return
+ end
+ else
+ if not result.isRequire then
+ return
+ end
+ end
+ lsp:checkWorkSpaceComplete()
+end
+
return function (lsp, params)
local uri = params.textDocument.uri
local vm, lines = lsp:loadVM(uri)
@@ -12,6 +25,9 @@ return function (lsp, params)
if not result then
return nil
end
+
+ checkWorkSpaceComplete(lsp, result)
+
local positions = matcher.definition(vm, result)
if not positions then
return nil