From 15a7b101e2556a60288bb8f9066caf132c8cce13 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9C=80=E8=90=8C=E5=B0=8F=E6=B1=90?= Date: Thu, 7 Jan 2021 20:14:14 +0800 Subject: fix --- script/provider/provider.lua | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'script/provider') diff --git a/script/provider/provider.lua b/script/provider/provider.lua index 010bc24e..fd8e113c 100644 --- a/script/provider/provider.lua +++ b/script/provider/provider.lua @@ -244,11 +244,13 @@ proto.on('textDocument/definition', function (params) if targetUri then local targetLines = files.getLines(targetUri) local targetText = files.getText(targetUri) - response[i] = define.locationLink(targetUri - , define.range(targetLines, targetText, info.target.start, info.target.finish) - , define.range(targetLines, targetText, info.target.start, info.target.finish) - , define.range(lines, text, info.source.start, info.source.finish) - ) + if targetLines then + response[i] = define.locationLink(targetUri + , define.range(targetLines, targetText, info.target.start, info.target.finish) + , define.range(targetLines, targetText, info.target.start, info.target.finish) + , define.range(lines, text, info.source.start, info.source.finish) + ) + end end end return response -- cgit v1.2.3